mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 14:41:25 +00:00
Consider ifc2x3 in a358cff1b7 #6255
In ifc2x3 position is not optional, so we should reset it's coordinates instead.
This commit is contained in:
@@ -331,9 +331,7 @@ class DumbSlabPlaner:
|
|||||||
ifc_position = extrusion.Position
|
ifc_position = extrusion.Position
|
||||||
if perpendicular_offset == 0.0:
|
if perpendicular_offset == 0.0:
|
||||||
# Clean up possible previous offset.
|
# Clean up possible previous offset.
|
||||||
if ifc_position:
|
tool.Model.reset_extrusion_position(extrusion)
|
||||||
extrusion.Position = None
|
|
||||||
ifcopenshell.util.element.remove_deep2(ifc_file, ifc_position)
|
|
||||||
else:
|
else:
|
||||||
position = offset_direction * perpendicular_offset
|
position = offset_direction * perpendicular_offset
|
||||||
if ifc_position:
|
if ifc_position:
|
||||||
|
|||||||
@@ -2064,6 +2064,21 @@ class Model(bonsai.core.tool.Model):
|
|||||||
|
|
||||||
extrusion.Position = new_position
|
extrusion.Position = new_position
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def reset_extrusion_position(cls, extrusion: ifcopenshell.entity_instance) -> None:
|
||||||
|
ifc_file = extrusion.file
|
||||||
|
|
||||||
|
if ifc_file.schema == "IFC2X3":
|
||||||
|
# Position is not optional.
|
||||||
|
extrusion.Position.Location.Coordinates = (0.0, 0.0, 0.0)
|
||||||
|
return
|
||||||
|
|
||||||
|
position = extrusion.Position
|
||||||
|
if position is None:
|
||||||
|
return
|
||||||
|
extrusion.Position = None
|
||||||
|
ifcopenshell.util.element.remove_deep2(ifc_file, position)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_existing_x_angle(cls, extrusion: ifcopenshell.entity_instance) -> float:
|
def get_existing_x_angle(cls, extrusion: ifcopenshell.entity_instance) -> float:
|
||||||
x, y, z = extrusion.ExtrudedDirection.DirectionRatios
|
x, y, z = extrusion.ExtrudedDirection.DirectionRatios
|
||||||
|
|||||||
Reference in New Issue
Block a user