mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-13 10:57:49 +00:00
black .
This commit is contained in:
@@ -2016,7 +2016,7 @@ class DecorationsHandler:
|
||||
return # Don't draw decorations in local view
|
||||
|
||||
# disable decorations when not in camera view
|
||||
if context.region_data.view_perspective != 'CAMERA':
|
||||
if context.region_data.view_perspective != "CAMERA":
|
||||
return
|
||||
|
||||
if not DrawingsData.is_loaded:
|
||||
|
||||
@@ -172,11 +172,11 @@ class Polyline(bonsai.core.tool.Polyline):
|
||||
angle = tool.Cad.angle_3_vectors(
|
||||
second_to_last_point, last_point, mouse_vector, new_angle=None, degrees=True
|
||||
)
|
||||
angle_round_threshold = 1000 # Avoids rounding when distance is too big
|
||||
angle_round_threshold = 1000 # Avoids rounding when distance is too big
|
||||
|
||||
# Round angle to the nearest 0.05
|
||||
angle = round(angle / 0.05) * 0.05 if distance < angle_round_threshold else angle
|
||||
|
||||
|
||||
orientation_angle = tool.Cad.angle_3_vectors(
|
||||
world_second_to_last_point, last_point, mouse_vector, new_angle=None, degrees=True
|
||||
)
|
||||
|
||||
@@ -181,7 +181,9 @@ class Raycast(bonsai.core.tool.Raycast):
|
||||
mouse_pos = event.mouse_region_x, event.mouse_region_y
|
||||
|
||||
view_vector = tool.Cad.region_2d_to_vector_3d_np(region, rv3d, mouse_pos)
|
||||
ray_origin = tool.Cad.region_2d_to_origin_3d_np(region, rv3d, mouse_pos, clamp=10) # TODO clamp is hardcoded but might be necessary to adapt
|
||||
ray_origin = tool.Cad.region_2d_to_origin_3d_np(
|
||||
region, rv3d, mouse_pos, clamp=10
|
||||
) # TODO clamp is hardcoded but might be necessary to adapt
|
||||
|
||||
ray_target = ray_origin + view_vector
|
||||
ray_direction = ray_target - ray_origin
|
||||
|
||||
Reference in New Issue
Block a user