mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 14:41:25 +00:00
Improved snap hierarchy to allow better face snapping.
This commit is contained in:
@@ -141,7 +141,8 @@ class Raycast(bonsai.core.tool.Raycast):
|
|||||||
points = []
|
points = []
|
||||||
|
|
||||||
# Makes the snapping point more or less sticky then others
|
# Makes the snapping point more or less sticky then others
|
||||||
# It changes the distance and affects how the snapping point is sorted
|
# It changes the distance and affects how the snapping point are sorted
|
||||||
|
reference = 0.2
|
||||||
stick_factor = 0.02
|
stick_factor = 0.02
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -186,8 +187,8 @@ class Raycast(bonsai.core.tool.Raycast):
|
|||||||
if intersection[0]:
|
if intersection[0]:
|
||||||
if tool.Cad.is_point_on_edge(intersection[1], (v1, v2)):
|
if tool.Cad.is_point_on_edge(intersection[1], (v1, v2)):
|
||||||
distance = (intersection[1] - intersection[0]).length
|
distance = (intersection[1] - intersection[0]).length
|
||||||
if distance < 0.8:
|
if distance < 0.2:
|
||||||
points.append([distance + 4 * stick_factor, (intersection[1], "Edge")])
|
points.append([distance + 2 * stick_factor, (intersection[1], "Edge")])
|
||||||
|
|
||||||
bm.free()
|
bm.free()
|
||||||
snapping_points = []
|
snapping_points = []
|
||||||
|
|||||||
Reference in New Issue
Block a user