mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-10-01 20:49:44 +00:00
Fix #6363. Improve how Curves are handled by the snapping system.
This commit is contained in:
@@ -204,6 +204,8 @@ class Raycast(bonsai.core.tool.Raycast):
|
|||||||
}
|
}
|
||||||
points.append(snap_point)
|
points.append(snap_point)
|
||||||
return points
|
return points
|
||||||
|
if obj and obj.type == "CURVE":
|
||||||
|
obj = bpy.data.objects.new("new_object", obj.to_mesh().copy())
|
||||||
|
|
||||||
if not custom_bmesh:
|
if not custom_bmesh:
|
||||||
bm = bmesh.new()
|
bm = bmesh.new()
|
||||||
|
|||||||
@@ -358,20 +358,13 @@ class Snap(bonsai.core.tool.Snap):
|
|||||||
face_index = result[2]
|
face_index = result[2]
|
||||||
if hit is not None:
|
if hit is not None:
|
||||||
# Wireframes
|
# Wireframes
|
||||||
if snap_obj.type == "EMPTY" or (snap_obj.type == "MESH" and len(snap_obj.data.polygons) == 0):
|
if snap_obj.type in {"EMPTY", "CURVE"} or (snap_obj.type == "MESH" and len(snap_obj.data.polygons) == 0):
|
||||||
snap_points = tool.Raycast.ray_cast_by_proximity(context, event, snap_obj)
|
snap_points = tool.Raycast.ray_cast_by_proximity(context, event, snap_obj)
|
||||||
if snap_points:
|
if snap_points:
|
||||||
for point in snap_points:
|
for point in snap_points:
|
||||||
point["group"] = "Wireframe"
|
point["group"] = "Wireframe"
|
||||||
detected_snaps.append(point)
|
detected_snaps.append(point)
|
||||||
|
|
||||||
elif snap_obj.type == "CURVE":
|
|
||||||
new_object = bpy.data.objects.new("new_object", obj.to_mesh().copy())
|
|
||||||
snap_points = tool.Raycast.ray_cast_by_proximity(context, event, new_object)
|
|
||||||
if snap_points:
|
|
||||||
for point in snap_points:
|
|
||||||
point["group"] = "Wireframe"
|
|
||||||
detected_snaps.append(point)
|
|
||||||
# Meshes
|
# Meshes
|
||||||
else:
|
else:
|
||||||
# Add face snap
|
# Add face snap
|
||||||
|
|||||||
Reference in New Issue
Block a user