Improved snap hierarchy to allow better face snapping.

This commit is contained in:
Bruno Perdigão
2024-10-09 10:41:53 -03:00
parent 1a55212099
commit 304db50692
+4 -3
View File
@@ -141,7 +141,8 @@ class Raycast(bonsai.core.tool.Raycast):
points = []
# 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
try:
@@ -186,8 +187,8 @@ class Raycast(bonsai.core.tool.Raycast):
if intersection[0]:
if tool.Cad.is_point_on_edge(intersection[1], (v1, v2)):
distance = (intersection[1] - intersection[0]).length
if distance < 0.8:
points.append([distance + 4 * stick_factor, (intersection[1], "Edge")])
if distance < 0.2:
points.append([distance + 2 * stick_factor, (intersection[1], "Edge")])
bm.free()
snapping_points = []