@weasel-js/geom 1.11.1 → 1.13.0-rc.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/booleans/index.js +2 -2
- package/dist/{chunk-EAKE3N7W.js → chunk-2PKPKU4P.js} +178 -178
- package/dist/chunk-2PKPKU4P.js.map +1 -0
- package/dist/{chunk-6FGQML7D.js → chunk-STGSBIOL.js} +3 -3
- package/dist/{chunk-6FGQML7D.js.map → chunk-STGSBIOL.js.map} +1 -1
- package/dist/{chunk-LRVPK7HI.js → chunk-UGE57OTX.js} +3 -3
- package/dist/{chunk-LRVPK7HI.js.map → chunk-UGE57OTX.js.map} +1 -1
- package/dist/{chunk-7F66PQCJ.js → chunk-VHXOCDZ2.js} +3 -3
- package/dist/{chunk-7F66PQCJ.js.map → chunk-VHXOCDZ2.js.map} +1 -1
- package/dist/{chunk-4Y67BZL5.js → chunk-YPWFGFQX.js} +3 -3
- package/dist/{chunk-4Y67BZL5.js.map → chunk-YPWFGFQX.js.map} +1 -1
- package/dist/index.d.ts +262 -56
- package/dist/index.js +663 -180
- package/dist/index.js.map +1 -1
- package/dist/nd/index.d.ts +40 -1
- package/dist/nd/index.js +681 -1
- package/dist/nd/index.js.map +1 -1
- package/dist/tessellate/index.js +3 -3
- package/dist/warp/index.js +3 -3
- package/package.json +2 -2
- package/dist/chunk-EAKE3N7W.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
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-BW8d_2RY.js';
|
|
2
2
|
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-BW8d_2RY.js';
|
|
3
3
|
import { A as AnchorSet, P as PenAnchor, a as SpiroPoint, S as SpiroKind, b as Scale2 } from './curvature-PkoLduGc.js';
|
|
4
4
|
export { c as AnchorRect, d as CombTooth, e as CurvatureCombOptions, C as CurvatureSource, E as EulerFit, f as EulerSegment, g as SPIRO_KINDS, h as SegmentComb, i as SegmentHit, j as SpiroSegment, k as anchorAt, l as anchorCount, m as anchorsInRect, n as anchorsToPath, o as combTeeth, p as countPathAnchors, q as cubicCurvatureAt, r as cubicCurvatureSource, s as cubicDerivativeAt, t as curvatureComb, u as deleteAnchorsAt, v as editAnchorSet, w as eulerAngleAt, x as eulerCurvatureAt, y as eulerCurvatureDerivativesAt, z as eulerPointAt, B as fitEulerSegment, D as flatAnchorIndex, F as insertAnchorOnSegment, G as isAnchorSmooth, H as isSpiroKind, I as isStraightSegment, J as locateAnchor, K as moveHandleTo, L as nearestSegmentT, M as openSubpathAt, N as pathToAnchors, O as placeEulerSegment, Q as pxExtent, R as scaleDelta, T as screenAngleOf, U as segmentAt, V as segmentEnds, W as solveSpiro, X as standoff, Y as translateAnchorBy, Z as withinPxBox, _ as withinPxRadius } from './curvature-PkoLduGc.js';
|
|
@@ -262,6 +262,266 @@ declare function nearestOnQuadratic(px: number, py: number, x0: number, y0: numb
|
|
|
262
262
|
*/
|
|
263
263
|
declare function nearestOnPath(commands: ArrayLike<number>, coords: ArrayLike<number>, px: number, py: number): PathNearest | null;
|
|
264
264
|
|
|
265
|
+
/**
|
|
266
|
+
* A path measured once by arc length, so many stations along it cost a binary
|
|
267
|
+
* search each rather than a fresh flatten: what `pointAlongPath` answers one
|
|
268
|
+
* fraction at a time, and what anything placing or bending geometry along a
|
|
269
|
+
* path reads many times over.
|
|
270
|
+
*/
|
|
271
|
+
|
|
272
|
+
/** A point on a path and its heading there. */
|
|
273
|
+
interface PathStation {
|
|
274
|
+
point: Point;
|
|
275
|
+
/** Unit vector along the path at `point`, pointing toward the end. */
|
|
276
|
+
tangent: Point;
|
|
277
|
+
}
|
|
278
|
+
/** Options for {@link measurePath}. */
|
|
279
|
+
interface MeasurePathOptions {
|
|
280
|
+
/** Curve flattening tolerance, in world units. Default 0.5. */
|
|
281
|
+
flattenTolerance?: number;
|
|
282
|
+
/** Keep a vertex that turns further than flattening at the tolerance could as a corner: `at`'s `smooth` heading then
|
|
283
|
+
* blends only across the vertices flattening made, and a straight edge heads along itself. Default false. */
|
|
284
|
+
keepCorners?: boolean;
|
|
285
|
+
}
|
|
286
|
+
/** The station on a path nearest a point. */
|
|
287
|
+
interface PathNearestStation extends PathStation {
|
|
288
|
+
/** Arc length at `point`, on the scale {@link PathMeasure.at} reads. */
|
|
289
|
+
s: number;
|
|
290
|
+
/** Distance from the queried point to `point`. */
|
|
291
|
+
dist: number;
|
|
292
|
+
}
|
|
293
|
+
/** A measured path: its length, and the station at any distance along it. */
|
|
294
|
+
interface PathMeasure {
|
|
295
|
+
/** Total arc length, every subpath counted in order. */
|
|
296
|
+
readonly length: number;
|
|
297
|
+
/** True when the path is a single closed contour, so a distance past the
|
|
298
|
+
* end can wrap round to the start. */
|
|
299
|
+
readonly closed: boolean;
|
|
300
|
+
/**
|
|
301
|
+
* The station `s` along the path, `s` clamped to `0..length`.
|
|
302
|
+
*
|
|
303
|
+
* The tangent is the heading of the flattened segment under `s`. With
|
|
304
|
+
* `smooth`, it is instead blended across each segment from the heading at
|
|
305
|
+
* one vertex to the next, so geometry bent along it turns without facets.
|
|
306
|
+
*/
|
|
307
|
+
at(s: number, smooth?: boolean): PathStation;
|
|
308
|
+
/**
|
|
309
|
+
* The inverse of `at`: the station nearest `p`. On a tie the earliest
|
|
310
|
+
* segment wins. The tangent is the heading of the segment holding it.
|
|
311
|
+
*/
|
|
312
|
+
nearest(p: Point): PathNearestStation;
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* Measure `path` by arc length. Subpaths are measured in order and treated as
|
|
316
|
+
* one run, the way a browser measures a whole `<path>`. Returns `null` for a
|
|
317
|
+
* path with no points; a path of zero length answers at its single point,
|
|
318
|
+
* heading along +X.
|
|
319
|
+
*/
|
|
320
|
+
declare function measurePath(path: Path, opts?: MeasurePathOptions): PathMeasure | null;
|
|
321
|
+
|
|
322
|
+
/** A station on a track, plus the side items stand on. */
|
|
323
|
+
interface TrackStation extends PathStation {
|
|
324
|
+
/** Unit vector the items stand on: away from an arc's center, left of travel on a line. */
|
|
325
|
+
normal: Point;
|
|
326
|
+
}
|
|
327
|
+
/** The nearest spot on a track to a point: its fraction along and the distance to it. */
|
|
328
|
+
interface TrackNearest {
|
|
329
|
+
f: number;
|
|
330
|
+
dist: number;
|
|
331
|
+
}
|
|
332
|
+
/** How `nearest` treats a track's ends. */
|
|
333
|
+
interface TrackNearestOptions {
|
|
334
|
+
/** Let `f` run on past 0 and 1: a line extends straight, an arc, an ellipse or a closed path round itself, unwrapped about
|
|
335
|
+
* `about`. A shape that cannot extend clamps. `dist` is to the track either way. */
|
|
336
|
+
open?: boolean;
|
|
337
|
+
/** Where along the track an open arc is unwrapped about, in the same terms as the `f` this `nearest` answers (a
|
|
338
|
+
* `TrackRun` reads it in reading order): a point is placed on whichever side of it is nearer by angle. Default 0.5,
|
|
339
|
+
* the middle. */
|
|
340
|
+
about?: number;
|
|
341
|
+
}
|
|
342
|
+
/** How `at` treats a fraction past 0 or 1. */
|
|
343
|
+
interface TrackAtOptions {
|
|
344
|
+
/** Carry on past the ends rather than clamp: a line and an open path straight along their end, an arc and an ellipse
|
|
345
|
+
* round themselves, a closed path round its contour. Default false. */
|
|
346
|
+
open?: boolean;
|
|
347
|
+
}
|
|
348
|
+
/** Which family a track shape belongs to. `'path'` is a shape over a measured `Path` (`pathShape`). */
|
|
349
|
+
type TrackShapeKind = 'line' | 'arc' | 'ellipse' | 'path';
|
|
350
|
+
/** A curve a control lies along, addressed by fraction 0..1 of its length. */
|
|
351
|
+
interface TrackShape {
|
|
352
|
+
readonly kind: TrackShapeKind;
|
|
353
|
+
readonly length: number;
|
|
354
|
+
/** True when the track's end meets its start: a whole circle or ellipse, or a path that is one closed contour. */
|
|
355
|
+
readonly closed: boolean;
|
|
356
|
+
/** The station at fraction `f`, clamped to 0..1 unless `options.open`. */
|
|
357
|
+
at(f: number, options?: TrackAtOptions): TrackStation;
|
|
358
|
+
/** The spot on the track nearest `p`. */
|
|
359
|
+
nearest(p: Point, options?: TrackNearestOptions): TrackNearest;
|
|
360
|
+
}
|
|
361
|
+
/** A straight track from `from` to `to`; its normal is the left of travel. */
|
|
362
|
+
declare function lineShape(from: Point, to: Point): TrackShape;
|
|
363
|
+
|
|
364
|
+
/** An arc track: degrees clockwise from 12 o'clock on a y-down plane. Equal `start` and `end` is a whole circle. */
|
|
365
|
+
interface ArcTrackSpec {
|
|
366
|
+
center: Point;
|
|
367
|
+
radius: number;
|
|
368
|
+
start: number;
|
|
369
|
+
end: number;
|
|
370
|
+
/** Which way the track runs from `start` to `end`. Default `'cw'`. */
|
|
371
|
+
direction?: 'cw' | 'ccw';
|
|
372
|
+
}
|
|
373
|
+
/** A track shape that remembers the arc it was built from, so path data can be drawn as arcs. */
|
|
374
|
+
type ArcTrackShape = TrackShape & {
|
|
375
|
+
readonly arc: ArcTrackSpec;
|
|
376
|
+
};
|
|
377
|
+
/** An arc track; its normal points away from the center, whichever way it runs. */
|
|
378
|
+
declare function arcShape(spec: ArcTrackSpec): ArcTrackShape;
|
|
379
|
+
|
|
380
|
+
/** An axis-aligned elliptical arc track. `start` and `end` are directions seen from the center, in degrees clockwise
|
|
381
|
+
* from 12 o'clock on a y-down plane, as an arc's are; equal `start` and `end` is the whole ellipse. */
|
|
382
|
+
interface EllipseTrackSpec {
|
|
383
|
+
center: Point;
|
|
384
|
+
/** Half the width. */
|
|
385
|
+
radiusX: number;
|
|
386
|
+
/** Half the height. */
|
|
387
|
+
radiusY: number;
|
|
388
|
+
start: number;
|
|
389
|
+
end: number;
|
|
390
|
+
/** Which way the track runs from `start` to `end`. Default `'cw'`. */
|
|
391
|
+
direction?: 'cw' | 'ccw';
|
|
392
|
+
}
|
|
393
|
+
/** A track shape that remembers the ellipse it was built from, so path data can be drawn as elliptical arcs. */
|
|
394
|
+
type EllipseTrackShape = TrackShape & {
|
|
395
|
+
readonly ellipse: EllipseTrackSpec;
|
|
396
|
+
};
|
|
397
|
+
/**
|
|
398
|
+
* An elliptical arc track, addressed by fraction of its length; its normal points away from the center, square to the
|
|
399
|
+
* ellipse, whichever way it runs. With equal radii it is `arcShape`'s arc.
|
|
400
|
+
*/
|
|
401
|
+
declare function ellipseShape(spec: EllipseTrackSpec): EllipseTrackShape;
|
|
402
|
+
|
|
403
|
+
/** A track shape that remembers the path it was built from, so path data can be drawn as the path itself. */
|
|
404
|
+
type PathTrackShape = TrackShape & {
|
|
405
|
+
readonly path: Path;
|
|
406
|
+
};
|
|
407
|
+
/**
|
|
408
|
+
* A track along any path, every subpath counted in order, addressed by fraction of its length. Its normal is the left of
|
|
409
|
+
* travel, as a line's is: outward on a contour drawn clockwise on screen. `null` for a path with no points.
|
|
410
|
+
*/
|
|
411
|
+
declare function pathShape(path: Path, options?: {
|
|
412
|
+
flattenTolerance?: number;
|
|
413
|
+
}): PathTrackShape | null;
|
|
414
|
+
|
|
415
|
+
/** 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 it (0 = upright, clockwise positive, in (-180, 180]). */
|
|
417
|
+
interface TrackPlace extends TrackStation {
|
|
418
|
+
angle: number;
|
|
419
|
+
/** True when `normal` points down the screen, so an item tipped by `angle` reads upside down. A run is turned over
|
|
420
|
+
* by one place alone, so one across 3 or 9 o'clock has turned places toward one end; an item that should read
|
|
421
|
+
* upright turns a half turn about its own center there. Nothing else in the place reflects it. */
|
|
422
|
+
turned: boolean;
|
|
423
|
+
}
|
|
424
|
+
/** The stretch `from..to` of a shape in reading order. It is itself a TrackShape: `at(g)` and `nearest(p).f` are
|
|
425
|
+
* in reading order, g = 0 at the reading start. */
|
|
426
|
+
interface TrackRun extends TrackShape {
|
|
427
|
+
readonly shape: TrackShape;
|
|
428
|
+
readonly from: number;
|
|
429
|
+
readonly to: number;
|
|
430
|
+
/** True when items stand on the shape's normal turned over: under `side: 'auto'`, when that normal points down the screen
|
|
431
|
+
* at `about`, so they stand upright. */
|
|
432
|
+
readonly flipped: boolean;
|
|
433
|
+
/** True when reading order runs against the shape's own direction. */
|
|
434
|
+
readonly reversed: boolean;
|
|
435
|
+
at(g: number, options?: TrackAtOptions): TrackPlace;
|
|
436
|
+
}
|
|
437
|
+
/** Which side of a shape a run's items stand on: `'auto'` whichever is upright, `'path'` the shape's own normal, `'flipped'`
|
|
438
|
+
* the other. */
|
|
439
|
+
type TrackSide = 'auto' | 'path' | 'flipped';
|
|
440
|
+
/** How {@link trackRun} reads a shape: which side of it is up, and where that is judged. */
|
|
441
|
+
interface TrackRunOptions {
|
|
442
|
+
/** Default `'auto'`. */
|
|
443
|
+
side?: TrackSide;
|
|
444
|
+
/** The shape fraction `'auto'` judges the side at. Default the run's middle, `(from + to) / 2`. */
|
|
445
|
+
about?: number;
|
|
446
|
+
}
|
|
447
|
+
/** 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. */
|
|
449
|
+
declare function trackRun(shape: TrackShape, from?: number, to?: number, options?: TrackRunOptions): TrackRun;
|
|
450
|
+
|
|
451
|
+
/** 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
|
|
452
|
+
* 64-step polyline. A whole path shape is its path's own data. */
|
|
453
|
+
declare function trackShapeD(shape: TrackShape, from?: number, to?: number): string;
|
|
454
|
+
|
|
455
|
+
/** Which way `shape` bends, against its own normal: 1 toward it, -1 away from it, 0 straight. A shape that bends both
|
|
456
|
+
* ways answers for the way it turns more in all. An arc and an ellipse bend away from their normal. */
|
|
457
|
+
declare function bendSide(shape: TrackShape): -1 | 0 | 1;
|
|
458
|
+
/**
|
|
459
|
+
* The track `shift` px along `shape`'s normal from it at every point — negative is against the normal — as a track
|
|
460
|
+
* of its own, addressed by fraction of its own length, its tangent and normal those of `shape` at the point it came
|
|
461
|
+
* from. Null when the shift reaches a center of curvature, where the track would fold back over itself: an arc shifted
|
|
462
|
+
* in by its radius or more.
|
|
463
|
+
*/
|
|
464
|
+
declare function shiftTrack(shape: TrackShape, shift: number): TrackShape | null;
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
* The stretch `from..to` of a shape (fractions of it, `from` below `to`) as a shape of its own, running the same way.
|
|
468
|
+
* An arc stays an arc and an ellipse an ellipse, so `trackShapeD` still draws it as one; any other shape is read through.
|
|
469
|
+
*/
|
|
470
|
+
declare function trackSlice(shape: TrackShape, from: number, to: number): TrackShape;
|
|
471
|
+
|
|
472
|
+
/** Where a sequence sits along a run: against its reading start, its middle, or its reading end. */
|
|
473
|
+
type RunAlign = 'start' | 'center' | 'end';
|
|
474
|
+
/** The order {@link placeAlongRun} lays items in: along the run's reading order, or from the end where the underlying
|
|
475
|
+
* shape's own direction starts. The two differ only on a run that is `reversed`. */
|
|
476
|
+
type RunOrder = 'reading' | 'track';
|
|
477
|
+
/** Where one item of a run falls: its center along the run, and how much of it lies past the run's ends. */
|
|
478
|
+
interface RunSpot {
|
|
479
|
+
center: number;
|
|
480
|
+
clipped: 'none' | 'part' | 'past';
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* Where each item's center falls along a run `room` px long, gaps measured along it. Without `at`, a sequence that fits
|
|
484
|
+
* sits as `align` says, and one that does not is laid from the start less `offset`. With `at`, the sequence's align
|
|
485
|
+
* point sits at `at - offset` whether or not it fits.
|
|
486
|
+
*/
|
|
487
|
+
declare function runPlaces(lengths: readonly number[], gap: number, room: number, align: RunAlign, offset: number, at?: number): RunSpot[];
|
|
488
|
+
/** How long items of `lengths` are laid end to end with `gap` between each two. */
|
|
489
|
+
declare function runLength(lengths: readonly number[], gap: number): number;
|
|
490
|
+
/** How {@link runStationAt} carries a place past either end of its run: straight along that end, tipped as it is there
|
|
491
|
+
* (`'extend'`), or on along the run's shape itself (`'follow'`), as a shape's `at` reads `open`. */
|
|
492
|
+
type RunPast = 'extend' | 'follow';
|
|
493
|
+
/** The place `distance` along `run`, carried past either end as `past` says (default `'extend'`). The point then moves
|
|
494
|
+
* `shift` along the place's up. */
|
|
495
|
+
declare function runStationAt(run: TrackRun, distance: number, shift?: number, past?: RunPast): TrackPlace;
|
|
496
|
+
/** How {@link placeAlongRun} lays its items: spacing, alignment, offset, anchor, stand-off, wrap and past-end handling. */
|
|
497
|
+
interface PlaceAlongRunOptions {
|
|
498
|
+
/** Space between each two items, along the run. Default 0. */
|
|
499
|
+
gap?: number;
|
|
500
|
+
/** Default `'center'`. */
|
|
501
|
+
align?: RunAlign;
|
|
502
|
+
/** How far the sequence is laid back along the run. Default 0. */
|
|
503
|
+
offset?: number;
|
|
504
|
+
/** Where along the run the sequence's align point sits, fitting or not; see {@link runPlaces}. */
|
|
505
|
+
at?: number;
|
|
506
|
+
/** How far each item stands off the run, along its up. Default 0. */
|
|
507
|
+
shift?: number;
|
|
508
|
+
/** Carry items on round a closed run past its seam, and count an item past once it is a whole lap on from the first
|
|
509
|
+
* item's start. Default false. */
|
|
510
|
+
wrap?: boolean;
|
|
511
|
+
/** Where an item past an end is placed: carried on straight beyond it (`'extend'`, the default), or on along the run's
|
|
512
|
+
* own shape (`'follow'`); `'hold'` follows the shape until the item is wholly past, then holds it at that end. */
|
|
513
|
+
past?: RunPast | 'hold';
|
|
514
|
+
/** `'reading'` (the default) lays item 1 at the run's reading start. `'track'` lays it at the shape's own start and
|
|
515
|
+
* proceeds in the shape's direction; items still stand as the run reads them. In `'track'` order `align`, `at`,
|
|
516
|
+
* `offset` and each `center` are measured from the shape's start. */
|
|
517
|
+
order?: RunOrder;
|
|
518
|
+
}
|
|
519
|
+
/** One item laid along a run: where its center falls and the place there. `center` is unwrapped. */
|
|
520
|
+
interface RunPlace extends RunSpot, TrackPlace {
|
|
521
|
+
}
|
|
522
|
+
/** Items of `lengths` laid end to end along `run`, each centered on its place and tipped to it. */
|
|
523
|
+
declare function placeAlongRun(run: TrackRun, lengths: readonly number[], options?: PlaceAlongRunOptions): RunPlace[];
|
|
524
|
+
|
|
265
525
|
/**
|
|
266
526
|
* The port-curve rule in the 2D kernel's currency: loose scalars, the way
|
|
267
527
|
* `cubicEvalAt` and `applyToPoint` take them. The rule itself lives in
|
|
@@ -688,60 +948,6 @@ declare function pathFromD(d: string, onWarn?: (message: string) => void): Retur
|
|
|
688
948
|
/** `path` as SVG path data. */
|
|
689
949
|
declare function pathToD(given: Path): string;
|
|
690
950
|
|
|
691
|
-
/**
|
|
692
|
-
* A path measured once by arc length, so many stations along it cost a binary
|
|
693
|
-
* search each rather than a fresh flatten: what `pointAlongPath` answers one
|
|
694
|
-
* fraction at a time, and what anything placing or bending geometry along a
|
|
695
|
-
* path reads many times over.
|
|
696
|
-
*/
|
|
697
|
-
|
|
698
|
-
/** A point on a path and its heading there. */
|
|
699
|
-
interface PathStation {
|
|
700
|
-
point: Point;
|
|
701
|
-
/** Unit vector along the path at `point`, pointing toward the end. */
|
|
702
|
-
tangent: Point;
|
|
703
|
-
}
|
|
704
|
-
/** Options for {@link measurePath}. */
|
|
705
|
-
interface MeasurePathOptions {
|
|
706
|
-
/** Curve flattening tolerance, in world units. Default 0.5. */
|
|
707
|
-
flattenTolerance?: number;
|
|
708
|
-
}
|
|
709
|
-
/** The station on a path nearest a point. */
|
|
710
|
-
interface PathNearestStation extends PathStation {
|
|
711
|
-
/** Arc length at `point`, on the scale {@link PathMeasure.at} reads. */
|
|
712
|
-
s: number;
|
|
713
|
-
/** Distance from the queried point to `point`. */
|
|
714
|
-
dist: number;
|
|
715
|
-
}
|
|
716
|
-
/** A measured path: its length, and the station at any distance along it. */
|
|
717
|
-
interface PathMeasure {
|
|
718
|
-
/** Total arc length, every subpath counted in order. */
|
|
719
|
-
readonly length: number;
|
|
720
|
-
/** True when the path is a single closed contour, so a distance past the
|
|
721
|
-
* end can wrap round to the start. */
|
|
722
|
-
readonly closed: boolean;
|
|
723
|
-
/**
|
|
724
|
-
* The station `s` along the path, `s` clamped to `0..length`.
|
|
725
|
-
*
|
|
726
|
-
* The tangent is the heading of the flattened segment under `s`. With
|
|
727
|
-
* `smooth`, it is instead blended across each segment from the heading at
|
|
728
|
-
* one vertex to the next, so geometry bent along it turns without facets.
|
|
729
|
-
*/
|
|
730
|
-
at(s: number, smooth?: boolean): PathStation;
|
|
731
|
-
/**
|
|
732
|
-
* The inverse of `at`: the station nearest `p`. On a tie the earliest
|
|
733
|
-
* segment wins. The tangent is the heading of the segment holding it.
|
|
734
|
-
*/
|
|
735
|
-
nearest(p: Point): PathNearestStation;
|
|
736
|
-
}
|
|
737
|
-
/**
|
|
738
|
-
* Measure `path` by arc length. Subpaths are measured in order and treated as
|
|
739
|
-
* one run, the way a browser measures a whole `<path>`. Returns `null` for a
|
|
740
|
-
* path with no points; a path of zero length answers at its single point,
|
|
741
|
-
* heading along +X.
|
|
742
|
-
*/
|
|
743
|
-
declare function measurePath(path: Path, opts?: MeasurePathOptions): PathMeasure | null;
|
|
744
|
-
|
|
745
951
|
/**
|
|
746
952
|
* A station along a path: where it is at a fraction of its length, and which
|
|
747
953
|
* way it is heading there.
|
|
@@ -2899,4 +3105,4 @@ declare function reviveTypedArrays(value: unknown): unknown;
|
|
|
2899
3105
|
/** `tagTypedArrays` as a `JSON.stringify` replacer. */
|
|
2900
3106
|
declare function typedArrayReplacer(_key: string, value: unknown): unknown;
|
|
2901
3107
|
|
|
2902
|
-
export { ANCHOR_FIELDS, type Affine, type AnchorField, type AnchorFieldValues, type AnchorPair, type AnchorPathMeasure, AnchorSet, type AnchorSubpathMeasure, type AnchorSymmetry, 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 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, 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 PathsEditItem, PenAnchor, 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 QuadraticCoords, type Rect, RectPath, type RepeatAlongPathOptions, type RepeatStation, type ResamplePathOptions, type ResolvedCorners, 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 TrimPathOptions, type TrimResult, type TypedArrayTag, type UnsatisfiedConstraintsOptions, type View, ZOOM_FLOOR, addExtremaAnchors, anchorOriginsOf, anchorSymmetries, anchorSymmetry, anchorsBefore, anchorsUnderBrush, anchorsWhere, applyToPoint, approxEq, asPolygonPath, averageAnchorsAt, balanceFactorToward, bendAlongPath, bendSegment, blendPaths, boundsOfCoords, boundsOfPath, boxContainsBox, boxContainsPoint, boxToBox, circlePath, clamp, clampRectWithin, closestOpenEnds, composePath, conflictingConstraints, constrainPathEdit, constrainPathsEdit, constraintAnchors, constraintApplies, constraintFits, convertSegments, 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, equalizeSegmentHandles, everyNthAnchor, extendToMeet, fillsOpenSubpaths, findPathSnap, findPathSnaps, fitAffine, fitCubicThroughDeletion, fitCubicWithTangents, flatIndexesAfterReverse, flattenCubic, flattenCubicWithArcLen, flattenQuadratic, flattenQuadraticWithArcLen, forEachSegment, growAnchorSelection, growRegion, handleAlongItsAngle, handleAtItsLength, handleBalances, harmonizeAnchors, hasOpenSubpath, identity$1 as identity, intersectSegments, invert$1 as invert, invertAnchorSelection, isSegmentStraight, joinAnchorsAt, joinSubpathEnds, keepCorners, len2, lengthToward, lengthenOpenEnd, lengthenPathEnd, linePath, linear, makeHandlesSymmetric, mapConstraintAnchors, mat3, meanScale, measureAnchorPath, measurePath, mergeRegion, moveHandleSymmetric, multiply$1 as multiply, nearestOnCubic, nearestOnLine, nearestOnPath, nearestOnQuadratic, nearestPathAnchor, normalizeZoom, offsetCornerTraces, openEndAt, openEndRay, openPathEnds, pathAnchorPoints, pathAwayFromAnchors, pathCommandCoordCount, pathContainsPoint, pathContainsPolygon, pathContainsRect, pathCrossings, pathDistanceToPoint, pathEndAnchorIndex, pathEndFrame, pathFromD, pathInPoseFrame, pathInWorld, pathIntersectsPolygon, pathIntersectsRect, pathSegments, pathSignedArea, pathThroughPoseFrame, pathToCubicContours, pathToD, placeRect, pointAlongPath, pointInPath, pointInPolygon, pointSegmentDist2, polygonContainsPath, polygonFromPoints, polygonIntersectsPath, polylineFromPoints, portControls, portCurvePoints, poseFrameInverseOf, poseFrameOf, poseLinearOf, poseRotationOf, prepareBlend, quadraticEvalAt, readAnchorFields, rectMarkerPath, rectPath, rectToContour, regularPolygonPath, remapAnchorValues, remapConstraints, remapPerAnchor, remapPointValues, repeatAlongPath, resamplePath, resolveCorners, resolveCornersWithSources, resolveEasing, restoreCorners, retractHandles, reverseAnchors, reversePath, reverseSubpaths, reviveTypedArrays, rotate, rotateAboutPoint, rotatePathAround, roundRectPath, scale, scalePathToBounds, scaleSegmentHandles, schneiderFit, segmentBetween, segmentExtremaTs, segmentsBetweenAnchors, segmentsCross, setDefaultOpenFill, setSubpathStart, 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, transformCoords, transformPath, translate, translateAnchorsSymmetric, translatePath, trimPathAt, typedArrayReplacer, unionBoundsPath, unionBox, unsatisfiedConstraints, untagTypedArray, viewToMat3, withAnchorPoints, worldEditToStorage, writeAnchorField };
|
|
3108
|
+
export { ANCHOR_FIELDS, type 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, 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 QuadraticCoords, type Rect, RectPath, type RepeatAlongPathOptions, type RepeatStation, type ResamplePathOptions, type ResolvedCorners, 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 TrimPathOptions, type TrimResult, type TypedArrayTag, type UnsatisfiedConstraintsOptions, type View, ZOOM_FLOOR, addExtremaAnchors, anchorOriginsOf, anchorSymmetries, anchorSymmetry, anchorsBefore, anchorsUnderBrush, anchorsWhere, applyToPoint, approxEq, arcShape, asPolygonPath, averageAnchorsAt, balanceFactorToward, bendAlongPath, bendSegment, bendSide, blendPaths, boundsOfCoords, boundsOfPath, boxContainsBox, boxContainsPoint, boxToBox, circlePath, clamp, clampRectWithin, closestOpenEnds, composePath, conflictingConstraints, constrainPathEdit, constrainPathsEdit, constraintAnchors, constraintApplies, constraintFits, convertSegments, 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, identity$1 as identity, intersectSegments, invert$1 as invert, invertAnchorSelection, isSegmentStraight, joinAnchorsAt, joinSubpathEnds, keepCorners, len2, lengthToward, lengthenOpenEnd, lengthenPathEnd, linePath, lineShape, linear, makeHandlesSymmetric, mapConstraintAnchors, mat3, meanScale, measureAnchorPath, measurePath, mergeRegion, moveHandleSymmetric, multiply$1 as multiply, nearestOnCubic, nearestOnLine, nearestOnPath, nearestOnQuadratic, nearestPathAnchor, normalizeZoom, offsetCornerTraces, openEndAt, openEndRay, openPathEnds, pathAnchorPoints, pathAwayFromAnchors, pathCommandCoordCount, pathContainsPoint, pathContainsPolygon, pathContainsRect, pathCrossings, pathDistanceToPoint, pathEndAnchorIndex, pathEndFrame, pathFromD, pathInPoseFrame, pathInWorld, pathIntersectsPolygon, pathIntersectsRect, pathSegments, pathShape, pathSignedArea, pathThroughPoseFrame, pathToCubicContours, pathToD, placeAlongRun, placeRect, pointAlongPath, pointInPath, pointInPolygon, pointSegmentDist2, polygonContainsPath, polygonFromPoints, polygonIntersectsPath, polylineFromPoints, portControls, portCurvePoints, poseFrameInverseOf, poseFrameOf, poseLinearOf, poseRotationOf, prepareBlend, quadraticEvalAt, readAnchorFields, rectMarkerPath, rectPath, rectToContour, regularPolygonPath, remapAnchorValues, remapConstraints, remapPerAnchor, remapPointValues, repeatAlongPath, resamplePath, resolveCorners, resolveCornersWithSources, resolveEasing, restoreCorners, retractHandles, reverseAnchors, reversePath, reverseSubpaths, reviveTypedArrays, rotate, rotateAboutPoint, rotatePathAround, roundRectPath, runLength, runPlaces, runStationAt, scale, 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, transformCoords, transformPath, translate, translateAnchorsSymmetric, translatePath, trimPathAt, typedArrayReplacer, unionBoundsPath, unionBox, unsatisfiedConstraints, untagTypedArray, viewToMat3, withAnchorPoints, worldEditToStorage, writeAnchorField };
|