-
Notifications
You must be signed in to change notification settings - Fork 404
Closed
Labels
questionFurther information is requestedFurther information is requested
Description
I am trying to create a train switch - using the following code for a single rail (simplified to a round bar).
def splinetrack(x, y):
pts = [(0, 0), (x / 2, y / 2), (x, y)]
tgts = [(x, 0), None, (2 * x, y)] # 1
# tgts = [(x, 0), (x / 2, y / 2 + x * 10), (2 * x, y)] # 2
# tgts = [(x, 0), None, (2 * x, 0)] # 3
path = cq.Workplane("XY").spline(pts, tgts)
return cq.Workplane("YZ").circle(3.0).sweep(path)generates this:
If I (try to) force a 90 degrees tangent in the middle you see the effect even better:
Experimenting I stumbled on the third 'tgts' definition which produces the correct 90 degrees angle.
Can someone explain?
Oops! I found it myself: the tangent vectors in the spline function are specified as starting from (0,0) - It would be good if the CadQuery 2 Documentation mentioned that :)
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested