See #1806. Typed fillings now share the same representation for their openings.

This commit is contained in:
Dion Moult
2023-02-06 17:01:29 +11:00
parent 38c6378315
commit e40bbf2525
3 changed files with 124 additions and 48 deletions
@@ -28,9 +28,6 @@ class Usecase:
def execute(self):
mapping_source = self.get_mapping_source()
if not mapping_source:
return
zero = self.file.createIfcCartesianPoint((0.0, 0.0, 0.0))
x_axis = self.file.createIfcDirection((1.0, 0.0, 0.0))
y_axis = self.file.createIfcDirection((0.0, 1.0, 0.0))
@@ -52,3 +49,10 @@ class Usecase:
for inverse in self.file.get_inverse(self.settings["representation"]):
if inverse.is_a("IfcRepresentationMap"):
return inverse
zero = self.file.createIfcCartesianPoint((0.0, 0.0, 0.0))
x_axis = self.file.createIfcDirection((1.0, 0.0, 0.0))
z_axis = self.file.createIfcDirection((0.0, 0.0, 1.0))
mapping_origin = self.file.createIfcAxis2Placement3D(zero, z_axis, x_axis)
return self.file.createIfcRepresentationMap(
MappingOrigin=mapping_origin, MappedRepresentation=self.settings["representation"]
)
@@ -59,3 +59,9 @@ def get_representation(element, context, subcontext=None, target_view=None):
for r in element.RepresentationMaps:
if is_representation_of_context(r.MappedRepresentation, context, subcontext, target_view):
return r.MappedRepresentation
def resolve_representation(representation):
if representation.Items and representation.Items[0].is_a("IfcMappedItem"):
return resolve_representation(representation.Items[0].MappingSource.MappedRepresentation)
return representation