Available - drawing, Trim and 3D regions

Spline tool

How to create and reshape smooth B-spline paths in Cadivari.

Updated September 202610 min readCAD tools

Recommended test

Try both an open freeform side profile and a small closed loop.

  1. Press B and place four well-spaced control points. Confirm the smooth preview follows the pointer.
  2. Press Backspace once, replace the last point, then click the green check beside the pointer or press Enter to finish the open spline.
  3. Drag each gold control point and confirm the curve and dashed control polygon update live.
  4. With a mirror-linked spline, leave both end handles slightly beside the guide and click Close on mirror. Confirm Properties reports Closed · mirrored, the seam gap becomes Exact, and both curve halves use one selected-contour color.
  5. Click Smooth curve in Properties. Confirm the middle of the curve relaxes while its endpoints and aligned mirror seam stay fixed. Click it again, then undo once and confirm only the last smoothing pass is reversed.
  6. Undo and redo one handle move. Confirm the complete drag behaves as one edit.
  7. Create another spline with at least three points, then click its first point to close it automatically.
  8. Draw a circle crossed twice by an open S-shaped spline in the same sketch. Return to 3D and extrude the two regions to different heights, then test Ctrl-click selection of both regions together.
  9. Create an unmirrored open spline, snap a line to one endpoint, then select either entity. Confirm the complete mixed path receives one cyan halo and Properties shows their combined length.
  10. Add a second segment and use Close with straight line. Confirm the new line is selected, the path turns green, and one undo reopens it.
  11. Create one standalone unmirrored open spline inside the CAM stock. In CAM choose Add contour, click the spline, then create an On-line spline contour. Confirm the 0.050 mm tolerance, depth motion, 3D channel, and animation. Inspect the G-code, confirm one G1 cut per sample per pass, complete preflight, and verify local `.nc` saving unlocks.

01 · CREATE

Build a smooth path point by point

Activate Spline from the tool rail or press B. Click the first control point, then continue clicking along the intended outline. A dashed polygon connects the control points while the gold curve previews the resulting shape.

Control points influence the curve

The first and last points lie on an open spline. Intermediate points pull the path toward them rather than acting like corners the curve must pass through. This produces smooth transitions for handles, enclosures, furniture parts, instrument bodies, and other freeform profiles.

02 · COMMIT

Finish open or close at the start

After placing at least two useful points, click the green check beside the pointer or press Enter to commit an open spline. After placing at least three points, move near the first point until the endpoint snap turns green and click to create a closed path.

Backspace removes the most recently placed control point without leaving the tool. Escape cancels the entire uncommitted spline. A finished spline is added to history as one document command.

03 · RESHAPE

Drag visible control handles

Select a spline to reveal its dashed control polygon and gold handles. Drag any handle to reshape the curve. Closed splines use one shared start/end handle, so the closure remains connected when that point moves.

The Properties panel reports the control-point count, approximate curve length in millimetres, and whether the path is open or closed. Each completed handle drag creates one undoable edit.

04 · REFINE

Apply a gentle smoothing pass

Select a spline and click Smooth curve in Properties. One click gently evens abrupt changes in the control polygon without moving an open spline's endpoints. Repeated clicks build the effect gradually, and each click is stored as one undoable edit.

For mirror-linked splines, the endpoint and its neighboring tangent control stay fixed so the centre seam does not drift. Closed splines keep their shared closure point synchronized. CAD smoothing remains available even when a mirror-linked spline is not yet closed tightly enough to qualify as a CAM boundary. Cadivari still rejects a pass if it would introduce a new self-crossing.

Smooth is intentionally conservative

This first version refines an existing curve without deleting control points or replacing the spline. A future Simplify command can separately reduce point count when that behavior is wanted.

05 · MIRROR CONTOUR

Close the editable half precisely on its guide

A mirror-linked spline stores one editable open half plus one live reflected half. Properties reports the physical Start and End seam gaps until both source endpoints lie exactly on the guide. Click Close on mirror to project both endpoints onto the guide and align their neighboring controls perpendicular to it, producing a smooth associative join in one undoable edit.

Spline placement and endpoint dragging also snap anywhere along the linked mirror guide when Snap is enabled. Once the derived result validates, Properties reads Closed · mirrored. The two strokes use one contour color; purple remains on reflected handles and the reflected control polygon only to identify the non-editable half.

The mirror relationship is preserved

Closing does not duplicate or bake the reflection into an unrelated second object. Editing the source half or moving the guide continues to update the complete contour.

04 · CONNECT

Use the established snap system

New control points and edited handles use the same screen-consistent grid and geometry snapping as the other drawing tools. Open spline endpoints are reusable snap targets for lines, arcs, and later paths. A closed spline exposes its shared closure point.

05 · MIXED PATHS

Use an open spline as one path segment

Selecting an unmirrored open spline now follows every line, circular arc, or other eligible open spline attached through its exact first or last control point. The smooth segment receives the same status halo and Open, Closed, Branched, or Self-crossing diagnostics as the rest of the component.

The inspector includes the spline’s approximated curve length in the total. Crossing checks use the same bounded B-spline samples that draw the visible curve, so line–spline, arc–spline, spline–spline, and single-spline self-crossings can prevent an unsafe Closed result.

