[Sketcher] Any suggestions on improving B-Spline knot insertion?
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: [Sketcher] Any suggestions on improving B-Spline knot insertion?
If I don't mistake the knot insertion can be used to make the point onto object constraint working with B-Splines.
Re: [Sketcher] Any suggestions on improving B-Spline knot insertion?
Unfortunately it is not that straightforward. A knot only tells where along the curve there is a "break". We can add a high multiplicity knot and fix it, but we lose tangent continuity because of that.
My latest (or last) project: B-spline Construction Project.
Re: [Sketcher] Any suggestions on improving B-Spline knot insertion?
What I have in mind is creating a knot at edge/spline intersection and recalculate it after every spline change. The inserted knot will be a kind of non-piloting one.
As the knot insertion doesn't change the spline shape, it's currently usable this way:
original spline add a knot coincidence constraint but spline is no more editable with original control points…
Re: [Sketcher] Any suggestions on improving B-Spline knot insertion?
I think you're not getting the point: any knot inserted effectively makes a different curve, and there is a discontinuity (at some derivative) inserted for every knot.
This should not be possible.As the knot insertion doesn't change the spline shape, it's currently usable this way:
original spline
Capture d’écran_2022-03-12_12-09-49.png
add a knot
Capture d’écran_2022-03-12_12-10-18.png
coincidence constraint
As I said this is because now the curve has been changed. Turn on "curvature comb" and try moving the new control points. You will already see the curvature comb is visibly different after knot insertion. After changing the new control points, you'll see that the curvatures at the inserted knot are no longer the same (so long as it is cubic, which your example is).Capture d’écran_2022-03-12_12-10-41.png
but spline is no more editable with original control points…
My latest (or last) project: B-spline Construction Project.
Re: [Sketcher] Any suggestions on improving B-Spline knot insertion?
Ok not this way.
Let me have another try
You already implement a "point onto BSpline" with knot insertion preview, can't we use this algorithm to add a point (not a knot) at a given place ?
Re: [Sketcher] Any suggestions on improving B-Spline knot insertion?
This is very much a possibility, but there are some caveats:
1) Unlike, say, a point on a circle, a point on b-spline will end up being fixed in terms of the parameter. This could just be a limitation in my knowledge however.
2) (If the fixed parameter limitation can be removed) there is also a question of whether to limit this to just the fully continuous sections of the b-spline (i.e. between consecutive knots). For example, a slot can be completely approximated with nurbs. Then do we want to specify a point lies on the circular/linear portion, or on the entire slot?
My latest (or last) project: B-spline Construction Project.