curve2.fillet
A true-arc fillet of a given radius between two 2D curves, or at a chain’s corners, with the curves trimmed to its ends.
Usage
Curve2.fillet(target: readonly [IdCurve2, IdCurve2] | Chain2, radius: number, options?: Curve2CornerOptions): Result<Curve2Edit>Parameters
targetreadonly [IdCurve2, IdCurve2] | Chain2Two curves of any kind, or a chain. Required. In model.
radiusnumberThe fillet radius, positive. Required. In model.
options.pickPoint2Two curves: a point on the side to round (the corner’s quadrant); needed when several fillets fit. Required. In model.
options.verticesreadonly (number | `#${number}`)[]A chain: the corners to round, by vertex id or #k.
options.scopestringThe node id minted ids are keyed under.
options.dryRunbooleanReturn the outline only. Default
false.options.tolerancenumberDistance under which points are one. Default
1e-9 × the bounds diagonal. In model.
Returns
Ok with { outline, curves: [a, b, the arc] } or { outline, chains: [the chain] }: the arc is endpoint-exact (its ends are the trimmed curves’ ends, bit for bit) with a stored centre, tangent to both; each curve keeps the piece that continues it smoothly.
Errors
Guarantees
- the arc’s centre lies the radius from both curves and its ends lie on them
- the arc’s id does not depend on the order of a and b
- The same result on every machine.
Example
const r = Curve2.fillet([{ id: 1, minter: 0, kind: 'line', a: Point2.of(0, 0), b: Point2.of(10, 0) }, { id: 2, minter: 0, kind: 'line', a: Point2.of(0, 0), b: Point2.of(0, 10) }], 1)
r.ok ? r.value.outline : Result.error(r).code // → ok once loadGeometryKernel() has run; CAPABILITY_UNAVAILABLE before