From 304db506926b0621e4e6873deb8698c4ae17e6d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Perdig=C3=A3o?= Date: Wed, 9 Oct 2024 10:41:53 -0300 Subject: [PATCH] Improved snap hierarchy to allow better face snapping. --- src/bonsai/bonsai/tool/raycast.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/bonsai/bonsai/tool/raycast.py b/src/bonsai/bonsai/tool/raycast.py index fa859c403e..707d2c5edc 100644 --- a/src/bonsai/bonsai/tool/raycast.py +++ b/src/bonsai/bonsai/tool/raycast.py @@ -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 = []