mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-20 06:58:56 +00:00
Minor fix
This commit is contained in:
@@ -496,12 +496,15 @@ class IfcImporter():
|
|||||||
representation_map = self.get_type_product_body_representation_map(element)
|
representation_map = self.get_type_product_body_representation_map(element)
|
||||||
mesh = None
|
mesh = None
|
||||||
if representation_map:
|
if representation_map:
|
||||||
shape = ifcopenshell.geom.create_shape(self.settings, representation_map.MappedRepresentation)
|
try:
|
||||||
mesh_name = f'mesh-{shape.id}'
|
shape = ifcopenshell.geom.create_shape(self.settings, representation_map.MappedRepresentation)
|
||||||
mesh = self.meshes.get(mesh_name)
|
mesh_name = f'mesh-{shape.id}'
|
||||||
if mesh is None:
|
mesh = self.meshes.get(mesh_name)
|
||||||
mesh = self.create_mesh(element, shape)
|
if mesh is None:
|
||||||
self.meshes[mesh_name] = mesh
|
mesh = self.create_mesh(element, shape)
|
||||||
|
self.meshes[mesh_name] = mesh
|
||||||
|
except:
|
||||||
|
self.ifc_import_settings.logger.error('Failed to generate shape for {}'.format(element))
|
||||||
obj = bpy.data.objects.new(self.get_name(element), mesh)
|
obj = bpy.data.objects.new(self.get_name(element), mesh)
|
||||||
if mesh:
|
if mesh:
|
||||||
self.material_creator.create(element, obj, mesh)
|
self.material_creator.create(element, obj, mesh)
|
||||||
@@ -1273,7 +1276,9 @@ class IfcImporter():
|
|||||||
if hasattr(element, 'Representation'):
|
if hasattr(element, 'Representation'):
|
||||||
tree = self.file.traverse(element.Representation)
|
tree = self.file.traverse(element.Representation)
|
||||||
elif hasattr(element, 'RepresentationMaps'):
|
elif hasattr(element, 'RepresentationMaps'):
|
||||||
tree = self.file.traverse(element.RepresentationMaps)
|
tree = []
|
||||||
|
for representation_map in element.RepresentationMaps:
|
||||||
|
tree.extend(self.file.traverse(representation_map))
|
||||||
representations = [e for e in tree if e.is_a('IfcRepresentation') \
|
representations = [e for e in tree if e.is_a('IfcRepresentation') \
|
||||||
and e.RepresentationIdentifier == 'Body' \
|
and e.RepresentationIdentifier == 'Body' \
|
||||||
and e.RepresentationType != 'MappedRepresentation']
|
and e.RepresentationType != 'MappedRepresentation']
|
||||||
|
|||||||
Reference in New Issue
Block a user