Deliberate first boundary

Closed splines already store their own closure state and are not folded into this endpoint graph yet. A spline linked to a mirror guide is also excluded because its reflected half is derived display geometry rather than a separately selectable document segment.

3D PROFILES

Use a spline to divide enclosed regions

In one sketch, an unmirrored spline can intersect a circle, rectangle, line, circular arc or another spline to form separately selectable regions in 3D > Push/Pull. The spline may be open: it is the combined boundary around each region that must close. A closed spline can also be divided, and a spline with connected lines can enclose a profile.

For a quick test, draw a circle and an S-shaped spline that starts and ends outside it. Confirm the actual curve crosses the circle twice. Return to 3D, choose Push/Pull, and give each side a different extrusion height. Ctrl-click both regions and choose Extrude selected to combine them instead. New body, Join and Cut use the same region selection.

The control points remain editable and saved extrusions follow the referenced region while its boundary connections remain intact. Changing the connections can invalidate the reference; restore the boundary or select the intended regions for a new extrusion. See the full spline-region workflow.

Region detection and connected paths serve different purposes

A crossing can divide CAD regions without turning the original strokes into one unbranched contour. CAM and connected-path diagnostics retain their existing behavior. Mirror-linked halves remain whole-profile inputs, and self-crossing or overlapping splines need simplification before automatic region splitting. Real gaps remain open.

SKETCH CLEANUP

Remove a section between crossings

Choose Trim (X), hover over the actual spline curve and click to remove the highlighted section. Lines, circles, circular arcs, rectangle sides and other ordinary splines can bound the section. Open endpoints also provide limits; closed splines can be trimmed across their start/end point.

The remaining shape is preserved as one or more editable cubic spline pieces. A longer spline may become several joined objects. Select a piece to reveal its gold control handles; later edits affect that piece independently. One Undo restores the original spline, and save/open preserves the replacements.

Mirrored halves are excluded: select the source and choose Remove mirror first. Self-crossing, overlapping or unresolved near-touching geometry needs simplification. Existing CAM-linked sources remain protected. Trimming replaces the spline's identity, so affected solid feature definitions stay stored but may require Undo or recreation from the current closed regions.

06 · CAM OUTPUT

Create and review a standalone On-line spline contour

In CAM choose Add contour and click one eligible open spline. Cadivari adaptively samples the mathematical curve until the measured chord error is no greater than 0.050 mm, with a conservative 512-segment ceiling. The blue 2D overlay shows the sampled centre line, full cutter diameter, S/E terminals, segment count, and tolerance.

After creation, Cut and Step produce explicit depth passes. Every pass follows the bounded samples as typed linear moves, and those same moves drive the 3D channel, pass layers, animated cutter, XYZ readout, and Shapeoko/GRBL G1 output. Reverse swaps the complete S-to-E order.

Sampled output is identified and checked again

Left and Right remain disabled. The generated program names the sample count and measured chord error. Export preflight independently requires the approved sample count, linear cut moves, generated G1 blocks, pass count, and tolerance to agree before local saving unlocks.

REFERENCE

Controls

BActivate Spline
ClickPlace the next control point
Green checkFinish an open spline
EnterFinish an open spline
Click first pointClose a spline after at least three points
Close on mirrorProject both seams onto the linked guide and align their tangents
Smooth curveApply one gentle, undoable curvature pass
BackspaceRemove the last uncommitted point
EscCancel the uncommitted spline or handle drag
VActivate Select
Ctrl + ZUndo creation or a completed edit

IMPLEMENTATION NOTE

Document model

The document stores renderer-independent millimetre control points and an explicit closure state. The SVG canvas receives sampled display points but does not own the geometry.

{
  "kind": "spline",
  "controlPoints": [
    { "x": 0, "y": 0 },
    { "x": 45, "y": 80 },
    { "x": 100, "y": 120 },
    { "x": 145, "y": 40 }
  ],
  "closed": false,
  "mirrorGuideId": null
}

The curve uses a clamped B-spline with degree three whenever four or more points are available, matching the useful AutoStrek behavior. Two-point and three-point paths reduce naturally to linear and quadratic forms. Smoothing applies a bounded two-stage fairing pass to eligible control points while preserving protected endpoints and mirror-seam tangent controls. A mirror-linked source remains an open half in storage; exact endpoint projection allows connected-path analysis to resolve it and its live reflection as one closed contour without duplicating geometry.

CURRENT SCOPE

Not implemented yet

  • Closed and mirror-linked splines in mixed endpoint topology (separate from CAD enclosed-region detection)
  • Automatic region splitting of mirror-linked spline halves or self-crossing splines
  • Trim of mirror-linked or self-crossing splines
  • Exact numeric editing for individual control-point coordinates
  • Adding or removing points after a spline is committed
  • Dragging an entire spline by its stroke
  • Tangent, curvature, and continuity constraints
  • Connected spline mixtures as CAM previews or operations
  • Open-spline Left/Right compensation

Compare a fixed exported spline job with a known-good Shapeoko/GRBL reference before expanding spline compensation.