2024-4-20-全局地形x道路建设x路肩x人行道x地平x绿化

地形:

在blender中用osm获得一个地形mesh,通过ue5.2插件mesh convert terrain在ue中创建landscape,转换world partition版本导出到5.3版本。地形方面的一致性通过选中landscape proxy在ue中导出fbx,再到blender中导入,其相对位置是一样的,然后找3个点放置模型观察两个软件中模型所处地形的相对位置,来确认贴图位置使blender和ue的地形位置一致。

道路建设:

frg对着贴图铺好车用道路后,convert mesh再用shrinkwrap的project模式,开启positive和negative,将车道吸附到地形上。

路肩:

选择边缘上的任意一点,select>select all by trait>non manifold可以将物体所有的边缘边选中,q键extract curve可以批量将所有curb的引导曲线提取出来,curbmesh添加array、curve modifier,此时选取这个复合曲线只会随机生成一个内接curb,选中状态下配合multiple_curves_array这个script,可以批量对所有的内侧包围曲线添加curb,curb的方向会根据曲线方向,这里只能手动对Y scale -1和1做调整来协调curb的方向。这些curb无法apply互相间存在instance关系,q键object data清除instance关联即可。

物体在复合曲线上做array curve,可以用于道路的curb批量添加
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import bpy

merge = False

scn = bpy.context.scene
ob = bpy.context.object

for m in ob.modifiers:
if m.type == 'ARRAY':
curve = m.curve

curves = []
objects = []


bpy.ops.object.select_all(action='DESELECT')
bpy.context.view_layer.objects.active = curve
curve.select_set(True)
bpy.ops.object.mode_set(mode = 'EDIT')

print("split curves")

n_splines = len(curve.data.splines)
next = curve
for i in range(n_splines):
new_crv = next.copy()
new_crv.data = next.data.copy()
if i > 0: new_crv.data.splines.remove(new_crv.data.splines[0])
next = new_crv.copy()
next.data = new_crv.data.copy()
curves.append(new_crv)
delete = False
for s in new_crv.data.splines:
if delete: new_crv.data.splines.remove(s)
delete = True
scn.collection.objects.link(new_crv)

bpy.ops.object.mode_set(mode = 'OBJECT')

bpy.ops.object.select_all(action='DESELECT')

print("copy objects")

for c in curves:
new_ob = ob.copy()
if merge:
new_ob.data = ob.data.copy()
objects.append(new_ob)
scn.collection.objects.link(new_ob)
for m in new_ob.modifiers:
if m.type == 'CURVE': m.object = c
if m.type == 'ARRAY': m.curve = c

bpy.context.scene.update()

if merge:
print("merge objects")
for o in objects:
o.data = o.to_mesh(scn, apply_modifiers=True, settings = 'PREVIEW')
o.modifiers.clear()
o.select = True
scn.objects.active = o
bpy.ops.object.join()
for c in curves: bpy.data.objects.remove(c)

人行道:

复合曲线由于方向问题若直接outline则会导致有的向内、有的向外偏移,把这个复合曲线convert mesh,f键填充面,再用inset可以确保向内收缩,然后面模式下反选删除外侧循环面即可,再对整体提取curve即实现了复合曲线向内offset,这样等于是实现了批量制作人行道的基准曲线,对于相同宽度的人行道分类合并故技重施即可批量制作不同宽度的人行道。

地平:

knife project投影的地形mesh无需quad remesh使用了archipack terrain会无视之前mesh的细分,整个重构。使用earthwork创建地平时,注意不要过度细分,十分相近的建筑合并共用一个地平。两个地平间应该有足够的距离可以容纳二者地平的渐进offset,offset过小会导致地平与附近的坡度过大。

offset无需在terrain激活update下就可生效,可以发现图2明显渐进平缓坡度。

当两个地平的offset相交时会互相影响,因此下图中的情况会导致一个明显的坡面。

绿化:

对于区块内的绿化在一个闭环曲面上可以用foliage fill模式下填充这个取面快速散布绿化,不过这可能超出边界“跑到”主路上,因此要对闭环取面做inset测试。

2024-4-24-地形环境sketchup设计思路问题 2024-4-15-SendToUE世界地形道路人行道的构建流程

评论

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×