2
$\begingroup$

I'm trying to modify my local copy of dynamic spacebar to include a "Snap to Curve Intersection" option on the "Snap Cursor Menu" starting with circle-circle intersections and circle-path intersections for straight paths that will snap the cursor to the closest intersection to its existing location. I've gotten as far as making a new menu option that only appears enabled when two curves are selected and broken out a separate curveIntersect function to encapsulate the whole thing but I'm having trouble finding a way to distinguish curve types.

So the questions here are:

Does anyone know how to determine curve types from within an addon, or are those only applied at the time of curve creation and all checks would have to be based on their vertices?

Is there already an addon that does this which might save time, or a function built into Blender to handle curve intersections that could be called to pick the from a list of vertices by distance from the existing cursor position? (so far I haven't found one anywhere in the API)

Worried I might have to go at this completely from scratch as my existing repository of c# functions for 2D geometry doesn't include bezier intersections I might port over to python.

$\endgroup$
3
$\begingroup$

this will return the curve type

bpy.data.curves['curve'].splines[0].type

the output is in [‘POLY’, ‘BEZIER’, ‘BSPLINE’, ‘CARDINAL’, ‘NURBS’]
for more info Spline

$\endgroup$
  • $\begingroup$ Are you guys serious, Blender doesn't detect curve intersection ? This must be intentional. So many hindered possibilities. How isn't this a bigger issue. This means you can't actually construct anything mathematically perfect using the Ruler and Compass method. $\endgroup$ – t8ja Jun 21 at 18:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.