mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 22:50:21 +00:00
Fix calculation for polyline tool when working with X, Y and Z.
This commit is contained in:
@@ -597,7 +597,7 @@ class PolylineOperator:
|
|||||||
self.report({"WARNING"}, "The number typed is not valid.")
|
self.report({"WARNING"}, "The number typed is not valid.")
|
||||||
return is_valid
|
return is_valid
|
||||||
else:
|
else:
|
||||||
if self.input_type in {"X", "Y"}:
|
if self.input_type in {"X", "Y", "Z"}:
|
||||||
tool.Polyline.calculate_distance_and_angle(context, self.input_ui, self.tool_state)
|
tool.Polyline.calculate_distance_and_angle(context, self.input_ui, self.tool_state)
|
||||||
elif self.input_type in {"D", "A"}:
|
elif self.input_type in {"D", "A"}:
|
||||||
tool.Polyline.calculate_x_y_and_z(context, self.input_ui, self.tool_state)
|
tool.Polyline.calculate_x_y_and_z(context, self.input_ui, self.tool_state)
|
||||||
|
|||||||
@@ -267,10 +267,20 @@ class Polyline(bonsai.core.tool.Polyline):
|
|||||||
snap_prop = context.scene.BIMPolylineProperties.snap_mouse_point[0]
|
snap_prop = context.scene.BIMPolylineProperties.snap_mouse_point[0]
|
||||||
snap_vector = Vector((snap_prop.x, snap_prop.y, snap_prop.z))
|
snap_vector = Vector((snap_prop.x, snap_prop.y, snap_prop.z))
|
||||||
|
|
||||||
if tool_state.use_default_container:
|
if tool_state.is_input_on:
|
||||||
snap_vector = Vector((snap_prop.x, snap_prop.y, default_container_elevation))
|
if tool_state.use_default_container:
|
||||||
|
mouse_vector = Vector(
|
||||||
|
(input_ui.get_number_value("X"), input_ui.get_number_value("Y"), default_container_elevation)
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
mouse_vector = Vector(
|
||||||
|
(input_ui.get_number_value("X"), input_ui.get_number_value("Y"), input_ui.get_number_value("Z"))
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
snap_vector = Vector((snap_prop.x, snap_prop.y, snap_prop.z))
|
if tool_state.use_default_container:
|
||||||
|
snap_vector = Vector((snap_prop.x, snap_prop.y, default_container_elevation))
|
||||||
|
else:
|
||||||
|
snap_vector = Vector((snap_prop.x, snap_prop.y, snap_prop.z))
|
||||||
|
|
||||||
if len(polyline_points) > 1:
|
if len(polyline_points) > 1:
|
||||||
second_to_last_point_data = polyline_points[len(polyline_points) - 2]
|
second_to_last_point_data = polyline_points[len(polyline_points) - 2]
|
||||||
|
|||||||
Reference in New Issue
Block a user