@mark1russell7/layout-contract 0.10.1 → 0.10.2
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 +2 -0
- package/build/index.d.ts +116 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +243 -1
- package/build/index.js.map +1 -1
- package/package.json +1 -1
- package/src/geometry3.ts +260 -0
- package/src/index.ts +1 -0
package/README.md
CHANGED
|
@@ -9,6 +9,7 @@ The package has one runtime dependency: `@mark1russell7/rigor-generators`, the h
|
|
|
9
9
|
| Part | Exports |
|
|
10
10
|
|---|---|
|
|
11
11
|
| Geometry | `Point`, `Rect`, `Region`, `Side`, `Sides`, `Margin`, `marginSides`, `grow`, `boundsOf`, `regionArea`, `regionPerimeter`, `translate`, `overlapOf`, `segmentsCross`, `crossingPoint`, `pointSegmentDistance`, `Ring`, `pointInRing`, `pointInRings`, `convexCorners`, `convexOverlap`, `cornersInConvex`, `boxCenterDistance` |
|
|
12
|
+
| Geometry in 3D | `Point3`, `Box3`, `Rotation3`, `Transform3`, `ORIGIN3`, `NO_ROTATION3`, `NO_TRANSFORM3`, `addPoints3`, `subtractPoints3`, `scalePoint3`, `dot3`, `cross3`, `length3`, `distance3`, `rotationAbout`, `rotatePoint3`, `composeRotations3`, `inverseRotation3`, `normalizeRotation3`, `transformPoint3`, `composeTransforms3`, `inverseTransform3`, `transformMatrix4`, `box3Center`, `box3Volume`, `box3Corners`, `boundsOf3`, `transformedBounds3`, `overlapOf3` |
|
|
12
13
|
| The shape kinds | `ShapeKind`, `SHAPE_KINDS`, `SHAPE_KIND_IDS`, `ShapeKindSpec`, `ShapeGeometry`, `DEFAULT_SHAPES`, `ShapeSupport`, `ShapeBound`, `RuleLevel`, `ShapeLevel`, `ShapeCheck`, `isShapeKind`, `shapeKindOf`, `shapeKindsOf`, `itemShapeOf`, `shapeKindProblem`, `shapesOf`, `ruleLevel`, `shapeLevel`, `shapeSupportProblems`, `boxArea`, `checkShapes` |
|
|
13
14
|
| The input `layout-input/1` | `LayoutInput`, `LayoutBox` (`Item` for the packer), `Port`, `portPoint`, `LayoutEdge`, `LayoutContainer`, `Obstacle`, `LayoutCell`, `LayoutGenerator`, `PairGap`, `canonicalInput` |
|
|
14
15
|
| The packer | `PackInput`, `PackLink`, `toPackInput`, `packLinks`, `Placement`, `PackOutput`, `StageTrace`, `applyPack` |
|
|
@@ -114,6 +115,7 @@ The comments of the source name each doc as `docs/<NAME>.md`. The docs are in th
|
|
|
114
115
|
| [`docs/CELLS.md`](https://github.com/mark1russell7/layout-contract/blob/main/docs/CELLS.md) | The cell measures of a Voronoi treemap: the area error and the compactness of the cells |
|
|
115
116
|
| [`docs/CURVES.md`](https://github.com/mark1russell7/layout-contract/blob/main/docs/CURVES.md) | The Hilbert, Moore and Morton curves through a grid, as data |
|
|
116
117
|
| [`docs/FRAMES.md`](https://github.com/mark1russell7/layout-contract/blob/main/docs/FRAMES.md) | The frame record `layout-frame/1`, the frames between two layouts and their laws |
|
|
118
|
+
| [`docs/GEOMETRY-3D.md`](https://github.com/mark1russell7/layout-contract/blob/main/docs/GEOMETRY-3D.md) | The 3D records: points, boxes, rotations and rigid transforms |
|
|
117
119
|
| [`docs/TEXT.md`](https://github.com/mark1russell7/layout-contract/blob/main/docs/TEXT.md) | The text layout of the subpath `/text`: the rules, the units and the measures |
|
|
118
120
|
| [`docs/CORPUS.md`](https://github.com/mark1russell7/layout-contract/blob/main/docs/CORPUS.md) | The shared corpus registry, its dimensions and families |
|
|
119
121
|
| [`docs/CORPUS-CHECKS.md`](https://github.com/mark1russell7/layout-contract/blob/main/docs/CORPUS-CHECKS.md) | The corpus checks and the split files |
|
package/build/index.d.ts
CHANGED
|
@@ -1,5 +1,121 @@
|
|
|
1
1
|
import { $ as CorpusEntry, A as shapeKindsOf, At as convexCorners, B as LayoutInput, Bt as pointSegmentDistance, C as checkShapes, Ct as SIDES, D as ruleLevel, Dt as boundsOf, E as itemShapeOf, Et as SizedRect, F as LayoutBox, Ft as grow, G as PairGap, Gt as segmentsCross, H as PackInput, Ht as regionPerimeter, I as LayoutCell, It as marginSides, J as canonicalInput, Jt as toSizedRect, K as Port, Kt as snapRect, L as LayoutContainer, Lt as overlapOf, M as shapeSupportProblems, Mt as cornersInConvex, N as shapesOf, Nt as crossingPoint, O as shapeKindOf, Ot as boxCenterDistance, P as Item, Pt as dropIndex, Q as ClaimBreak, R as LayoutEdge, Rt as pointInRing, S as boxArea, St as Ring, T as isShapeKind, Tt as Sides, U as PackInputOptions, Ut as ringCentroid, V as Obstacle, Vt as regionArea, W as PackLink, Wt as scaleRect, X as portPoint, Y as packLinks, Yt as translate, Z as toPackInput, _ as ShapeKind, _t as splitFolds, a as MeasureSpec, at as FamilyCell, b as ShapeLimit, bt as Rect, c as minEffectOf, ct as SplitFold, d as SHAPE_KINDS, dt as corpusHashOf, et as CorpusSplit, f as SHAPE_KIND_IDS, ft as declaredClaimOf, g as ShapeInput, gt as splitFileName, h as ShapeGeometry, ht as leaveOneSeedOut, i as JointMeasureId, it as FamilyBy, j as shapeLevel, jt as convexOverlap, k as shapeKindProblem, kt as clipRing, l as DEFAULT_SHAPES, lt as checkDeclared, m as ShapeCheck, mt as familyOf, n as JOINT_MEASURES, nt as Declares, o as Verdict, ot as SPLIT_SCHEMA, p as ShapeBound, pt as declaredCounts, q as Resize, qt as toRect, r as JOINT_MOVED_MIN, rt as FAMILY_ANY_KIND, s as compareMeasure, st as SplitCorpus, t as Direction, tt as DeclaredClaim, u as RuleLevel, ut as checkSplit, v as ShapeKindSpec, vt as Margin, w as inputShapeLevel, wt as Side, x as ShapeSupport, xt as Region, y as ShapeLevel, yt as Point, z as LayoutGenerator, zt as pointInRings } from "./measures-J0yY_JvV.js";
|
|
2
2
|
import { AnyOption, BooleanOption, DeclaredStrategy, EnumOption, EnumerateOptions, EnumerateOptions as EnumerateOptions$1, GridOptions, KindOptions, KindOptions as KindOptions$1, ListItem, MemberRule, NoDefault, NoDefaultReason, NumberOption, OptionDeclaration, OptionIssue, OptionRef, OptionScale, OptionSchema, OptionSetting, OptionSupports, ParamKind, ParamValue, ParamWhen, STRATEGY_SPACE_SCHEMA, SampleOptions, ShapeFilter, SpaceConstraint, SpaceParam, SpaceSize, SpaceSize as SpaceSize$1, SpaceSizeOptions, SpaceSizeOptions as SpaceSizeOptions$1, SpaceStage, StageChoice, StageOption, StrategyConfig, StrategyConfig as StrategyConfig$1, StrategySpace, StrategySpace as StrategySpace$1, SweepOptions, ValueOption, canonicalConfig, checkConfig, checkOptions, checkSchema, clampOptions, configId, declarationIssues, joinConfigs, listOptions, optionDefaults, optionIssue, paramActive, paramAt, paramLevels, paramProblem, paramUnit, paramValue, productSpace, splitConfig, sweepGrid, sweepOf, sweepValues } from "@mark1russell7/strategy-space";
|
|
3
|
+
/**
|
|
4
|
+
* The 3D records: points, boxes with their sides along the axes, rotations and rigid transforms.
|
|
5
|
+
* The three axes make a right-handed system. The records give no meaning to an axis and no unit to a length.
|
|
6
|
+
* `docs/GEOMETRY-3D.md` gives the rules.
|
|
7
|
+
*/
|
|
8
|
+
/** A point or a vector in 3D. */
|
|
9
|
+
export interface Point3 {
|
|
10
|
+
readonly x: number;
|
|
11
|
+
readonly y: number;
|
|
12
|
+
readonly z: number;
|
|
13
|
+
}
|
|
14
|
+
/** The point at the origin. It is also the vector of length 0. */
|
|
15
|
+
export declare const ORIGIN3: Point3;
|
|
16
|
+
/**
|
|
17
|
+
* A box with its sides along the axes: the corner with the smallest coordinates, and its size.
|
|
18
|
+
* `w` is the size along x, `h` is the size along y, and `d` is the size along z.
|
|
19
|
+
*/
|
|
20
|
+
export interface Box3 {
|
|
21
|
+
readonly x: number;
|
|
22
|
+
readonly y: number;
|
|
23
|
+
readonly z: number;
|
|
24
|
+
readonly w: number;
|
|
25
|
+
readonly h: number;
|
|
26
|
+
readonly d: number;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* A rotation about the origin, as a unit quaternion. `w` is the scalar part.
|
|
30
|
+
* The glTF format and three.js keep the four numbers in the same order.
|
|
31
|
+
*/
|
|
32
|
+
export interface Rotation3 {
|
|
33
|
+
readonly x: number;
|
|
34
|
+
readonly y: number;
|
|
35
|
+
readonly z: number;
|
|
36
|
+
readonly w: number;
|
|
37
|
+
}
|
|
38
|
+
/** The rotation that moves no point. */
|
|
39
|
+
export declare const NO_ROTATION3: Rotation3;
|
|
40
|
+
/**
|
|
41
|
+
* A rigid transform: the rotation of a point about the origin, then a move by `position`.
|
|
42
|
+
* It has no scale, because the size of a box is in the box.
|
|
43
|
+
*/
|
|
44
|
+
export interface Transform3 {
|
|
45
|
+
readonly position: Point3;
|
|
46
|
+
readonly rotation: Rotation3;
|
|
47
|
+
}
|
|
48
|
+
/** The transform that moves no point. */
|
|
49
|
+
export declare const NO_TRANSFORM3: Transform3;
|
|
50
|
+
/** This function gives the sum of two vectors. */
|
|
51
|
+
export declare function addPoints3(a: Point3, b: Point3): Point3;
|
|
52
|
+
/** This function gives the vector from `b` to `a`: `a` minus `b`. */
|
|
53
|
+
export declare function subtractPoints3(a: Point3, b: Point3): Point3;
|
|
54
|
+
/** This function gives a vector with each coordinate times `factor`. */
|
|
55
|
+
export declare function scalePoint3(point: Point3, factor: number): Point3;
|
|
56
|
+
/** This function gives the dot product of two vectors. */
|
|
57
|
+
export declare function dot3(a: Point3, b: Point3): number;
|
|
58
|
+
/** This function gives the cross product of `a` and `b`. In a right-handed system, x cross y is z. */
|
|
59
|
+
export declare function cross3(a: Point3, b: Point3): Point3;
|
|
60
|
+
/** This function gives the length of a vector. */
|
|
61
|
+
export declare function length3(vector: Point3): number;
|
|
62
|
+
/** This function gives the distance between two points. */
|
|
63
|
+
export declare function distance3(a: Point3, b: Point3): number;
|
|
64
|
+
/**
|
|
65
|
+
* This function gives the rotation by `angle` radians about the line through the origin along `axis`.
|
|
66
|
+
* The rotation follows the right-hand rule: a positive angle about z turns the x axis to the y axis.
|
|
67
|
+
* An axis of length 0, or a number that is not finite, gives a `RangeError`.
|
|
68
|
+
*/
|
|
69
|
+
export declare function rotationAbout(axis: Point3, angle: number): Rotation3;
|
|
70
|
+
/**
|
|
71
|
+
* This function gives the rotation `inner`, then the rotation `outer`, as one rotation.
|
|
72
|
+
* It is the quaternion product of `outer` and `inner`.
|
|
73
|
+
*/
|
|
74
|
+
export declare function composeRotations3(outer: Rotation3, inner: Rotation3): Rotation3;
|
|
75
|
+
/** This function gives the rotation that moves each point back. It is the conjugate of a unit quaternion. */
|
|
76
|
+
export declare function inverseRotation3(rotation: Rotation3): Rotation3;
|
|
77
|
+
/**
|
|
78
|
+
* This function gives the rotation with the length 1. Many products of rotations collect small float errors, and this function removes them.
|
|
79
|
+
* A quaternion of length 0, or a number that is not finite, gives a `RangeError`.
|
|
80
|
+
*/
|
|
81
|
+
export declare function normalizeRotation3(rotation: Rotation3): Rotation3;
|
|
82
|
+
/** This function gives the point after the rotation. The rotation is a unit quaternion. */
|
|
83
|
+
export declare function rotatePoint3(rotation: Rotation3, point: Point3): Point3;
|
|
84
|
+
/** This function gives the point after the transform: the rotation, then the move. */
|
|
85
|
+
export declare function transformPoint3(transform: Transform3, point: Point3): Point3;
|
|
86
|
+
/**
|
|
87
|
+
* This function gives the transform `inner`, then the transform `outer`, as one transform.
|
|
88
|
+
* Thus `inner` is the place of a part in its parent, and `outer` is the place of the parent.
|
|
89
|
+
*/
|
|
90
|
+
export declare function composeTransforms3(outer: Transform3, inner: Transform3): Transform3;
|
|
91
|
+
/** This function gives the transform that moves each point back. */
|
|
92
|
+
export declare function inverseTransform3(transform: Transform3): Transform3;
|
|
93
|
+
/**
|
|
94
|
+
* This function gives the 4 by 4 matrix of a transform as 16 numbers, column by column.
|
|
95
|
+
* WebGL, the glTF format and three.js read a matrix in this order.
|
|
96
|
+
*/
|
|
97
|
+
export declare function transformMatrix4(transform: Transform3): readonly number[];
|
|
98
|
+
/** This function gives the center of a box. */
|
|
99
|
+
export declare function box3Center(box: Box3): Point3;
|
|
100
|
+
/** This function gives the volume of a box. */
|
|
101
|
+
export declare function box3Volume(box: Box3): number;
|
|
102
|
+
/**
|
|
103
|
+
* This function gives the 8 corners of a box. The corner at the index `i` has the largest x when bit 0 of `i` is 1.
|
|
104
|
+
* Bit 1 gives the largest y, and bit 2 gives the largest z. Thus the corner 0 is the corner of the box record.
|
|
105
|
+
*/
|
|
106
|
+
export declare function box3Corners(box: Box3): readonly Point3[];
|
|
107
|
+
/** This function gives the smallest box that holds each point, or `undefined` for no points. */
|
|
108
|
+
export declare function boundsOf3(points: readonly Point3[]): Box3 | undefined;
|
|
109
|
+
/**
|
|
110
|
+
* This function gives the smallest box along the axes that holds a box after a transform.
|
|
111
|
+
* A box that turns by an angle that is not a quarter turn gets a larger box.
|
|
112
|
+
*/
|
|
113
|
+
export declare function transformedBounds3(box: Box3, transform: Transform3): Box3;
|
|
114
|
+
/**
|
|
115
|
+
* This function gives the overlap of the insides of two boxes on each axis.
|
|
116
|
+
* A value of 0 or less on an axis is no overlap. Two boxes with a common face have an overlap of 0 on one axis.
|
|
117
|
+
*/
|
|
118
|
+
export declare function overlapOf3(a: Box3, b: Box3): Point3;
|
|
3
119
|
/**
|
|
4
120
|
* A symmetry of a square: one of its 8 rotations and reflections. The names tell where a point `(s, t)` goes in a square
|
|
5
121
|
* of side `size`.
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":["StrategySpace","KindOptions","SpaceSizeOptions","SpaceSize","EnumerateOptions","StrategyConfig"],"sources":["../src/curves.ts","../src/tolerance.ts","../src/output.ts","../src/record.ts","../src/rules.ts","../src/turn.ts","../src/resize.ts","../src/balance.ts","../src/measure-registry.ts","../src/cell.ts","../src/frame.ts","../src/strategy.ts","../src/random.ts","../src/edges.ts","../src/hash.ts","../src/portfolio.ts","../src/corpus-manifest.ts","../src/strategy-space.ts","../src/strategy-catalog.ts","../src/verdict.ts","../src/families.ts","../src/measure-survey.ts"],"mappings":";;;;;;YAUY;;qBAmBC,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AW;WACX;WACA;;WAEA;;;iBAIM;WACN;WACA;WACA,mBAAmB;;;iBAIb;WACN,eAAe;;WAEf;WACA,kBAAkB;;;;;;iBAOZ;WACN;WACA;;WAEA;aAA4B;aAAqB;aAAyB;;;;iBAIpE;;WAEN;;WAEA,UAAU,SAAS;;WAEnB;aAA+B;aAAqB;aAAsC;;;WAE1F,gBAAgB;;WAEhB;;WAEA,OAAO,SAAS;;;wBAOX,YAAY;;wBA8CZ,eAAe;;wBAMf,eAAe,QAAQ,gBAAgB"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":["StrategySpace","KindOptions","SpaceSizeOptions","SpaceSize","EnumerateOptions","StrategyConfig"],"sources":["../src/geometry3.ts","../src/curves.ts","../src/tolerance.ts","../src/output.ts","../src/record.ts","../src/rules.ts","../src/turn.ts","../src/resize.ts","../src/balance.ts","../src/measure-registry.ts","../src/cell.ts","../src/frame.ts","../src/strategy.ts","../src/random.ts","../src/edges.ts","../src/hash.ts","../src/portfolio.ts","../src/corpus-manifest.ts","../src/strategy-space.ts","../src/strategy-catalog.ts","../src/verdict.ts","../src/families.ts","../src/measure-survey.ts"],"mappings":";;;;;;;;iBAOiB;WACN;WACA;WACA;;;qBAIE,SAAS;;;;;iBAML;WACN;WACA;WACA;WACA;WACA;WACA;;;;;;iBAOM;WACN;WACA;WACA;WACA;;;qBAIE,cAAc;;;;;iBAMV;WACN,UAAU;WACV,UAAU;;;qBAIR,eAAe;;wBAGZ,WAAW,GAAG,QAAQ,GAAG,SAAS;;wBAKlC,gBAAgB,GAAG,QAAQ,GAAG,SAAS;;wBAKvC,YAAY,OAAO,QAAQ,iBAAiB;;wBAK5C,KAAK,GAAG,QAAQ,GAAG;;wBAKnB,OAAO,GAAG,QAAQ,GAAG,SAAS;;wBAK9B,QAAQ,QAAQ;;wBAKhB,UAAU,GAAG,QAAQ,GAAG;;;;;;wBASxB,cAAc,MAAM,QAAQ,gBAAgB;;;;;wBAa5C,kBAAkB,OAAO,WAAW,OAAO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,eAAe,cAC9B,gBACA,cACC;;wBA8Ha,qBAAqB,IAAI,aAAa,WAAU,SAAS,aAAa,MAAW,eAAe;;iBA2G/F;WACN;WACA;;WAEA;WACA;;WAEA,qBAAqB;;WAErB;WACA,aAAa;;WAEb,cAAc,MAAM;;EAE7B,MAAM,OAAO,aAAa,cAAc,MAAM,kBAAkB;;;iBAIjD;;WAEN;;WAEA;WACA;;WAEA,QAAQ,OAAO;;;;;;;wBAWV,cAAc,MAAM,aAAa,cAAc,gBAAgB,cAAc,UAAS,iBAAsB,aAAa;;;;;qBA+D5H,YAAY;;;;qBA0BZ,eAAe;;;;;;;;;qBAuBf,kBAAkB,aAAa;;;;;;qBAqD/B,gBAAgB,aAAa;;qBCl3B7B;;iBAGI;WACN;WACA;WACA,WAAW;WACX;WACA;;WAEA;;;iBAIM;WACN;WACA;WACA,mBAAmB;;;iBAIb;WACN,eAAe;;WAEf;WACA,kBAAkB;;;;;;iBAOZ;WACN;WACA;;WAEA;aAA4B;aAAqB;aAAyB;;;;iBAIpE;;WAEN;;WAEA,UAAU,SAAS;;WAEnB;aAA+B;aAAqB;aAAsC;;;WAE1F,gBAAgB;;WAEhB;;WAEA,OAAO,SAAS;;;wBAOX,YAAY;;wBA8CZ,eAAe;;wBAMf,eAAe,QAAQ,gBAAgB"}
|
package/build/index.js
CHANGED
|
@@ -449,6 +449,248 @@ function dropIndex(point, centers, rowTolerance = 24) {
|
|
|
449
449
|
}
|
|
450
450
|
return centers.length;
|
|
451
451
|
}
|
|
452
|
+
// src/geometry3.ts
|
|
453
|
+
/** The point at the origin. It is also the vector of length 0. */
|
|
454
|
+
const ORIGIN3 = {
|
|
455
|
+
x: 0,
|
|
456
|
+
y: 0,
|
|
457
|
+
z: 0
|
|
458
|
+
};
|
|
459
|
+
/** The rotation that moves no point. */
|
|
460
|
+
const NO_ROTATION3 = {
|
|
461
|
+
x: 0,
|
|
462
|
+
y: 0,
|
|
463
|
+
z: 0,
|
|
464
|
+
w: 1
|
|
465
|
+
};
|
|
466
|
+
/** The transform that moves no point. */
|
|
467
|
+
const NO_TRANSFORM3 = {
|
|
468
|
+
position: ORIGIN3,
|
|
469
|
+
rotation: NO_ROTATION3
|
|
470
|
+
};
|
|
471
|
+
/** This function gives the sum of two vectors. */
|
|
472
|
+
function addPoints3(a, b) {
|
|
473
|
+
return {
|
|
474
|
+
x: a.x + b.x,
|
|
475
|
+
y: a.y + b.y,
|
|
476
|
+
z: a.z + b.z
|
|
477
|
+
};
|
|
478
|
+
}
|
|
479
|
+
/** This function gives the vector from `b` to `a`: `a` minus `b`. */
|
|
480
|
+
function subtractPoints3(a, b) {
|
|
481
|
+
return {
|
|
482
|
+
x: a.x - b.x,
|
|
483
|
+
y: a.y - b.y,
|
|
484
|
+
z: a.z - b.z
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
/** This function gives a vector with each coordinate times `factor`. */
|
|
488
|
+
function scalePoint3(point, factor) {
|
|
489
|
+
return {
|
|
490
|
+
x: point.x * factor,
|
|
491
|
+
y: point.y * factor,
|
|
492
|
+
z: point.z * factor
|
|
493
|
+
};
|
|
494
|
+
}
|
|
495
|
+
/** This function gives the dot product of two vectors. */
|
|
496
|
+
function dot3(a, b) {
|
|
497
|
+
return a.x * b.x + a.y * b.y + a.z * b.z;
|
|
498
|
+
}
|
|
499
|
+
/** This function gives the cross product of `a` and `b`. In a right-handed system, x cross y is z. */
|
|
500
|
+
function cross3(a, b) {
|
|
501
|
+
return {
|
|
502
|
+
x: a.y * b.z - a.z * b.y,
|
|
503
|
+
y: a.z * b.x - a.x * b.z,
|
|
504
|
+
z: a.x * b.y - a.y * b.x
|
|
505
|
+
};
|
|
506
|
+
}
|
|
507
|
+
/** This function gives the length of a vector. */
|
|
508
|
+
function length3(vector) {
|
|
509
|
+
return Math.hypot(vector.x, vector.y, vector.z);
|
|
510
|
+
}
|
|
511
|
+
/** This function gives the distance between two points. */
|
|
512
|
+
function distance3(a, b) {
|
|
513
|
+
return Math.hypot(a.x - b.x, a.y - b.y, a.z - b.z);
|
|
514
|
+
}
|
|
515
|
+
/**
|
|
516
|
+
* This function gives the rotation by `angle` radians about the line through the origin along `axis`.
|
|
517
|
+
* The rotation follows the right-hand rule: a positive angle about z turns the x axis to the y axis.
|
|
518
|
+
* An axis of length 0, or a number that is not finite, gives a `RangeError`.
|
|
519
|
+
*/
|
|
520
|
+
function rotationAbout(axis, angle) {
|
|
521
|
+
const length = length3(axis);
|
|
522
|
+
if (!Number.isFinite(length) || length === 0 || !Number.isFinite(angle)) throw new RangeError("A rotation needs a finite angle and a finite axis with a length above 0.");
|
|
523
|
+
const factor = Math.sin(angle / 2) / length;
|
|
524
|
+
return {
|
|
525
|
+
x: axis.x * factor,
|
|
526
|
+
y: axis.y * factor,
|
|
527
|
+
z: axis.z * factor,
|
|
528
|
+
w: Math.cos(angle / 2)
|
|
529
|
+
};
|
|
530
|
+
}
|
|
531
|
+
/**
|
|
532
|
+
* This function gives the rotation `inner`, then the rotation `outer`, as one rotation.
|
|
533
|
+
* It is the quaternion product of `outer` and `inner`.
|
|
534
|
+
*/
|
|
535
|
+
function composeRotations3(outer, inner) {
|
|
536
|
+
return {
|
|
537
|
+
x: outer.w * inner.x + outer.x * inner.w + outer.y * inner.z - outer.z * inner.y,
|
|
538
|
+
y: outer.w * inner.y - outer.x * inner.z + outer.y * inner.w + outer.z * inner.x,
|
|
539
|
+
z: outer.w * inner.z + outer.x * inner.y - outer.y * inner.x + outer.z * inner.w,
|
|
540
|
+
w: outer.w * inner.w - outer.x * inner.x - outer.y * inner.y - outer.z * inner.z
|
|
541
|
+
};
|
|
542
|
+
}
|
|
543
|
+
/** This function gives the rotation that moves each point back. It is the conjugate of a unit quaternion. */
|
|
544
|
+
function inverseRotation3(rotation) {
|
|
545
|
+
return {
|
|
546
|
+
x: -rotation.x,
|
|
547
|
+
y: -rotation.y,
|
|
548
|
+
z: -rotation.z,
|
|
549
|
+
w: rotation.w
|
|
550
|
+
};
|
|
551
|
+
}
|
|
552
|
+
/**
|
|
553
|
+
* This function gives the rotation with the length 1. Many products of rotations collect small float errors, and this function removes them.
|
|
554
|
+
* A quaternion of length 0, or a number that is not finite, gives a `RangeError`.
|
|
555
|
+
*/
|
|
556
|
+
function normalizeRotation3(rotation) {
|
|
557
|
+
const length = Math.hypot(rotation.x, rotation.y, rotation.z, rotation.w);
|
|
558
|
+
if (!Number.isFinite(length) || length === 0) throw new RangeError("A rotation needs a finite quaternion with a length above 0.");
|
|
559
|
+
return {
|
|
560
|
+
x: rotation.x / length,
|
|
561
|
+
y: rotation.y / length,
|
|
562
|
+
z: rotation.z / length,
|
|
563
|
+
w: rotation.w / length
|
|
564
|
+
};
|
|
565
|
+
}
|
|
566
|
+
/** This function gives the point after the rotation. The rotation is a unit quaternion. */
|
|
567
|
+
function rotatePoint3(rotation, point) {
|
|
568
|
+
const first = cross3(rotation, point);
|
|
569
|
+
const second = cross3(rotation, first);
|
|
570
|
+
return {
|
|
571
|
+
x: point.x + 2 * (rotation.w * first.x + second.x),
|
|
572
|
+
y: point.y + 2 * (rotation.w * first.y + second.y),
|
|
573
|
+
z: point.z + 2 * (rotation.w * first.z + second.z)
|
|
574
|
+
};
|
|
575
|
+
}
|
|
576
|
+
/** This function gives the point after the transform: the rotation, then the move. */
|
|
577
|
+
function transformPoint3(transform, point) {
|
|
578
|
+
return addPoints3(rotatePoint3(transform.rotation, point), transform.position);
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* This function gives the transform `inner`, then the transform `outer`, as one transform.
|
|
582
|
+
* Thus `inner` is the place of a part in its parent, and `outer` is the place of the parent.
|
|
583
|
+
*/
|
|
584
|
+
function composeTransforms3(outer, inner) {
|
|
585
|
+
return {
|
|
586
|
+
position: transformPoint3(outer, inner.position),
|
|
587
|
+
rotation: composeRotations3(outer.rotation, inner.rotation)
|
|
588
|
+
};
|
|
589
|
+
}
|
|
590
|
+
/** This function gives the transform that moves each point back. */
|
|
591
|
+
function inverseTransform3(transform) {
|
|
592
|
+
const rotation = inverseRotation3(transform.rotation);
|
|
593
|
+
return {
|
|
594
|
+
position: scalePoint3(rotatePoint3(rotation, transform.position), -1),
|
|
595
|
+
rotation
|
|
596
|
+
};
|
|
597
|
+
}
|
|
598
|
+
/**
|
|
599
|
+
* This function gives the 4 by 4 matrix of a transform as 16 numbers, column by column.
|
|
600
|
+
* WebGL, the glTF format and three.js read a matrix in this order.
|
|
601
|
+
*/
|
|
602
|
+
function transformMatrix4(transform) {
|
|
603
|
+
const { x, y, z, w } = transform.rotation;
|
|
604
|
+
const { position } = transform;
|
|
605
|
+
return [
|
|
606
|
+
1 - 2 * (y * y + z * z),
|
|
607
|
+
2 * (x * y + w * z),
|
|
608
|
+
2 * (x * z - w * y),
|
|
609
|
+
0,
|
|
610
|
+
2 * (x * y - w * z),
|
|
611
|
+
1 - 2 * (x * x + z * z),
|
|
612
|
+
2 * (y * z + w * x),
|
|
613
|
+
0,
|
|
614
|
+
2 * (x * z + w * y),
|
|
615
|
+
2 * (y * z - w * x),
|
|
616
|
+
1 - 2 * (x * x + y * y),
|
|
617
|
+
0,
|
|
618
|
+
position.x,
|
|
619
|
+
position.y,
|
|
620
|
+
position.z,
|
|
621
|
+
1
|
|
622
|
+
];
|
|
623
|
+
}
|
|
624
|
+
/** This function gives the center of a box. */
|
|
625
|
+
function box3Center(box) {
|
|
626
|
+
return {
|
|
627
|
+
x: box.x + box.w / 2,
|
|
628
|
+
y: box.y + box.h / 2,
|
|
629
|
+
z: box.z + box.d / 2
|
|
630
|
+
};
|
|
631
|
+
}
|
|
632
|
+
/** This function gives the volume of a box. */
|
|
633
|
+
function box3Volume(box) {
|
|
634
|
+
return box.w * box.h * box.d;
|
|
635
|
+
}
|
|
636
|
+
/**
|
|
637
|
+
* This function gives the 8 corners of a box. The corner at the index `i` has the largest x when bit 0 of `i` is 1.
|
|
638
|
+
* Bit 1 gives the largest y, and bit 2 gives the largest z. Thus the corner 0 is the corner of the box record.
|
|
639
|
+
*/
|
|
640
|
+
function box3Corners(box) {
|
|
641
|
+
const corners = [];
|
|
642
|
+
for (let index = 0; index < 8; index += 1) corners.push({
|
|
643
|
+
x: box.x + (index & 1) * box.w,
|
|
644
|
+
y: box.y + (index >> 1 & 1) * box.h,
|
|
645
|
+
z: box.z + (index >> 2 & 1) * box.d
|
|
646
|
+
});
|
|
647
|
+
return corners;
|
|
648
|
+
}
|
|
649
|
+
/** This function gives the smallest box that holds each point, or `undefined` for no points. */
|
|
650
|
+
function boundsOf3(points) {
|
|
651
|
+
const first = points[0];
|
|
652
|
+
if (first === void 0) return void 0;
|
|
653
|
+
let minX = first.x;
|
|
654
|
+
let minY = first.y;
|
|
655
|
+
let minZ = first.z;
|
|
656
|
+
let maxX = first.x;
|
|
657
|
+
let maxY = first.y;
|
|
658
|
+
let maxZ = first.z;
|
|
659
|
+
for (const point of points) {
|
|
660
|
+
minX = Math.min(minX, point.x);
|
|
661
|
+
minY = Math.min(minY, point.y);
|
|
662
|
+
minZ = Math.min(minZ, point.z);
|
|
663
|
+
maxX = Math.max(maxX, point.x);
|
|
664
|
+
maxY = Math.max(maxY, point.y);
|
|
665
|
+
maxZ = Math.max(maxZ, point.z);
|
|
666
|
+
}
|
|
667
|
+
return {
|
|
668
|
+
x: minX,
|
|
669
|
+
y: minY,
|
|
670
|
+
z: minZ,
|
|
671
|
+
w: maxX - minX,
|
|
672
|
+
h: maxY - minY,
|
|
673
|
+
d: maxZ - minZ
|
|
674
|
+
};
|
|
675
|
+
}
|
|
676
|
+
/**
|
|
677
|
+
* This function gives the smallest box along the axes that holds a box after a transform.
|
|
678
|
+
* A box that turns by an angle that is not a quarter turn gets a larger box.
|
|
679
|
+
*/
|
|
680
|
+
function transformedBounds3(box, transform) {
|
|
681
|
+
return boundsOf3(box3Corners(box).map((corner) => transformPoint3(transform, corner)));
|
|
682
|
+
}
|
|
683
|
+
/**
|
|
684
|
+
* This function gives the overlap of the insides of two boxes on each axis.
|
|
685
|
+
* A value of 0 or less on an axis is no overlap. Two boxes with a common face have an overlap of 0 on one axis.
|
|
686
|
+
*/
|
|
687
|
+
function overlapOf3(a, b) {
|
|
688
|
+
return {
|
|
689
|
+
x: Math.min(a.x + a.w, b.x + b.w) - Math.max(a.x, b.x),
|
|
690
|
+
y: Math.min(a.y + a.h, b.y + b.h) - Math.max(a.y, b.y),
|
|
691
|
+
z: Math.min(a.z + a.d, b.z + b.d) - Math.max(a.z, b.z)
|
|
692
|
+
};
|
|
693
|
+
}
|
|
452
694
|
// src/curves.ts
|
|
453
695
|
/** The 8 symmetries of a square, in a fixed order. */
|
|
454
696
|
const CURVE_SYMMETRIES = /* @__PURE__ */ Object.freeze([
|
|
@@ -6146,6 +6388,6 @@ function surveyFindings(survey) {
|
|
|
6146
6388
|
units
|
|
6147
6389
|
};
|
|
6148
6390
|
}
|
|
6149
|
-
export { BALANCE_MEASURE_SUFFIXES, BALANCE_SIDE_DEPTH, CELL_MEASURE_SUFFIXES, CELL_SOURCE, CIRCLE_SCATTERED, CORPUS_DIMENSIONS, CORPUS_MANIFEST_SCHEMA, CURVE_MAX_SIDE, CURVE_SYMMETRIES, DEFAULT_FAMILY_BY, DEFAULT_RNG, DEFAULT_SHAPES, DEFAULT_TOLERANCE, EDGES_STEP, EDGE_DENSITY, EDGE_KEY_STEP, EDGE_KEY_STEP_VERSION, EDGE_STEP_VERSION, EPS, EPS_STEPS, FAMILY_ANY_KIND, FRAME_SCHEMA, FRAME_STATES, HARD_RULE_VERSION, HILBERT_CURVE, HILBERT_PATTERN, INVALIDATED_FIELD, JOINT_MEASURES, JOINT_MOVED_MIN, JOINT_SOURCE, MEASURE_REGISTRY, MEASURE_SURVEY_SCHEMA, MOORE_CURVE, MOORE_PATTERN, MORTON_CURVE, NODE_POSITIONS_DIMENSION, NOISE_KINDS, NO_FINITE_RANGE, NO_UNIT, OUTPUT_CLASS_MIN_INPUTS, OUTPUT_GRID_PROPERTIES, OUTPUT_NEAR_WHOLE, PACK_HARD_RULES, RECORD_EPS, RECORD_SCALE, RECT_SCATTERED, REFUSED_PROBE, SHAPE_KINDS, SHAPE_KIND_IDS, SHARE_UNIT, SIDES, SPLIT_SCHEMA, SQUARE_COMPACTNESS, STRATEGY_CATALOG_SCHEMA, STRATEGY_CATALOG_SCHEMAS, STRATEGY_SPACE_SCHEMA, VERDICT_DRAWS, VERDICT_EXACT_CAP, VERDICT_EXACT_MAX, VERDICT_RUNS, VERDICT_SEED, applyPack, applySymmetry, balanceMeasureSpecs, balanceMeasures, balanceOf, boundsOf, boxArea, boxCenterDistance, canonicalConfig, canonicalInput, canonicalJson, carryRecord, catalogChoices, catalogDefaults, catalogKey, catalogOptions, cellMeasureEntries, cellMeasureSpecs, cellMeasures, cellsOf, checkCatalog, checkConfig, checkDeclared, checkInput, checkLayoutRecord, checkOptions, checkRegistry, checkSchema, checkShapes, checkSpace, checkSplit, checkSurvey, circleOverlaps, circlesOutside, clampOptions, clipRing, compareMeasure, composeFamily, configId, convexCorners, convexOverlap, cornersInConvex, corpusHashOf, corpusManifestText, countLinksThroughShapes, countObstacleHits, countOutside, countOverlaps, countPortsOffBorder, countResizeBreaks, createFamilyRegistry, crossingPoint, curveCell, curveCells, curveIndex, declarationIssues, declaredClaimOf, declaredCounts, decodeOptionValue, defaultNormalize, dimensionAt, dimensionSupports, dimensionUnit, documentHash, dropIndex, edgeKeyStep, edgeStep, encodeOptionValue, enumerateSpace, exercised, familyKind, familyOf, fingerprintOf, fixedPointMove, fnv1a32, frameAt, frameMove, frameOf, grow, hardRuleOf, hilbertCell, hilbertIndex, inputShapeLevel, inverseSymmetry, isShapeKind, itemShapeOf, joinConfigs, leaveOneSeedOut, levelsOf, lineJson, listOptions, manifestText, marginSides, measureEntry, minEffectOf, mooreCell, mooreIndex, mortonCell, mortonIndex, mulberry32, nameAfterStage, nearestGaps, normalizeMeasure, optionDefaults, optionIssue, outputGridClass, outputGroups, outputHash, outputOf, overlapOf, ownerDimension, packHard, packLinks, packOutputForm, paramActive, paramAt, paramLevels, paramProblem, paramUnit, paramValue, parseLayoutRecord, parseStrategyCatalog, perChange, pickMoves, placedCircle, placedConvex, placedRect, pointInRing, pointInRings, pointSegmentDistance, portPoint, portfolio, probeHash, procrustesOf, productSpace, randomInt, rectInRegion, regionArea, regionHitsRect, regionPerimeter, resizeBox, resizeProblems, resolveDimensions, ringCentroid, ruleLevel, scaleRect, segmentThroughShape, segmentsCross, selectBest, sha256Hex, shapeFits, shapeKindOf, shapeKindProblem, shapeKindsOf, shapeLevel, shapeSupportProblems, shapesOf, shapesOverlap, sharedDimension, sizeBoundsOf, sizeFits, snapRect, spaceShapeKinds, spaceSize, splitConfig, splitFileName, splitFolds, stepRandom, surveyFindings, sweepGrid, sweepOf, sweepValues, toLayoutRecord, toPackInput, toRect, toSizedRect, translate, turnBox, turnMargin, turnPoint, turnPort, turnRegion, turnResize, turnSide, unitFault, verdict, writeStrategyCatalog };
|
|
6391
|
+
export { BALANCE_MEASURE_SUFFIXES, BALANCE_SIDE_DEPTH, CELL_MEASURE_SUFFIXES, CELL_SOURCE, CIRCLE_SCATTERED, CORPUS_DIMENSIONS, CORPUS_MANIFEST_SCHEMA, CURVE_MAX_SIDE, CURVE_SYMMETRIES, DEFAULT_FAMILY_BY, DEFAULT_RNG, DEFAULT_SHAPES, DEFAULT_TOLERANCE, EDGES_STEP, EDGE_DENSITY, EDGE_KEY_STEP, EDGE_KEY_STEP_VERSION, EDGE_STEP_VERSION, EPS, EPS_STEPS, FAMILY_ANY_KIND, FRAME_SCHEMA, FRAME_STATES, HARD_RULE_VERSION, HILBERT_CURVE, HILBERT_PATTERN, INVALIDATED_FIELD, JOINT_MEASURES, JOINT_MOVED_MIN, JOINT_SOURCE, MEASURE_REGISTRY, MEASURE_SURVEY_SCHEMA, MOORE_CURVE, MOORE_PATTERN, MORTON_CURVE, NODE_POSITIONS_DIMENSION, NOISE_KINDS, NO_FINITE_RANGE, NO_ROTATION3, NO_TRANSFORM3, NO_UNIT, ORIGIN3, OUTPUT_CLASS_MIN_INPUTS, OUTPUT_GRID_PROPERTIES, OUTPUT_NEAR_WHOLE, PACK_HARD_RULES, RECORD_EPS, RECORD_SCALE, RECT_SCATTERED, REFUSED_PROBE, SHAPE_KINDS, SHAPE_KIND_IDS, SHARE_UNIT, SIDES, SPLIT_SCHEMA, SQUARE_COMPACTNESS, STRATEGY_CATALOG_SCHEMA, STRATEGY_CATALOG_SCHEMAS, STRATEGY_SPACE_SCHEMA, VERDICT_DRAWS, VERDICT_EXACT_CAP, VERDICT_EXACT_MAX, VERDICT_RUNS, VERDICT_SEED, addPoints3, applyPack, applySymmetry, balanceMeasureSpecs, balanceMeasures, balanceOf, boundsOf, boundsOf3, box3Center, box3Corners, box3Volume, boxArea, boxCenterDistance, canonicalConfig, canonicalInput, canonicalJson, carryRecord, catalogChoices, catalogDefaults, catalogKey, catalogOptions, cellMeasureEntries, cellMeasureSpecs, cellMeasures, cellsOf, checkCatalog, checkConfig, checkDeclared, checkInput, checkLayoutRecord, checkOptions, checkRegistry, checkSchema, checkShapes, checkSpace, checkSplit, checkSurvey, circleOverlaps, circlesOutside, clampOptions, clipRing, compareMeasure, composeFamily, composeRotations3, composeTransforms3, configId, convexCorners, convexOverlap, cornersInConvex, corpusHashOf, corpusManifestText, countLinksThroughShapes, countObstacleHits, countOutside, countOverlaps, countPortsOffBorder, countResizeBreaks, createFamilyRegistry, cross3, crossingPoint, curveCell, curveCells, curveIndex, declarationIssues, declaredClaimOf, declaredCounts, decodeOptionValue, defaultNormalize, dimensionAt, dimensionSupports, dimensionUnit, distance3, documentHash, dot3, dropIndex, edgeKeyStep, edgeStep, encodeOptionValue, enumerateSpace, exercised, familyKind, familyOf, fingerprintOf, fixedPointMove, fnv1a32, frameAt, frameMove, frameOf, grow, hardRuleOf, hilbertCell, hilbertIndex, inputShapeLevel, inverseRotation3, inverseSymmetry, inverseTransform3, isShapeKind, itemShapeOf, joinConfigs, leaveOneSeedOut, length3, levelsOf, lineJson, listOptions, manifestText, marginSides, measureEntry, minEffectOf, mooreCell, mooreIndex, mortonCell, mortonIndex, mulberry32, nameAfterStage, nearestGaps, normalizeMeasure, normalizeRotation3, optionDefaults, optionIssue, outputGridClass, outputGroups, outputHash, outputOf, overlapOf, overlapOf3, ownerDimension, packHard, packLinks, packOutputForm, paramActive, paramAt, paramLevels, paramProblem, paramUnit, paramValue, parseLayoutRecord, parseStrategyCatalog, perChange, pickMoves, placedCircle, placedConvex, placedRect, pointInRing, pointInRings, pointSegmentDistance, portPoint, portfolio, probeHash, procrustesOf, productSpace, randomInt, rectInRegion, regionArea, regionHitsRect, regionPerimeter, resizeBox, resizeProblems, resolveDimensions, ringCentroid, rotatePoint3, rotationAbout, ruleLevel, scalePoint3, scaleRect, segmentThroughShape, segmentsCross, selectBest, sha256Hex, shapeFits, shapeKindOf, shapeKindProblem, shapeKindsOf, shapeLevel, shapeSupportProblems, shapesOf, shapesOverlap, sharedDimension, sizeBoundsOf, sizeFits, snapRect, spaceShapeKinds, spaceSize, splitConfig, splitFileName, splitFolds, stepRandom, subtractPoints3, surveyFindings, sweepGrid, sweepOf, sweepValues, toLayoutRecord, toPackInput, toRect, toSizedRect, transformMatrix4, transformPoint3, transformedBounds3, translate, turnBox, turnMargin, turnPoint, turnPort, turnRegion, turnResize, turnSide, unitFault, verdict, writeStrategyCatalog };
|
|
6150
6392
|
|
|
6151
6393
|
//# sourceMappingURL=index.js.map
|