Composite
Composite joins several curves and edges into one curve. Some inputs take exactly one curve: a sweep path, a loft guide, the source of an offset or a projected curve that should be treated as one run. A real path is rarely one piece: it runs along an edge of the model, across a bridge, and on along a sketch. A composite curve makes those pieces one curve, picked with one click and used wherever one curve is expected.
It also gives a run of edges a name that stays put. The run is selected once and reused, where every tool that needs it would otherwise select it again.

curve(rim, br, tail)An edge of the block, a bridge from its end and a sketched line, joined into one curve.

sweep(path, profile)A circle swept along the whole run: along the edge, round the bridge and out along the line.
The code behind the curve
The dialog writes a picked edge as a selector of its own, such as block.endEdges(edge().onPlane('xz')); any edge selection works in its place.
import { sketch, extrude, line, plane, select, bridge, curve } from 'fluidcad/core';
import { rect } from 'fluidcad/shapes';
import { edge } from 'fluidcad/filters';
// A block 40 × 20, 10 tall.
sketch('xy', () => {
rect([0, 0], 40, 20);
});
const block = extrude(10);
// A line in the air beside the block, at the height of its top. The sketch
// returns it so a statement after the sketch can read its ends.
const tail = sketch(plane('xy', 10), () => {
const l = line([60, 10], [80, 10]);
return { l };
});
// An edge of the model: the top edge along the front of the block.
const rim = select(edge().onPlane('xy', 10).onPlane('xz'));
// A bridge from the end of that edge to the start of the line.
const br = bridge(rim.end(), tail.geometries.l.start());
// The edge, the bridge and the line as one curve, in the order it is
// walked: it starts at the free end of the edge and ends at the far end of
// the line. The pieces are copied, not changed: the block keeps its edge,
// and the bridge and the sketch hide, as when any tool uses them.
const path = curve(rim, br, tail);
The code behind the sweep
import { sketch, extrude, line, circle, plane, select, bridge, curve, sweep } from 'fluidcad/core';
import { rect } from 'fluidcad/shapes';
import { edge } from 'fluidcad/filters';
sketch('xy', () => {
rect([0, 0], 40, 20);
});
const block = extrude(10);
const tail = sketch(plane('xy', 10), () => {
const l = line([60, 10], [80, 10]);
return { l };
});
const rim = select(edge().onPlane('xy', 10).onPlane('xz'));
const br = bridge(rim.end(), tail.geometries.l.start());
const path = curve(rim, br, tail);
// A circle on a plane square to the curve where it starts.
const profile = sketch(plane(path.edges(0), 'start'), () => {
circle([0, 0], 3);
});
// One sweep along the whole run: along the edge of the block, round the
// bridge and out along the line. A sweep path is one curve, and the
// composite is one.
sweep(path, profile);
In the viewport
- Open the Curves menu on the toolbar and click Composite. The Composite Curve dialog opens with its one row, Pieces, armed (blue border).
- Click the pieces in the order the curve runs. Each click adds a chip to the row, and the curve joined so far previews in blue from the first pick on.
- Click Apply. The timeline gains a Composite Curve row and the statement is written to the file.

