mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 02:02:22 +00:00
See #1227. Don't move any child at all when regenerating wall body.
This commit is contained in:
@@ -155,7 +155,7 @@ class Usecase:
|
||||
elif obj.is_a("IfcFeatureElement"):
|
||||
# Feature elements affect the geometry of their parent, and
|
||||
# so logically should always move with the parent. However,
|
||||
# subchildren shouldn't move.
|
||||
# subchildren (fillings) shouldn't move.
|
||||
placement2 = obj.ObjectPlacement
|
||||
for referenced_placement2 in placement2.ReferencedByPlacements:
|
||||
matrix2 = ifcopenshell.util.placement.get_local_placement(referenced_placement2)
|
||||
|
||||
+13
-1
@@ -311,12 +311,24 @@ class Regenerator:
|
||||
ifcopenshell.api.geometry.assign_representation(self.file, product=wall, representation=axis_rep)
|
||||
|
||||
if not np.allclose(self.reference_p1, np.array((0.0, 0.0))):
|
||||
children = []
|
||||
for referenced_placement in wall.ObjectPlacement.ReferencedByPlacements:
|
||||
matrix = ifcopenshell.util.placement.get_local_placement(referenced_placement)
|
||||
children.append((matrix, referenced_placement.PlacesObject))
|
||||
|
||||
matrix = ifcopenshell.util.placement.get_local_placement(wall.ObjectPlacement)
|
||||
matrix[:, 3] = matrix @ np.concatenate((self.reference_p1, (0, 1)))
|
||||
ifcopenshell.api.geometry.edit_object_placement(
|
||||
self.file, product=wall, matrix=matrix, is_si=False, should_transform_children=False
|
||||
self.file, product=wall, matrix=matrix, is_si=False, should_transform_children=True
|
||||
)
|
||||
|
||||
# Restore children to their previous location
|
||||
for matrix, elements in children:
|
||||
for element in elements:
|
||||
ifcopenshell.api.geometry.edit_object_placement(
|
||||
self.file, product=element, matrix=matrix, is_si=False, should_transform_children=True
|
||||
)
|
||||
|
||||
return body_rep
|
||||
|
||||
def join(self, wall1, wall2, layers1, layers2, connection1, connection2):
|
||||
|
||||
Reference in New Issue
Block a user