Joining Splines?

Morning,

I’ve been having a bit of a play with splines, and cannot seem to see any way to join two separate splines together; regardless of whether it’s been created with either with control points or with fit points.

I can split a spline into two with Divide (DI), but can’t see any way to combine two splines by either bridging or merging their end points.

Is there a hidden tool or method I’ve missed, or is this not possible?

Cheers,
Derek

Derek,
This is not implemented under QCAD.

There are some reasons …

  • Open fit-point splines under QCAD end normal … Relaxed … There is no residual stress, no forced tangent orientation …
    … Converging to a straight line.
  • Same for open control-points splines on creation.
  • When you trim or divide a fit-point spline the tangent direction at the endpoints is preserved by converting it/them to control-points splines.
  • The Maths are rather complex. :wink:

Merging two splines with non-matching end tangents will no longer be a fluent curve.
Also known as ‘clamped’ splines.

Although QCAD does not support creating such it supports the rendering of these splines when created by another App.

Maybe converting them to polylines (with tangentially connected arcs) is a solution for you.
These polylines can be merged.

Regards,
CVH

Thanks for confirming that CVH.

Concerting them to polylines isn’t really a solution, as I’d want the two joined end-points to be a single point, and a smooth section of spline just like all the others.

I’m sure the maths are complex, but the long-winded solution I have is to draw a new spline which snaps to the existing points of the two splines I wish to join. Surely it must be possible to select two splines, have the computer remember all the control points that comprise them, and make a new spline with the same points?

Oh well. It’s not for anything urgent or critical. Just seemed to be a gap in the toolset, that’s all.

Cheers,
Derek

“Joining” two splines isn’t really a thing as the resulting spline will be different from the two or more original splines.

If you want to create a new spline, reusing the control points (or fit points) of multiple existing splines, you can proceed as follows:

  • Make sure the drawing order of your splines is the order in which you want to combine the splines

  • Make sure the splines have the desired direction (start / end point), reverse direction if necessary (Modify > Reverse)

  • Make sure to check the preference
    Edit > Application Preferences > Info > Store Positions > Splines > Store Nodes (control points or fit points) for splines

  • Select the two or more splines

  • Misc > Information > Store Positions

  • Draw > Spline > Spline (Control Points) or Spline (Fit Points)

  • Misc > Information > Use Positions

  • Right-click to terminate the spline tool

This simply stores the control points (or fit points) of the selected existing splines and then uses these positions as input for the new spline.

Thanks Andrew, that’s perfect.

I wasn’t expecting to be able to join the splines and keep the ends of each spline exactly as they were (straight’..? ‘un-spliney’..? can’t think of the correct terminology right now), as once they are joined, they will behave just like all the other control points, with a smooth join, which is what I was wanting.

And your method of storing the control points, and then using those when creating a new spline is exactly what I described.

That’s great. Does just what I wanted.

Cheers, Derek

It should not preserve tangent orientations …

  • The resulting new spline will only match if the two merged splines were actually tangent to begin with.
  • In all other cases it was a discontinuity before and turned in a smooth curvature afterwards.
    The change in curvature will not be limited to local either, it might still be noticeable several points away..

Creating two tangent splines sounds easy but that is it not.
There is no start- or end-angle to begin with.
For control point spline one can construct the normal vector at the endpoints.

If one wants to break up a larger spline an merge it back later then the advice is to keep a copy.
Forth and back will not always return the original.
One can also undo the last actions until your back with the original.

Regards,
CVH