@weasel-js/geom 1.13.0-rc.0 → 1.14.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/README.md +6 -2
- package/dist/3d/index.d.ts +8 -1
- package/dist/3d/index.js +25 -1
- package/dist/3d/index.js.map +1 -1
- package/dist/booleans/index.d.ts +6 -5
- package/dist/booleans/index.js +583 -73
- package/dist/booleans/index.js.map +1 -1
- package/dist/{chunk-CE7IY7TB.js → chunk-2N6OWA7E.js} +3 -3
- package/dist/{chunk-CE7IY7TB.js.map → chunk-2N6OWA7E.js.map} +1 -1
- package/dist/{chunk-Q66NA2FU.js → chunk-3HQJGI63.js} +8 -5
- package/dist/chunk-3HQJGI63.js.map +1 -0
- package/dist/{chunk-YPWFGFQX.js → chunk-3YH5XU3H.js} +125 -8
- package/dist/chunk-3YH5XU3H.js.map +1 -0
- package/dist/{chunk-UI3FUWXM.js → chunk-42TZDN5C.js} +4 -4
- package/dist/{chunk-UI3FUWXM.js.map → chunk-42TZDN5C.js.map} +1 -1
- package/dist/{chunk-B53BERKG.js → chunk-B3D6KWW3.js} +110 -8
- package/dist/chunk-B3D6KWW3.js.map +1 -0
- package/dist/{chunk-2PKPKU4P.js → chunk-EURWZUNY.js} +25 -22
- package/dist/chunk-EURWZUNY.js.map +1 -0
- package/dist/{chunk-VHXOCDZ2.js → chunk-FROQPADA.js} +6 -6
- package/dist/{chunk-VHXOCDZ2.js.map → chunk-FROQPADA.js.map} +1 -1
- package/dist/{chunk-UGE57OTX.js → chunk-GWSJQSQE.js} +11 -8
- package/dist/chunk-GWSJQSQE.js.map +1 -0
- package/dist/chunk-XXNK4N7Z.js +683 -0
- package/dist/chunk-XXNK4N7Z.js.map +1 -0
- package/dist/chunk-ZOMUTU7J.js +249 -0
- package/dist/chunk-ZOMUTU7J.js.map +1 -0
- package/dist/{curvature-PkoLduGc.d.ts → curvature-CDOI32hv.d.ts} +46 -3
- package/dist/curves/index.d.ts +2 -2
- package/dist/curves/index.js +4 -4
- package/dist/index.d.ts +172 -45
- package/dist/index.js +244 -178
- package/dist/index.js.map +1 -1
- package/dist/nd/index.d.ts +28 -1
- package/dist/nd/index.js +27 -675
- package/dist/nd/index.js.map +1 -1
- package/dist/{path-BW8d_2RY.d.ts → path-t80OoJnM.d.ts} +11 -0
- package/dist/tessellate/index.d.ts +11 -4
- package/dist/tessellate/index.js +4 -4
- package/dist/warp/index.d.ts +1 -1
- package/dist/warp/index.js +238 -64
- package/dist/warp/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-2PKPKU4P.js.map +0 -1
- package/dist/chunk-B53BERKG.js.map +0 -1
- package/dist/chunk-Q66NA2FU.js.map +0 -1
- package/dist/chunk-STGSBIOL.js +0 -152
- package/dist/chunk-STGSBIOL.js.map +0 -1
- package/dist/chunk-UGE57OTX.js.map +0 -1
- package/dist/chunk-YPWFGFQX.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { f as
|
|
3
|
-
import {
|
|
4
|
-
export {
|
|
1
|
+
import { A as Affine, a as AnchorSet, P as PenAnchor, b as SpiroPoint, S as SpiroKind, c as Scale2 } from './curvature-CDOI32hv.js';
|
|
2
|
+
export { d as AnchorRect, e as CombTooth, f as CurvatureCombOptions, C as CurvatureSource, E as EulerFit, g as EulerSegment, h as SPIRO_KINDS, i as SegmentComb, j as SegmentHit, k as SpiroSegment, l as anchorAt, m as anchorCount, n as anchorsInRect, o as anchorsToPath, p as applyToPoint, q as boxToBox, r as combTeeth, s as countPathAnchors, t as cubicCurvatureAt, u as cubicCurvatureSource, v as cubicDerivativeAt, w as curvatureComb, x as deleteAnchorsAt, y as editAnchorSet, z as eulerAngleAt, B as eulerCurvatureAt, D as eulerCurvatureDerivativesAt, F as eulerPointAt, G as fitEulerSegment, H as flatAnchorIndex, I as identity, J as insertAnchorOnSegment, K as invert, L as isAnchorSmooth, M as isSpiroKind, N as isStraightSegment, O as locateAnchor, Q as moveHandleTo, R as multiply, T as nearestSegmentT, U as openSubpathAt, V as pathToAnchors, W as placeEulerSegment, X as pxExtent, Y as pxExtentInFrame, Z as rotate, _ as rotateAboutPoint, $ as scale, a0 as scaleDelta, a1 as screenAngleOf, a2 as segmentAt, a3 as segmentEnds, a4 as solveSpiro, a5 as standoff, a6 as transformCoords, a7 as translate, a8 as translateAnchorBy, a9 as withinPxBox, aa as withinPxRadius } from './curvature-CDOI32hv.js';
|
|
3
|
+
import { b as Point, a as Path, c as PathOpenFill, P as PolygonPath, d as PathFillRule, R as RectPath, C as CornerSpec, e as CornerPiece } from './path-t80OoJnM.js';
|
|
4
|
+
export { f as CORNER_FIT_TOLERANCE, g as CORNER_KEYWORDS, h as CornerKeyword, i as CornerShape, j as CornerShapeFrame, k as compactCorners, l as cornerAt, m as cornerCenter, n as cornerKeywordOf, o as cornerShapeK, p as cornerShapePieces, q as cornerShapePoint, r as cornerSpecAt, s as cubicPointAt, t as hasCorners, u as isCornerShape, v as lerpCorners, w as nextCornerShape, x as scaleCorners, y as splitCubicAtT, z as withCorner, A as withoutCorners } from './path-t80OoJnM.js';
|
|
5
5
|
export { P as PORT_REACH } from './portCurve-C5HDWuuV.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -70,37 +70,6 @@ declare const ZOOM_FLOOR = 1e-9;
|
|
|
70
70
|
*/
|
|
71
71
|
declare function normalizeZoom(zoom: number): number;
|
|
72
72
|
|
|
73
|
-
/** `[a, b, c, d, e, f]`: `x' = a·x + c·y + e`, `y' = b·x + d·y + f`. */
|
|
74
|
-
type Affine = readonly [number, number, number, number, number, number];
|
|
75
|
-
/** The transform that leaves a point where it is. */
|
|
76
|
-
declare function identity$1(): Affine;
|
|
77
|
-
/** A pure translation by `(tx, ty)`. */
|
|
78
|
-
declare function translate(tx: number, ty: number): Affine;
|
|
79
|
-
/** A pure scale about the origin. Scale about another point by composing
|
|
80
|
-
* translate → scale → inverse translate with `multiply`. */
|
|
81
|
-
declare function scale(sx: number, sy: number): Affine;
|
|
82
|
-
/** A pure rotation about the origin, in radians, clockwise in canvas
|
|
83
|
-
* coordinates (y down). */
|
|
84
|
-
declare function rotate(rad: number): Affine;
|
|
85
|
-
/** Compose: result applies `n` first, then `m` (m·n). */
|
|
86
|
-
declare function multiply$1(m: Affine, n: Affine): Affine;
|
|
87
|
-
/** Inverse, or null when the matrix is singular, non-finite, or too
|
|
88
|
-
* ill-conditioned to invert meaningfully at its own scale. */
|
|
89
|
-
declare function invert$1(m: Affine): Affine | null;
|
|
90
|
-
/** Apply to a point, returning a tuple. Cold-path use; hot loops inline. */
|
|
91
|
-
declare function applyToPoint(m: Affine, x: number, y: number): [number, number];
|
|
92
|
-
/** Affine that maps source box (sx,sy,sw,sh) onto destination box (dx,dy,dw,dh). */
|
|
93
|
-
declare function boxToBox(sx: number, sy: number, sw: number, sh: number, dx: number, dy: number, dw: number, dh: number): Affine;
|
|
94
|
-
/** Rotation by `rad` about pivot (cx,cy): translate(c)·rotate·translate(-c). */
|
|
95
|
-
declare function rotateAboutPoint(cx: number, cy: number, rad: number): Affine;
|
|
96
|
-
/**
|
|
97
|
-
* Apply an affine to an interleaved coord stream, returning a fresh f64
|
|
98
|
-
* buffer. Command codes are unaffected — for a Bezier the transformed control
|
|
99
|
-
* points define the transformed curve exactly (affine invariance), so callers
|
|
100
|
-
* pass `path.coords` straight through and keep `path.commands` as-is.
|
|
101
|
-
*/
|
|
102
|
-
declare function transformCoords(coords: ArrayLike<number>, m: Affine): Float64Array;
|
|
103
|
-
|
|
104
73
|
/** Axis-aligned box as [minX, minY, maxX, maxY]. */
|
|
105
74
|
type Box = readonly [number, number, number, number];
|
|
106
75
|
/** An axis-aligned rectangle in object form. `Box` is the tuple form; this is
|
|
@@ -413,7 +382,8 @@ declare function pathShape(path: Path, options?: {
|
|
|
413
382
|
}): PathTrackShape | null;
|
|
414
383
|
|
|
415
384
|
/** A station as a run places an item: `normal` is the item's up after any flip, `tangent` its reading direction,
|
|
416
|
-
* `angle` the CSS rotation in degrees that tips an upright item to
|
|
385
|
+
* `angle` the CSS rotation in degrees that tips an upright item to the place (0 = upright, clockwise positive, in
|
|
386
|
+
* (-180, 180]). Read right to left, `tangent` points against the direction `angle` turns an item's own left to right. */
|
|
417
387
|
interface TrackPlace extends TrackStation {
|
|
418
388
|
angle: number;
|
|
419
389
|
/** True when `normal` points down the screen, so an item tipped by `angle` reads upside down. A run is turned over
|
|
@@ -432,7 +402,12 @@ interface TrackRun extends TrackShape {
|
|
|
432
402
|
readonly flipped: boolean;
|
|
433
403
|
/** True when reading order runs against the shape's own direction. */
|
|
434
404
|
readonly reversed: boolean;
|
|
405
|
+
/** The inline direction it reads in, from {@link TrackRunOptions.direction}. */
|
|
406
|
+
readonly direction: 'ltr' | 'rtl';
|
|
435
407
|
at(g: number, options?: TrackAtOptions): TrackPlace;
|
|
408
|
+
/** The shape fraction reading fraction `g` falls at, unclamped: `from` at g = 0 and `to` at g = 1, or the other way
|
|
409
|
+
* round when the run is `reversed`. */
|
|
410
|
+
toShape(g: number): number;
|
|
436
411
|
}
|
|
437
412
|
/** Which side of a shape a run's items stand on: `'auto'` whichever is upright, `'path'` the shape's own normal, `'flipped'`
|
|
438
413
|
* the other. */
|
|
@@ -443,9 +418,12 @@ interface TrackRunOptions {
|
|
|
443
418
|
side?: TrackSide;
|
|
444
419
|
/** The shape fraction `'auto'` judges the side at. Default the run's middle, `(from + to) / 2`. */
|
|
445
420
|
about?: number;
|
|
421
|
+
/** The inline direction items read in on the side the run stands on: `'rtl'` starts the run at its right end. Each
|
|
422
|
+
* item still stands as it would read left to right. Default `'ltr'`. */
|
|
423
|
+
direction?: 'ltr' | 'rtl';
|
|
446
424
|
}
|
|
447
425
|
/** The stretch `from..to` (default the whole shape) as items read it: on the side `options.side` picks, reversed to read
|
|
448
|
-
* left to right on that side. */
|
|
426
|
+
* left to right on that side, or right to left under `options.direction: 'rtl'`. */
|
|
449
427
|
declare function trackRun(shape: TrackShape, from?: number, to?: number, options?: TrackRunOptions): TrackRun;
|
|
450
428
|
|
|
451
429
|
/** SVG path data for the stretch `from..to` of a shape: a segment for a line, true arcs for an arc or an ellipse, else a
|
|
@@ -562,15 +540,15 @@ declare function flattenQuadratic(x0: number, y0: number, x1: number, y1: number
|
|
|
562
540
|
* Like `flattenCubic` but also appends to `arcOut`, for each new flattened
|
|
563
541
|
* point, its *cumulative distance from the segment start* — not a normalized
|
|
564
542
|
* fraction. The caller divides each by the segment's total flattened arc
|
|
565
|
-
* length to yield t ∈ (0, 1]. `
|
|
566
|
-
*
|
|
543
|
+
* length to yield t ∈ (0, 1]. With `offset`, each piece is also fine enough
|
|
544
|
+
* that edges that far out from it stay within the tolerance.
|
|
567
545
|
*/
|
|
568
|
-
declare function flattenCubicWithArcLen(x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, tolerance: number, out: number[], arcOut: number[],
|
|
546
|
+
declare function flattenCubicWithArcLen(x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, tolerance: number, out: number[], arcOut: number[], offset?: number): number;
|
|
569
547
|
/** Flatten a quadratic bezier into line segments within `tolerance`, appending
|
|
570
548
|
* points to `out` and their cumulative arc lengths to `arcOut`. The arc
|
|
571
549
|
* lengths are what lets per-anchor color and dash phase be interpolated
|
|
572
550
|
* evenly along the curve rather than per segment. */
|
|
573
|
-
declare function flattenQuadraticWithArcLen(x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, tolerance: number, out: number[], arcOut: number[],
|
|
551
|
+
declare function flattenQuadraticWithArcLen(x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, tolerance: number, out: number[], arcOut: number[], offset?: number): number;
|
|
574
552
|
|
|
575
553
|
/**
|
|
576
554
|
* Even-odd ray-cast point-in-polygon over an interleaved, unclosed contour
|
|
@@ -617,6 +595,8 @@ declare class PathBuilder {
|
|
|
617
595
|
private cmds;
|
|
618
596
|
private xs;
|
|
619
597
|
private fillRule;
|
|
598
|
+
private origin;
|
|
599
|
+
private auto;
|
|
620
600
|
/** Seed a builder with an existing `PolygonPath`. Useful for extending
|
|
621
601
|
* an in-flight path with another segment (e.g. appending a cubic to
|
|
622
602
|
* the end of a curve in response to a user action) without hand-
|
|
@@ -627,6 +607,21 @@ declare class PathBuilder {
|
|
|
627
607
|
* ```
|
|
628
608
|
*/
|
|
629
609
|
static fromPath(path: PolygonPath): PathBuilder;
|
|
610
|
+
/**
|
|
611
|
+
* Measure the coords from `(x, y)`, which the built path carries as its
|
|
612
|
+
* `origin`: every point given before or after this call is still in the
|
|
613
|
+
* path's own space, and is stored as its offset from the origin, taken in
|
|
614
|
+
* doubles. Far from 0, an origin beside the shape is what keeps its
|
|
615
|
+
* coordinates' fractions.
|
|
616
|
+
*/
|
|
617
|
+
setOrigin(x: number, y: number): this;
|
|
618
|
+
/**
|
|
619
|
+
* At `build`, if no origin was set, measure the coords from the one
|
|
620
|
+
* `originFor` picks for them: none while they stay within
|
|
621
|
+
* `ORIGIN_THRESHOLD` of 0. For a producer whose points may land far out.
|
|
622
|
+
*/
|
|
623
|
+
autoOrigin(): this;
|
|
624
|
+
private push;
|
|
630
625
|
setFillRule(rule: PathFillRule): this;
|
|
631
626
|
moveTo(x: number, y: number): this;
|
|
632
627
|
lineTo(x: number, y: number): this;
|
|
@@ -692,6 +687,55 @@ declare function linePath(a: {
|
|
|
692
687
|
*/
|
|
693
688
|
declare function boundsOfPath(path: Path): RectPath;
|
|
694
689
|
|
|
690
|
+
/**
|
|
691
|
+
* A polygon path's coords read in the path's own space: each pair plus
|
|
692
|
+
* `PolygonPath.origin`, added in doubles. Every reader that answers in that
|
|
693
|
+
* space (hit tests, anchors, booleans, SVG data) reads through here.
|
|
694
|
+
*/
|
|
695
|
+
|
|
696
|
+
/** The point `path`'s coords are measured from: `(0, 0)` when it has none. */
|
|
697
|
+
declare function originOf(path: PolygonPath): {
|
|
698
|
+
readonly x: number;
|
|
699
|
+
readonly y: number;
|
|
700
|
+
};
|
|
701
|
+
/** Coordinate pair `i` of `path` (coords `2i`, `2i + 1`) in the path's own space. */
|
|
702
|
+
declare function pathPoint(path: PolygonPath, i: number): Point;
|
|
703
|
+
/**
|
|
704
|
+
* `path.coords` in the path's own space, in doubles: the coords themselves
|
|
705
|
+
* when the path has no origin, else a `Float64Array` of each pair plus it.
|
|
706
|
+
*/
|
|
707
|
+
declare function worldCoords(path: PolygonPath): Float32Array | Float64Array;
|
|
708
|
+
/** `xy`, interleaved pairs measured from `path`'s origin, moved into the
|
|
709
|
+
* path's own space in place: for a reader that derived offsets from the coords. */
|
|
710
|
+
declare function addOrigin<T extends {
|
|
711
|
+
[i: number]: number;
|
|
712
|
+
readonly length: number;
|
|
713
|
+
}>(path: PolygonPath, xy: T): T;
|
|
714
|
+
/** `world`, interleaved pairs in a path's own space, as the float32 coords
|
|
715
|
+
* of a path measured from `origin`: the inverse of {@link worldCoords}. */
|
|
716
|
+
declare function coordsFrom(origin: {
|
|
717
|
+
readonly x: number;
|
|
718
|
+
readonly y: number;
|
|
719
|
+
} | undefined, world: ArrayLike<number>): Float32Array;
|
|
720
|
+
/**
|
|
721
|
+
* How far from 0 a coordinate may sit before a producer that picks its own
|
|
722
|
+
* origin (`PathBuilder.autoOrigin`, `transformPath`'s `autoOrigin`) gives the
|
|
723
|
+
* path one: 2^14. Past it a float32 coordinate's step is 1/512 world unit or
|
|
724
|
+
* coarser, so its rounding reaches 1/16 px at 64x zoom; inside it, paths in a
|
|
725
|
+
* document near 0 stay as they always were.
|
|
726
|
+
*/
|
|
727
|
+
declare const ORIGIN_THRESHOLD = 16384;
|
|
728
|
+
/** The origin a path through the interleaved pairs `xy` is measured from: none
|
|
729
|
+
* while every coordinate is within {@link ORIGIN_THRESHOLD} of 0, else the
|
|
730
|
+
* center of their bounds, rounded to whole units. */
|
|
731
|
+
declare function originFor(xy: ArrayLike<number>): {
|
|
732
|
+
x: number;
|
|
733
|
+
y: number;
|
|
734
|
+
} | undefined;
|
|
735
|
+
/** `parts` as one `'nonzero'` compound path, measured from the first part's
|
|
736
|
+
* origin: a part measured from another is re-measured from it in doubles. */
|
|
737
|
+
declare function joinPaths(parts: readonly PolygonPath[]): PolygonPath;
|
|
738
|
+
|
|
695
739
|
/**
|
|
696
740
|
* Corner expansion: a path's corner specs turned into the plain geometry
|
|
697
741
|
* that every reader draws, hits, bounds, and exports.
|
|
@@ -854,8 +898,17 @@ declare function scalePathToBounds(path: Path, target: RectPath): Path;
|
|
|
854
898
|
*
|
|
855
899
|
* Axis-aligned maps (no rotation/shear: `m[1]` and `m[2]` within 1e-9 of 0) keep a
|
|
856
900
|
* `RectPath` a rect, normalizing negative extent (mirror). Rotation or
|
|
857
|
-
* shear promotes the rect's four corners to a `PolygonPath`.
|
|
858
|
-
|
|
901
|
+
* shear promotes the rect's four corners to a `PolygonPath`.
|
|
902
|
+
*
|
|
903
|
+
* A polygon that had no origin and lands past `ORIGIN_THRESHOLD` is measured
|
|
904
|
+
* from the one `originFor` picks, so the map's doubles survive the float32
|
|
905
|
+
* coords; `autoOrigin: false` keeps it origin-free. */
|
|
906
|
+
declare function transformPath(path: Path, m: Affine, opts?: TransformPathOptions): Path;
|
|
907
|
+
/** Options for {@link transformPath}. */
|
|
908
|
+
interface TransformPathOptions {
|
|
909
|
+
/** Give a far-out result with no origin one. Default true. */
|
|
910
|
+
autoOrigin?: boolean;
|
|
911
|
+
}
|
|
859
912
|
|
|
860
913
|
/**
|
|
861
914
|
* Translation-only compose/decompose for `Path` poses, the analog of
|
|
@@ -932,7 +985,8 @@ declare function reversePath(path: PolygonPath): PolygonPath;
|
|
|
932
985
|
* command letters are skipped (and reported via `onWarn` when provided); the
|
|
933
986
|
* builder still returns whatever valid commands preceded them. Data that does
|
|
934
987
|
* not begin with a moveto builds an empty path, and a command with the wrong
|
|
935
|
-
* number of arguments ends the path before it, as SVG renders both.
|
|
988
|
+
* number of arguments ends the path before it, as SVG renders both. Data that
|
|
989
|
+
* reaches past `ORIGIN_THRESHOLD` builds a path measured from an origin.
|
|
936
990
|
*/
|
|
937
991
|
declare function pathFromD(d: string, onWarn?: (message: string) => void): ReturnType<PathBuilder['build']>;
|
|
938
992
|
|
|
@@ -1109,6 +1163,72 @@ declare function stationsAlongPath(path: Path, opts?: RepeatAlongPathOptions): R
|
|
|
1109
1163
|
*/
|
|
1110
1164
|
declare function repeatAlongPath(shape: Path, path: Path, opts?: RepeatAlongPathOptions): Path[];
|
|
1111
1165
|
|
|
1166
|
+
/**
|
|
1167
|
+
* Roughen a path: every point of its outline moved by a random offset, after
|
|
1168
|
+
* evenly spaced points are added to each segment. The offsets come from a
|
|
1169
|
+
* seed, so the same path and options always roughen the same way.
|
|
1170
|
+
*/
|
|
1171
|
+
|
|
1172
|
+
/** How a path is roughened. */
|
|
1173
|
+
interface RoughenPathOptions {
|
|
1174
|
+
/** The largest offset on each axis, in the path's units. */
|
|
1175
|
+
size: number;
|
|
1176
|
+
/** Points added to each segment before roughening. Default 4. */
|
|
1177
|
+
detail?: number;
|
|
1178
|
+
/** Picks the offsets. Default 0. */
|
|
1179
|
+
seed?: number;
|
|
1180
|
+
}
|
|
1181
|
+
/**
|
|
1182
|
+
* `path` with each point of its outline, anchors and the `detail` points added
|
|
1183
|
+
* between them, moved by up to `size` on each axis, joined by straight
|
|
1184
|
+
* segments. A `size` of zero or less answers `path` itself.
|
|
1185
|
+
*/
|
|
1186
|
+
declare function roughenPath(path: Path, opts: RoughenPathOptions): Path;
|
|
1187
|
+
|
|
1188
|
+
/**
|
|
1189
|
+
* Zigzag a path: evenly spaced points laid along each segment, and every
|
|
1190
|
+
* point of the outline pushed alternately to one side of it and the other.
|
|
1191
|
+
*/
|
|
1192
|
+
|
|
1193
|
+
/** How a path is zigzagged. */
|
|
1194
|
+
interface ZigzagPathOptions {
|
|
1195
|
+
/** How far each point is pushed off the outline, in the path's units. */
|
|
1196
|
+
size: number;
|
|
1197
|
+
/** Points added to each segment. Default 4. */
|
|
1198
|
+
ridges?: number;
|
|
1199
|
+
/** Run a curve through the pushed points instead of meeting at sharp
|
|
1200
|
+
* corners there. Default `false`. */
|
|
1201
|
+
smooth?: boolean;
|
|
1202
|
+
}
|
|
1203
|
+
/**
|
|
1204
|
+
* `path` with `ridges` points added to each segment and every point, anchors
|
|
1205
|
+
* included, pushed `size` along the outline's normal, the side alternating
|
|
1206
|
+
* from one point to the next. A `size` of zero answers `path` itself.
|
|
1207
|
+
*/
|
|
1208
|
+
declare function zigzagPath(path: Path, opts: ZigzagPathOptions): Path;
|
|
1209
|
+
|
|
1210
|
+
/**
|
|
1211
|
+
* Pucker or bloat a path: pull its anchors toward the center of its bounds
|
|
1212
|
+
* and push its handles away, or the reverse.
|
|
1213
|
+
*/
|
|
1214
|
+
|
|
1215
|
+
/** How far a path is puckered or bloated. */
|
|
1216
|
+
interface PuckerBloatPathOptions {
|
|
1217
|
+
/**
|
|
1218
|
+
* A fraction of each handle's distance from the center. Positive bloats:
|
|
1219
|
+
* handles move that far away from the center, anchors half as far toward
|
|
1220
|
+
* it, so segments bulge outward. Negative puckers: handles move toward the
|
|
1221
|
+
* center and anchors away, so the anchors become spikes.
|
|
1222
|
+
*/
|
|
1223
|
+
amount: number;
|
|
1224
|
+
}
|
|
1225
|
+
/**
|
|
1226
|
+
* `path` puckered or bloated about the center of its bounds. A straight
|
|
1227
|
+
* segment moves as a curve with its handles a third of the way along from
|
|
1228
|
+
* each end. An `amount` of zero answers `path` itself.
|
|
1229
|
+
*/
|
|
1230
|
+
declare function puckerBloatPath(path: Path, opts: PuckerBloatPathOptions): Path;
|
|
1231
|
+
|
|
1112
1232
|
/**
|
|
1113
1233
|
* Pure-geometry distance from a point to a path's boundary (stroke), with
|
|
1114
1234
|
* no fill-side logic. Used by pickers that want to know "how close is this
|
|
@@ -2203,6 +2323,13 @@ declare function poseLinearOf(pose: unknown): PoseLinear | null;
|
|
|
2203
2323
|
* the step.
|
|
2204
2324
|
*/
|
|
2205
2325
|
declare function poseFrameOf(pose: unknown): Affine | null;
|
|
2326
|
+
/**
|
|
2327
|
+
* The matrix taking a point in the box's own coordinates, with their origin
|
|
2328
|
+
* on its corner and their axes along its own, to where the node draws it:
|
|
2329
|
+
* what a container's children are laid out in when its pose is a frame.
|
|
2330
|
+
* `null` when the pose is not a box.
|
|
2331
|
+
*/
|
|
2332
|
+
declare function boxFrameOf(pose: unknown): Affine | null;
|
|
2206
2333
|
/**
|
|
2207
2334
|
* The inverse of {@link poseFrameOf}: where a parent-frame point falls in the
|
|
2208
2335
|
* pose's unrotated box frame. `null` when there is no frame to undo, or when
|
|
@@ -3105,4 +3232,4 @@ declare function reviveTypedArrays(value: unknown): unknown;
|
|
|
3105
3232
|
/** `tagTypedArrays` as a `JSON.stringify` replacer. */
|
|
3106
3233
|
declare function typedArrayReplacer(_key: string, value: unknown): unknown;
|
|
3107
3234
|
|
|
3108
|
-
export { ANCHOR_FIELDS,
|
|
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 };
|