delete mesh planes
This commit is contained in:
parent
41504af119
commit
4dbd59b1bd
1 changed files with 11 additions and 1 deletions
|
@ -189,6 +189,7 @@ class BlenderEngine(Base3DEngine):
|
||||||
|
|
||||||
main_object = None
|
main_object = None
|
||||||
polygons_for_join = []
|
polygons_for_join = []
|
||||||
|
last_mesh_plane = None
|
||||||
current_mesh_plane = None
|
current_mesh_plane = None
|
||||||
''')
|
''')
|
||||||
|
|
||||||
|
@ -279,7 +280,7 @@ class BlenderEngine(Base3DEngine):
|
||||||
vertices = np.hstack((vertices, np.array(altitudes).reshape((vertices.shape[0], 1))))
|
vertices = np.hstack((vertices, np.array(altitudes).reshape((vertices.shape[0], 1))))
|
||||||
self._add_mesh_plane('Level %s top mesh plane' % geoms.short_label, vertices / 1000, faces)
|
self._add_mesh_plane('Level %s top mesh plane' % geoms.short_label, vertices / 1000, faces)
|
||||||
|
|
||||||
self._add_polygon('Level %s buildings' % geoms.short_label, geoms.buildings,
|
self._add_polygon('Level %s' % geoms.short_label, geoms.buildings,
|
||||||
last_min_z-1000, current_max_z+1000)
|
last_min_z-1000, current_max_z+1000)
|
||||||
self._set_last_polygon_to_main()
|
self._set_last_polygon_to_main()
|
||||||
self._cut_last_poly_with_mesh_planes(last_min_z-1000, current_max_z+1000)
|
self._cut_last_poly_with_mesh_planes(last_min_z-1000, current_max_z+1000)
|
||||||
|
@ -305,6 +306,12 @@ class BlenderEngine(Base3DEngine):
|
||||||
|
|
||||||
break
|
break
|
||||||
|
|
||||||
|
self._add_python('''
|
||||||
|
if last_mesh_plane:
|
||||||
|
delete_object(last_mesh_plane)
|
||||||
|
if current_mesh_plane:
|
||||||
|
delete_object(current_mesh_plane)''')
|
||||||
|
|
||||||
def _add_polygon(self, name, geometry, minz, maxz):
|
def _add_polygon(self, name, geometry, minz, maxz):
|
||||||
geometry = geometry.buffer(0)
|
geometry = geometry.buffer(0)
|
||||||
self._add_python('sub_polygons = []')
|
self._add_python('sub_polygons = []')
|
||||||
|
@ -356,6 +363,9 @@ class BlenderEngine(Base3DEngine):
|
||||||
)
|
)
|
||||||
|
|
||||||
def _add_mesh_plane(self, name, vertices, faces):
|
def _add_mesh_plane(self, name, vertices, faces):
|
||||||
|
self._add_python('''
|
||||||
|
if last_mesh_plane:
|
||||||
|
delete_object(last_mesh_plane)''')
|
||||||
self._add_python('last_mesh_plane = current_mesh_plane')
|
self._add_python('last_mesh_plane = current_mesh_plane')
|
||||||
self._add_python(
|
self._add_python(
|
||||||
'current_mesh_plane = add_mesh(name=%(name)r, vertices=%(vertices)r, faces=%(faces)r)' % {
|
'current_mesh_plane = add_mesh(name=%(name)r, vertices=%(vertices)r, faces=%(faces)r)' % {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue