mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-19 19:54:07 +00:00
black .
This commit is contained in:
@@ -252,7 +252,7 @@ class PolylineOperator:
|
||||
if event.value == "RELEASE" and event.type == "LEFTMOUSE":
|
||||
result = tool.Snap.insert_polyline_point(self.input_ui)
|
||||
if result:
|
||||
self.report({'WARNING'}, result)
|
||||
self.report({"WARNING"}, result)
|
||||
tool.Blender.update_viewport()
|
||||
|
||||
if event.value == "PRESS" and event.type == "C":
|
||||
@@ -269,7 +269,7 @@ class PolylineOperator:
|
||||
if is_valid:
|
||||
result = tool.Snap.insert_polyline_point(self.input_ui)
|
||||
if result:
|
||||
self.report({'WARNING'}, result)
|
||||
self.report({"WARNING"}, result)
|
||||
|
||||
self.tool_state.mode = "Mouse"
|
||||
self.tool_state.is_input_on = False
|
||||
|
||||
@@ -88,7 +88,7 @@ class Raycast(bonsai.core.tool.Raycast):
|
||||
rv3d = context.region_data
|
||||
original_perspective = rv3d.view_perspective
|
||||
|
||||
# TODO The raycast was working for orthographic view, but not when you are inside a camera view. This solution feels hacky,
|
||||
# TODO The raycast was working for orthographic view, but not when you are inside a camera view. This solution feels hacky,
|
||||
# but it temporarily switches the perspective_matrix from camera to the perspective_matrix from ortho view.
|
||||
if original_perspective == "CAMERA":
|
||||
rv3d.view_perspective = "ORTHO"
|
||||
|
||||
@@ -137,13 +137,15 @@ class Snap(bonsai.core.tool.Snap):
|
||||
polyline_data = bpy.context.scene.BIMPolylineProperties.polyline_point
|
||||
if polyline_data:
|
||||
# Avoids creating two points at the same location
|
||||
for point in polyline_data[1:]: # The first can be repeated to form a wall loop
|
||||
for point in polyline_data[1:]: # The first can be repeated to form a wall loop
|
||||
if (x, y, z) == (point.x, point.y, point.z):
|
||||
return "Cannot create two points at the same location"
|
||||
print(type(snap_vertex))
|
||||
print(type(polyline_data[-1]))
|
||||
# Avoids creating segments smaller then 0.1. This is a limitation from create_wall_from_2_points
|
||||
length = (Vector((x, y, z)) - Vector((polyline_data[-1].x, polyline_data[-1].y, polyline_data[-1].z))).length
|
||||
length = (
|
||||
Vector((x, y, z)) - Vector((polyline_data[-1].x, polyline_data[-1].y, polyline_data[-1].z))
|
||||
).length
|
||||
if length < 0.1:
|
||||
return "Cannot create a segment smaller then 10cm"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user