mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 17:58:20 +00:00
Fix extrusion position update on OffsetFromReferenceLine changed #6255
Also fixed an issue when previously there was an offset and now it was set to 0 but slab did not reset it's position.
This commit is contained in:
@@ -283,6 +283,7 @@ class DumbSlabPlaner:
|
|||||||
if tool.Model.get_usage_type(element) != "LAYER3":
|
if tool.Model.get_usage_type(element) != "LAYER3":
|
||||||
return
|
return
|
||||||
layer_params = tool.Model.get_material_layer_parameters(element)
|
layer_params = tool.Model.get_material_layer_parameters(element)
|
||||||
|
ifc_file = tool.Ifc.get()
|
||||||
body_context = ifcopenshell.util.representation.get_context(tool.Ifc.get(), "Model", "Body", "MODEL_VIEW")
|
body_context = ifcopenshell.util.representation.get_context(tool.Ifc.get(), "Model", "Body", "MODEL_VIEW")
|
||||||
obj = tool.Ifc.get_object(element)
|
obj = tool.Ifc.get_object(element)
|
||||||
if not obj:
|
if not obj:
|
||||||
@@ -326,9 +327,18 @@ class DumbSlabPlaner:
|
|||||||
extrusion.ExtrudedDirection.DirectionRatios = tuple(direction_ratios)
|
extrusion.ExtrudedDirection.DirectionRatios = tuple(direction_ratios)
|
||||||
extrusion.Depth = perpendicular_depth
|
extrusion.Depth = perpendicular_depth
|
||||||
|
|
||||||
if perpendicular_offset != 0.0 and not extrusion.Position:
|
ifc_position = extrusion.Position
|
||||||
|
if perpendicular_offset == 0.0:
|
||||||
|
# Clean up possible previous offset.
|
||||||
|
if ifc_position:
|
||||||
|
extrusion.Position = None
|
||||||
|
ifcopenshell.util.element.remove_deep2(ifc_file, ifc_position)
|
||||||
|
else:
|
||||||
position = offset_direction * perpendicular_offset
|
position = offset_direction * perpendicular_offset
|
||||||
tool.Model.add_extrusion_position(extrusion, position)
|
if ifc_position:
|
||||||
|
ifc_position.Location.Coordinates = position
|
||||||
|
else:
|
||||||
|
tool.Model.add_extrusion_position(extrusion, position)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
props = tool.Model.get_model_props()
|
props = tool.Model.get_model_props()
|
||||||
|
|||||||
Reference in New Issue
Block a user