Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- Be respectful, on topic and if you see a problem, Flag it.
If you would like to contact our Community Manager personally, feel free to send a private message or an email.
b-spline in sketches with featurescript?
EvanReese
Member, Mentor Posts: 2,135 ✭✭✭✭✭
I'm working on a feature that creates a single b-spline, but I'd like the output to be sketch geometry. Is there a way? I know I can do a bezier, but the b-spline I'm after is a 3-span and I don't want the seams between the 3 beziers.
Evan Reese
0
Answers
Sketch geometry is the base for curves, it would be going backwards. If you want it to be a b spline on a plane, then just make sure all control points are on a common plane. Use project(plane,point) and that will make it basically 2D.
You can take any number of b spline curves and if tangent to each other, combine them into a single curve. Sadly I cannot share that code with you, I can tell you that it is possible, complicated but not too complicated.
Do not use parameterization on a path because the output will be wrong, you need to use the control points only. also, the connection points between 2 curves must be g1 meaning that the control points next to the connection control point need to be inline with the connection point and each other. I hope this makes sense.
Then use those knot values in evEdgeTangentLines, do not use arc length parameterization. The results are the points needed for fit splines. The start and end derivatives are going to be the harder part to determine how skFitSpline accepts them. For reference, the start and end derivatives for Fit Spline are the base point of the onshape Fit Spline arrow manipulators. These are the first and end control points in the bSplineCurve.
I hope this helps a little, but it probably won't, I am just sharing some info I discovered during testing.
Thanks.
However, the critical piece of information left out of this question is that we're working with degree 7 B-splines (with 3 spans). As far as I know the Onshape sketch spline is only degree-3.