mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-20 04:04:00 +00:00
Detect BBIM railings at import to import as meshes not curves #3144
Sometimes railing could consist just of one IFCSWEPTDISKSOLID then it will be considered native swept disk solid and imported as a curve. But when user create BBIM railing they edit it as a mesh and curve might look a bit different. Therefore we detect it now at import to make sure it's going to be reprsented the same way as it was saved.
This commit is contained in:
@@ -381,7 +381,7 @@ class IfcImporter:
|
|||||||
representations = self.get_transformed_body_representations(element.Representation.Representations)
|
representations = self.get_transformed_body_representations(element.Representation.Representations)
|
||||||
|
|
||||||
# Single swept disk solids (e.g. rebar) are better natively represented as beveled curves
|
# Single swept disk solids (e.g. rebar) are better natively represented as beveled curves
|
||||||
if self.is_native_swept_disk_solid(representations):
|
if self.is_native_swept_disk_solid(element, representations):
|
||||||
self.native_data[element.GlobalId] = {
|
self.native_data[element.GlobalId] = {
|
||||||
"representations": representations,
|
"representations": representations,
|
||||||
"representation": self.get_body_representation(element.Representation.Representations),
|
"representation": self.get_body_representation(element.Representation.Representations),
|
||||||
@@ -409,7 +409,11 @@ class IfcImporter:
|
|||||||
}
|
}
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def is_native_swept_disk_solid(self, representations):
|
def is_native_swept_disk_solid(self, element, representations):
|
||||||
|
# detect BBIM Railings to represent them with meshes and not curves
|
||||||
|
if tool.Pset.get_element_pset(element, "BBIM_Railing"):
|
||||||
|
return False
|
||||||
|
|
||||||
for representation in representations:
|
for representation in representations:
|
||||||
items = representation["raw"].Items or [] # Be forgiving of invalid IFCs because Revit :(
|
items = representation["raw"].Items or [] # Be forgiving of invalid IFCs because Revit :(
|
||||||
if len(items) == 1 and items[0].is_a("IfcSweptDiskSolid"):
|
if len(items) == 1 and items[0].is_a("IfcSweptDiskSolid"):
|
||||||
|
|||||||
Reference in New Issue
Block a user