mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 02:02:22 +00:00
See #6397 - Fix extrusion profile editing issue.
Profile transformations now correctly use the perpendicular value of the offset.
This commit is contained in:
@@ -677,8 +677,9 @@ class EnableEditingExtrusionProfile(bpy.types.Operator, tool.Ifc.Operator):
|
||||
|
||||
# Restore the position to before it was changed by the offset and x_angle
|
||||
rot_matrix = Matrix.Rotation(existing_x_angle, 4, "X")
|
||||
offset = Vector((0.0, 0.0, -layer_params["offset"]))
|
||||
rot_offset = offset @ rot_matrix
|
||||
perpendicular_offset = layer_params["offset"] * abs(1 / cos(existing_x_angle))
|
||||
offset_vector = Vector((0.0, 0.0, -perpendicular_offset))
|
||||
rot_offset = offset_vector @ rot_matrix
|
||||
tranlation_matrix = Matrix.Translation(rot_offset)
|
||||
position = position @ tranlation_matrix
|
||||
|
||||
@@ -725,8 +726,9 @@ class EditExtrusionProfile(bpy.types.Operator, tool.Ifc.Operator):
|
||||
|
||||
# Restore the position to after it was changed by the offset and x_angle
|
||||
rot_matrix = Matrix.Rotation(existing_x_angle, 4, "X")
|
||||
offset = Vector((0.0, 0.0, -layer_params["offset"]))
|
||||
rot_offset = offset @ rot_matrix
|
||||
perpendicular_offset = layer_params["offset"] * abs(1 / cos(existing_x_angle))
|
||||
offset_vector = Vector((0.0, 0.0, -perpendicular_offset))
|
||||
rot_offset = offset_vector @ rot_matrix
|
||||
tranlation_matrix = Matrix.Translation(rot_offset)
|
||||
position = position @ tranlation_matrix
|
||||
|
||||
|
||||
Reference in New Issue
Block a user