flo-mat 3.0.9 → 3.0.11
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/__tests__/jsog/check-jsog-eql-calc.spec.ts +81 -0
- package/__tests__/jsog/decode-jsog.ts +85 -0
- package/__tests__/jsog/get-mats1.ts +41 -0
- package/__tests__/{cp-node/fs → jsog}/mat-dummys.ts +51 -564
- package/__tests__/jsog/to-jsog-breath-first.ts +107 -0
- package/__tests__/jsog/to-jsog-depth-first.ts +55 -0
- package/browser/index.js +280 -236
- package/browser/index.min.js +1 -1
- package/node/add-n-prong.ts/join-spokes.js.map +1 -1
- package/node/closest-boundary-point/cull-bezier-pieces.d.ts +5 -4
- package/node/closest-boundary-point/cull-bezier-pieces.js +9 -8
- package/node/closest-boundary-point/cull-bezier-pieces.js.map +1 -1
- package/node/closest-boundary-point/cull-by-loose-bounding-box.d.ts +2 -2
- package/node/closest-boundary-point/cull-by-loose-bounding-box.js +8 -8
- package/node/closest-boundary-point/cull-by-loose-bounding-box.js.map +1 -1
- package/node/closest-boundary-point/cull-by-tight-boundary-box.d.ts +2 -2
- package/node/closest-boundary-point/cull-by-tight-boundary-box.js +8 -8
- package/node/closest-boundary-point/cull-by-tight-boundary-box.js.map +1 -1
- package/node/closest-boundary-point/dd-deflate-with-running-error.js.map +1 -1
- package/node/closest-boundary-point/get-best-distance-squared.d.ts +1 -1
- package/node/closest-boundary-point/get-best-distance-squared.js +6 -6
- package/node/closest-boundary-point/get-best-distance-squared.js.map +1 -1
- package/node/closest-boundary-point/get-close-boundary-points-certified.d.ts +2 -2
- package/node/closest-boundary-point/get-close-boundary-points-certified.js +7 -7
- package/node/closest-boundary-point/get-close-boundary-points-certified.js.map +1 -1
- package/node/contact-point/contact-point.js.map +1 -1
- package/node/corner/get-corner.js.map +1 -1
- package/node/corner/get-interface-ccw.js.map +1 -1
- package/node/cp-node/cp-node-fs.d.ts +2 -1
- package/node/cp-node/cp-node-fs.js +1 -2
- package/node/cp-node/cp-node-fs.js.map +1 -1
- package/node/cp-node/fs/cp-node-comparator.d.ts +3 -0
- package/node/cp-node/fs/cp-node-comparator.js +6 -0
- package/node/cp-node/fs/cp-node-comparator.js.map +1 -0
- package/node/cp-node/fs/find-first.js.map +1 -1
- package/node/cp-node/fs/get-all-on-loop.js.map +1 -1
- package/node/cp-node/fs/get-boundary-bezier-parts-to-next.d.ts +1 -1
- package/node/cp-node/fs/get-boundary-bezier-parts-to-next.js +11 -16
- package/node/cp-node/fs/get-boundary-bezier-parts-to-next.js.map +1 -1
- package/node/cp-node/fs/get-boundary-beziers-between.js +4 -6
- package/node/cp-node/fs/get-boundary-beziers-between.js.map +1 -1
- package/node/cp-node/fs/get-boundary-beziers-to-next.d.ts +10 -1
- package/node/cp-node/fs/get-boundary-beziers-to-next.js +70 -35
- package/node/cp-node/fs/get-boundary-beziers-to-next.js.map +1 -1
- package/node/cp-node/fs/get-branch-beziers.js.map +1 -1
- package/node/cp-node/fs/get-branch.js.map +1 -1
- package/node/cp-node/fs/get-children.js.map +1 -1
- package/node/cp-node/fs/get-first-exit.js.map +1 -1
- package/node/cp-node/fs/get-mat-curve-to-next.js.map +1 -1
- package/node/cp-node/fs/get-mat-curves-between.js.map +1 -1
- package/node/cp-node/fs/get-prong-count.js.map +1 -1
- package/node/cp-node/fs/get-real-prong-count.js.map +1 -1
- package/node/cp-node/fs/get-salience.js +2 -2
- package/node/cp-node/fs/get-salience.js.map +1 -1
- package/node/cp-node/fs/get-speed.js +0 -1
- package/node/cp-node/fs/get-speed.js.map +1 -1
- package/node/cp-node/fs/get-vertex-forward-children.js.map +1 -1
- package/node/cp-node/fs/is-fully-terminating.d.ts +1 -1
- package/node/cp-node/fs/is-fully-terminating.js.map +1 -1
- package/node/cp-node/fs/is-one-prong.js.map +1 -1
- package/node/cp-node/fs/is-sharp.js.map +1 -1
- package/node/cp-node/fs/is-terminating.js.map +1 -1
- package/node/cp-node/fs/traverse-cp.js.map +1 -1
- package/node/cp-node/fs/traverse-edges.js.map +1 -1
- package/node/cp-node/fs/traverse-vertices.js.map +1 -1
- package/node/debug/functions/draw-elem/bounding-hull.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-cp-node.js +1 -1
- package/node/debug/functions/draw-elem/draw-cp-node.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-cull.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-dull-corner.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-elem.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-leaves.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-loose-bounding-box.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-max-vertex.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-min-y.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-one-prong-at-dull-corner.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-one-prong.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-sharp-corner.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-speed.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-three-prong.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-tight-bounding-box.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-two-prong.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-vertex.js.map +1 -1
- package/node/debug/functions/general.js.map +1 -1
- package/node/find-2-prong/add-1-prong.js.map +1 -1
- package/node/find-2-prong/cull-bezier-pieces.d.ts +4 -4
- package/node/find-2-prong/cull-bezier-pieces.js +9 -9
- package/node/find-2-prong/cull-bezier-pieces.js.map +1 -1
- package/node/find-2-prong/find-2-prong.js +8 -8
- package/node/find-2-prong/find-2-prong.js.map +1 -1
- package/node/find-2-prong/find-equidistant-point-on-line-dd.js.map +1 -1
- package/node/find-2-prong/get-initial-bezier-pieces.d.ts +2 -2
- package/node/find-2-prong/get-initial-bezier-pieces.js +2 -2
- package/node/find-2-prong/get-initial-bezier-pieces.js.map +1 -1
- package/node/find-2-prong/reduce-radius.d.ts +1 -1
- package/node/find-2-prong/reduce-radius.js +5 -5
- package/node/find-2-prong/reduce-radius.js.map +1 -1
- package/node/find-3-prong.ts/calc-better-x.d.ts +2 -2
- package/node/find-3-prong.ts/calc-better-x.js +3 -3
- package/node/find-3-prong.ts/calc-better-x.js.map +1 -1
- package/node/find-3-prong.ts/calc-initial-3-prong-center.d.ts +2 -2
- package/node/find-3-prong.ts/calc-initial-3-prong-center.js +3 -3
- package/node/find-3-prong.ts/calc-initial-3-prong-center.js.map +1 -1
- package/node/find-3-prong.ts/find-3-prong-for-delta3s.d.ts +2 -2
- package/node/find-3-prong.ts/find-3-prong-for-delta3s.js +16 -16
- package/node/find-3-prong.ts/find-3-prong-for-delta3s.js.map +1 -1
- package/node/find-3-prong.ts/find-3-prong.js +2 -2
- package/node/find-3-prong.ts/find-3-prong.js.map +1 -1
- package/node/find-3-prong.ts/find-and-add-3-prong.js.map +1 -1
- package/node/find-3-prong.ts/find-and-add-3-prongs.js.map +1 -1
- package/node/find-3-prong.ts/get-closest-points.d.ts +2 -2
- package/node/find-3-prong.ts/get-closest-points.js +4 -4
- package/node/find-3-prong.ts/get-closest-points.js.map +1 -1
- package/node/find-mat/find-mats.js.map +1 -1
- package/node/geometry/get-closest-square-distance-to-rect.js.map +1 -1
- package/node/geometry/get-closest-squared-distance-to-rotated-rect.js.map +1 -1
- package/node/index.d.ts +35 -1
- package/node/index.js +36 -1
- package/node/index.js.map +1 -1
- package/node/mat/create-new-cp-tree.js.map +1 -1
- package/node/mat/get-boundary-piece-beziers.js +7 -7
- package/node/mat/get-boundary-piece-beziers.js.map +1 -1
- package/node/mat/get-largest-vertex.js.map +1 -1
- package/node/mat/trim-mat.js.map +1 -1
- package/node/memoize-primitive.js.map +1 -1
- package/node/sat/add-debug-info.js.map +1 -1
- package/node/sat/cull.d.ts +7 -5
- package/node/sat/cull.js +7 -4
- package/node/sat/cull.js.map +1 -1
- package/node/sat/get-leaves.js.map +1 -1
- package/node/sat/to-scale-axis.d.ts +3 -2
- package/node/sat/to-scale-axis.js +3 -2
- package/node/sat/to-scale-axis.js.map +1 -1
- package/node/svg/get-loop-bounds.js.map +1 -1
- package/node/svg/get-min-y-pos.js.map +1 -1
- package/node/sweep-line/sweep-line.js.map +1 -1
- package/package.json +6 -6
- package/src/add-n-prong.ts/join-spokes.ts +11 -11
- package/src/closest-boundary-point/cull-bezier-pieces.ts +12 -11
- package/src/closest-boundary-point/cull-by-loose-bounding-box.ts +8 -8
- package/src/closest-boundary-point/cull-by-tight-boundary-box.ts +8 -8
- package/src/closest-boundary-point/dd-deflate-with-running-error.ts +22 -22
- package/src/closest-boundary-point/get-best-distance-squared.ts +6 -6
- package/src/closest-boundary-point/get-close-boundary-points-certified.ts +41 -41
- package/src/contact-point/contact-point.ts +13 -13
- package/src/corner/get-corner.ts +39 -39
- package/src/corner/get-interface-ccw.ts +3 -3
- package/src/cp-node/cp-node-fs.ts +132 -135
- package/src/cp-node/cp-node.ts +30 -30
- package/src/cp-node/fs/clone.ts +4 -4
- package/src/cp-node/fs/cp-node-comparator.ts +13 -0
- package/src/cp-node/fs/find-first.ts +6 -6
- package/src/cp-node/fs/get-all-on-loop.ts +1 -1
- package/src/cp-node/fs/get-boundary-bezier-parts-to-next.ts +12 -18
- package/src/cp-node/fs/get-boundary-beziers-between.ts +6 -7
- package/src/cp-node/fs/get-boundary-beziers-to-next.ts +79 -53
- package/src/cp-node/fs/get-branch-beziers.ts +1 -1
- package/src/cp-node/fs/get-branch.ts +1 -1
- package/src/cp-node/fs/get-children.ts +8 -8
- package/src/cp-node/fs/get-first-exit.ts +11 -11
- package/src/cp-node/fs/get-mat-curve-to-next.ts +1 -1
- package/src/cp-node/fs/get-mat-curves-between.ts +1 -1
- package/src/cp-node/fs/get-prong-count.ts +8 -8
- package/src/cp-node/fs/get-real-prong-count.ts +3 -3
- package/src/cp-node/fs/get-salience.ts +2 -2
- package/src/cp-node/fs/get-speed.ts +1 -6
- package/src/cp-node/fs/get-vertex-forward-children.ts +10 -10
- package/src/cp-node/fs/is-fully-terminating.ts +3 -3
- package/src/cp-node/fs/is-one-prong.ts +8 -8
- package/src/cp-node/fs/is-sharp.ts +1 -1
- package/src/cp-node/fs/is-terminating.ts +1 -1
- package/src/cp-node/fs/iterate-all-on-loop.ts +6 -6
- package/src/cp-node/fs/traverse-all-forward.ts +11 -11
- package/src/cp-node/fs/traverse-cp.ts +19 -17
- package/src/cp-node/fs/traverse-edges.ts +10 -10
- package/src/cp-node/fs/traverse-vertices.ts +17 -17
- package/src/curve/curve.ts +26 -26
- package/src/debug/functions/cmp-cp-on-delta.ts +1 -1
- package/src/debug/functions/draw-elem/bounding-hull.ts +2 -2
- package/src/debug/functions/draw-elem/culls.ts +2 -2
- package/src/debug/functions/draw-elem/draw-cp-node.ts +30 -30
- package/src/debug/functions/draw-elem/draw-cull.ts +2 -2
- package/src/debug/functions/draw-elem/draw-dull-corner.ts +7 -7
- package/src/debug/functions/draw-elem/draw-elem.ts +28 -28
- package/src/debug/functions/draw-elem/draw-leaves.ts +12 -12
- package/src/debug/functions/draw-elem/draw-loose-bounding-box.ts +7 -7
- package/src/debug/functions/draw-elem/draw-max-vertex.ts +2 -2
- package/src/debug/functions/draw-elem/draw-min-y.ts +2 -2
- package/src/debug/functions/draw-elem/draw-one-prong-at-dull-corner.ts +1 -1
- package/src/debug/functions/draw-elem/draw-one-prong.ts +1 -1
- package/src/debug/functions/draw-elem/draw-sharp-corner.ts +6 -6
- package/src/debug/functions/draw-elem/draw-speed.ts +2 -2
- package/src/debug/functions/draw-elem/draw-three-prong.ts +28 -28
- package/src/debug/functions/draw-elem/draw-tight-bounding-box.ts +4 -4
- package/src/debug/functions/draw-elem/draw-two-prong.ts +51 -51
- package/src/debug/functions/draw-elem/draw-vertex.ts +12 -12
- package/src/debug/functions/draw-elem/dull-corner.ts +7 -7
- package/src/debug/functions/draw-elem/leaves.ts +2 -2
- package/src/debug/functions/draw-elem/loose-bounding-box.ts +7 -7
- package/src/debug/functions/draw-elem/max-vertex.ts +2 -2
- package/src/debug/functions/draw-elem/min-y.ts +2 -2
- package/src/debug/functions/draw-elem/one-prong-at-dull-corner.ts +1 -1
- package/src/debug/functions/draw-elem/one-prong.ts +1 -1
- package/src/debug/functions/draw-elem/sharp-corner.ts +6 -6
- package/src/debug/functions/draw-elem/three-prong.ts +19 -19
- package/src/debug/functions/draw-elem/tight-bounding-box.ts +4 -4
- package/src/debug/functions/draw-elem/two-prong.ts +44 -44
- package/src/debug/functions/draw-elem/vertex.ts +28 -28
- package/src/debug/functions/general.ts +18 -18
- package/src/debug/functions/three-prong.ts +184 -184
- package/src/debug/functions/two-prong.ts +201 -201
- package/src/debug/two-prong-for-debugging.ts +26 -26
- package/src/find-2-prong/add-1-prong.ts +25 -25
- package/src/find-2-prong/add-debug-info.ts +38 -38
- package/src/find-2-prong/cull-bezier-pieces.ts +10 -10
- package/src/find-2-prong/find-2-prong.ts +158 -158
- package/src/find-2-prong/find-equidistant-point-on-line-dd.ts +50 -50
- package/src/find-2-prong/find-equidistant-point-on-line.ts +27 -27
- package/src/find-2-prong/get-initial-bezier-pieces.ts +2 -2
- package/src/find-2-prong/reduce-radius.ts +5 -5
- package/src/find-3-prong.ts/calc-better-x.ts +3 -3
- package/src/find-3-prong.ts/calc-initial-3-prong-center.ts +3 -3
- package/src/find-3-prong.ts/find-3-prong-for-delta3s.ts +17 -17
- package/src/find-3-prong.ts/find-3-prong.ts +23 -23
- package/src/find-3-prong.ts/find-and-add-3-prong.ts +37 -37
- package/src/find-3-prong.ts/find-and-add-3-prongs.ts +30 -30
- package/src/find-3-prong.ts/get-closest-points.ts +4 -4
- package/src/find-mat/add-2-prongs-by-error.ts +8 -8
- package/src/find-mat/find-mats.ts +49 -49
- package/src/find-mat/fix-ordering.ts +2 -2
- package/src/find-mat/get-total-by.ts +12 -12
- package/src/geometry/get-closest-square-distance-to-rect.ts +37 -37
- package/src/geometry/get-closest-squared-distance-to-rotated-rect.ts +14 -14
- package/src/get-curve/get-curve-between.ts +1 -1
- package/src/index.ts +41 -4
- package/src/mat/cmp-cp-on-delta.ts +1 -1
- package/src/mat/create-new-cp-tree.ts +12 -12
- package/src/mat/get-boundary-piece-beziers.ts +7 -7
- package/src/mat/get-edges-as-array.ts +9 -9
- package/src/mat/get-largest-3-prong.ts +8 -8
- package/src/mat/get-largest-three-prong.ts +5 -5
- package/src/mat/get-largest-vertex.ts +6 -6
- package/src/mat/get-two-prong-type.ts +9 -9
- package/src/mat/trim-mat.ts +1 -1
- package/src/memoize-primitive.ts +14 -14
- package/src/sat/add-debug-info.ts +4 -4
- package/src/sat/cull-by-salience.ts +1 -1
- package/src/sat/cull.ts +10 -7
- package/src/sat/get-leaves.ts +0 -1
- package/src/sat/to-scale-axis.ts +18 -17
- package/src/svg/get-extreme.ts +8 -8
- package/src/svg/get-loop-bounds.ts +84 -84
- package/src/svg/get-min-y-pos.ts +1 -1
- package/src/sweep-line/sweep-line.ts +23 -23
- package/src/utils/bezier-piece-to-bezier.ts +7 -7
- package/__tests__/cp-node/fs/check-jsog-eql-calc.spec.ts +0 -30
- package/node/cp-node/fs/cp-nodes-to-boundary-beziers.d.ts +0 -3
- package/node/cp-node/fs/cp-nodes-to-boundary-beziers.js +0 -6
- package/node/cp-node/fs/cp-nodes-to-boundary-beziers.js.map +0 -1
- package/src/closest-boundary-point/get-closest-boundary-point-certified.ts +0 -70
- package/src/cp-node/fs/cp-nodes-to-boundary-beziers.ts +0 -10
|
@@ -1,41 +1,14 @@
|
|
|
1
|
-
import { findMats } from "
|
|
1
|
+
import { findMats } from "../../src/find-mat/find-mats.js";
|
|
2
|
+
import { Mat } from "../../src/index.js";
|
|
3
|
+
import { decodeJSOG } from "./decode-jsog.js";
|
|
4
|
+
import { getMats1 } from "./get-mats1.js";
|
|
5
|
+
import { toJsogBreathFirst } from "./to-jsog-breath-first.js";
|
|
2
6
|
|
|
3
7
|
|
|
4
|
-
|
|
5
|
-
const loops1 = [
|
|
6
|
-
[
|
|
7
|
-
[[139, 8], [82, -101]],
|
|
8
|
-
[[82, -101], [24, 8]],
|
|
9
|
-
[[24, 8], [46, 8]],
|
|
10
|
-
[[46, 8], [46, 54]],
|
|
11
|
-
[[46, 54], [117, 54]],
|
|
12
|
-
[[117, 54], [117, 8]],
|
|
13
|
-
[[117, 8], [139, 8]],
|
|
14
|
-
[[139, 8], [139, 8]]
|
|
15
|
-
]
|
|
16
|
-
];
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
let mats_calc1: any;
|
|
20
|
-
function getMats_calc1() {
|
|
21
|
-
if (!mats_calc1) {
|
|
22
|
-
mats_calc1 = findMats(loops1, {
|
|
23
|
-
applySat: false,
|
|
24
|
-
simplify: true,
|
|
25
|
-
satScale: 1.675,
|
|
26
|
-
maxCurviness: 0.05,
|
|
27
|
-
maxLength: 40,
|
|
28
|
-
// maxCurviness: 5,
|
|
29
|
-
// maxLength: 4000,
|
|
30
|
-
angleIncrement: 15,
|
|
31
|
-
simplifyTolerance: 2**-1
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
return mats_calc1;
|
|
35
|
-
}
|
|
8
|
+
toJsogBreathFirst(getMats1()); //?
|
|
36
9
|
|
|
37
10
|
|
|
38
|
-
const
|
|
11
|
+
const mats1Jsog: any = [
|
|
39
12
|
{
|
|
40
13
|
"@id": "1",
|
|
41
14
|
"cpNode": {
|
|
@@ -49,76 +22,13 @@ const mats_jsog1: any = [
|
|
|
49
22
|
"loop": {
|
|
50
23
|
"@id": "6",
|
|
51
24
|
"beziers": [
|
|
52
|
-
[
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
8
|
|
60
|
-
]
|
|
61
|
-
],
|
|
62
|
-
[
|
|
63
|
-
[
|
|
64
|
-
24,
|
|
65
|
-
8
|
|
66
|
-
],
|
|
67
|
-
[
|
|
68
|
-
46,
|
|
69
|
-
8
|
|
70
|
-
]
|
|
71
|
-
],
|
|
72
|
-
[
|
|
73
|
-
[
|
|
74
|
-
46,
|
|
75
|
-
8
|
|
76
|
-
],
|
|
77
|
-
[
|
|
78
|
-
46,
|
|
79
|
-
54
|
|
80
|
-
]
|
|
81
|
-
],
|
|
82
|
-
[
|
|
83
|
-
[
|
|
84
|
-
46,
|
|
85
|
-
54
|
|
86
|
-
],
|
|
87
|
-
[
|
|
88
|
-
117,
|
|
89
|
-
54
|
|
90
|
-
]
|
|
91
|
-
],
|
|
92
|
-
[
|
|
93
|
-
[
|
|
94
|
-
117,
|
|
95
|
-
54
|
|
96
|
-
],
|
|
97
|
-
[
|
|
98
|
-
117,
|
|
99
|
-
8
|
|
100
|
-
]
|
|
101
|
-
],
|
|
102
|
-
[
|
|
103
|
-
[
|
|
104
|
-
117,
|
|
105
|
-
8
|
|
106
|
-
],
|
|
107
|
-
[
|
|
108
|
-
139,
|
|
109
|
-
8
|
|
110
|
-
]
|
|
111
|
-
],
|
|
112
|
-
[
|
|
113
|
-
[
|
|
114
|
-
139,
|
|
115
|
-
8
|
|
116
|
-
],
|
|
117
|
-
[
|
|
118
|
-
82,
|
|
119
|
-
-101
|
|
120
|
-
]
|
|
121
|
-
]
|
|
25
|
+
[[82,-101],[24,8]],
|
|
26
|
+
[[24,8],[46,8]],
|
|
27
|
+
[[46,8],[46,54]],
|
|
28
|
+
[[46,54],[117,54]],
|
|
29
|
+
[[117,54],[117,8]],
|
|
30
|
+
[[117,8],[139,8]],
|
|
31
|
+
[[139,8],[82,-101]]
|
|
122
32
|
],
|
|
123
33
|
"curves": [
|
|
124
34
|
{
|
|
@@ -130,14 +40,8 @@ const mats_jsog1: any = [
|
|
|
130
40
|
"@ref": "6"
|
|
131
41
|
},
|
|
132
42
|
"ps": [
|
|
133
|
-
[
|
|
134
|
-
|
|
135
|
-
8
|
|
136
|
-
],
|
|
137
|
-
[
|
|
138
|
-
46,
|
|
139
|
-
8
|
|
140
|
-
]
|
|
43
|
+
[24,8],
|
|
44
|
+
[46,8]
|
|
141
45
|
],
|
|
142
46
|
"prev": {
|
|
143
47
|
"@ref": "5"
|
|
@@ -148,14 +52,8 @@ const mats_jsog1: any = [
|
|
|
148
52
|
"@ref": "6"
|
|
149
53
|
},
|
|
150
54
|
"ps": [
|
|
151
|
-
[
|
|
152
|
-
|
|
153
|
-
8
|
|
154
|
-
],
|
|
155
|
-
[
|
|
156
|
-
46,
|
|
157
|
-
54
|
|
158
|
-
]
|
|
55
|
+
[46,8],
|
|
56
|
+
[46,54]
|
|
159
57
|
],
|
|
160
58
|
"prev": {
|
|
161
59
|
"@ref": "7"
|
|
@@ -166,14 +64,8 @@ const mats_jsog1: any = [
|
|
|
166
64
|
"@ref": "6"
|
|
167
65
|
},
|
|
168
66
|
"ps": [
|
|
169
|
-
[
|
|
170
|
-
|
|
171
|
-
54
|
|
172
|
-
],
|
|
173
|
-
[
|
|
174
|
-
117,
|
|
175
|
-
54
|
|
176
|
-
]
|
|
67
|
+
[46,54],
|
|
68
|
+
[117,54]
|
|
177
69
|
],
|
|
178
70
|
"prev": {
|
|
179
71
|
"@ref": "8"
|
|
@@ -184,14 +76,8 @@ const mats_jsog1: any = [
|
|
|
184
76
|
"@ref": "6"
|
|
185
77
|
},
|
|
186
78
|
"ps": [
|
|
187
|
-
[
|
|
188
|
-
|
|
189
|
-
54
|
|
190
|
-
],
|
|
191
|
-
[
|
|
192
|
-
117,
|
|
193
|
-
8
|
|
194
|
-
]
|
|
79
|
+
[117,54],
|
|
80
|
+
[117,8]
|
|
195
81
|
],
|
|
196
82
|
"prev": {
|
|
197
83
|
"@ref": "9"
|
|
@@ -202,14 +88,8 @@ const mats_jsog1: any = [
|
|
|
202
88
|
"@ref": "6"
|
|
203
89
|
},
|
|
204
90
|
"ps": [
|
|
205
|
-
[
|
|
206
|
-
|
|
207
|
-
8
|
|
208
|
-
],
|
|
209
|
-
[
|
|
210
|
-
139,
|
|
211
|
-
8
|
|
212
|
-
]
|
|
91
|
+
[117,8],
|
|
92
|
+
[139,8]
|
|
213
93
|
],
|
|
214
94
|
"prev": {
|
|
215
95
|
"@ref": "10"
|
|
@@ -220,14 +100,8 @@ const mats_jsog1: any = [
|
|
|
220
100
|
"@ref": "6"
|
|
221
101
|
},
|
|
222
102
|
"ps": [
|
|
223
|
-
[
|
|
224
|
-
|
|
225
|
-
8
|
|
226
|
-
],
|
|
227
|
-
[
|
|
228
|
-
82,
|
|
229
|
-
-101
|
|
230
|
-
]
|
|
103
|
+
[139,8],
|
|
104
|
+
[82,-101]
|
|
231
105
|
],
|
|
232
106
|
"prev": {
|
|
233
107
|
"@ref": "11"
|
|
@@ -266,14 +140,8 @@ const mats_jsog1: any = [
|
|
|
266
140
|
"idx": 0
|
|
267
141
|
},
|
|
268
142
|
"ps": [
|
|
269
|
-
[
|
|
270
|
-
|
|
271
|
-
-101
|
|
272
|
-
],
|
|
273
|
-
[
|
|
274
|
-
24,
|
|
275
|
-
8
|
|
276
|
-
]
|
|
143
|
+
[82,-101],
|
|
144
|
+
[24,8]
|
|
277
145
|
],
|
|
278
146
|
"prev": {
|
|
279
147
|
"@ref": "12"
|
|
@@ -1069,276 +937,31 @@ const mats_jsog1: any = [
|
|
|
1069
937
|
"maxCoordinate": 139,
|
|
1070
938
|
"squaredDiagonalLength": 37250,
|
|
1071
939
|
"looseBoundingBoxes": [
|
|
1072
|
-
[
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
8
|
|
1080
|
-
]
|
|
1081
|
-
],
|
|
1082
|
-
[
|
|
1083
|
-
[
|
|
1084
|
-
24,
|
|
1085
|
-
8
|
|
1086
|
-
],
|
|
1087
|
-
[
|
|
1088
|
-
46,
|
|
1089
|
-
8
|
|
1090
|
-
]
|
|
1091
|
-
],
|
|
1092
|
-
[
|
|
1093
|
-
[
|
|
1094
|
-
46,
|
|
1095
|
-
8
|
|
1096
|
-
],
|
|
1097
|
-
[
|
|
1098
|
-
46,
|
|
1099
|
-
54
|
|
1100
|
-
]
|
|
1101
|
-
],
|
|
1102
|
-
[
|
|
1103
|
-
[
|
|
1104
|
-
46,
|
|
1105
|
-
54
|
|
1106
|
-
],
|
|
1107
|
-
[
|
|
1108
|
-
117,
|
|
1109
|
-
54
|
|
1110
|
-
]
|
|
1111
|
-
],
|
|
1112
|
-
[
|
|
1113
|
-
[
|
|
1114
|
-
117,
|
|
1115
|
-
8
|
|
1116
|
-
],
|
|
1117
|
-
[
|
|
1118
|
-
117,
|
|
1119
|
-
54
|
|
1120
|
-
]
|
|
1121
|
-
],
|
|
1122
|
-
[
|
|
1123
|
-
[
|
|
1124
|
-
117,
|
|
1125
|
-
8
|
|
1126
|
-
],
|
|
1127
|
-
[
|
|
1128
|
-
139,
|
|
1129
|
-
8
|
|
1130
|
-
]
|
|
1131
|
-
],
|
|
1132
|
-
[
|
|
1133
|
-
[
|
|
1134
|
-
82,
|
|
1135
|
-
-101
|
|
1136
|
-
],
|
|
1137
|
-
[
|
|
1138
|
-
139,
|
|
1139
|
-
8
|
|
1140
|
-
]
|
|
1141
|
-
]
|
|
940
|
+
[[24,-101],[82,8]],
|
|
941
|
+
[[24,8],[46,8]],
|
|
942
|
+
[[46,8],[46,54]],
|
|
943
|
+
[[46,54],[117,54]],
|
|
944
|
+
[[117,8],[117,54]],
|
|
945
|
+
[[117,8],[139,8]],
|
|
946
|
+
[[82,-101],[139,8]]
|
|
1142
947
|
],
|
|
1143
948
|
"tightBoundingBoxes": [
|
|
1144
|
-
[
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
7.999999999999986
|
|
1152
|
-
],
|
|
1153
|
-
[
|
|
1154
|
-
24.000000000000007,
|
|
1155
|
-
7.999999999999986
|
|
1156
|
-
],
|
|
1157
|
-
[
|
|
1158
|
-
82,
|
|
1159
|
-
-101
|
|
1160
|
-
]
|
|
1161
|
-
],
|
|
1162
|
-
[
|
|
1163
|
-
[
|
|
1164
|
-
24,
|
|
1165
|
-
8
|
|
1166
|
-
],
|
|
1167
|
-
[
|
|
1168
|
-
46,
|
|
1169
|
-
8
|
|
1170
|
-
],
|
|
1171
|
-
[
|
|
1172
|
-
46,
|
|
1173
|
-
8
|
|
1174
|
-
],
|
|
1175
|
-
[
|
|
1176
|
-
24,
|
|
1177
|
-
8
|
|
1178
|
-
]
|
|
1179
|
-
],
|
|
1180
|
-
[
|
|
1181
|
-
[
|
|
1182
|
-
46,
|
|
1183
|
-
8
|
|
1184
|
-
],
|
|
1185
|
-
[
|
|
1186
|
-
46,
|
|
1187
|
-
54
|
|
1188
|
-
],
|
|
1189
|
-
[
|
|
1190
|
-
46,
|
|
1191
|
-
54
|
|
1192
|
-
],
|
|
1193
|
-
[
|
|
1194
|
-
46,
|
|
1195
|
-
8
|
|
1196
|
-
]
|
|
1197
|
-
],
|
|
1198
|
-
[
|
|
1199
|
-
[
|
|
1200
|
-
46,
|
|
1201
|
-
54
|
|
1202
|
-
],
|
|
1203
|
-
[
|
|
1204
|
-
117,
|
|
1205
|
-
54
|
|
1206
|
-
],
|
|
1207
|
-
[
|
|
1208
|
-
117,
|
|
1209
|
-
54
|
|
1210
|
-
],
|
|
1211
|
-
[
|
|
1212
|
-
46,
|
|
1213
|
-
54
|
|
1214
|
-
]
|
|
1215
|
-
],
|
|
1216
|
-
[
|
|
1217
|
-
[
|
|
1218
|
-
117,
|
|
1219
|
-
54
|
|
1220
|
-
],
|
|
1221
|
-
[
|
|
1222
|
-
117,
|
|
1223
|
-
8
|
|
1224
|
-
],
|
|
1225
|
-
[
|
|
1226
|
-
117,
|
|
1227
|
-
8
|
|
1228
|
-
],
|
|
1229
|
-
[
|
|
1230
|
-
117,
|
|
1231
|
-
54
|
|
1232
|
-
]
|
|
1233
|
-
],
|
|
1234
|
-
[
|
|
1235
|
-
[
|
|
1236
|
-
117,
|
|
1237
|
-
8
|
|
1238
|
-
],
|
|
1239
|
-
[
|
|
1240
|
-
139,
|
|
1241
|
-
8
|
|
1242
|
-
],
|
|
1243
|
-
[
|
|
1244
|
-
139,
|
|
1245
|
-
8
|
|
1246
|
-
],
|
|
1247
|
-
[
|
|
1248
|
-
117,
|
|
1249
|
-
8
|
|
1250
|
-
]
|
|
1251
|
-
],
|
|
1252
|
-
[
|
|
1253
|
-
[
|
|
1254
|
-
139,
|
|
1255
|
-
8
|
|
1256
|
-
],
|
|
1257
|
-
[
|
|
1258
|
-
82,
|
|
1259
|
-
-100.99999999999999
|
|
1260
|
-
],
|
|
1261
|
-
[
|
|
1262
|
-
82,
|
|
1263
|
-
-100.99999999999999
|
|
1264
|
-
],
|
|
1265
|
-
[
|
|
1266
|
-
139,
|
|
1267
|
-
8
|
|
1268
|
-
]
|
|
1269
|
-
]
|
|
949
|
+
[[82,-101],[24.000000000000007,7.999999999999986],[24.000000000000007,7.999999999999986],[82,-101]],
|
|
950
|
+
[[24,8],[46,8],[46,8],[24,8]],
|
|
951
|
+
[[46,8],[46,54],[46,54],[46,8]],
|
|
952
|
+
[[46,54],[117,54],[117,54],[46,54]],
|
|
953
|
+
[[117,54],[117,8],[117,8],[117,54]],
|
|
954
|
+
[[117,8],[139,8],[139,8],[117,8]],
|
|
955
|
+
[[139,8],[82,-100.99999999999999],[82,-100.99999999999999],[139,8]]
|
|
1270
956
|
],
|
|
1271
957
|
"boundingHulls": [
|
|
1272
|
-
[
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
8
|
|
1280
|
-
]
|
|
1281
|
-
],
|
|
1282
|
-
[
|
|
1283
|
-
[
|
|
1284
|
-
24,
|
|
1285
|
-
8
|
|
1286
|
-
],
|
|
1287
|
-
[
|
|
1288
|
-
46,
|
|
1289
|
-
8
|
|
1290
|
-
]
|
|
1291
|
-
],
|
|
1292
|
-
[
|
|
1293
|
-
[
|
|
1294
|
-
46,
|
|
1295
|
-
8
|
|
1296
|
-
],
|
|
1297
|
-
[
|
|
1298
|
-
46,
|
|
1299
|
-
54
|
|
1300
|
-
]
|
|
1301
|
-
],
|
|
1302
|
-
[
|
|
1303
|
-
[
|
|
1304
|
-
46,
|
|
1305
|
-
54
|
|
1306
|
-
],
|
|
1307
|
-
[
|
|
1308
|
-
117,
|
|
1309
|
-
54
|
|
1310
|
-
]
|
|
1311
|
-
],
|
|
1312
|
-
[
|
|
1313
|
-
[
|
|
1314
|
-
117,
|
|
1315
|
-
8
|
|
1316
|
-
],
|
|
1317
|
-
[
|
|
1318
|
-
117,
|
|
1319
|
-
54
|
|
1320
|
-
]
|
|
1321
|
-
],
|
|
1322
|
-
[
|
|
1323
|
-
[
|
|
1324
|
-
117,
|
|
1325
|
-
8
|
|
1326
|
-
],
|
|
1327
|
-
[
|
|
1328
|
-
139,
|
|
1329
|
-
8
|
|
1330
|
-
]
|
|
1331
|
-
],
|
|
1332
|
-
[
|
|
1333
|
-
[
|
|
1334
|
-
82,
|
|
1335
|
-
-101
|
|
1336
|
-
],
|
|
1337
|
-
[
|
|
1338
|
-
139,
|
|
1339
|
-
8
|
|
1340
|
-
]
|
|
1341
|
-
]
|
|
958
|
+
[[82,-101],[24,8]],
|
|
959
|
+
[[24,8],[46,8]],
|
|
960
|
+
[[46,8],[46,54]],
|
|
961
|
+
[[46,54],[117,54]],
|
|
962
|
+
[[117,8],[117,54]],
|
|
963
|
+
[[117,8],[139,8]],
|
|
964
|
+
[[82,-101],[139,8]]
|
|
1342
965
|
],
|
|
1343
966
|
"sharpCorners": [
|
|
1344
967
|
{
|
|
@@ -6573,144 +6196,8 @@ const mats_jsog1: any = [
|
|
|
6573
6196
|
}
|
|
6574
6197
|
];
|
|
6575
6198
|
|
|
6576
|
-
/*
|
|
6577
|
-
Copy/paste this IIFE into the Chrome console to serialize an object to JSOG
|
|
6578
|
-
and copy the result to clipboard. Replace `temp1` with your root object.
|
|
6579
|
-
|
|
6580
|
-
(function () {
|
|
6581
|
-
const seen = new Map();
|
|
6582
|
-
let nextId = 1;
|
|
6583
|
-
|
|
6584
|
-
function encode(obj) {
|
|
6585
|
-
if (obj === null || typeof obj !== 'object') return obj;
|
|
6586
|
-
|
|
6587
|
-
if (seen.has(obj)) {
|
|
6588
|
-
return { '@ref': seen.get(obj) };
|
|
6589
|
-
}
|
|
6590
|
-
|
|
6591
|
-
// Arrays are encoded by value only because JSON drops custom array props
|
|
6592
|
-
// like "@id" during stringify.
|
|
6593
|
-
if (Array.isArray(obj)) {
|
|
6594
|
-
return obj.map(encode);
|
|
6595
|
-
}
|
|
6596
|
-
|
|
6597
|
-
const id = String(nextId++);
|
|
6598
|
-
seen.set(obj, id);
|
|
6599
|
-
|
|
6600
|
-
if (obj instanceof Map) {
|
|
6601
|
-
return {
|
|
6602
|
-
'@id': id,
|
|
6603
|
-
'@type': 'Map',
|
|
6604
|
-
entries: [...obj.entries()].map(([k, v]) => [encode(k), encode(v)])
|
|
6605
|
-
};
|
|
6606
|
-
}
|
|
6607
|
-
|
|
6608
|
-
if (obj instanceof Set) {
|
|
6609
|
-
return {
|
|
6610
|
-
'@id': id,
|
|
6611
|
-
'@type': 'Set',
|
|
6612
|
-
values: [...obj.values()].map(v => encode(v))
|
|
6613
|
-
};
|
|
6614
|
-
}
|
|
6615
|
-
|
|
6616
|
-
const result = { '@id': id };
|
|
6617
|
-
for (const [key, value] of Object.entries(obj)) {
|
|
6618
|
-
result[key] = encode(value);
|
|
6619
|
-
}
|
|
6620
|
-
return result;
|
|
6621
|
-
}
|
|
6622
|
-
|
|
6623
|
-
copy(JSON.stringify(encode(temp1), null, 2));
|
|
6624
|
-
console.log('JSOG copied to clipboard.');
|
|
6625
|
-
})();
|
|
6626
|
-
*/
|
|
6627
|
-
|
|
6628
|
-
|
|
6629
|
-
|
|
6630
|
-
/**
|
|
6631
|
-
* Decodes a JSOG-encoded object back into a live circular graph.
|
|
6632
|
-
*/
|
|
6633
|
-
function decodeJSOG(jsog: any) {
|
|
6634
|
-
const idMap = new Map<string, any>();
|
|
6635
|
-
|
|
6636
|
-
// Pass 1: catalog all objects that have an @id.
|
|
6637
|
-
function findIds(obj: any) {
|
|
6638
|
-
if (!obj || typeof obj !== 'object') return;
|
|
6639
|
-
|
|
6640
|
-
if (Array.isArray(obj)) {
|
|
6641
|
-
obj.forEach(findIds);
|
|
6642
|
-
return;
|
|
6643
|
-
}
|
|
6644
|
-
|
|
6645
|
-
if (obj['@id'] !== undefined) {
|
|
6646
|
-
const id = String(obj['@id']);
|
|
6647
|
-
if (!idMap.has(id)) {
|
|
6648
|
-
if (obj['@type'] === 'Map') {
|
|
6649
|
-
idMap.set(id, new Map());
|
|
6650
|
-
} else if (obj['@type'] === 'Set') {
|
|
6651
|
-
idMap.set(id, new Set());
|
|
6652
|
-
} else {
|
|
6653
|
-
idMap.set(id, {});
|
|
6654
|
-
}
|
|
6655
|
-
}
|
|
6656
|
-
}
|
|
6657
|
-
|
|
6658
|
-
Object.entries(obj).forEach(([key, val]) => {
|
|
6659
|
-
if (key !== '@ref') {
|
|
6660
|
-
findIds(val);
|
|
6661
|
-
}
|
|
6662
|
-
});
|
|
6663
|
-
}
|
|
6664
|
-
|
|
6665
|
-
// Pass 2: reconstruct the graph by swapping @ref for the actual object.
|
|
6666
|
-
function resolve(obj: any): any {
|
|
6667
|
-
if (!obj || typeof obj !== 'object') return obj;
|
|
6668
|
-
|
|
6669
|
-
if (Array.isArray(obj)) {
|
|
6670
|
-
return obj.map(resolve);
|
|
6671
|
-
}
|
|
6672
|
-
|
|
6673
|
-
if (obj['@ref'] !== undefined) {
|
|
6674
|
-
const refId = String(obj['@ref']);
|
|
6675
|
-
if (!idMap.has(refId)) {
|
|
6676
|
-
throw new Error(`Invalid JSOG: missing @id for @ref "${refId}".`);
|
|
6677
|
-
}
|
|
6678
|
-
return idMap.get(refId);
|
|
6679
|
-
}
|
|
6680
|
-
|
|
6681
|
-
const result = obj['@id'] !== undefined
|
|
6682
|
-
? idMap.get(String(obj['@id']))
|
|
6683
|
-
: {};
|
|
6684
|
-
|
|
6685
|
-
if (obj['@type'] === 'Map') {
|
|
6686
|
-
for (const pair of obj.entries ?? []) {
|
|
6687
|
-
if (!Array.isArray(pair) || pair.length !== 2) continue;
|
|
6688
|
-
result.set(resolve(pair[0]), resolve(pair[1]));
|
|
6689
|
-
}
|
|
6690
|
-
return result;
|
|
6691
|
-
}
|
|
6692
|
-
|
|
6693
|
-
if (obj['@type'] === 'Set') {
|
|
6694
|
-
for (const value of obj.values ?? []) {
|
|
6695
|
-
result.add(resolve(value));
|
|
6696
|
-
}
|
|
6697
|
-
return result;
|
|
6698
|
-
}
|
|
6699
|
-
|
|
6700
|
-
for (const key in obj) {
|
|
6701
|
-
if (key === '@id' || key === '@type') continue;
|
|
6702
|
-
result[key] = resolve(obj[key]);
|
|
6703
|
-
}
|
|
6704
|
-
|
|
6705
|
-
return result;
|
|
6706
|
-
}
|
|
6707
|
-
|
|
6708
|
-
findIds(jsog);
|
|
6709
|
-
return resolve(jsog);
|
|
6710
|
-
}
|
|
6711
|
-
|
|
6712
6199
|
|
|
6713
|
-
const
|
|
6200
|
+
const mats1_ = decodeJSOG(mats1Jsog);
|
|
6714
6201
|
|
|
6715
6202
|
|
|
6716
|
-
export {
|
|
6203
|
+
export { mats1_, getMats1 };
|