- 1PiecesThe curves and edges to join. The row takes any number of picks and stays armed for the next one.
- 2ChipsOne chip per piece, in the order picked: that is the order the statement writes them in and the curve is walked in. A chip’s ✕ takes its piece out; a sketch’s or a curve’s chip shows the line of its statement.
- 3Where it startsThe curve starts at the first piece. See The order of the pieces below.
- 4ApplyWrites curve(piece, piece, …). The row needs at least one piece. Exit closes the dialog without writing anything.
What a click takes
While Pieces is armed:
- A sketch or a curve is taken whole: click a sketch in the viewport, any edge of a curve (a bridge, a helix, a projected, offset or intersection curve, another composite), or its row in the timeline. The chip reads its variable's name.
- An edge of a solid or a surface is taken as that edge. The chip reads Picked edge.
- Right-click an edge of a solid or a surface for the groups it belongs to, such as its tangent chain and the loops it lies on; double-click it to take its group at once. Every edge of the group becomes a piece of its own.
- A click on a piece the row already holds takes it back out. A face is not a piece.
The order of the pieces
The order of the chips is the order the curve is walked in, and it sets where the curve starts.
- When the first piece sits at an end of the run, with one end free and the other meeting the next piece, the curve starts at that free end. Picked edge, bridge, line, the curve above starts at the far end of the block's edge; picked line, bridge, edge, it starts at the far end of the line.
- When that leaves a choice, the first piece's own direction decides: a piece given alone, a first piece in the middle of the run, or a closed loop.
The start matters to what reads the curve afterwards: path.start() and path.end(), the plane a sweep profile is set on, and the side an offset goes to.
What a composite curve is not
- It does not smooth anything. Pieces that meet at a corner still meet at a corner. Bridge makes a smooth join between two ends; the bridge is then one of the pieces.
- It does not merge the pieces into one spline. Each edge of the result is a copy of an edge you gave: a line stays a line, an arc an arc.
- It does not use up solids. An edge of a body leaves the body as it is. A sketch or a curve used as a piece hides, as when any tool uses it, and stays readable: a later statement can read it again, and a dialog that takes curves offers it again.
It makes no new geometry. Ends that nearly meet are joined, within the tolerance sketch profiles close with.
Pieces that do not touch
Pieces whose ends meet form one curve. Pieces that do not touch form one curve per connected run, and the composite holds them all. That is not an error: the dialog notes The pieces form 2 separate curves. under the row and Apply stays available.
Whether several curves are acceptable is for the tool that uses the result to say. A sweep path has to be one curve, so a sweep along such a composite fails with:
sweep path is 2 separate curves, not one connected curve; the nearest ends, (0, 0, 10) and (0, 40, 10), are 40 apart.
The message gives the two ends nearest each other: that is the gap to close, with a bridge or by moving a piece.
A fork
A curve cannot branch. Pieces that fork are refused, and the dialog shows the message in place of the preview:
curve: the pieces branch at (40, 0, 10); a curve cannot fork.
The point is where the branch is. A fork is three or more ends meeting at one point, a tail on a corner of a closed loop, or a piece that ends on the middle of another. Take out one of the pieces that meet there, or give each branch a composite of its own. Pieces that only cross, away from their ends, are separate curves.
Using a composite curve
A click on any edge of a composite takes its curve wherever a dialog takes curves, also where it lies on the edge of the body it was made from. Pieces that form separate curves make a composite of several, and a click then takes the one it lies on, as Picking a curve describes:
- the Path of a Sweep;
- the Guides of a Loft;
- the Edges of Offset and the Curves of Project, which then treat it as one run;
- the Pieces of another composite.
The From and To rows of Bridge offer the ends of its edges.
Offsetting a composite curve
An offset of a composite goes by the way the composite is walked. Stand on the outside of the faces and walk along the curve in the order of its pieces: a positive distance is to the left, a negative one to the right. So the order of the pieces sets the side, and the preview shows which one you get.
The rule for a rim, where a positive distance goes onto the faces from their own border edges, does not apply to a composite, even one made of those edges.
Two top edges of a block joined round a corner, offset 3 onto the top face:
The code behind it
import { sketch, extrude, select, curve, offset } from 'fluidcad/core';
import { rect } from 'fluidcad/shapes';
import { edge } from 'fluidcad/filters';
// A block 40 × 20, 10 tall.
sketch('xy', () => {
rect([0, 0], 40, 20);
});
const block = extrude(10);
// Two top edges that meet at the corner above the origin.
const front = select(edge().onPlane('xy', 10).onPlane('xz'));
const left = select(edge().onPlane('xy', 10).onPlane('yz'));
// One curve round the corner. It is walked from the far end of the left
// edge to the corner, then along the front edge: the top face is on the
// left of that walk.
const corner = curve(left, front);
// A positive distance goes to the left of the walk: 3 inside the two
// edges, on the top face. curve(front, left) is walked the other way and
// needs -3 for the same line.
const inset = offset(3, corner, { on: block.endFaces() });
Editing
Double-click the Composite Curve row in the timeline. The view rolls back to just before the statement and the dialog reopens with one chip per piece, in the order written, each showing the piece as it is written and lit in the viewport.
- A chip's ✕ takes its piece out. A click adds a piece at the end of the row.
- To put a new piece between two others, take the later ones out, pick the new piece, then pick the later ones again. A piece put back this way is still the statement's own: it is written back as it was.
- Apply rewrites only the list of pieces. Pieces you did not touch keep their text; a dialog left untouched writes nothing.
A statement that passes its pieces as a list, curve(pieces) or curve(...pieces), cannot be shown piece by piece; it is edited in the source.
In code
import { curve } from 'fluidcad/core';
const path = curve(rim, br, tail);
| Argument | Takes |
|---|---|
...parts | Any number of curves, at least one, in the order the curve is walked: a sketch, one line of a sketch (s.geometries.l), a curve (a helix, a bridge, an intersection, projected or offset curve, another composite), a selection of edges (select(edge()…), body.endEdges(), c.edges(0)). A list is the same as its items written out. |
The tool has no options. curve is written outside a sketch; inside one, edges that meet already form one curve.
The result holds one curve per connected run:
path.edges() // every edge, in the order the curve is walked
path.edges(0) // one edge
path.start() // where the (first) run starts
path.end() // where it ends: an end for a bridge
An edge given twice counts once. The edges are the composite's own copies, so changing the body an edge came from later leaves the curve as it was built.
Errors
| Situation | Message |
|---|---|
| No pieces | curve: give at least one curve or edge. |
| The pieces fork | curve: the pieces branch at (x, y, z); a curve cannot fork. |
| A piece is a face selection | curve: piece 1 is a face selection; pick its edges. |
| A piece is a solid or a surface | curve: piece 2 is a solid; pick the edges to use. |
| A piece holds no edge, such as an empty sketch | curve: piece 3 has no edges to build a curve from. |
| Written inside a sketch | curve: is written outside a sketch; inside one, edges that meet already form one curve. |
Pieces are counted in the order written.