spline() tangents, how?

44 views
Skip to first unread message

Neri

unread,
Feb 27, 2025, 2:03:34 PMFeb 27
to CadQuery
Here is a code snippet which fails to work:

from cadquery import Sketch
sk = Sketch()
sk = sk.spline([ (0,1), (0,0), (1,0) ],
               [ (-1,-1), (1,1) ])
#sk = sk.spline([ (0,1), (0,0), (1,0) ])
sk = sk.segment((1,0), (0,1))
sk = sk.assemble()
show_object(sk)

There is some sort of runtime error complaining about lists and method signatures.  Replacing the spline() line with the one commented out solves the problem, but I'm not trying to specify tangents there.

I looked at the source code of sketch.py and saw the 'tangents' there.  However I've struggled to use it, also in the non-Sketch spline() call.  I've had no luck specifying 'tangents' in spline() either in Sketch or in the Workplane.

BTW I've had success with Sketch in generating a very complex involute gear profile.

Lorenz

unread,
Mar 1, 2025, 7:56:01 PMMar 1
to CadQuery
The boolean arg is required. Try:
sk = sk.spline([(0, 1), (0, 0), (1, 0)], [(-1, -1), (1, 1)], False)
Reply all
Reply to author
Forward
0 new messages