@weasel-js/geom 1.14.1 → 1.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-GWSJQSQE.js → chunk-HMGGJZTM.js} +217 -15
- package/dist/chunk-HMGGJZTM.js.map +1 -0
- package/dist/{chunk-42TZDN5C.js → chunk-HNLJO3E7.js} +3 -3
- package/dist/{chunk-42TZDN5C.js.map → chunk-HNLJO3E7.js.map} +1 -1
- package/dist/curves/index.js +1 -1
- package/dist/index.d.ts +85 -42
- package/dist/index.js +258 -91
- package/dist/index.js.map +1 -1
- package/dist/nd/index.d.ts +3 -2
- package/dist/nd/index.js.map +1 -1
- package/dist/tessellate/index.d.ts +12 -4
- package/dist/tessellate/index.js +1 -1
- package/dist/warp/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-GWSJQSQE.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/paths/curvature.ts","../src/paths/eulerSpiral.ts","../src/paths/spiro.ts","../src/paths/spiroPath.ts"],"names":[],"mappings":";;;;AAKO,SAAS,iBAAA,CAAkB,EAAA,EAAW,EAAA,EAAW,EAAA,EAAW,IAAW,CAAA,EAAkB;AAC9F,EAAA,MAAM,IAAI,CAAA,GAAI,CAAA;AACd,EAAA,OAAO;AAAA,IACL,CAAA,EAAG,IAAI,CAAA,GAAI,CAAA,IAAK,GAAG,CAAA,GAAI,EAAA,CAAG,KAAK,CAAA,GAAI,CAAA,GAAI,KAAK,EAAA,CAAG,CAAA,GAAI,GAAG,CAAA,CAAA,GAAK,CAAA,GAAI,IAAI,CAAA,IAAK,EAAA,CAAG,IAAI,EAAA,CAAG,CAAA,CAAA;AAAA,IAClF,CAAA,EAAG,IAAI,CAAA,GAAI,CAAA,IAAK,GAAG,CAAA,GAAI,EAAA,CAAG,KAAK,CAAA,GAAI,CAAA,GAAI,KAAK,EAAA,CAAG,CAAA,GAAI,GAAG,CAAA,CAAA,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AE,GAAG,CAAA,CAAE,CAAC,CAAA,EAAG,CAAA,CAAE,IAAI,CAAA;AACvF,EAAA,IAAI,CAAA,GAAI,CAAA;AACR,EAAA,OAAO,OAAA,CAAQ,GAAA,CAAI,CAAC,GAAA,EAAK,CAAA,MAAO;AAAA,IAC9B,MAAA,EAAQ,OAAO,CAAC,CAAA;AAAA,IAChB,MAAA,EAAQ,GAAA,CAAI,GAAA,CAAI,CAAC,CAAA,KAAM;AACrB,MAAA,MAAM,OAAO,KAAA,KAAU,GAAA,CAAI,MAAA,GAAS,GAAA,CAAI,CAAC,CAAA,CAAE,IAAA,GAAO,OAAA,CAAQ,GAAA,CAAI,IAAI,CAAA,CAAE,CAAA,EAAG,CAAA,CAAE,CAAC,CAAC,CAAA,IAAK,QAAA;AAChF,MAAA,CAAA,EAAA;AACA,MAAA,OAAO,EAAE,CAAA,EAAG,CAAA,CAAE,GAAG,CAAA,EAAG,CAAA,CAAE,GAAG,IAAA,EAAK;AAAA,IAChC,CAAC;AAAA,GACH,CAAE,CAAA;AACJ","file":"chunk-42TZDN5C.js","sourcesContent":["import type { AnchorSet } from './anchorEdits';\nimport { isStraightSegment, segmentEnds } from './anchors';\nimport { cubicPointAt, type Point } from './cubicMath';\n\n/** First derivative of the cubic Bezier (p0, p1, p2, p3) at t. */\nexport function cubicDerivativeAt(p0: Point, p1: Point, p2: Point, p3: Point, t: number): Point {\n const u = 1 - t;\n return {\n x: 3 * u * u * (p1.x - p0.x) + 6 * u * t * (p2.x - p1.x) + 3 * t * t * (p3.x - p2.x),\n y: 3 * u * u * (p1.y - p0.y) + 6 * u * t * (p2.y - p1.y) + 3 * t * t * (p3.y - p2.y),\n };\n}\n\nfunction cubicSecondDerivativeAt(p0: Point, p1: Point, p2: Point, p3: Point, t: number): Point {\n const u = 1 - t;\n return {\n x: 6 * u * (p2.x - 2 * p1.x + p0.x) + 6 * t * (p3.x - 2 * p2.x + p1.x),\n y: 6 * u * (p2.y - 2 * p1.y + p0.y) + 6 * t * (p3.y - 2 * p2.y + p1.y),\n };\n}\n\n/**\n * Signed curvature of the cubic Bezier (p0, p1, p2, p3) at t: one over the\n * radius of the circle that fits the curve there. Positive where the curve\n * turns toward its left normal `(-dy, dx)`, negative where it turns away, so\n * the sign flips at an inflection. 0 where the curve has no direction at t, as\n * at an end whose handle sits on its anchor.\n */\nexport function cubicCurvatureAt(p0: Point, p1: Point, p2: Point, p3: Point, t: number): number {\n const d1 = cubicDerivativeAt(p0, p1, p2, p3, t);\n const d2 = cubicSecondDerivativeAt(p0, p1, p2, p3, t);\n const den = Math.pow(d1.x * d1.x + d1.y * d1.y, 1.5);\n if (den < 1e-12) return 0;\n return (d1.x * d2.y - d1.y * d2.x) / den;\n}\n\n/** One tooth of a curvature comb: a point on the curve and the tip of the\n * tooth standing on it. */\nexport interface CombTooth {\n /** The point on the curve. */\n x: number;\n y: number;\n /** The tooth's tip: off the curve along its normal, on the outside of the\n * bend, by the curvature times the comb's scale. */\n tipX: number;\n tipY: number;\n /** Signed curvature at the point, as {@link cubicCurvatureAt} gives it. */\n curvature: number;\n}\n\n/** The comb of one curved segment, which runs from anchor `segIdx` of\n * subpath `sub` to the next. */\nexport interface SegmentComb {\n sub: number;\n segIdx: number;\n /** Evenly spaced in t, ends included. */\n teeth: CombTooth[];\n}\n\n/** Options for {@link curvatureComb} and {@link combTeeth}. */\nexport interface CurvatureCombOptions {\n /** Tooth length per unit of curvature. A tooth over a stretch of radius r is\n * `scale / r` long, in the curve's own units. */\n scale: number;\n /** Teeth per segment for {@link curvatureComb}, or along the whole source\n * for {@link combTeeth}; ends included. Default 24; at least 2. */\n samplesPerSegment?: number;\n}\n\n/**\n * A curve parameterized over t in [0, 1], as a curvature comb reads it. Any\n * curve can stand a comb this way, whether or not it is a path.\n */\nexport interface CurvatureSource {\n /** The point on the curve at t. */\n pointAt(t: number): Point;\n /** A vector along the direction of travel at t. Only its direction is read;\n * a zero vector means the curve has no direction there. */\n tangentAt(t: number): Point;\n /** Signed curvature at t, positive where the curve turns toward its left\n * normal `(-dy, dx)`, as {@link cubicCurvatureAt} gives it. */\n curvatureAt(t: number): number;\n}\n\n/** How far in from an end a tooth moves when the curve has no direction at\n * the end itself, so it reports the curvature the end is approached with. */\nconst END_NUDGE = 1e-3;\n\nfunction sampleCount(opts: CurvatureCombOptions): number {\n return Math.max(2, Math.round(opts.samplesPerSegment ?? 24));\n}\n\n/**\n * The teeth of a curvature comb along `source`, evenly spaced in t with both\n * ends included. Each stands out of the curve along its normal, on the outside\n * of the bend, `scale` times the curvature long.\n */\nexport function combTeeth(source: CurvatureSource, opts: CurvatureCombOptions): CombTooth[] {\n const samples = sampleCount(opts);\n const teeth: CombTooth[] = [];\n for (let i = 0; i < samples; i++) teeth.push(toothAt(source, i / (samples - 1), opts.scale));\n return teeth;\n}\n\n/** The cubic Bezier (p0, p1, p2, p3) as a {@link CurvatureSource}. */\nexport function cubicCurvatureSource(p0: Point, p1: Point, p2: Point, p3: Point): CurvatureSource {\n return {\n pointAt: (t) => cubicPointAt(p0, p1, p2, p3, t),\n tangentAt: (t) => cubicDerivativeAt(p0, p1, p2, p3, t),\n curvatureAt: (t) => cubicCurvatureAt(p0, p1, p2, p3, t),\n };\n}\n\n/**\n * Curvature combs for every curved segment of `set`: teeth that stand out of\n * the curve, each as long as the curvature where it stands. Joining their tips\n * draws how the bend changes along the path. A tooth that jumps in length at\n * an anchor shows a curvature break there; teeth that change side show an\n * inflection. Straight segments have no curvature, and no comb.\n */\nexport function curvatureComb(set: AnchorSet, opts: CurvatureCombOptions): SegmentComb[] {\n const out: SegmentComb[] = [];\n for (let sub = 0; sub < set.anchors.length; sub++) {\n const count = set.anchors[sub].length - (set.closed[sub] ? 0 : 1);\n for (let segIdx = 0; segIdx < count; segIdx++) {\n const ends = segmentEnds(set.anchors, set.closed, sub, segIdx);\n if (!ends || isStraightSegment(ends.a, ends.b)) continue;\n const { a, b } = ends;\n const source = cubicCurvatureSource(a, a.outHandle ?? a, b.inHandle ?? b, b);\n out.push({ sub, segIdx, teeth: combTeeth(source, opts) });\n }\n }\n return out;\n}\n\nfunction toothAt(source: CurvatureSource, t: number, scale: number): CombTooth {\n const at = source.pointAt(t);\n let d = source.tangentAt(t);\n let k = source.curvatureAt(t);\n if (Math.hypot(d.x, d.y) < 1e-9) {\n const inner = t < 0.5 ? t + END_NUDGE : t - END_NUDGE;\n d = source.tangentAt(inner);\n k = source.curvatureAt(inner);\n }\n const len = Math.hypot(d.x, d.y);\n if (len < 1e-12) return { x: at.x, y: at.y, tipX: at.x, tipY: at.y, curvature: 0 };\n // The bend's center lies along the left normal times 1/k, so the tooth goes\n // the other way: outside the bend on either side of an inflection.\n const nx = -d.y / len;\n const ny = d.x / len;\n return { x: at.x, y: at.y, tipX: at.x - nx * k * scale, tipY: at.y - ny * k * scale, curvature: k };\n}\n","/**\n * One spiral segment, fitted between two points so it leaves the first and\n * reaches the second at given angles to the chord. `solveSpiro` joins these\n * into a curvature-continuous spline.\n *\n * In its normalized frame the segment has unit arc length and, with\n * `u = s − ½`, tangent angle `φ = k0·u + (k1/2)·u² + (k2/6)·u³ + (k3/24)·u⁴`,\n * so its curvature is `k0 + k1·u + (k2/2)·u² + (k3/6)·u³`. An Euler spiral has\n * `k2 = k3 = 0`: its curvature changes linearly along it. A cubic-curvature\n * segment uses all four, which is what lets a G4 point keep the curvature's\n * first two derivatives continuous as well.\n */\nimport type { Point } from './cubicMath';\n\n/** The shape of a fitted segment, in its normalized frame. */\nexport interface EulerFit {\n k0: number;\n k1: number;\n /** Zero on an Euler spiral; set on a cubic-curvature segment. */\n k2: number;\n k3: number;\n /** Chord over arc length: the normalized segment's chord length. */\n ratio: number;\n /** The normalized chord's angle, which the world chord is rotated onto. */\n chordAngle: number;\n}\n\n/** Steps of the Simpson rule that integrates a segment's tangent. Even. */\nconst STEPS = 48;\n/** A chord-relative angle past this has no sensible spiral. */\nconst MAX_ANGLE = Math.PI * 0.95;\n\nconst clampAngle = (a: number): number => Math.max(-MAX_ANGLE, Math.min(MAX_ANGLE, a));\n\n/** `∫₀^upTo e^{iφ(s)} ds` for the normalized segment `(k0, k1, k2, k3)`. */\nexport function integrateEuler(k0: number, k1: number, upTo = 1, k2 = 0, k3 = 0): Point {\n const n = Math.max(2, Math.ceil((STEPS * upTo) / 2) * 2);\n const h = upTo / n;\n let x = 0;\n let y = 0;\n for (let i = 0; i <= n; i++) {\n const u = i * h - 0.5;\n const phi = k0 * u + u * u * (k1 / 2 + u * (k2 / 6 + (u * k3) / 24));\n const w = i === 0 || i === n ? 1 : i % 2 === 1 ? 4 : 2;\n x += w * Math.cos(phi);\n y += w * Math.sin(phi);\n }\n return { x: (x * h) / 3, y: (y * h) / 3 };\n}\n\n/** How far the start angle of `(k0, k1, k2, k3)` is from `th0`. */\nfunction startError(k0: number, k1: number, k2: number, k3: number, th0: number): number {\n const c = integrateEuler(k0, k1, 1, k2, k3);\n return -k0 / 2 + k1 / 8 - k2 / 48 + k3 / 384 - Math.atan2(c.y, c.x) - th0;\n}\n\n/**\n * The spiral leaving its chord at angle `th0` and reaching the far end at\n * angle `th1`, both measured from the chord, counterclockwise positive. With\n * `k2` and `k3` left at zero it is an Euler spiral; given, they are the\n * cubic-curvature segment's higher terms, and `k0` and `k1` are fitted around them.\n */\nexport function fitEulerSegment(th0: number, th1: number, k2 = 0, k3 = 0): EulerFit {\n const t0 = clampAngle(th0);\n const t1 = clampAngle(th1);\n // The odd terms set the total turn; the even ones bow the segment.\n const k0 = t1 - t0 - k2 / 24;\n // The small-angle solution, then Newton on the one remaining unknown.\n let k1 = 6 * (t0 + t1) - k3 / 40;\n for (let iter = 0; iter < 12; iter++) {\n const e = startError(k0, k1, k2, k3, t0);\n if (Math.abs(e) < 1e-12) break;\n const d = (startError(k0, k1 + 1e-6, k2, k3, t0) - e) / 1e-6;\n if (!Number.isFinite(d) || Math.abs(d) < 1e-12) break;\n k1 -= e / d;\n }\n const c = integrateEuler(k0, k1, 1, k2, k3);\n return { k0, k1, k2, k3, ratio: Math.hypot(c.x, c.y), chordAngle: Math.atan2(c.y, c.x) };\n}\n\n/** A fitted segment placed between two world points. */\nexport interface EulerSegment extends EulerFit {\n p0: Point;\n p1: Point;\n /** World arc length. */\n length: number;\n /** The world angle the normalized frame is turned by. */\n rotation: number;\n}\n\n/** `fit` placed so it runs from `p0` to `p1`. */\nexport function placeEulerSegment(fit: EulerFit, p0: Point, p1: Point): EulerSegment {\n const chord = Math.hypot(p1.x - p0.x, p1.y - p0.y);\n const length = fit.ratio > 1e-9 ? chord / fit.ratio : chord;\n const rotation = Math.atan2(p1.y - p0.y, p1.x - p0.x) - fit.chordAngle;\n return { ...fit, p0, p1, length, rotation };\n}\n\n/** The point at fraction `s` of the arc length along `seg`. */\nexport function eulerPointAt(seg: EulerSegment, s: number): Point {\n const c = integrateEuler(seg.k0, seg.k1, s, seg.k2, seg.k3);\n const cos = Math.cos(seg.rotation);\n const sin = Math.sin(seg.rotation);\n return {\n x: seg.p0.x + seg.length * (c.x * cos - c.y * sin),\n y: seg.p0.y + seg.length * (c.x * sin + c.y * cos),\n };\n}\n\n/** World tangent angle at fraction `s` of `seg`'s arc length. */\nexport function eulerAngleAt(seg: EulerSegment, s: number): number {\n const u = s - 0.5;\n return seg.rotation + seg.k0 * u + u * u * (seg.k1 / 2 + u * (seg.k2 / 6 + (u * seg.k3) / 24));\n}\n\n/** Normalized curvature at `u = s − ½`. */\nconst bendAt = (f: EulerFit, u: number): number => f.k0 + u * (f.k1 + u * (f.k2 / 2 + (u * f.k3) / 6));\n\n/** Signed world curvature at fraction `s` of `seg`'s arc length;\n * positive turns counterclockwise. */\nexport function eulerCurvatureAt(seg: EulerSegment, s: number): number {\n if (seg.length < 1e-12) return 0;\n return bendAt(seg, s - 0.5) / seg.length;\n}\n\n/** The first and second derivatives of `seg`'s world curvature with respect\n * to world arc length, at fraction `s` of it. */\nexport function eulerCurvatureDerivativesAt(seg: EulerSegment, s: number): [number, number] {\n if (seg.length < 1e-12) return [0, 0];\n const u = s - 0.5;\n return [\n (seg.k1 + u * (seg.k2 + (u * seg.k3) / 2)) / seg.length ** 2,\n (seg.k2 + u * seg.k3) / seg.length ** 3,\n ];\n}\n\nconst SAMPLES = 16;\n\n/** Handle lengths `[a, b]` along `u0`, `u1` that best fit `samples` at the\n * cubic parameters `ts`, by least squares. Null when the fit degenerates. */\nfunction fitHandleLengths(\n p0: Point, p1: Point, u0: Point, u1: Point, samples: readonly Point[], ts: readonly number[],\n): [number, number] | null {\n // B(t) = base(t) + a·3(1−t)²t·u0 − b·3(1−t)t²·u1, linear in a and b.\n let m00 = 0, m01 = 0, m11 = 0, r0 = 0, r1 = 0;\n samples.forEach((q, i) => {\n const t = ts[i];\n const mt = 1 - t;\n const b0 = mt * mt * mt + 3 * mt * mt * t;\n const b3 = 3 * mt * t * t + t * t * t;\n const ex = q.x - (b0 * p0.x + b3 * p1.x);\n const ey = q.y - (b0 * p0.y + b3 * p1.y);\n const f1 = 3 * mt * mt * t;\n const f2 = 3 * mt * t * t;\n const ax = f1 * u0.x, ay = f1 * u0.y;\n const bx = -f2 * u1.x, by = -f2 * u1.y;\n m00 += ax * ax + ay * ay;\n m01 += ax * bx + ay * by;\n m11 += bx * bx + by * by;\n r0 += ax * ex + ay * ey;\n r1 += bx * ex + by * ey;\n });\n const det = m00 * m11 - m01 * m01;\n if (Math.abs(det) < 1e-12) return null;\n const a = (r0 * m11 - r1 * m01) / det;\n const b = (m00 * r1 - m01 * r0) / det;\n return a > 0 && b > 0 && Number.isFinite(a) && Number.isFinite(b) ? [a, b] : null;\n}\n\n/** One Newton step moving `t` toward the point of the cubic nearest `q`. */\nfunction nearerT(p: readonly Point[], q: Point, t: number): number {\n const mt = 1 - t;\n const at = (c0: number, c1: number, c2: number, c3: number) =>\n mt * mt * mt * c0 + 3 * mt * mt * t * c1 + 3 * mt * t * t * c2 + t * t * t * c3;\n const d1 = (c0: number, c1: number, c2: number, c3: number) =>\n 3 * (mt * mt * (c1 - c0) + 2 * mt * t * (c2 - c1) + t * t * (c3 - c2));\n const d2 = (c0: number, c1: number, c2: number, c3: number) =>\n 6 * (mt * (c2 - 2 * c1 + c0) + t * (c3 - 2 * c2 + c1));\n const ex = at(p[0].x, p[1].x, p[2].x, p[3].x) - q.x;\n const ey = at(p[0].y, p[1].y, p[2].y, p[3].y) - q.y;\n const dx = d1(p[0].x, p[1].x, p[2].x, p[3].x);\n const dy = d1(p[0].y, p[1].y, p[2].y, p[3].y);\n const ddx = d2(p[0].x, p[1].x, p[2].x, p[3].x);\n const ddy = d2(p[0].y, p[1].y, p[2].y, p[3].y);\n const den = dx * dx + dy * dy + ex * ddx + ey * ddy;\n if (Math.abs(den) < 1e-12) return t;\n return Math.min(1, Math.max(0, t - (ex * dx + ey * dy) / den));\n}\n\n/**\n * The two control points of a cubic that follows `seg`: each handle lies on\n * the spiral's tangent at its end, with lengths fitted to points sampled along\n * the spiral by least squares, re-pairing each sample with its nearest cubic\n * parameter between rounds.\n */\nexport function eulerSegmentCubic(seg: EulerSegment): { c1: Point; c2: Point } {\n const { p0, p1 } = seg;\n const a0 = eulerAngleAt(seg, 0);\n const a1 = eulerAngleAt(seg, 1);\n const u0 = { x: Math.cos(a0), y: Math.sin(a0) };\n const u1 = { x: Math.cos(a1), y: Math.sin(a1) };\n const samples: Point[] = [];\n const ts: number[] = [];\n for (let i = 1; i < SAMPLES; i++) {\n samples.push(eulerPointAt(seg, i / SAMPLES));\n ts.push(i / SAMPLES);\n }\n const chord = Math.hypot(p1.x - p0.x, p1.y - p0.y);\n let lengths: [number, number] = [chord / 3, chord / 3];\n const handles = ([a, b]: [number, number]) => ({\n c1: { x: p0.x + a * u0.x, y: p0.y + a * u0.y },\n c2: { x: p1.x - b * u1.x, y: p1.y - b * u1.y },\n });\n for (let round = 0; round < 4; round++) {\n const fit = fitHandleLengths(p0, p1, u0, u1, samples, ts);\n if (!fit) break;\n lengths = fit;\n const { c1, c2 } = handles(lengths);\n const ctrl = [p0, c1, c2, p1];\n samples.forEach((q, i) => { ts[i] = nearerT(ctrl, q, ts[i]); });\n }\n return handles(lengths);\n}\n\n/** The stretch of `seg` from fraction `s0` to `s1` of its arc length, as a\n * segment of its own: a piece of an Euler spiral is one. */\nexport function subEulerSegment(seg: EulerSegment, s0: number, s1: number): EulerSegment {\n const d = s1 - s0;\n const m = (s0 + s1) / 2 - 0.5;\n // The curvature polynomial re-centered on the piece and scaled to its length.\n const k0 = bendAt(seg, m) * d;\n const k1 = (seg.k1 + m * (seg.k2 + (m * seg.k3) / 2)) * d ** 2;\n const k2 = (seg.k2 + m * seg.k3) * d ** 3;\n const k3 = seg.k3 * d ** 4;\n const c = integrateEuler(k0, k1, 1, k2, k3);\n const fit: EulerFit = { k0, k1, k2, k3, ratio: Math.hypot(c.x, c.y), chordAngle: Math.atan2(c.y, c.x) };\n return placeEulerSegment(fit, eulerPointAt(seg, s0), eulerPointAt(seg, s1));\n}\n\n/** How far the cubic `(seg.p0, c1, c2, seg.p1)` strays from `seg`, measured\n * at a few points along the spiral. */\nexport function eulerCubicError(seg: EulerSegment, c1: Point, c2: Point): number {\n const ctrl = [seg.p0, c1, c2, seg.p1];\n let worst = 0;\n for (const s of [0.2, 0.4, 0.5, 0.6, 0.8]) {\n const q = eulerPointAt(seg, s);\n let t = s;\n for (let i = 0; i < 4; i++) t = nearerT(ctrl, q, t);\n const mt = 1 - t;\n const x = mt * mt * mt * seg.p0.x + 3 * mt * mt * t * c1.x + 3 * mt * t * t * c2.x + t * t * t * seg.p1.x;\n const y = mt * mt * mt * seg.p0.y + 3 * mt * mt * t * c1.y + 3 * mt * t * t * c2.y + t * t * t * seg.p1.y;\n worst = Math.max(worst, Math.hypot(x - q.x, y - q.y));\n }\n return worst;\n}\n","/**\n * Spiro curves: a spline defined by on-curve points alone. Between each pair\n * of neighboring points runs an Euler-spiral segment (`eulerSpiral`), and the\n * segments are solved together so that, at every smooth point, both the\n * tangent and the curvature carry straight through. The curve has no handles\n * to tune; moving a point re-solves the whole curve.\n *\n * Each point's kind says what holds at it:\n *\n * | kind | at the point |\n * |---|---|\n * | `smooth` | tangent and curvature continue (G2); next to a straight segment, the curve leaves along the line |\n * | `g4` | tangent, curvature, and the curvature's first two derivatives continue (G4); otherwise as `smooth` |\n * | `corner` | the two sides are independent; each meets the point with zero curvature |\n * | `left` | the segment arriving is straight, and the curve leaving continues the line |\n * | `right` | the segment leaving is straight, and the curve arriving runs into the line |\n *\n * The ends of an open curve meet their points with zero curvature, as a\n * corner's sides do.\n *\n * A segment with a `g4` point at either end is a cubic-curvature segment,\n * with two more unknowns than an Euler spiral's two end tangents. A `g4`\n * point between two curved segments pays for its side's two with its two\n * extra equations; anywhere else, such a segment's curvature stops bending\n * at that end (its second derivative is zero there).\n */\nimport type { Point } from './cubicMath';\nimport {\n eulerAngleAt, eulerCurvatureAt, eulerCurvatureDerivativesAt, fitEulerSegment, placeEulerSegment,\n type EulerSegment,\n} from './eulerSpiral';\n\n/** What holds at a spiro point; see the table at the top of `spiro.ts`. */\nexport type SpiroKind = 'smooth' | 'g4' | 'corner' | 'left' | 'right';\n\n/** Every {@link SpiroKind}, in the order a picker lists them. */\nexport const SPIRO_KINDS: readonly SpiroKind[] = ['smooth', 'g4', 'corner', 'left', 'right'];\n\n/** One on-curve point of a spiro curve. */\nexport interface SpiroPoint {\n x: number;\n y: number;\n kind: SpiroKind;\n}\n\n/** One solved segment of a spiro curve: a straight line, or a placed Euler\n * spiral (`spiral`) between the two points. */\nexport interface SpiroSegment {\n from: Point;\n to: Point;\n spiral: EulerSegment | null;\n}\n\ntype Side = { kind: 'none' } | { kind: 'line'; angle: number } | { kind: 'curve'; seg: number };\n\nconst TAU = Math.PI * 2;\nconst wrap = (a: number): number => a - TAU * Math.round(a / TAU);\nconst angleOf = (p: Point, q: Point): number => Math.atan2(q.y - p.y, q.x - p.x);\nconst distance = (p: Point, q: Point): number => Math.hypot(q.x - p.x, q.y - p.y);\n\n/** Whether `kind` is one of the {@link SpiroKind}s. */\nexport function isSpiroKind(kind: unknown): kind is SpiroKind {\n return SPIRO_KINDS.includes(kind as SpiroKind);\n}\n\ninterface System {\n points: readonly SpiroPoint[];\n /** Segment `i` runs from point `i` to point `ends[i]`. */\n ends: number[];\n straight: boolean[];\n /** The first unknown slot of each curved segment (start tangent, end\n * tangent, then a cubic-curvature segment's two higher terms), or -1. */\n slot: number[];\n /** Whether each segment is a cubic-curvature one. */\n cubic: boolean[];\n unknowns: number;\n}\n\nfunction buildSystem(points: readonly SpiroPoint[], closed: boolean): System {\n const n = points.length;\n const count = closed ? n : n - 1;\n const ends: number[] = [];\n const straight: boolean[] = [];\n const slot: number[] = [];\n const cubic: boolean[] = [];\n let unknowns = 0;\n for (let i = 0; i < count; i++) {\n const j = (i + 1) % n;\n ends.push(j);\n const line = points[i].kind === 'right' || points[j].kind === 'left'\n || distance(points[i], points[j]) < 1e-9;\n straight.push(line);\n slot.push(line ? -1 : unknowns);\n const higher = !line && (points[i].kind === 'g4' || points[j].kind === 'g4');\n cubic.push(higher);\n if (!line) unknowns += higher ? 4 : 2;\n }\n return { points, ends, straight, slot, cubic, unknowns };\n}\n\nfunction sides(sys: System, closed: boolean, i: number): [Side, Side] {\n const n = sys.points.length;\n const count = sys.ends.length;\n const side = (seg: number): Side => {\n if (seg < 0 || seg >= count) return { kind: 'none' };\n if (sys.straight[seg]) return { kind: 'line', angle: angleOf(sys.points[seg], sys.points[sys.ends[seg]]) };\n return { kind: 'curve', seg };\n };\n const into = i > 0 ? i - 1 : closed ? n - 1 : -1;\n const outOf = closed || i < n - 1 ? i : -1;\n return [side(into), side(outOf)];\n}\n\ninterface Fitted { seg: EulerSegment; chord: number; startAngle: number; endAngle: number; cubic: boolean }\n\nfunction fitSegment(sys: System, s: number, x: readonly number[]): Fitted {\n const p0 = sys.points[s];\n const p1 = sys.points[sys.ends[s]];\n const chord = angleOf(p0, p1);\n const k = sys.slot[s];\n const fit = sys.cubic[s]\n ? fitEulerSegment(wrap(x[k] - chord), wrap(x[k + 1] - chord), x[k + 2], x[k + 3])\n : fitEulerSegment(wrap(x[k] - chord), wrap(x[k + 1] - chord));\n const seg = placeEulerSegment(fit, p0, p1);\n const startAngle = eulerAngleAt(seg, 0);\n return { seg, chord: distance(p0, p1), startAngle, endAngle: eulerAngleAt(seg, 1), cubic: sys.cubic[s] };\n}\n\n/** Curvature at one end of `f`, times its chord so every equation is on one scale. */\nconst bend = (f: Fitted, at: 0 | 1): number => eulerCurvatureAt(f.seg, at) * f.chord;\n\n/** The second derivative of curvature at one end of `f`, on the same scale. */\nconst twist = (f: Fitted, at: 0 | 1): number => eulerCurvatureDerivativesAt(f.seg, at)[1] * f.chord ** 3;\n\n/** Angle, curvature, and the curvature's first two derivatives matched where\n * `fa` ends and `fb` begins. */\nfunction g4Join(fa: Fitted, fb: Fitted): number[] {\n const scale = (fa.chord + fb.chord) / 2;\n const [a1, a2] = eulerCurvatureDerivativesAt(fa.seg, 1);\n const [b1, b2] = eulerCurvatureDerivativesAt(fb.seg, 0);\n return [\n wrap(fa.endAngle - fb.startAngle),\n (eulerCurvatureAt(fa.seg, 1) - eulerCurvatureAt(fb.seg, 0)) * scale,\n (a1 - b1) * scale ** 2,\n (a2 - b2) * scale ** 3,\n ];\n}\n\nfunction residuals(sys: System, closed: boolean, fits: readonly Fitted[]): number[] {\n const out: number[] = [];\n const fitOf = (side: Side): Fitted => fits[(side as { seg: number }).seg];\n for (let i = 0; i < sys.points.length; i++) {\n const [a, b] = sides(sys, closed, i);\n const kind = sys.points[i].kind;\n const ac = a.kind === 'curve';\n const bc = b.kind === 'curve';\n if (!ac && !bc) continue;\n if (kind === 'g4' && ac && bc) {\n out.push(...g4Join(fitOf(a), fitOf(b)));\n continue;\n }\n if (kind === 'smooth' && ac && bc) {\n const fa = fitOf(a), fb = fitOf(b);\n out.push(...g4Join(fa, fb).slice(0, 2));\n if (fa.cubic) out.push(twist(fa, 1));\n if (fb.cubic) out.push(twist(fb, 0));\n continue;\n }\n // One curved side from here on, or a corner's two independent ones.\n for (const [side, other, at] of [[a, b, 1], [b, a, 0]] as const) {\n if (side.kind !== 'curve') continue;\n const f = fitOf(side);\n const angle = at === 1 ? f.endAngle : f.startAngle;\n const followsLine = other.kind === 'line' && kind !== 'corner';\n out.push(followsLine ? wrap(angle - other.angle) : bend(f, at));\n if (f.cubic) out.push(twist(f, at));\n }\n }\n return out;\n}\n\n/** A starting tangent at each point: along the bisector of its two chords. */\nfunction initialGuess(sys: System, closed: boolean): number[] {\n const x = new Array<number>(sys.unknowns).fill(0);\n const n = sys.points.length;\n const tangentAt = (i: number, seg: number): number => {\n const chord = angleOf(sys.points[seg], sys.points[sys.ends[seg]]);\n const [a, b] = sides(sys, closed, i);\n if (sys.points[i].kind === 'corner' || a.kind === 'none' || b.kind === 'none') return chord;\n if (a.kind === 'line') return a.angle;\n if (b.kind === 'line') return b.angle;\n const prev = sys.points[(i - 1 + n) % n];\n const next = sys.points[(i + 1) % n];\n const pin = angleOf(prev, sys.points[i]);\n const pout = angleOf(sys.points[i], next);\n return pin + wrap(pout - pin) / 2;\n };\n for (let s = 0; s < sys.ends.length; s++) {\n const k = sys.slot[s];\n if (k < 0) continue;\n x[k] = tangentAt(s, s);\n x[k + 1] = tangentAt(sys.ends[s], s);\n }\n return x;\n}\n\n/** Solve `m · d = r` in place by Gaussian elimination with partial pivoting. */\nfunction solveLinear(m: number[][], r: number[]): number[] | null {\n const n = r.length;\n for (let c = 0; c < n; c++) {\n let p = c;\n for (let i = c + 1; i < n; i++) if (Math.abs(m[i][c]) > Math.abs(m[p][c])) p = i;\n if (Math.abs(m[p][c]) < 1e-14) return null;\n [m[c], m[p]] = [m[p], m[c]];\n [r[c], r[p]] = [r[p], r[c]];\n for (let i = c + 1; i < n; i++) {\n const f = m[i][c] / m[c][c];\n if (f === 0) continue;\n for (let j = c; j < n; j++) m[i][j] -= f * m[c][j];\n r[i] -= f * r[c];\n }\n }\n const out = new Array<number>(n).fill(0);\n for (let i = n - 1; i >= 0; i--) {\n let v = r[i];\n for (let j = i + 1; j < n; j++) v -= m[i][j] * out[j];\n out[i] = v / m[i][i];\n }\n return out;\n}\n\nconst norm = (v: readonly number[]): number => Math.sqrt(v.reduce((s, e) => s + e * e, 0));\n\n/**\n * Solve the spiro curve through `points`. A closed curve has a segment from\n * the last point back to the first. Fewer than two points make no segments.\n */\nexport function solveSpiro(points: readonly SpiroPoint[], closed: boolean): SpiroSegment[] {\n if (points.length < 2) return [];\n const sys = buildSystem(points, closed && points.length > 2);\n const isClosed = closed && points.length > 2;\n let x = initialGuess(sys, isClosed);\n const fitAll = (v: readonly number[]): Fitted[] =>\n sys.ends.map((_, s) => (sys.slot[s] < 0 ? (null as unknown as Fitted) : fitSegment(sys, s, v)));\n let fits = fitAll(x);\n let r = residuals(sys, isClosed, fits);\n for (let iter = 0; iter < 40 && sys.unknowns > 0; iter++) {\n const err = norm(r);\n if (err < 1e-10) break;\n // Each unknown moves only its own segment, so a column refits one segment.\n const jac = r.map(() => new Array<number>(sys.unknowns).fill(0));\n for (let s = 0; s < sys.ends.length; s++) {\n const k = sys.slot[s];\n if (k < 0) continue;\n for (let u = k; u < k + (sys.cubic[s] ? 4 : 2); u++) {\n const h = 1e-6;\n const xs = x.slice();\n xs[u] += h;\n const moved = fits.slice();\n moved[s] = fitSegment(sys, s, xs);\n const rs = residuals(sys, isClosed, moved);\n for (let e = 0; e < r.length; e++) jac[e][u] = (rs[e] - r[e]) / h;\n }\n }\n const step = solveLinear(jac, r.map((v) => -v));\n if (!step) break;\n // Halve the step until it lowers the error.\n let t = 1;\n let accepted = false;\n for (let tries = 0; tries < 12; tries++, t /= 2) {\n const xt = x.map((v, i) => v + t * step[i]);\n const ft = fitAll(xt);\n const rt = residuals(sys, isClosed, ft);\n if (norm(rt) < err) {\n x = xt; fits = ft; r = rt; accepted = true;\n break;\n }\n }\n if (!accepted) break;\n }\n return sys.ends.map((end, s) => ({\n from: { x: points[s].x, y: points[s].y },\n to: { x: points[end].x, y: points[end].y },\n spiral: sys.slot[s] < 0 ? null : fits[s].seg,\n }));\n}\n","/**\n * Spiro curves as cubic paths, and back. A solved curve is written as cubics,\n * each spiral segment split into as many as it takes to stay within tolerance,\n * so most anchors of the path are not spiro points. `at` records which are:\n * `at[i]` is the flat anchor index of point `i`, counted across subpaths. The\n * points are then read back out of the path itself, so whatever moves the path\n * — a move, a resize, a rotation — moves them with it.\n */\nimport type { PolygonPath } from '../path';\nimport { anchorsToPath, pathToAnchors, type PenAnchor } from './anchors';\nimport { eulerCubicError, eulerSegmentCubic, subEulerSegment, type EulerSegment } from './eulerSpiral';\nimport { solveSpiro, type SpiroKind, type SpiroPoint } from './spiro';\n\n/** One subpath of a spiro curve: its points, and whether it closes. */\nexport interface SpiroContour {\n points: SpiroPoint[];\n closed: boolean;\n}\n\n/** A spiro curve written as a cubic path, with the anchor each point became. */\nexport interface SpiroPath {\n path: PolygonPath;\n /** The flat anchor index of each point, in contour order. */\n at: number[];\n}\n\n/** Options for {@link spiroToPath}. */\nexport interface SpiroToPathOptions {\n /** The furthest a cubic may stray from its spiral, as a fraction of that\n * segment's arc length. Default `1e-4`. */\n tolerance?: number;\n /** The path being reshaped, whose fill rules the result keeps. */\n like?: PolygonPath;\n}\n\nconst MAX_PIECES = 16;\n\ninterface Piece { end: EulerSegment; c1: { x: number; y: number }; c2: { x: number; y: number } }\n\n/** `spiral` as the fewest equal pieces whose cubics all stay within `tol`. */\nfunction cubicPieces(spiral: EulerSegment, tol: number): Piece[] {\n let best: Piece[] = [];\n for (let m = 1; m <= MAX_PIECES; m++) {\n best = [];\n let fits = true;\n for (let j = 0; j < m; j++) {\n const piece = m === 1 ? spiral : subEulerSegment(spiral, j / m, (j + 1) / m);\n const { c1, c2 } = eulerSegmentCubic(piece);\n best.push({ end: piece, c1, c2 });\n if (eulerCubicError(piece, c1, c2) > tol * spiral.length) fits = false;\n }\n if (fits) break;\n }\n return best;\n}\n\nfunction contourAnchors(c: SpiroContour, tol: number): { anchors: PenAnchor[]; at: number[] } {\n const anchors: PenAnchor[] = [];\n const at: number[] = [];\n const segments = solveSpiro(c.points, c.closed);\n // The handle the last piece of a segment arrives with, for the point after it.\n let arriving: { x: number; y: number } | null = null;\n c.points.forEach((p, i) => {\n at.push(anchors.length);\n anchors.push({ x: p.x, y: p.y, ...(arriving ? { inHandle: arriving } : {}) });\n arriving = null;\n const spiral = segments[i]?.spiral;\n if (!spiral) return;\n const pieces = cubicPieces(spiral, tol);\n pieces.forEach((piece, j) => {\n anchors[anchors.length - 1].outHandle = { x: piece.c1.x, y: piece.c1.y };\n const c2 = { x: piece.c2.x, y: piece.c2.y };\n if (j < pieces.length - 1) anchors.push({ x: piece.end.p1.x, y: piece.end.p1.y, inHandle: c2 });\n else arriving = c2;\n });\n });\n if (arriving) anchors[0].inHandle = arriving;\n return { anchors, at };\n}\n\n/**\n * Solve each contour and write it as a cubic path. Straight segments carry no\n * handles.\n */\nexport function spiroToPath(contours: readonly SpiroContour[], options: SpiroToPathOptions = {}): SpiroPath {\n const tol = options.tolerance ?? 1e-4;\n const subs: PenAnchor[][] = [];\n const closed: boolean[] = [];\n const at: number[] = [];\n let base = 0;\n for (const c of contours) {\n if (c.points.length === 0) continue;\n const written = contourAnchors(c, tol);\n subs.push(written.anchors);\n closed.push(c.closed && c.points.length > 2);\n at.push(...written.at.map((i) => i + base));\n base += written.anchors.length;\n }\n return { path: anchorsToPath(subs, closed, options.like), at };\n}\n\n/**\n * The spiro points `path` holds, given the kind of each and the anchor each\n * became. Null when `kinds` and `at` do not describe `path`: the counts\n * differ, an index is out of order or out of range, or a subpath does not\n * start on a point.\n */\nexport function spiroContoursOf(\n path: PolygonPath,\n kinds: readonly SpiroKind[],\n at: readonly number[],\n): SpiroContour[] | null {\n if (kinds.length !== at.length || at.length === 0) return null;\n const { anchors, closed } = pathToAnchors(path);\n const contours: SpiroContour[] = [];\n let flat = 0;\n let k = 0;\n for (let s = 0; s < anchors.length; s++) {\n const sub = anchors[s];\n if (at[k] !== flat) return null;\n const points: SpiroPoint[] = [];\n while (k < at.length && at[k] < flat + sub.length) {\n if (k > 0 && at[k] <= at[k - 1]) return null;\n const a = sub[at[k] - flat];\n points.push({ x: a.x, y: a.y, kind: kinds[k] });\n k++;\n }\n contours.push({ points, closed: closed[s] });\n flat += sub.length;\n }\n return k === at.length ? contours : null;\n}\n\n/** The straight-sided path through each contour's points: what an editor\n * shows and moves in place of the curve. */\nexport function spiroControlPath(contours: readonly SpiroContour[]): PolygonPath {\n return anchorsToPath(\n contours.map((c) => c.points.map((p) => ({ x: p.x, y: p.y }))),\n contours.map((c) => c.closed),\n );\n}\n\nconst key = (x: number, y: number): string => `${Math.round(x * 1e3)},${Math.round(y * 1e3)}`;\n\n/**\n * Read an edited control path back as contours: every anchor is a point.\n * Kinds follow from `before`, the contours the edit started from: point for\n * point when the count is unchanged, else by position, with an anchor that\n * lands nowhere a point was taking `fallback`. Handles are ignored.\n */\nexport function spiroContoursFromControl(\n control: PolygonPath,\n before: readonly SpiroContour[],\n fallback: SpiroKind = 'smooth',\n): SpiroContour[] {\n const { anchors, closed } = pathToAnchors(control);\n const old = before.flatMap((c) => c.points);\n const count = anchors.reduce((n, sub) => n + sub.length, 0);\n const byPlace = new Map<string, SpiroKind>();\n for (const p of old) if (!byPlace.has(key(p.x, p.y))) byPlace.set(key(p.x, p.y), p.kind);\n let i = 0;\n return anchors.map((sub, s) => ({\n closed: closed[s],\n points: sub.map((a) => {\n const kind = count === old.length ? old[i].kind : byPlace.get(key(a.x, a.y)) ?? fallback;\n i++;\n return { x: a.x, y: a.y, kind };\n }),\n }));\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/paths/curvature.ts","../src/paths/eulerSpiral.ts","../src/paths/spiro.ts","../src/paths/spiroPath.ts"],"names":[],"mappings":";;;;AAKO,SAAS,iBAAA,CAAkB,EAAA,EAAW,EAAA,EAAW,EAAA,EAAW,IAAW,CAAA,EAAkB;AAC9F,EAAA,MAAM,IAAI,CAAA,GAAI,CAAA;AACd,EAAA,OAAO;AAAA,IACL,CAAA,EAAG,IAAI,CAAA,GAA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AAA;AAC1C,EAAA,MAAM,KAAA,GAAQ,QAAQ,MAAA,CAAO,CAAC,GAAG,GAAA,KAAQ,CAAA,GAAI,GAAA,CAAI,MAAA,EAAQ,CAAC,CAAA;AAC1D,EAAA,MAAM,OAAA,uBAAc,GAAA,EAAuB;AAC3C,EAAA,KAAA,MAAW,CAAA,IAAK,KAAK,IAAI,CAAC,QAAQ,GAAA,CAAI,GAAA,CAAI,CAAA,CAAE,CAAA,EAAG,CAAA,CAAE,CAAC,CAAC,CAAA,EAAG,OAAA,CAAQ,IAAI,GAAA,CAAI,CAAA,CAAE,GAAG,CAAA,CAAE,CAAC,CAAA,EAAG,CAAA,CAAE,IAAI,CAAA;AACvF,EAAA,IAAI,CAAA,GAAI,CAAA;AACR,EAAA,OAAO,OAAA,CAAQ,GAAA,CAAI,CAAC,GAAA,EAAK,CAAA,MAAO;AAAA,IAC9B,MAAA,EAAQ,OAAO,CAAC,CAAA;AAAA,IAChB,MAAA,EAAQ,GAAA,CAAI,GAAA,CAAI,CAAC,CAAA,KAAM;AACrB,MAAA,MAAM,OAAO,KAAA,KAAU,GAAA,CAAI,MAAA,GAAS,GAAA,CAAI,CAAC,CAAA,CAAE,IAAA,GAAO,OAAA,CAAQ,GAAA,CAAI,IAAI,CAAA,CAAE,CAAA,EAAG,CAAA,CAAE,CAAC,CAAC,CAAA,IAAK,QAAA;AAChF,MAAA,CAAA,EAAA;AACA,MAAA,OAAO,EAAE,CAAA,EAAG,CAAA,CAAE,GAAG,CAAA,EAAG,CAAA,CAAE,GAAG,IAAA,EAAK;AAAA,IAChC,CAAC;AAAA,GACH,CAAE,CAAA;AACJ","file":"chunk-HNLJO3E7.js","sourcesContent":["import type { AnchorSet } from './anchorEdits';\nimport { isStraightSegment, segmentEnds } from './anchors';\nimport { cubicPointAt, type Point } from './cubicMath';\n\n/** First derivative of the cubic Bezier (p0, p1, p2, p3) at t. */\nexport function cubicDerivativeAt(p0: Point, p1: Point, p2: Point, p3: Point, t: number): Point {\n const u = 1 - t;\n return {\n x: 3 * u * u * (p1.x - p0.x) + 6 * u * t * (p2.x - p1.x) + 3 * t * t * (p3.x - p2.x),\n y: 3 * u * u * (p1.y - p0.y) + 6 * u * t * (p2.y - p1.y) + 3 * t * t * (p3.y - p2.y),\n };\n}\n\nfunction cubicSecondDerivativeAt(p0: Point, p1: Point, p2: Point, p3: Point, t: number): Point {\n const u = 1 - t;\n return {\n x: 6 * u * (p2.x - 2 * p1.x + p0.x) + 6 * t * (p3.x - 2 * p2.x + p1.x),\n y: 6 * u * (p2.y - 2 * p1.y + p0.y) + 6 * t * (p3.y - 2 * p2.y + p1.y),\n };\n}\n\n/**\n * Signed curvature of the cubic Bezier (p0, p1, p2, p3) at t: one over the\n * radius of the circle that fits the curve there. Positive where the curve\n * turns toward its left normal `(-dy, dx)`, negative where it turns away, so\n * the sign flips at an inflection. 0 where the curve has no direction at t, as\n * at an end whose handle sits on its anchor.\n */\nexport function cubicCurvatureAt(p0: Point, p1: Point, p2: Point, p3: Point, t: number): number {\n const d1 = cubicDerivativeAt(p0, p1, p2, p3, t);\n const d2 = cubicSecondDerivativeAt(p0, p1, p2, p3, t);\n const den = Math.pow(d1.x * d1.x + d1.y * d1.y, 1.5);\n if (den < 1e-12) return 0;\n return (d1.x * d2.y - d1.y * d2.x) / den;\n}\n\n/** One tooth of a curvature comb: a point on the curve and the tip of the\n * tooth standing on it. */\nexport interface CombTooth {\n /** The point on the curve. */\n x: number;\n y: number;\n /** The tooth's tip: off the curve along its normal, on the outside of the\n * bend, by the curvature times the comb's scale. */\n tipX: number;\n tipY: number;\n /** Signed curvature at the point, as {@link cubicCurvatureAt} gives it. */\n curvature: number;\n}\n\n/** The comb of one curved segment, which runs from anchor `segIdx` of\n * subpath `sub` to the next. */\nexport interface SegmentComb {\n sub: number;\n segIdx: number;\n /** Evenly spaced in t, ends included. */\n teeth: CombTooth[];\n}\n\n/** Options for {@link curvatureComb} and {@link combTeeth}. */\nexport interface CurvatureCombOptions {\n /** Tooth length per unit of curvature. A tooth over a stretch of radius r is\n * `scale / r` long, in the curve's own units. */\n scale: number;\n /** Teeth per segment for {@link curvatureComb}, or along the whole source\n * for {@link combTeeth}; ends included. Default 24; at least 2. */\n samplesPerSegment?: number;\n}\n\n/**\n * A curve parameterized over t in [0, 1], as a curvature comb reads it. Any\n * curve can stand a comb this way, whether or not it is a path.\n */\nexport interface CurvatureSource {\n /** The point on the curve at t. */\n pointAt(t: number): Point;\n /** A vector along the direction of travel at t. Only its direction is read;\n * a zero vector means the curve has no direction there. */\n tangentAt(t: number): Point;\n /** Signed curvature at t, positive where the curve turns toward its left\n * normal `(-dy, dx)`, as {@link cubicCurvatureAt} gives it. */\n curvatureAt(t: number): number;\n}\n\n/** How far in from an end a tooth moves when the curve has no direction at\n * the end itself, so it reports the curvature the end is approached with. */\nconst END_NUDGE = 1e-3;\n\nfunction sampleCount(opts: CurvatureCombOptions): number {\n return Math.max(2, Math.round(opts.samplesPerSegment ?? 24));\n}\n\n/**\n * The teeth of a curvature comb along `source`, evenly spaced in t with both\n * ends included. Each stands out of the curve along its normal, on the outside\n * of the bend, `scale` times the curvature long.\n */\nexport function combTeeth(source: CurvatureSource, opts: CurvatureCombOptions): CombTooth[] {\n const samples = sampleCount(opts);\n const teeth: CombTooth[] = [];\n for (let i = 0; i < samples; i++) teeth.push(toothAt(source, i / (samples - 1), opts.scale));\n return teeth;\n}\n\n/** The cubic Bezier (p0, p1, p2, p3) as a {@link CurvatureSource}. */\nexport function cubicCurvatureSource(p0: Point, p1: Point, p2: Point, p3: Point): CurvatureSource {\n return {\n pointAt: (t) => cubicPointAt(p0, p1, p2, p3, t),\n tangentAt: (t) => cubicDerivativeAt(p0, p1, p2, p3, t),\n curvatureAt: (t) => cubicCurvatureAt(p0, p1, p2, p3, t),\n };\n}\n\n/**\n * Curvature combs for every curved segment of `set`: teeth that stand out of\n * the curve, each as long as the curvature where it stands. Joining their tips\n * draws how the bend changes along the path. A tooth that jumps in length at\n * an anchor shows a curvature break there; teeth that change side show an\n * inflection. Straight segments have no curvature, and no comb.\n */\nexport function curvatureComb(set: AnchorSet, opts: CurvatureCombOptions): SegmentComb[] {\n const out: SegmentComb[] = [];\n for (let sub = 0; sub < set.anchors.length; sub++) {\n const count = set.anchors[sub].length - (set.closed[sub] ? 0 : 1);\n for (let segIdx = 0; segIdx < count; segIdx++) {\n const ends = segmentEnds(set.anchors, set.closed, sub, segIdx);\n if (!ends || isStraightSegment(ends.a, ends.b)) continue;\n const { a, b } = ends;\n const source = cubicCurvatureSource(a, a.outHandle ?? a, b.inHandle ?? b, b);\n out.push({ sub, segIdx, teeth: combTeeth(source, opts) });\n }\n }\n return out;\n}\n\nfunction toothAt(source: CurvatureSource, t: number, scale: number): CombTooth {\n const at = source.pointAt(t);\n let d = source.tangentAt(t);\n let k = source.curvatureAt(t);\n if (Math.hypot(d.x, d.y) < 1e-9) {\n const inner = t < 0.5 ? t + END_NUDGE : t - END_NUDGE;\n d = source.tangentAt(inner);\n k = source.curvatureAt(inner);\n }\n const len = Math.hypot(d.x, d.y);\n if (len < 1e-12) return { x: at.x, y: at.y, tipX: at.x, tipY: at.y, curvature: 0 };\n // The bend's center lies along the left normal times 1/k, so the tooth goes\n // the other way: outside the bend on either side of an inflection.\n const nx = -d.y / len;\n const ny = d.x / len;\n return { x: at.x, y: at.y, tipX: at.x - nx * k * scale, tipY: at.y - ny * k * scale, curvature: k };\n}\n","/**\n * One spiral segment, fitted between two points so it leaves the first and\n * reaches the second at given angles to the chord. `solveSpiro` joins these\n * into a curvature-continuous spline.\n *\n * In its normalized frame the segment has unit arc length and, with\n * `u = s − ½`, tangent angle `φ = k0·u + (k1/2)·u² + (k2/6)·u³ + (k3/24)·u⁴`,\n * so its curvature is `k0 + k1·u + (k2/2)·u² + (k3/6)·u³`. An Euler spiral has\n * `k2 = k3 = 0`: its curvature changes linearly along it. A cubic-curvature\n * segment uses all four, which is what lets a G4 point keep the curvature's\n * first two derivatives continuous as well.\n */\nimport type { Point } from './cubicMath';\n\n/** The shape of a fitted segment, in its normalized frame. */\nexport interface EulerFit {\n k0: number;\n k1: number;\n /** Zero on an Euler spiral; set on a cubic-curvature segment. */\n k2: number;\n k3: number;\n /** Chord over arc length: the normalized segment's chord length. */\n ratio: number;\n /** The normalized chord's angle, which the world chord is rotated onto. */\n chordAngle: number;\n}\n\n/** Steps of the Simpson rule that integrates a segment's tangent. Even. */\nconst STEPS = 48;\n/** A chord-relative angle past this has no sensible spiral. */\nconst MAX_ANGLE = Math.PI * 0.95;\n\nconst clampAngle = (a: number): number => Math.max(-MAX_ANGLE, Math.min(MAX_ANGLE, a));\n\n/** `∫₀^upTo e^{iφ(s)} ds` for the normalized segment `(k0, k1, k2, k3)`. */\nexport function integrateEuler(k0: number, k1: number, upTo = 1, k2 = 0, k3 = 0): Point {\n const n = Math.max(2, Math.ceil((STEPS * upTo) / 2) * 2);\n const h = upTo / n;\n let x = 0;\n let y = 0;\n for (let i = 0; i <= n; i++) {\n const u = i * h - 0.5;\n const phi = k0 * u + u * u * (k1 / 2 + u * (k2 / 6 + (u * k3) / 24));\n const w = i === 0 || i === n ? 1 : i % 2 === 1 ? 4 : 2;\n x += w * Math.cos(phi);\n y += w * Math.sin(phi);\n }\n return { x: (x * h) / 3, y: (y * h) / 3 };\n}\n\n/** How far the start angle of `(k0, k1, k2, k3)` is from `th0`. */\nfunction startError(k0: number, k1: number, k2: number, k3: number, th0: number): number {\n const c = integrateEuler(k0, k1, 1, k2, k3);\n return -k0 / 2 + k1 / 8 - k2 / 48 + k3 / 384 - Math.atan2(c.y, c.x) - th0;\n}\n\n/**\n * The spiral leaving its chord at angle `th0` and reaching the far end at\n * angle `th1`, both measured from the chord, counterclockwise positive. With\n * `k2` and `k3` left at zero it is an Euler spiral; given, they are the\n * cubic-curvature segment's higher terms, and `k0` and `k1` are fitted around them.\n */\nexport function fitEulerSegment(th0: number, th1: number, k2 = 0, k3 = 0): EulerFit {\n const t0 = clampAngle(th0);\n const t1 = clampAngle(th1);\n // The odd terms set the total turn; the even ones bow the segment.\n const k0 = t1 - t0 - k2 / 24;\n // The small-angle solution, then Newton on the one remaining unknown.\n let k1 = 6 * (t0 + t1) - k3 / 40;\n for (let iter = 0; iter < 12; iter++) {\n const e = startError(k0, k1, k2, k3, t0);\n if (Math.abs(e) < 1e-12) break;\n const d = (startError(k0, k1 + 1e-6, k2, k3, t0) - e) / 1e-6;\n if (!Number.isFinite(d) || Math.abs(d) < 1e-12) break;\n k1 -= e / d;\n }\n const c = integrateEuler(k0, k1, 1, k2, k3);\n return { k0, k1, k2, k3, ratio: Math.hypot(c.x, c.y), chordAngle: Math.atan2(c.y, c.x) };\n}\n\n/** A fitted segment placed between two world points. */\nexport interface EulerSegment extends EulerFit {\n p0: Point;\n p1: Point;\n /** World arc length. */\n length: number;\n /** The world angle the normalized frame is turned by. */\n rotation: number;\n}\n\n/** `fit` placed so it runs from `p0` to `p1`. */\nexport function placeEulerSegment(fit: EulerFit, p0: Point, p1: Point): EulerSegment {\n const chord = Math.hypot(p1.x - p0.x, p1.y - p0.y);\n const length = fit.ratio > 1e-9 ? chord / fit.ratio : chord;\n const rotation = Math.atan2(p1.y - p0.y, p1.x - p0.x) - fit.chordAngle;\n return { ...fit, p0, p1, length, rotation };\n}\n\n/** The point at fraction `s` of the arc length along `seg`. */\nexport function eulerPointAt(seg: EulerSegment, s: number): Point {\n const c = integrateEuler(seg.k0, seg.k1, s, seg.k2, seg.k3);\n const cos = Math.cos(seg.rotation);\n const sin = Math.sin(seg.rotation);\n return {\n x: seg.p0.x + seg.length * (c.x * cos - c.y * sin),\n y: seg.p0.y + seg.length * (c.x * sin + c.y * cos),\n };\n}\n\n/** World tangent angle at fraction `s` of `seg`'s arc length. */\nexport function eulerAngleAt(seg: EulerSegment, s: number): number {\n const u = s - 0.5;\n return seg.rotation + seg.k0 * u + u * u * (seg.k1 / 2 + u * (seg.k2 / 6 + (u * seg.k3) / 24));\n}\n\n/** Normalized curvature at `u = s − ½`. */\nconst bendAt = (f: EulerFit, u: number): number => f.k0 + u * (f.k1 + u * (f.k2 / 2 + (u * f.k3) / 6));\n\n/** Signed world curvature at fraction `s` of `seg`'s arc length;\n * positive turns counterclockwise. */\nexport function eulerCurvatureAt(seg: EulerSegment, s: number): number {\n if (seg.length < 1e-12) return 0;\n return bendAt(seg, s - 0.5) / seg.length;\n}\n\n/** The first and second derivatives of `seg`'s world curvature with respect\n * to world arc length, at fraction `s` of it. */\nexport function eulerCurvatureDerivativesAt(seg: EulerSegment, s: number): [number, number] {\n if (seg.length < 1e-12) return [0, 0];\n const u = s - 0.5;\n return [\n (seg.k1 + u * (seg.k2 + (u * seg.k3) / 2)) / seg.length ** 2,\n (seg.k2 + u * seg.k3) / seg.length ** 3,\n ];\n}\n\nconst SAMPLES = 16;\n\n/** Handle lengths `[a, b]` along `u0`, `u1` that best fit `samples` at the\n * cubic parameters `ts`, by least squares. Null when the fit degenerates. */\nfunction fitHandleLengths(\n p0: Point, p1: Point, u0: Point, u1: Point, samples: readonly Point[], ts: readonly number[],\n): [number, number] | null {\n // B(t) = base(t) + a·3(1−t)²t·u0 − b·3(1−t)t²·u1, linear in a and b.\n let m00 = 0, m01 = 0, m11 = 0, r0 = 0, r1 = 0;\n samples.forEach((q, i) => {\n const t = ts[i];\n const mt = 1 - t;\n const b0 = mt * mt * mt + 3 * mt * mt * t;\n const b3 = 3 * mt * t * t + t * t * t;\n const ex = q.x - (b0 * p0.x + b3 * p1.x);\n const ey = q.y - (b0 * p0.y + b3 * p1.y);\n const f1 = 3 * mt * mt * t;\n const f2 = 3 * mt * t * t;\n const ax = f1 * u0.x, ay = f1 * u0.y;\n const bx = -f2 * u1.x, by = -f2 * u1.y;\n m00 += ax * ax + ay * ay;\n m01 += ax * bx + ay * by;\n m11 += bx * bx + by * by;\n r0 += ax * ex + ay * ey;\n r1 += bx * ex + by * ey;\n });\n const det = m00 * m11 - m01 * m01;\n if (Math.abs(det) < 1e-12) return null;\n const a = (r0 * m11 - r1 * m01) / det;\n const b = (m00 * r1 - m01 * r0) / det;\n return a > 0 && b > 0 && Number.isFinite(a) && Number.isFinite(b) ? [a, b] : null;\n}\n\n/** One Newton step moving `t` toward the point of the cubic nearest `q`. */\nfunction nearerT(p: readonly Point[], q: Point, t: number): number {\n const mt = 1 - t;\n const at = (c0: number, c1: number, c2: number, c3: number) =>\n mt * mt * mt * c0 + 3 * mt * mt * t * c1 + 3 * mt * t * t * c2 + t * t * t * c3;\n const d1 = (c0: number, c1: number, c2: number, c3: number) =>\n 3 * (mt * mt * (c1 - c0) + 2 * mt * t * (c2 - c1) + t * t * (c3 - c2));\n const d2 = (c0: number, c1: number, c2: number, c3: number) =>\n 6 * (mt * (c2 - 2 * c1 + c0) + t * (c3 - 2 * c2 + c1));\n const ex = at(p[0].x, p[1].x, p[2].x, p[3].x) - q.x;\n const ey = at(p[0].y, p[1].y, p[2].y, p[3].y) - q.y;\n const dx = d1(p[0].x, p[1].x, p[2].x, p[3].x);\n const dy = d1(p[0].y, p[1].y, p[2].y, p[3].y);\n const ddx = d2(p[0].x, p[1].x, p[2].x, p[3].x);\n const ddy = d2(p[0].y, p[1].y, p[2].y, p[3].y);\n const den = dx * dx + dy * dy + ex * ddx + ey * ddy;\n if (Math.abs(den) < 1e-12) return t;\n return Math.min(1, Math.max(0, t - (ex * dx + ey * dy) / den));\n}\n\n/**\n * The two control points of a cubic that follows `seg`: each handle lies on\n * the spiral's tangent at its end, with lengths fitted to points sampled along\n * the spiral by least squares, re-pairing each sample with its nearest cubic\n * parameter between rounds.\n */\nexport function eulerSegmentCubic(seg: EulerSegment): { c1: Point; c2: Point } {\n const { p0, p1 } = seg;\n const a0 = eulerAngleAt(seg, 0);\n const a1 = eulerAngleAt(seg, 1);\n const u0 = { x: Math.cos(a0), y: Math.sin(a0) };\n const u1 = { x: Math.cos(a1), y: Math.sin(a1) };\n const samples: Point[] = [];\n const ts: number[] = [];\n for (let i = 1; i < SAMPLES; i++) {\n samples.push(eulerPointAt(seg, i / SAMPLES));\n ts.push(i / SAMPLES);\n }\n const chord = Math.hypot(p1.x - p0.x, p1.y - p0.y);\n let lengths: [number, number] = [chord / 3, chord / 3];\n const handles = ([a, b]: [number, number]) => ({\n c1: { x: p0.x + a * u0.x, y: p0.y + a * u0.y },\n c2: { x: p1.x - b * u1.x, y: p1.y - b * u1.y },\n });\n for (let round = 0; round < 4; round++) {\n const fit = fitHandleLengths(p0, p1, u0, u1, samples, ts);\n if (!fit) break;\n lengths = fit;\n const { c1, c2 } = handles(lengths);\n const ctrl = [p0, c1, c2, p1];\n samples.forEach((q, i) => { ts[i] = nearerT(ctrl, q, ts[i]); });\n }\n return handles(lengths);\n}\n\n/** The stretch of `seg` from fraction `s0` to `s1` of its arc length, as a\n * segment of its own: a piece of an Euler spiral is one. */\nexport function subEulerSegment(seg: EulerSegment, s0: number, s1: number): EulerSegment {\n const d = s1 - s0;\n const m = (s0 + s1) / 2 - 0.5;\n // The curvature polynomial re-centered on the piece and scaled to its length.\n const k0 = bendAt(seg, m) * d;\n const k1 = (seg.k1 + m * (seg.k2 + (m * seg.k3) / 2)) * d ** 2;\n const k2 = (seg.k2 + m * seg.k3) * d ** 3;\n const k3 = seg.k3 * d ** 4;\n const c = integrateEuler(k0, k1, 1, k2, k3);\n const fit: EulerFit = { k0, k1, k2, k3, ratio: Math.hypot(c.x, c.y), chordAngle: Math.atan2(c.y, c.x) };\n return placeEulerSegment(fit, eulerPointAt(seg, s0), eulerPointAt(seg, s1));\n}\n\n/** How far the cubic `(seg.p0, c1, c2, seg.p1)` strays from `seg`, measured\n * at a few points along the spiral. */\nexport function eulerCubicError(seg: EulerSegment, c1: Point, c2: Point): number {\n const ctrl = [seg.p0, c1, c2, seg.p1];\n let worst = 0;\n for (const s of [0.2, 0.4, 0.5, 0.6, 0.8]) {\n const q = eulerPointAt(seg, s);\n let t = s;\n for (let i = 0; i < 4; i++) t = nearerT(ctrl, q, t);\n const mt = 1 - t;\n const x = mt * mt * mt * seg.p0.x + 3 * mt * mt * t * c1.x + 3 * mt * t * t * c2.x + t * t * t * seg.p1.x;\n const y = mt * mt * mt * seg.p0.y + 3 * mt * mt * t * c1.y + 3 * mt * t * t * c2.y + t * t * t * seg.p1.y;\n worst = Math.max(worst, Math.hypot(x - q.x, y - q.y));\n }\n return worst;\n}\n","/**\n * Spiro curves: a spline defined by on-curve points alone. Between each pair\n * of neighboring points runs an Euler-spiral segment (`eulerSpiral`), and the\n * segments are solved together so that, at every smooth point, both the\n * tangent and the curvature carry straight through. The curve has no handles\n * to tune; moving a point re-solves the whole curve.\n *\n * Each point's kind says what holds at it:\n *\n * | kind | at the point |\n * |---|---|\n * | `smooth` | tangent and curvature continue (G2); next to a straight segment, the curve leaves along the line |\n * | `g4` | tangent, curvature, and the curvature's first two derivatives continue (G4); otherwise as `smooth` |\n * | `corner` | the two sides are independent; each meets the point with zero curvature |\n * | `left` | the segment arriving is straight, and the curve leaving continues the line |\n * | `right` | the segment leaving is straight, and the curve arriving runs into the line |\n *\n * The ends of an open curve meet their points with zero curvature, as a\n * corner's sides do.\n *\n * A segment with a `g4` point at either end is a cubic-curvature segment,\n * with two more unknowns than an Euler spiral's two end tangents. A `g4`\n * point between two curved segments pays for its side's two with its two\n * extra equations; anywhere else, such a segment's curvature stops bending\n * at that end (its second derivative is zero there).\n */\nimport type { Point } from './cubicMath';\nimport {\n eulerAngleAt, eulerCurvatureAt, eulerCurvatureDerivativesAt, fitEulerSegment, placeEulerSegment,\n type EulerSegment,\n} from './eulerSpiral';\n\n/** What holds at a spiro point; see the table at the top of `spiro.ts`. */\nexport type SpiroKind = 'smooth' | 'g4' | 'corner' | 'left' | 'right';\n\n/** Every {@link SpiroKind}, in the order a picker lists them. */\nexport const SPIRO_KINDS: readonly SpiroKind[] = ['smooth', 'g4', 'corner', 'left', 'right'];\n\n/** One on-curve point of a spiro curve. */\nexport interface SpiroPoint {\n x: number;\n y: number;\n kind: SpiroKind;\n}\n\n/** One solved segment of a spiro curve: a straight line, or a placed Euler\n * spiral (`spiral`) between the two points. */\nexport interface SpiroSegment {\n from: Point;\n to: Point;\n spiral: EulerSegment | null;\n}\n\ntype Side = { kind: 'none' } | { kind: 'line'; angle: number } | { kind: 'curve'; seg: number };\n\nconst TAU = Math.PI * 2;\nconst wrap = (a: number): number => a - TAU * Math.round(a / TAU);\nconst angleOf = (p: Point, q: Point): number => Math.atan2(q.y - p.y, q.x - p.x);\nconst distance = (p: Point, q: Point): number => Math.hypot(q.x - p.x, q.y - p.y);\n\n/** Whether `kind` is one of the {@link SpiroKind}s. */\nexport function isSpiroKind(kind: unknown): kind is SpiroKind {\n return SPIRO_KINDS.includes(kind as SpiroKind);\n}\n\ninterface System {\n points: readonly SpiroPoint[];\n /** Segment `i` runs from point `i` to point `ends[i]`. */\n ends: number[];\n straight: boolean[];\n /** The first unknown slot of each curved segment (start tangent, end\n * tangent, then a cubic-curvature segment's two higher terms), or -1. */\n slot: number[];\n /** Whether each segment is a cubic-curvature one. */\n cubic: boolean[];\n unknowns: number;\n}\n\nfunction buildSystem(points: readonly SpiroPoint[], closed: boolean): System {\n const n = points.length;\n const count = closed ? n : n - 1;\n const ends: number[] = [];\n const straight: boolean[] = [];\n const slot: number[] = [];\n const cubic: boolean[] = [];\n let unknowns = 0;\n for (let i = 0; i < count; i++) {\n const j = (i + 1) % n;\n ends.push(j);\n const line = points[i].kind === 'right' || points[j].kind === 'left'\n || distance(points[i], points[j]) < 1e-9;\n straight.push(line);\n slot.push(line ? -1 : unknowns);\n const higher = !line && (points[i].kind === 'g4' || points[j].kind === 'g4');\n cubic.push(higher);\n if (!line) unknowns += higher ? 4 : 2;\n }\n return { points, ends, straight, slot, cubic, unknowns };\n}\n\nfunction sides(sys: System, closed: boolean, i: number): [Side, Side] {\n const n = sys.points.length;\n const count = sys.ends.length;\n const side = (seg: number): Side => {\n if (seg < 0 || seg >= count) return { kind: 'none' };\n if (sys.straight[seg]) return { kind: 'line', angle: angleOf(sys.points[seg], sys.points[sys.ends[seg]]) };\n return { kind: 'curve', seg };\n };\n const into = i > 0 ? i - 1 : closed ? n - 1 : -1;\n const outOf = closed || i < n - 1 ? i : -1;\n return [side(into), side(outOf)];\n}\n\ninterface Fitted { seg: EulerSegment; chord: number; startAngle: number; endAngle: number; cubic: boolean }\n\nfunction fitSegment(sys: System, s: number, x: readonly number[]): Fitted {\n const p0 = sys.points[s];\n const p1 = sys.points[sys.ends[s]];\n const chord = angleOf(p0, p1);\n const k = sys.slot[s];\n const fit = sys.cubic[s]\n ? fitEulerSegment(wrap(x[k] - chord), wrap(x[k + 1] - chord), x[k + 2], x[k + 3])\n : fitEulerSegment(wrap(x[k] - chord), wrap(x[k + 1] - chord));\n const seg = placeEulerSegment(fit, p0, p1);\n const startAngle = eulerAngleAt(seg, 0);\n return { seg, chord: distance(p0, p1), startAngle, endAngle: eulerAngleAt(seg, 1), cubic: sys.cubic[s] };\n}\n\n/** Curvature at one end of `f`, times its chord so every equation is on one scale. */\nconst bend = (f: Fitted, at: 0 | 1): number => eulerCurvatureAt(f.seg, at) * f.chord;\n\n/** The second derivative of curvature at one end of `f`, on the same scale. */\nconst twist = (f: Fitted, at: 0 | 1): number => eulerCurvatureDerivativesAt(f.seg, at)[1] * f.chord ** 3;\n\n/** Angle, curvature, and the curvature's first two derivatives matched where\n * `fa` ends and `fb` begins. */\nfunction g4Join(fa: Fitted, fb: Fitted): number[] {\n const scale = (fa.chord + fb.chord) / 2;\n const [a1, a2] = eulerCurvatureDerivativesAt(fa.seg, 1);\n const [b1, b2] = eulerCurvatureDerivativesAt(fb.seg, 0);\n return [\n wrap(fa.endAngle - fb.startAngle),\n (eulerCurvatureAt(fa.seg, 1) - eulerCurvatureAt(fb.seg, 0)) * scale,\n (a1 - b1) * scale ** 2,\n (a2 - b2) * scale ** 3,\n ];\n}\n\nfunction residuals(sys: System, closed: boolean, fits: readonly Fitted[]): number[] {\n const out: number[] = [];\n const fitOf = (side: Side): Fitted => fits[(side as { seg: number }).seg];\n for (let i = 0; i < sys.points.length; i++) {\n const [a, b] = sides(sys, closed, i);\n const kind = sys.points[i].kind;\n const ac = a.kind === 'curve';\n const bc = b.kind === 'curve';\n if (!ac && !bc) continue;\n if (kind === 'g4' && ac && bc) {\n out.push(...g4Join(fitOf(a), fitOf(b)));\n continue;\n }\n if (kind === 'smooth' && ac && bc) {\n const fa = fitOf(a), fb = fitOf(b);\n out.push(...g4Join(fa, fb).slice(0, 2));\n if (fa.cubic) out.push(twist(fa, 1));\n if (fb.cubic) out.push(twist(fb, 0));\n continue;\n }\n // One curved side from here on, or a corner's two independent ones.\n for (const [side, other, at] of [[a, b, 1], [b, a, 0]] as const) {\n if (side.kind !== 'curve') continue;\n const f = fitOf(side);\n const angle = at === 1 ? f.endAngle : f.startAngle;\n const followsLine = other.kind === 'line' && kind !== 'corner';\n out.push(followsLine ? wrap(angle - other.angle) : bend(f, at));\n if (f.cubic) out.push(twist(f, at));\n }\n }\n return out;\n}\n\n/** A starting tangent at each point: along the bisector of its two chords. */\nfunction initialGuess(sys: System, closed: boolean): number[] {\n const x = new Array<number>(sys.unknowns).fill(0);\n const n = sys.points.length;\n const tangentAt = (i: number, seg: number): number => {\n const chord = angleOf(sys.points[seg], sys.points[sys.ends[seg]]);\n const [a, b] = sides(sys, closed, i);\n if (sys.points[i].kind === 'corner' || a.kind === 'none' || b.kind === 'none') return chord;\n if (a.kind === 'line') return a.angle;\n if (b.kind === 'line') return b.angle;\n const prev = sys.points[(i - 1 + n) % n];\n const next = sys.points[(i + 1) % n];\n const pin = angleOf(prev, sys.points[i]);\n const pout = angleOf(sys.points[i], next);\n return pin + wrap(pout - pin) / 2;\n };\n for (let s = 0; s < sys.ends.length; s++) {\n const k = sys.slot[s];\n if (k < 0) continue;\n x[k] = tangentAt(s, s);\n x[k + 1] = tangentAt(sys.ends[s], s);\n }\n return x;\n}\n\n/** Solve `m · d = r` in place by Gaussian elimination with partial pivoting. */\nfunction solveLinear(m: number[][], r: number[]): number[] | null {\n const n = r.length;\n for (let c = 0; c < n; c++) {\n let p = c;\n for (let i = c + 1; i < n; i++) if (Math.abs(m[i][c]) > Math.abs(m[p][c])) p = i;\n if (Math.abs(m[p][c]) < 1e-14) return null;\n [m[c], m[p]] = [m[p], m[c]];\n [r[c], r[p]] = [r[p], r[c]];\n for (let i = c + 1; i < n; i++) {\n const f = m[i][c] / m[c][c];\n if (f === 0) continue;\n for (let j = c; j < n; j++) m[i][j] -= f * m[c][j];\n r[i] -= f * r[c];\n }\n }\n const out = new Array<number>(n).fill(0);\n for (let i = n - 1; i >= 0; i--) {\n let v = r[i];\n for (let j = i + 1; j < n; j++) v -= m[i][j] * out[j];\n out[i] = v / m[i][i];\n }\n return out;\n}\n\nconst norm = (v: readonly number[]): number => Math.sqrt(v.reduce((s, e) => s + e * e, 0));\n\n/**\n * Solve the spiro curve through `points`. A closed curve has a segment from\n * the last point back to the first. Fewer than two points make no segments.\n */\nexport function solveSpiro(points: readonly SpiroPoint[], closed: boolean): SpiroSegment[] {\n if (points.length < 2) return [];\n const sys = buildSystem(points, closed && points.length > 2);\n const isClosed = closed && points.length > 2;\n let x = initialGuess(sys, isClosed);\n const fitAll = (v: readonly number[]): Fitted[] =>\n sys.ends.map((_, s) => (sys.slot[s] < 0 ? (null as unknown as Fitted) : fitSegment(sys, s, v)));\n let fits = fitAll(x);\n let r = residuals(sys, isClosed, fits);\n for (let iter = 0; iter < 40 && sys.unknowns > 0; iter++) {\n const err = norm(r);\n if (err < 1e-10) break;\n // Each unknown moves only its own segment, so a column refits one segment.\n const jac = r.map(() => new Array<number>(sys.unknowns).fill(0));\n for (let s = 0; s < sys.ends.length; s++) {\n const k = sys.slot[s];\n if (k < 0) continue;\n for (let u = k; u < k + (sys.cubic[s] ? 4 : 2); u++) {\n const h = 1e-6;\n const xs = x.slice();\n xs[u] += h;\n const moved = fits.slice();\n moved[s] = fitSegment(sys, s, xs);\n const rs = residuals(sys, isClosed, moved);\n for (let e = 0; e < r.length; e++) jac[e][u] = (rs[e] - r[e]) / h;\n }\n }\n const step = solveLinear(jac, r.map((v) => -v));\n if (!step) break;\n // Halve the step until it lowers the error.\n let t = 1;\n let accepted = false;\n for (let tries = 0; tries < 12; tries++, t /= 2) {\n const xt = x.map((v, i) => v + t * step[i]);\n const ft = fitAll(xt);\n const rt = residuals(sys, isClosed, ft);\n if (norm(rt) < err) {\n x = xt; fits = ft; r = rt; accepted = true;\n break;\n }\n }\n if (!accepted) break;\n }\n return sys.ends.map((end, s) => ({\n from: { x: points[s].x, y: points[s].y },\n to: { x: points[end].x, y: points[end].y },\n spiral: sys.slot[s] < 0 ? null : fits[s].seg,\n }));\n}\n","/**\n * Spiro curves as cubic paths, and back. A solved curve is written as cubics,\n * each spiral segment split into as many as it takes to stay within tolerance,\n * so most anchors of the path are not spiro points. `at` records which are:\n * `at[i]` is the flat anchor index of point `i`, counted across subpaths. The\n * points are then read back out of the path itself, so whatever moves the path\n * — a move, a resize, a rotation — moves them with it.\n */\nimport type { PolygonPath } from '../path';\nimport { anchorsToPath, pathToAnchors, type PenAnchor } from './anchors';\nimport { eulerCubicError, eulerSegmentCubic, subEulerSegment, type EulerSegment } from './eulerSpiral';\nimport { solveSpiro, type SpiroKind, type SpiroPoint } from './spiro';\n\n/** One subpath of a spiro curve: its points, and whether it closes. */\nexport interface SpiroContour {\n points: SpiroPoint[];\n closed: boolean;\n}\n\n/** A spiro curve written as a cubic path, with the anchor each point became. */\nexport interface SpiroPath {\n path: PolygonPath;\n /** The flat anchor index of each point, in contour order. */\n at: number[];\n}\n\n/** Options for {@link spiroToPath}. */\nexport interface SpiroToPathOptions {\n /** The furthest a cubic may stray from its spiral, as a fraction of that\n * segment's arc length. Default `1e-4`. */\n tolerance?: number;\n /** The path being reshaped, whose fill rules the result keeps. */\n like?: PolygonPath;\n}\n\nconst MAX_PIECES = 16;\n\ninterface Piece { end: EulerSegment; c1: { x: number; y: number }; c2: { x: number; y: number } }\n\n/** `spiral` as the fewest equal pieces whose cubics all stay within `tol`. */\nfunction cubicPieces(spiral: EulerSegment, tol: number): Piece[] {\n let best: Piece[] = [];\n for (let m = 1; m <= MAX_PIECES; m++) {\n best = [];\n let fits = true;\n for (let j = 0; j < m; j++) {\n const piece = m === 1 ? spiral : subEulerSegment(spiral, j / m, (j + 1) / m);\n const { c1, c2 } = eulerSegmentCubic(piece);\n best.push({ end: piece, c1, c2 });\n if (eulerCubicError(piece, c1, c2) > tol * spiral.length) fits = false;\n }\n if (fits) break;\n }\n return best;\n}\n\nfunction contourAnchors(c: SpiroContour, tol: number): { anchors: PenAnchor[]; at: number[] } {\n const anchors: PenAnchor[] = [];\n const at: number[] = [];\n const segments = solveSpiro(c.points, c.closed);\n // The handle the last piece of a segment arrives with, for the point after it.\n let arriving: { x: number; y: number } | null = null;\n c.points.forEach((p, i) => {\n at.push(anchors.length);\n anchors.push({ x: p.x, y: p.y, ...(arriving ? { inHandle: arriving } : {}) });\n arriving = null;\n const spiral = segments[i]?.spiral;\n if (!spiral) return;\n const pieces = cubicPieces(spiral, tol);\n pieces.forEach((piece, j) => {\n anchors[anchors.length - 1].outHandle = { x: piece.c1.x, y: piece.c1.y };\n const c2 = { x: piece.c2.x, y: piece.c2.y };\n if (j < pieces.length - 1) anchors.push({ x: piece.end.p1.x, y: piece.end.p1.y, inHandle: c2 });\n else arriving = c2;\n });\n });\n if (arriving) anchors[0].inHandle = arriving;\n return { anchors, at };\n}\n\n/**\n * Solve each contour and write it as a cubic path. Straight segments carry no\n * handles.\n */\nexport function spiroToPath(contours: readonly SpiroContour[], options: SpiroToPathOptions = {}): SpiroPath {\n const tol = options.tolerance ?? 1e-4;\n const subs: PenAnchor[][] = [];\n const closed: boolean[] = [];\n const at: number[] = [];\n let base = 0;\n for (const c of contours) {\n if (c.points.length === 0) continue;\n const written = contourAnchors(c, tol);\n subs.push(written.anchors);\n closed.push(c.closed && c.points.length > 2);\n at.push(...written.at.map((i) => i + base));\n base += written.anchors.length;\n }\n return { path: anchorsToPath(subs, closed, options.like), at };\n}\n\n/**\n * The spiro points `path` holds, given the kind of each and the anchor each\n * became. Null when `kinds` and `at` do not describe `path`: the counts\n * differ, an index is out of order or out of range, or a subpath does not\n * start on a point.\n */\nexport function spiroContoursOf(\n path: PolygonPath,\n kinds: readonly SpiroKind[],\n at: readonly number[],\n): SpiroContour[] | null {\n if (kinds.length !== at.length || at.length === 0) return null;\n const { anchors, closed } = pathToAnchors(path);\n const contours: SpiroContour[] = [];\n let flat = 0;\n let k = 0;\n for (let s = 0; s < anchors.length; s++) {\n const sub = anchors[s];\n if (at[k] !== flat) return null;\n const points: SpiroPoint[] = [];\n while (k < at.length && at[k] < flat + sub.length) {\n if (k > 0 && at[k] <= at[k - 1]) return null;\n const a = sub[at[k] - flat];\n points.push({ x: a.x, y: a.y, kind: kinds[k] });\n k++;\n }\n contours.push({ points, closed: closed[s] });\n flat += sub.length;\n }\n return k === at.length ? contours : null;\n}\n\n/** The straight-sided path through each contour's points: what an editor\n * shows and moves in place of the curve. */\nexport function spiroControlPath(contours: readonly SpiroContour[]): PolygonPath {\n return anchorsToPath(\n contours.map((c) => c.points.map((p) => ({ x: p.x, y: p.y }))),\n contours.map((c) => c.closed),\n );\n}\n\nconst key = (x: number, y: number): string => `${Math.round(x * 1e3)},${Math.round(y * 1e3)}`;\n\n/**\n * Read an edited control path back as contours: every anchor is a point.\n * Kinds follow from `before`, the contours the edit started from: point for\n * point when the count is unchanged, else by position, with an anchor that\n * lands nowhere a point was taking `fallback`. Handles are ignored.\n */\nexport function spiroContoursFromControl(\n control: PolygonPath,\n before: readonly SpiroContour[],\n fallback: SpiroKind = 'smooth',\n): SpiroContour[] {\n const { anchors, closed } = pathToAnchors(control);\n const old = before.flatMap((c) => c.points);\n const count = anchors.reduce((n, sub) => n + sub.length, 0);\n const byPlace = new Map<string, SpiroKind>();\n for (const p of old) if (!byPlace.has(key(p.x, p.y))) byPlace.set(key(p.x, p.y), p.kind);\n let i = 0;\n return anchors.map((sub, s) => ({\n closed: closed[s],\n points: sub.map((a) => {\n const kind = count === old.length ? old[i].kind : byPlace.get(key(a.x, a.y)) ?? fallback;\n i++;\n return { x: a.x, y: a.y, kind };\n }),\n }));\n}\n"]}
|
package/dist/curves/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cubicCurvatureAt, SPIRO_KINDS, eulerCurvatureAt, spiroToPath, eulerPointAt, solveSpiro } from '../chunk-
|
|
1
|
+
import { cubicCurvatureAt, SPIRO_KINDS, eulerCurvatureAt, spiroToPath, eulerPointAt, solveSpiro } from '../chunk-HNLJO3E7.js';
|
|
2
2
|
import '../chunk-3HQJGI63.js';
|
|
3
3
|
import '../chunk-2N6OWA7E.js';
|
|
4
4
|
import { PATH_M, cubicPointAt, PATH_L, PATH_Q, PATH_C } from '../chunk-B3D6KWW3.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -1460,8 +1460,57 @@ interface PathAwayFromAnchors {
|
|
|
1460
1460
|
declare function pathAwayFromAnchors(path: PolygonPath, moving: Iterable<number>): PathAwayFromAnchors;
|
|
1461
1461
|
|
|
1462
1462
|
/**
|
|
1463
|
-
*
|
|
1464
|
-
*
|
|
1463
|
+
* The curve an open end grows along, as the segments `lengthenPathEnd` appends
|
|
1464
|
+
* and `extendToMeet` searches. Each mode starts with the end's own point and
|
|
1465
|
+
* tangent:
|
|
1466
|
+
*
|
|
1467
|
+
* - `'tangent'` runs straight on.
|
|
1468
|
+
* - `'curvature'` follows the circle of the end's curvature.
|
|
1469
|
+
* - `'eased'` starts with the end's curvature and lets it fall linearly to
|
|
1470
|
+
* zero along the arc length (an Euler spiral), then runs straight. The ease
|
|
1471
|
+
* is as long as it takes the spiral to turn `easeTurn`, so a tight end eases
|
|
1472
|
+
* off quickly and a gentle one over a long run. A distance shorter than the
|
|
1473
|
+
* ease stops partway along that same spiral, so every distance walks one
|
|
1474
|
+
* curve, and a drag or a search never reshapes what it has already passed.
|
|
1475
|
+
*
|
|
1476
|
+
* The spiral is drawn as cubics fitted to it with the spiral's curvature at
|
|
1477
|
+
* both ends of each, so the extension meets the path, and its own pieces meet
|
|
1478
|
+
* each other, with matching curvature.
|
|
1479
|
+
*/
|
|
1480
|
+
|
|
1481
|
+
/** How an end grows: straight on, bending as the end bends, or easing out of
|
|
1482
|
+
* the end's bend into a straight run. */
|
|
1483
|
+
type LengthenMode = 'tangent' | 'curvature' | 'eased';
|
|
1484
|
+
/** Where an end is, which way it heads out of the path, and how it bends there. */
|
|
1485
|
+
interface PathEndFrame {
|
|
1486
|
+
point: Point;
|
|
1487
|
+
/** Unit vector pointing out of the path. */
|
|
1488
|
+
tangent: Point;
|
|
1489
|
+
/** Signed curvature along `tangent`: positive turns toward `(-tangent.y, tangent.x)`. */
|
|
1490
|
+
curvature: number;
|
|
1491
|
+
}
|
|
1492
|
+
/** Shape options for the `'eased'` mode. */
|
|
1493
|
+
interface EaseOptions {
|
|
1494
|
+
/** How far, in radians, the spiral turns before the extension runs
|
|
1495
|
+
* straight. Default π/6 (30°). */
|
|
1496
|
+
easeTurn?: number;
|
|
1497
|
+
}
|
|
1498
|
+
/** One segment of an extension: a line (two points) or a cubic (four), and
|
|
1499
|
+
* its arc length. */
|
|
1500
|
+
interface ExtensionPiece {
|
|
1501
|
+
pts: Point[];
|
|
1502
|
+
length: number;
|
|
1503
|
+
}
|
|
1504
|
+
/** The pieces of `frame`'s extension in `mode`, `distance` long. Empty when
|
|
1505
|
+
* `distance` is not positive. A curvature arc stops at one full turn. */
|
|
1506
|
+
declare function extensionPieces(frame: PathEndFrame, distance: number, mode: LengthenMode, opts?: EaseOptions): ExtensionPiece[];
|
|
1507
|
+
/** The ease length: the arc length over which the eased spiral of `frame`
|
|
1508
|
+
* turns `easeTurn`. Infinite on a straight end. */
|
|
1509
|
+
declare function easeLength(frame: PathEndFrame, opts?: EaseOptions): number;
|
|
1510
|
+
|
|
1511
|
+
/**
|
|
1512
|
+
* Growing an open end of a path along the curve a `LengthenMode` draws: by a
|
|
1513
|
+
* distance, or until it meets another stroke.
|
|
1465
1514
|
*/
|
|
1466
1515
|
|
|
1467
1516
|
/** One end of an open subpath. `sub` counts subpaths as the path's anchor set
|
|
@@ -1479,23 +1528,24 @@ declare function openEndRay(path: Path, end: OpenPathEnd): {
|
|
|
1479
1528
|
dir: Point;
|
|
1480
1529
|
} | null;
|
|
1481
1530
|
/**
|
|
1482
|
-
* `path` with `end` carried `distance` further
|
|
1483
|
-
*
|
|
1484
|
-
*
|
|
1485
|
-
*
|
|
1486
|
-
* `distance` is not positive.
|
|
1531
|
+
* `path` with `end` carried `distance` further, by `lengthenPathEnd` in `mode`
|
|
1532
|
+
* (default `'tangent'`): a straight end grown straight gets longer, and
|
|
1533
|
+
* anything else gains segments that keep the tangent continuous. Null when the
|
|
1534
|
+
* end is not open or has no direction, or `distance` is not positive.
|
|
1487
1535
|
*/
|
|
1488
|
-
declare function lengthenOpenEnd(path: Path, end: OpenPathEnd, distance: number): PolygonPath | null;
|
|
1536
|
+
declare function lengthenOpenEnd(path: Path, end: OpenPathEnd, distance: number, mode?: LengthenMode, opts?: EaseOptions): PolygonPath | null;
|
|
1489
1537
|
/** Options for {@link extendToMeet}. */
|
|
1490
|
-
interface ExtendToMeetOptions {
|
|
1491
|
-
/** The furthest the end may travel. Default: as far as any stroke reaches. */
|
|
1538
|
+
interface ExtendToMeetOptions extends EaseOptions {
|
|
1539
|
+
/** The furthest the end may travel, by arc length. Default: as far as any stroke reaches. */
|
|
1492
1540
|
maxDistance?: number;
|
|
1541
|
+
/** The curve the end travels along. Default `'eased'`. */
|
|
1542
|
+
mode?: LengthenMode;
|
|
1493
1543
|
}
|
|
1494
1544
|
/**
|
|
1495
|
-
* Extend `end` of `path` along
|
|
1496
|
-
* one of `boundaries`, or `path`'s own other segments. Returns the
|
|
1497
|
-
* path, the point it now ends at and how far it went
|
|
1498
|
-
*
|
|
1545
|
+
* Extend `end` of `path` along the curve `opts.mode` draws to the first stroke
|
|
1546
|
+
* it meets — one of `boundaries`, or `path`'s own other segments. Returns the
|
|
1547
|
+
* extended path, the point it now ends at and how far it went by arc length,
|
|
1548
|
+
* or null when the curve meets nothing.
|
|
1499
1549
|
*/
|
|
1500
1550
|
declare function extendToMeet(path: Path, boundaries: readonly Path[], end: OpenPathEnd, opts?: ExtendToMeetOptions): {
|
|
1501
1551
|
path: PolygonPath;
|
|
@@ -1507,12 +1557,12 @@ declare function extendToMeet(path: Path, boundaries: readonly Path[], end: Open
|
|
|
1507
1557
|
* Grow or trim an open subpath at one of its ends. Lengthen drags this, and
|
|
1508
1558
|
* Extend to next path reaches it through `lengthenOpenEnd`.
|
|
1509
1559
|
*
|
|
1510
|
-
* A positive distance extends the end outward
|
|
1511
|
-
*
|
|
1512
|
-
* with
|
|
1513
|
-
*
|
|
1514
|
-
*
|
|
1515
|
-
* grown.
|
|
1560
|
+
* A positive distance extends the end outward along the curve its mode draws
|
|
1561
|
+
* (`extensionPieces`): straight along the end tangent, along a circular arc
|
|
1562
|
+
* with the curvature the end has, or easing out of that curvature into a
|
|
1563
|
+
* straight run. A straight end segment lengthened straight grows in place;
|
|
1564
|
+
* anything else is continued with new segments. A negative distance trims the
|
|
1565
|
+
* path back along itself by arc length, whichever way it would have grown.
|
|
1516
1566
|
*
|
|
1517
1567
|
* The arc rather than extrapolating the end cubic past t = 1: a cubic's
|
|
1518
1568
|
* leading term takes over beyond its range, so a continued curve swings off
|
|
@@ -1520,16 +1570,6 @@ declare function extendToMeet(path: Path, boundaries: readonly Path[], end: Open
|
|
|
1520
1570
|
* curvature the end shows for as long as it is drawn.
|
|
1521
1571
|
*/
|
|
1522
1572
|
|
|
1523
|
-
/** How `lengthenPathEnd` grows an end: straight on, or bending as the end bends. */
|
|
1524
|
-
type LengthenMode = 'tangent' | 'curvature';
|
|
1525
|
-
/** Where an end is, which way it heads out of the path, and how it bends there. */
|
|
1526
|
-
interface PathEndFrame {
|
|
1527
|
-
point: Point;
|
|
1528
|
-
/** Unit vector pointing out of the path. */
|
|
1529
|
-
tangent: Point;
|
|
1530
|
-
/** Signed curvature along `tangent`: positive turns toward `(-tangent.y, tangent.x)`. */
|
|
1531
|
-
curvature: number;
|
|
1532
|
-
}
|
|
1533
1573
|
/** The end of an open subpath that the anchor at `flatIndex` is, or null when it is
|
|
1534
1574
|
* an inner anchor, on a closed subpath, or alone in its subpath. */
|
|
1535
1575
|
declare function openEndAt(set: AnchorSet, flatIndex: number): OpenPathEnd | null;
|
|
@@ -1543,15 +1583,16 @@ declare function pathEndFrame(set: AnchorSet, end: OpenPathEnd): PathEndFrame |
|
|
|
1543
1583
|
* stops at one full turn. Returns false when `end` is not the end of an open
|
|
1544
1584
|
* subpath or nothing changed.
|
|
1545
1585
|
*/
|
|
1546
|
-
declare function lengthenPathEnd(set: AnchorSet, end: OpenPathEnd, distance: number, mode: LengthenMode): boolean;
|
|
1586
|
+
declare function lengthenPathEnd(set: AnchorSet, end: OpenPathEnd, distance: number, mode: LengthenMode, opts?: EaseOptions): boolean;
|
|
1547
1587
|
/**
|
|
1548
1588
|
* The distance `lengthenPathEnd` takes for its new end to land nearest `point`: the
|
|
1549
|
-
* point projected onto the end tangent,
|
|
1550
|
-
* around the circle of curvature
|
|
1551
|
-
*
|
|
1552
|
-
*
|
|
1589
|
+
* point projected onto the end tangent, for a curvature lengthening measured
|
|
1590
|
+
* around the circle of curvature, and for an eased one along the eased curve
|
|
1591
|
+
* where the point is ahead of the end. A measurement around the circle can name
|
|
1592
|
+
* the same spot a turn apart; it answers the one nearest `near`, so a drag
|
|
1593
|
+
* passing half a turn keeps going instead of jumping back.
|
|
1553
1594
|
*/
|
|
1554
|
-
declare function lengthToward(set: AnchorSet, end: OpenPathEnd, mode: LengthenMode, point: Point, near?: number): number;
|
|
1595
|
+
declare function lengthToward(set: AnchorSet, end: OpenPathEnd, mode: LengthenMode, point: Point, near?: number, opts?: EaseOptions): number;
|
|
1555
1596
|
|
|
1556
1597
|
/**
|
|
1557
1598
|
* Controls for the one cubic that replaces `prev → removed → next` when
|
|
@@ -1714,17 +1755,19 @@ interface ResamplePathOptions {
|
|
|
1714
1755
|
*/
|
|
1715
1756
|
declare function resamplePath(path: PolygonPath, opts?: ResamplePathOptions): PolygonPath;
|
|
1716
1757
|
|
|
1717
|
-
/**
|
|
1718
|
-
|
|
1719
|
-
|
|
1758
|
+
/** Which turns count as extremes: in x (furthest left and right), in y (furthest up and down), or both. */
|
|
1759
|
+
type ExtremaAxes = 'xy' | 'x' | 'y';
|
|
1760
|
+
/** The parameters in (0, 1) where the segment from `a` to `b` turns along
|
|
1761
|
+
* `axes`, ascending, or none for a straight segment. */
|
|
1762
|
+
declare function segmentExtremaTs(a: PenAnchor, b: PenAnchor, axes?: ExtremaAxes): number[];
|
|
1720
1763
|
/**
|
|
1721
|
-
* Split every curved segment of `set` at its extremes
|
|
1764
|
+
* Split every curved segment of `set` at its extremes along `axes`
|
|
1722
1765
|
* ({@link segmentExtremaTs}), in place. `include(sub, segIdx)` limits it to
|
|
1723
1766
|
* some segments, named as `segmentEnds` names them; absent, every one.
|
|
1724
1767
|
* Returns the new anchors' flat indices in the edited set. Each new anchor is
|
|
1725
1768
|
* smooth, and every anchor after one moves up an index.
|
|
1726
1769
|
*/
|
|
1727
|
-
declare function addExtremaAnchors(set: AnchorSet, include?: (sub: number, segIdx: number) => boolean): number[];
|
|
1770
|
+
declare function addExtremaAnchors(set: AnchorSet, include?: (sub: number, segIdx: number) => boolean, axes?: ExtremaAxes): number[];
|
|
1728
1771
|
|
|
1729
1772
|
/**
|
|
1730
1773
|
* Anchor selections walked along the path: grown or shrunk by one anchor,
|
|
@@ -3232,4 +3275,4 @@ declare function reviveTypedArrays(value: unknown): unknown;
|
|
|
3232
3275
|
/** `tagTypedArrays` as a `JSON.stringify` replacer. */
|
|
3233
3276
|
declare function typedArrayReplacer(_key: string, value: unknown): unknown;
|
|
3234
3277
|
|
|
3235
|
-
export { ANCHOR_FIELDS, Affine, type AnchorField, type AnchorFieldValues, type AnchorPair, type AnchorPathMeasure, AnchorSet, type AnchorSubpathMeasure, type AnchorSymmetry, type ArcTrackShape, type ArcTrackSpec, type AverageAxis, type BendAlongPathOptions, type BendGrip, type BezierEasing, type BlendPathsOptions, type Box, CONSTRAINT_TOLERANCE, CORNER_RESTORE_TOLERANCE, type ConflictingConstraintsOptions, type ConstrainPathEditOptions, type ConstrainedPathEdit, type ConstrainedPathsEdit, type ConstraintPoint, type CornerCut, type CornerFrame, CornerPiece, CornerSpec, type CornerTrace, type CubicContour, type CubicCoords, type CubicSegment, type CurveNearest, DEFAULT_FLATTEN_TOLERANCE, type DirectionMark, EASINGS, EPS, type EasingFn, type EasingName, type EasingSpec, type EllipseTrackShape, type EllipseTrackSpec, type ExtendToMeetOptions, type FramedBox, type GlMat3, type GrowRegionOptions, type HandleBalance, type HandleRef, type JoinOptions, type LengthenMode, type LineCoords, type MeasureAnchorPathOptions, type MeasurePathOptions, type MergeRegionOptions, type NumberEntry, type NumberTypedArray, ORIGIN_THRESHOLD, type OpenPathEnd, PATH_C, PATH_CMD_LENGTHS, PATH_COMMANDS, PATH_L, PATH_M, PATH_Q, PATH_SNAP_KINDS, PATH_Z, Path, type PathAnchorHit, type PathAwayFromAnchors, type PathBlend, PathBuilder, type PathCommandCode, type PathCommandName, type PathConstraint, type PathConstraintKind, type PathCrossing, type PathEndFrame, PathFillRule, type PathInWorldPose, type PathLink, type PathMeasure, type PathNearest, type PathNearestStation, PathOpenFill, type PathSegment, type PathSnapHit, type PathSnapIndex, type PathSnapKind, type PathSnapQuery, type PathSnapTarget, type PathStation, type PathStop, type PathTrackShape, type PathsEditItem, PenAnchor, type PlaceAlongRunOptions, type PlaceRectOptions, type PlacedRect, type Placement, type PlacementAlign, type PlacementSide, Point, type PointAlongPathOptions, type PointInPathOptions, type PointOrigin, type PolygonIntersectsPathOptions, PolygonPath, type PoseLinear, type PoseRotation, type PuckerBloatPathOptions, type QuadraticCoords, type Rect, RectPath, type RepeatAlongPathOptions, type RepeatStation, type ResamplePathOptions, type ResolvedCorners, type RoughenPathOptions, type RunAlign, type RunOrder, type RunPast, type RunPlace, type RunSpot, SPRING_PRESETS, Scale2, type SegmentCrossing, type SegmentMeasure, type SegmentRef, type SegmentType, type SimplifyPathOptions, type SmudgePathOptions, type SoftFalloff, type SolveConstraintsOptions, type SolveConstraintsResult, type SolvePathConstraintsResult, type SpiroContour, SpiroKind, type SpiroPath, SpiroPoint, type SpiroToPathOptions, type SpringPreset, type SpringPresetName, type StaticPathSnapKind, type StrokeHitTestOptions, type SubpathEnd, TYPED_ARRAY_CONSTRUCTORS, type TaggedTypedArray, type TrackAtOptions, type TrackNearest, type TrackNearestOptions, type TrackPlace, type TrackRun, type TrackRunOptions, type TrackShape, type TrackShapeKind, type TrackSide, type TrackStation, type TransformPathOptions, type TrimPathOptions, type TrimResult, type TypedArrayTag, type UnsatisfiedConstraintsOptions, type View, ZOOM_FLOOR, type ZigzagPathOptions, addExtremaAnchors, addOrigin, anchorOriginsOf, anchorSymmetries, anchorSymmetry, anchorsBefore, anchorsUnderBrush, anchorsWhere, approxEq, arcShape, asPolygonPath, averageAnchorsAt, balanceFactorToward, bendAlongPath, bendSegment, bendSide, blendPaths, boundsOfCoords, boundsOfPath, boxContainsBox, boxContainsPoint, boxFrameOf, circlePath, clamp, clampRectWithin, closestOpenEnds, composePath, conflictingConstraints, constrainPathEdit, constrainPathsEdit, constraintAnchors, constraintApplies, constraintFits, convertSegments, coordsFrom, cornerAnchors, cornerCuts, cornerFrameAt, cornerFrames, cornerTraces, createPathSnapIndex, cross, cubicAxisExtremaTs, cubicBezierEasing, cubicBounds, cubicContoursToPath, cubicEvalAt, decomposePath, defaultOpenFill, directionMarks, dot, easeIn, easeInBack, easeInBounce, easeInCirc, easeInCubic, easeInElastic, easeInExpo, easeInOut, easeInOutBack, easeInOutBounce, easeInOutCirc, easeInOutCubic, easeInOutElastic, easeInOutExpo, easeInOutQuad, easeInOutQuart, easeInOutQuint, easeInOutSine, easeInQuad, easeInQuart, easeInQuint, easeInSine, easeOut, easeOutBack, easeOutBounce, easeOutCirc, easeOutCubic, easeOutElastic, easeOutExpo, easeOutQuad, easeOutQuart, easeOutQuint, easeOutSine, editAnchorSetTracked, elevateQuadraticToCubic, ellipsePath, ellipseShape, equalizeSegmentHandles, everyNthAnchor, extendToMeet, fillsOpenSubpaths, findPathSnap, findPathSnaps, fitAffine, fitCubicThroughDeletion, fitCubicWithTangents, flatIndexesAfterReverse, flattenCubic, flattenCubicWithArcLen, flattenQuadratic, flattenQuadraticWithArcLen, forEachSegment, growAnchorSelection, growRegion, handleAlongItsAngle, handleAtItsLength, handleBalances, harmonizeAnchors, hasOpenSubpath, intersectSegments, invertAnchorSelection, isSegmentStraight, joinAnchorsAt, joinPaths, joinSubpathEnds, keepCorners, len2, lengthToward, lengthenOpenEnd, lengthenPathEnd, linePath, lineShape, linear, makeHandlesSymmetric, mapConstraintAnchors, mat3, meanScale, measureAnchorPath, measurePath, mergeRegion, moveHandleSymmetric, nearestOnCubic, nearestOnLine, nearestOnPath, nearestOnQuadratic, nearestPathAnchor, normalizeZoom, offsetCornerTraces, openEndAt, openEndRay, openPathEnds, originFor, originOf, pathAnchorPoints, pathAwayFromAnchors, pathCommandCoordCount, pathContainsPoint, pathContainsPolygon, pathContainsRect, pathCrossings, pathDistanceToPoint, pathEndAnchorIndex, pathEndFrame, pathFromD, pathInPoseFrame, pathInWorld, pathIntersectsPolygon, pathIntersectsRect, pathPoint, pathSegments, pathShape, pathSignedArea, pathThroughPoseFrame, pathToCubicContours, pathToD, placeAlongRun, placeRect, pointAlongPath, pointInPath, pointInPolygon, pointSegmentDist2, polygonContainsPath, polygonFromPoints, polygonIntersectsPath, polylineFromPoints, portControls, portCurvePoints, poseFrameInverseOf, poseFrameOf, poseLinearOf, poseRotationOf, prepareBlend, puckerBloatPath, quadraticEvalAt, readAnchorFields, rectMarkerPath, rectPath, rectToContour, regularPolygonPath, remapAnchorValues, remapConstraints, remapPerAnchor, remapPointValues, repeatAlongPath, resamplePath, resolveCorners, resolveCornersWithSources, resolveEasing, restoreCorners, retractHandles, reverseAnchors, reversePath, reverseSubpaths, reviveTypedArrays, rotatePathAround, roughenPath, roundRectPath, runLength, runPlaces, runStationAt, scalePathToBounds, scaleSegmentHandles, schneiderFit, segmentBetween, segmentExtremaTs, segmentsBetweenAnchors, segmentsCross, setDefaultOpenFill, setSubpathStart, shiftTrack, shrinkAnchorSelection, sign, simplifyAnchorsAt, simplifyPath, simplifySpan, simplifySubpath, smoothAnchors, smudgePath, softFalloff, softSelectionBand, softSelectionWeights, solveConstraints, solvePathConstraints, spiroContoursFromControl, spiroContoursOf, spiroControlPath, spiroToPath, splitByClosure, splitCubicAt, splitLineAt, splitQuadraticAt, splitSubpaths, squarePath, starPath, stationsAlongPath, strokeHitTest, sub, subpathEndAt, subpathsOfAnchors, tagTypedArray, tagTypedArrays, trackRun, trackShapeD, trackSlice, transformPath, translateAnchorsSymmetric, translatePath, trimPathAt, typedArrayReplacer, unionBoundsPath, unionBox, unsatisfiedConstraints, untagTypedArray, viewToMat3, withAnchorPoints, worldCoords, worldEditToStorage, writeAnchorField, zigzagPath };
|
|
3278
|
+
export { ANCHOR_FIELDS, Affine, type AnchorField, type AnchorFieldValues, type AnchorPair, type AnchorPathMeasure, AnchorSet, type AnchorSubpathMeasure, type AnchorSymmetry, type ArcTrackShape, type ArcTrackSpec, type AverageAxis, type BendAlongPathOptions, type BendGrip, type BezierEasing, type BlendPathsOptions, type Box, CONSTRAINT_TOLERANCE, CORNER_RESTORE_TOLERANCE, type ConflictingConstraintsOptions, type ConstrainPathEditOptions, type ConstrainedPathEdit, type ConstrainedPathsEdit, type ConstraintPoint, type CornerCut, type CornerFrame, CornerPiece, CornerSpec, type CornerTrace, type CubicContour, type CubicCoords, type CubicSegment, type CurveNearest, DEFAULT_FLATTEN_TOLERANCE, type DirectionMark, EASINGS, EPS, type EaseOptions, type EasingFn, type EasingName, type EasingSpec, type EllipseTrackShape, type EllipseTrackSpec, type ExtendToMeetOptions, type ExtensionPiece, type ExtremaAxes, type FramedBox, type GlMat3, type GrowRegionOptions, type HandleBalance, type HandleRef, type JoinOptions, type LengthenMode, type LineCoords, type MeasureAnchorPathOptions, type MeasurePathOptions, type MergeRegionOptions, type NumberEntry, type NumberTypedArray, ORIGIN_THRESHOLD, type OpenPathEnd, PATH_C, PATH_CMD_LENGTHS, PATH_COMMANDS, PATH_L, PATH_M, PATH_Q, PATH_SNAP_KINDS, PATH_Z, Path, type PathAnchorHit, type PathAwayFromAnchors, type PathBlend, PathBuilder, type PathCommandCode, type PathCommandName, type PathConstraint, type PathConstraintKind, type PathCrossing, type PathEndFrame, PathFillRule, type PathInWorldPose, type PathLink, type PathMeasure, type PathNearest, type PathNearestStation, PathOpenFill, type PathSegment, type PathSnapHit, type PathSnapIndex, type PathSnapKind, type PathSnapQuery, type PathSnapTarget, type PathStation, type PathStop, type PathTrackShape, type PathsEditItem, PenAnchor, type PlaceAlongRunOptions, type PlaceRectOptions, type PlacedRect, type Placement, type PlacementAlign, type PlacementSide, Point, type PointAlongPathOptions, type PointInPathOptions, type PointOrigin, type PolygonIntersectsPathOptions, PolygonPath, type PoseLinear, type PoseRotation, type PuckerBloatPathOptions, type QuadraticCoords, type Rect, RectPath, type RepeatAlongPathOptions, type RepeatStation, type ResamplePathOptions, type ResolvedCorners, type RoughenPathOptions, type RunAlign, type RunOrder, type RunPast, type RunPlace, type RunSpot, SPRING_PRESETS, Scale2, type SegmentCrossing, type SegmentMeasure, type SegmentRef, type SegmentType, type SimplifyPathOptions, type SmudgePathOptions, type SoftFalloff, type SolveConstraintsOptions, type SolveConstraintsResult, type SolvePathConstraintsResult, type SpiroContour, SpiroKind, type SpiroPath, SpiroPoint, type SpiroToPathOptions, type SpringPreset, type SpringPresetName, type StaticPathSnapKind, type StrokeHitTestOptions, type SubpathEnd, TYPED_ARRAY_CONSTRUCTORS, type TaggedTypedArray, type TrackAtOptions, type TrackNearest, type TrackNearestOptions, type TrackPlace, type TrackRun, type TrackRunOptions, type TrackShape, type TrackShapeKind, type TrackSide, type TrackStation, type TransformPathOptions, type TrimPathOptions, type TrimResult, type TypedArrayTag, type UnsatisfiedConstraintsOptions, type View, ZOOM_FLOOR, type ZigzagPathOptions, addExtremaAnchors, addOrigin, anchorOriginsOf, anchorSymmetries, anchorSymmetry, anchorsBefore, anchorsUnderBrush, anchorsWhere, approxEq, arcShape, asPolygonPath, averageAnchorsAt, balanceFactorToward, bendAlongPath, bendSegment, bendSide, blendPaths, boundsOfCoords, boundsOfPath, boxContainsBox, boxContainsPoint, boxFrameOf, circlePath, clamp, clampRectWithin, closestOpenEnds, composePath, conflictingConstraints, constrainPathEdit, constrainPathsEdit, constraintAnchors, constraintApplies, constraintFits, convertSegments, coordsFrom, cornerAnchors, cornerCuts, cornerFrameAt, cornerFrames, cornerTraces, createPathSnapIndex, cross, cubicAxisExtremaTs, cubicBezierEasing, cubicBounds, cubicContoursToPath, cubicEvalAt, decomposePath, defaultOpenFill, directionMarks, dot, easeIn, easeInBack, easeInBounce, easeInCirc, easeInCubic, easeInElastic, easeInExpo, easeInOut, easeInOutBack, easeInOutBounce, easeInOutCirc, easeInOutCubic, easeInOutElastic, easeInOutExpo, easeInOutQuad, easeInOutQuart, easeInOutQuint, easeInOutSine, easeInQuad, easeInQuart, easeInQuint, easeInSine, easeLength, easeOut, easeOutBack, easeOutBounce, easeOutCirc, easeOutCubic, easeOutElastic, easeOutExpo, easeOutQuad, easeOutQuart, easeOutQuint, easeOutSine, editAnchorSetTracked, elevateQuadraticToCubic, ellipsePath, ellipseShape, equalizeSegmentHandles, everyNthAnchor, extendToMeet, extensionPieces, fillsOpenSubpaths, findPathSnap, findPathSnaps, fitAffine, fitCubicThroughDeletion, fitCubicWithTangents, flatIndexesAfterReverse, flattenCubic, flattenCubicWithArcLen, flattenQuadratic, flattenQuadraticWithArcLen, forEachSegment, growAnchorSelection, growRegion, handleAlongItsAngle, handleAtItsLength, handleBalances, harmonizeAnchors, hasOpenSubpath, intersectSegments, invertAnchorSelection, isSegmentStraight, joinAnchorsAt, joinPaths, joinSubpathEnds, keepCorners, len2, lengthToward, lengthenOpenEnd, lengthenPathEnd, linePath, lineShape, linear, makeHandlesSymmetric, mapConstraintAnchors, mat3, meanScale, measureAnchorPath, measurePath, mergeRegion, moveHandleSymmetric, nearestOnCubic, nearestOnLine, nearestOnPath, nearestOnQuadratic, nearestPathAnchor, normalizeZoom, offsetCornerTraces, openEndAt, openEndRay, openPathEnds, originFor, originOf, pathAnchorPoints, pathAwayFromAnchors, pathCommandCoordCount, pathContainsPoint, pathContainsPolygon, pathContainsRect, pathCrossings, pathDistanceToPoint, pathEndAnchorIndex, pathEndFrame, pathFromD, pathInPoseFrame, pathInWorld, pathIntersectsPolygon, pathIntersectsRect, pathPoint, pathSegments, pathShape, pathSignedArea, pathThroughPoseFrame, pathToCubicContours, pathToD, placeAlongRun, placeRect, pointAlongPath, pointInPath, pointInPolygon, pointSegmentDist2, polygonContainsPath, polygonFromPoints, polygonIntersectsPath, polylineFromPoints, portControls, portCurvePoints, poseFrameInverseOf, poseFrameOf, poseLinearOf, poseRotationOf, prepareBlend, puckerBloatPath, quadraticEvalAt, readAnchorFields, rectMarkerPath, rectPath, rectToContour, regularPolygonPath, remapAnchorValues, remapConstraints, remapPerAnchor, remapPointValues, repeatAlongPath, resamplePath, resolveCorners, resolveCornersWithSources, resolveEasing, restoreCorners, retractHandles, reverseAnchors, reversePath, reverseSubpaths, reviveTypedArrays, rotatePathAround, roughenPath, roundRectPath, runLength, runPlaces, runStationAt, scalePathToBounds, scaleSegmentHandles, schneiderFit, segmentBetween, segmentExtremaTs, segmentsBetweenAnchors, segmentsCross, setDefaultOpenFill, setSubpathStart, shiftTrack, shrinkAnchorSelection, sign, simplifyAnchorsAt, simplifyPath, simplifySpan, simplifySubpath, smoothAnchors, smudgePath, softFalloff, softSelectionBand, softSelectionWeights, solveConstraints, solvePathConstraints, spiroContoursFromControl, spiroContoursOf, spiroControlPath, spiroToPath, splitByClosure, splitCubicAt, splitLineAt, splitQuadraticAt, splitSubpaths, squarePath, starPath, stationsAlongPath, strokeHitTest, sub, subpathEndAt, subpathsOfAnchors, tagTypedArray, tagTypedArrays, trackRun, trackShapeD, trackSlice, transformPath, translateAnchorsSymmetric, translatePath, trimPathAt, typedArrayReplacer, unionBoundsPath, unionBox, unsatisfiedConstraints, untagTypedArray, viewToMat3, withAnchorPoints, worldCoords, worldEditToStorage, writeAnchorField, zigzagPath };
|