mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-17 14:02:27 +00:00
Fix bug where loaded point geometry had unlinked meshes or placements with wrong units.
This commit is contained in:
@@ -692,7 +692,7 @@ class IfcImporter:
|
|||||||
mesh = self.create_native_faceted_brep(element, mesh_name)
|
mesh = self.create_native_faceted_brep(element, mesh_name)
|
||||||
elif native_data["type"] == "IfcFaceBasedSurfaceModel":
|
elif native_data["type"] == "IfcFaceBasedSurfaceModel":
|
||||||
mesh = self.create_native_faceted_brep(element, mesh_name)
|
mesh = self.create_native_faceted_brep(element, mesh_name)
|
||||||
mesh.BIMMeshProperties.ifc_definition_id = representation.id()
|
tool.Ifc.link(representation, mesh)
|
||||||
mesh.name = mesh_name
|
mesh.name = mesh_name
|
||||||
self.meshes[mesh_name] = mesh
|
self.meshes[mesh_name] = mesh
|
||||||
self.create_product(element, mesh=mesh)
|
self.create_product(element, mesh=mesh)
|
||||||
@@ -921,7 +921,7 @@ class IfcImporter:
|
|||||||
return result
|
return result
|
||||||
|
|
||||||
def create_pointcloud(self, product, representation):
|
def create_pointcloud(self, product, representation):
|
||||||
placement_matrix = ifcopenshell.util.placement.get_local_placement(product.ObjectPlacement)
|
placement_matrix = self.get_element_matrix(product)
|
||||||
vertex_list = []
|
vertex_list = []
|
||||||
for item in representation.Items:
|
for item in representation.Items:
|
||||||
if item.is_a("IfcCartesianPointList"):
|
if item.is_a("IfcCartesianPointList"):
|
||||||
@@ -937,6 +937,7 @@ class IfcImporter:
|
|||||||
mesh_name = f"{representation.ContextOfItems.id()}/{representation.id()}"
|
mesh_name = f"{representation.ContextOfItems.id()}/{representation.id()}"
|
||||||
mesh = bpy.data.meshes.new(mesh_name)
|
mesh = bpy.data.meshes.new(mesh_name)
|
||||||
mesh.from_pydata(vertex_list, [], [])
|
mesh.from_pydata(vertex_list, [], [])
|
||||||
|
tool.Ifc.link(representation, mesh)
|
||||||
|
|
||||||
obj = bpy.data.objects.new("{}/{}".format(product.is_a(), product.Name), mesh)
|
obj = bpy.data.objects.new("{}/{}".format(product.is_a(), product.Name), mesh)
|
||||||
self.set_matrix_world(obj, self.apply_blender_offset_to_matrix_world(obj, placement_matrix))
|
self.set_matrix_world(obj, self.apply_blender_offset_to_matrix_world(obj, placement_matrix))
|
||||||
|
|||||||
Reference in New Issue
Block a user