Docs

Search documentation

Shared docs and current release

Loading search…

日本語

@shumoku/core · 0.4.2 · function

drawingArcs

Source

How each vertex of a polyline is rounded, given the radius asked for at each (0 at the ends). The arc is tangent to both runs, so a vertex turning through θ takes `r·tan(θ/2)` off each, at most half of either run; where that does not fit, the radius is reduced to fit. A vertex that is not rounded (an end, no radius, a run of no length, no turn) has no arc. This is the one place a drawn corner is worked out; the renderer writes the arcs out and the layout samples them.

drawingArcs(points: readonly Point[], radii: readonly number[]): Arc | undefined[]

Parameters

Parameter Type Description Default
points readonly Point[] No additional description. —
radii readonly number[] No additional description. —

Returns

Arc | undefined[]

libs/@shumoku/core/src/libs/@shumoku/core/src/drawing/arcs.ts:29