Skip to main content

Arc

A circular arc between two endpoints. Arcs round the corners of profiles, blend into lines with tangency, and close the ends of slots.

In the viewport

Two tools draw arcs; both write the same arc() statement.

  • 3-Point Arc — click the start, click the end, then click a point the arc passes through (the third click sets the bulge).
  • Center Arc — click the centre, click the start, then sweep to the end. The sweep stops just short of a full turn.

An endpoint that snaps onto an existing vertex gets a coincident; an arc drawn at the end of a line with Polyline in T-Arc mode also gets the tangent.

A hook: shank, tangent bend and return

The code behind it
plate.part.js
import { sketch, line, arc } from 'fluidcad/core';
import { coincident, tangent, vertical, horizontal, fix, radius, distance } from "fluidcad/constraints";

sketch("xy", () => {
// A hook: a straight shank, a semicircular bend, and a short return.
const shank = line([0, 0], [0, 60]);
// arc(start, end, center): all three are guesses the solver reconciles.
const bend = arc([0, 60], [40, 60], [20, 60]);
const tip = line([40, 60], [40, 40]);
// Join the pieces and make the bend leave the shank without a kink.
coincident(shank.end(), bend.start());
coincident(bend.end(), tip.start());
tangent(shank, bend);
tangent(bend, tip);
vertical(shank);
fix(shank.start(), [0, 0]);
distance(shank.start(), shank.end(), 60);
// The radius dimension is what sizes the bend; the centre guess only
// picks which side it bulges to.
radius(bend, 20);
distance(tip.start(), tip.end(), 20);
})

By hand

arc(start, end, center)

All three points are guesses. The solver keeps the arc consistent — the centre stays equidistant from both ends — so a rough centre is fine. Pair the arc with radius() or tangent() to pin it down.

Sweep direction

The arc sweeps counter-clockwise from start to end by default. Chain .cw() to take the other side of the chord:

A lens: the same chord swept both ways

The code behind it
plate.part.js
import { sketch, arc } from 'fluidcad/core';
import { coincident, fix } from "fluidcad/constraints";

sketch("xy", () => {
// A lens (a leaf-shaped blade): two arcs on the same chord.
// CCW from start to end, with the centre below the chord, sweeps
// through the bottom …
const lower = arc([0, 0], [80, 0], [40, -30]);
// … and .cw() takes the other side of the chord for the upper arc.
const upper = arc([0, 0], [80, 0], [40, 30]).cw();
coincident(lower.start(), upper.start());
coincident(lower.end(), upper.end());
fix(lower.start(), [0, 0]);
fix(lower.end(), [80, 0]);
})

The sweep side is a display and topology choice only — the solver treats both the same.

Accessors

AccessorMeaning
a.start()The start point
a.end()The end point
a.center()The centre point

The arc itself is a target for tangent, equal, concentric, radius, distance and coincident(p, a).