flo-mat 4.0.2 → 4.0.3
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__/specific-cases/specific-cases.spec.ts +6 -0
- package/browser/index.js +4511 -7115
- package/browser/index.min.js +1 -1
- package/node/cp-node/fs/is-on-same-loop.d.ts +3 -0
- package/node/cp-node/fs/is-on-same-loop.js +6 -0
- package/node/cp-node/fs/is-on-same-loop.js.map +1 -0
- package/node/debug/debug.d.ts +10 -15
- package/node/debug/debug.js +35 -46
- package/node/debug/debug.js.map +1 -1
- package/node/find-2-prong/add-1-prong.js +1 -4
- package/node/find-2-prong/add-1-prong.js.map +1 -1
- package/node/find-mat/find-mat.js +1 -2
- package/node/find-mat/find-mat.js.map +1 -1
- package/node/find-mat/get-meta.d.ts +1 -6
- package/node/find-mat/get-meta.js +4 -26
- package/node/find-mat/get-meta.js.map +1 -1
- package/node/index.d.ts +4 -2
- package/node/index.js +3 -1
- package/node/index.js.map +1 -1
- package/node/reconstruct-from-mat/filter-zero-length.d.ts +10 -0
- package/node/reconstruct-from-mat/filter-zero-length.js +14 -0
- package/node/reconstruct-from-mat/filter-zero-length.js.map +1 -0
- package/node/reconstruct-from-mat/get-all-on-loop-by-loop.d.ts +7 -0
- package/node/reconstruct-from-mat/get-all-on-loop-by-loop.js +38 -0
- package/node/reconstruct-from-mat/get-all-on-loop-by-loop.js.map +1 -0
- package/node/reconstruct-from-mat/get-bezier-piece-length.d.ts +3 -0
- package/node/reconstruct-from-mat/get-bezier-piece-length.js +6 -0
- package/node/reconstruct-from-mat/get-bezier-piece-length.js.map +1 -0
- package/node/reconstruct-from-mat/get-boundary.d.ts +7 -0
- package/node/reconstruct-from-mat/get-boundary.js +18 -0
- package/node/reconstruct-from-mat/get-boundary.js.map +1 -0
- package/node/reconstruct-from-mat/get-cp-nodess-for-sat.d.ts +4 -0
- package/node/reconstruct-from-mat/get-cp-nodess-for-sat.js +15 -0
- package/node/reconstruct-from-mat/get-cp-nodess-for-sat.js.map +1 -0
- package/node/reconstruct-from-mat/get-matching-beziers.d.ts +10 -0
- package/node/reconstruct-from-mat/get-matching-beziers.js +29 -0
- package/node/reconstruct-from-mat/get-matching-beziers.js.map +1 -0
- package/node/reconstruct-from-mat/get-mbss-by-loop-per-sat.d.ts +6 -0
- package/node/reconstruct-from-mat/get-mbss-by-loop-per-sat.js +10 -0
- package/node/reconstruct-from-mat/get-mbss-by-loop-per-sat.js.map +1 -0
- package/node/reconstruct-from-mat/get-mbss-by-loop-with-opp-arr.d.ts +7 -0
- package/node/reconstruct-from-mat/get-mbss-by-loop-with-opp-arr.js +47 -0
- package/node/reconstruct-from-mat/get-mbss-by-loop-with-opp-arr.js.map +1 -0
- package/node/reconstruct-from-mat/get-sats2.d.ts +10 -0
- package/node/reconstruct-from-mat/get-sats2.js +16 -0
- package/node/reconstruct-from-mat/get-sats2.js.map +1 -0
- package/node/reconstruct-from-mat/is-fully-terminating.d.ts +3 -0
- package/node/reconstruct-from-mat/is-fully-terminating.js +19 -0
- package/node/reconstruct-from-mat/is-fully-terminating.js.map +1 -0
- package/node/reconstruct-from-mat/matched-beziers.d.ts +10 -0
- package/node/reconstruct-from-mat/matched-beziers.js +2 -0
- package/node/reconstruct-from-mat/matched-beziers.js.map +1 -0
- package/node/reconstruct-from-mat/reconstruct-from-mat.d.ts +4 -0
- package/node/reconstruct-from-mat/reconstruct-from-mat.js +28 -0
- package/node/reconstruct-from-mat/reconstruct-from-mat.js.map +1 -0
- package/node/reconstruct-from-mat/remove-sat-induced-trivial-3prongs.d.ts +12 -0
- package/node/reconstruct-from-mat/remove-sat-induced-trivial-3prongs.js +46 -0
- package/node/reconstruct-from-mat/remove-sat-induced-trivial-3prongs.js.map +1 -0
- package/node/reconstruct-from-mat/split-tri-path.d.ts +5 -0
- package/node/reconstruct-from-mat/split-tri-path.js +209 -0
- package/node/reconstruct-from-mat/split-tri-path.js.map +1 -0
- package/node/sat/add-debug-info.js +1 -2
- package/node/sat/add-debug-info.js.map +1 -1
- package/node/utils/clip.d.ts +2 -0
- package/node/utils/clip.js +6 -0
- package/node/utils/clip.js.map +1 -0
- package/package.json +2 -2
- package/src/cp-node/fs/is-on-same-loop.ts +15 -0
- package/src/debug/debug.ts +54 -72
- package/src/find-2-prong/add-1-prong.ts +1 -5
- package/src/find-mat/find-mat.ts +1 -2
- package/src/find-mat/get-meta.ts +3 -38
- package/src/index.ts +5 -3
- package/src/reconstruct-from-mat/filter-zero-length.ts +23 -0
- package/src/reconstruct-from-mat/get-all-on-loop-by-loop.ts +52 -0
- package/src/reconstruct-from-mat/get-bezier-piece-length.ts +12 -0
- package/src/reconstruct-from-mat/get-boundary.ts +32 -0
- package/src/reconstruct-from-mat/get-cp-nodess-for-sat.ts +24 -0
- package/src/reconstruct-from-mat/get-matching-beziers.ts +46 -0
- package/src/reconstruct-from-mat/get-mbss-by-loop-per-sat.ts +19 -0
- package/src/reconstruct-from-mat/get-mbss-by-loop-with-opp-arr.ts +69 -0
- package/src/reconstruct-from-mat/get-sats2.ts +25 -0
- package/src/reconstruct-from-mat/is-fully-terminating.ts +27 -0
- package/src/reconstruct-from-mat/matched-beziers.ts +14 -0
- package/src/reconstruct-from-mat/reconstruct-from-mat.ts +45 -0
- package/src/reconstruct-from-mat/remove-sat-induced-trivial-3prongs.ts +62 -0
- package/src/reconstruct-from-mat/split-tri-path.ts +280 -0
- package/src/sat/add-debug-info.ts +1 -2
- package/src/utils/clip.ts +13 -0
- package/node/debug/functions/general.d.ts +0 -48
- package/node/debug/functions/general.js +0 -53
- package/node/debug/functions/general.js.map +0 -1
- package/node/point-on-shape/pos-to-human-string.d.ts +0 -8
- package/node/point-on-shape/pos-to-human-string.js +0 -12
- package/node/point-on-shape/pos-to-human-string.js.map +0 -1
- package/src/debug/elem-type-two-prong.ts +0 -8
- package/src/debug/functions/cmp-cp-on-delta.ts +0 -54
- package/src/debug/functions/general.ts +0 -79
- package/src/debug/functions/three-prong.ts +0 -249
- package/src/debug/functions/two-prong.ts +0 -203
- package/src/find-2-prong/add-debug-info.ts +0 -45
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
// /** @internal */
|
|
2
|
-
// declare let _debug_: Debug;
|
|
3
|
-
|
|
4
|
-
// import { drawFs } from 'flo-draw';
|
|
5
|
-
// import { equal, getObjClosestTo } from 'flo-vector2d';
|
|
6
|
-
// import { Debug } from '../debug.js';
|
|
7
|
-
// import { ThreeProngForDebugging } from '../three-prong-for-debugging.js';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
// /** @internal */
|
|
11
|
-
// export interface IThreeProngDebugFunctions {
|
|
12
|
-
// drawSpokes : (g: SVGGElement, n: number) => void,
|
|
13
|
-
// traceConvergence : (g: SVGGElement, n: number, indx: number) => void,
|
|
14
|
-
// showBoundary : (g: SVGGElement, n: number, indx: number) => void,
|
|
15
|
-
// logδs : (n: number) => void,
|
|
16
|
-
// logNearest : (
|
|
17
|
-
// showSpokes? : boolean,
|
|
18
|
-
// showTrace? : boolean,
|
|
19
|
-
// showBoundaries? : boolean
|
|
20
|
-
// ) => (g: SVGGElement, p: number[], showDelay?: number) => void
|
|
21
|
-
// }
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
// /**
|
|
25
|
-
// * @internal
|
|
26
|
-
// * Draws 3 lines from the given 3-prong center to its 3 contact points.
|
|
27
|
-
// * @param n - The 3-prong's zero-based index.
|
|
28
|
-
// */
|
|
29
|
-
// function drawSpokes(g: SVGGElement, n: number): void {
|
|
30
|
-
// const threeProng = _debug_.generated.elems.threeProng[n];
|
|
31
|
-
// const cc = threeProng.circle.center;
|
|
32
|
-
// const poss = threeProng.poss;
|
|
33
|
-
|
|
34
|
-
// for (let i=0; i<poss.length; i++) {
|
|
35
|
-
// const pos = poss[i];
|
|
36
|
-
// drawFs.line(g, [pos.p, cc], 'thin5 red');
|
|
37
|
-
// }
|
|
38
|
-
// }
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
// /**
|
|
42
|
-
// * @internal
|
|
43
|
-
// * Shows the circle for each boundary iteration.
|
|
44
|
-
// * @param n_ - The 3-prong's zero-based index. If ommitted, all will be shown.
|
|
45
|
-
// * @param idx - The specific boundary iteration index to view. If ommitted, all
|
|
46
|
-
// * will be shown.
|
|
47
|
-
// */
|
|
48
|
-
// function traceConvergence(g: SVGGElement, n_: number, idx: number): void {
|
|
49
|
-
// let sIndx;
|
|
50
|
-
// let eIndx;
|
|
51
|
-
// if (n_ === undefined) {
|
|
52
|
-
// sIndx = 0;
|
|
53
|
-
// eIndx = _debug_.generated.elems.threeProng.length;
|
|
54
|
-
// } else {
|
|
55
|
-
// sIndx = n_;
|
|
56
|
-
// eIndx = n_ + 1;
|
|
57
|
-
// }
|
|
58
|
-
|
|
59
|
-
// for (let n=sIndx; n<eIndx; n++) {
|
|
60
|
-
|
|
61
|
-
// const forDebugging = _debug_.generated.elems.threeProng[n];
|
|
62
|
-
// //const g = forDebugging.generated.g;
|
|
63
|
-
|
|
64
|
-
// console.log(forDebugging);
|
|
65
|
-
|
|
66
|
-
// const candidateThreeProngs = forDebugging.candidateThreeProngs;
|
|
67
|
-
|
|
68
|
-
// //-----------------------------
|
|
69
|
-
// //---- Get start and end index
|
|
70
|
-
// //-----------------------------
|
|
71
|
-
// let startIndx;
|
|
72
|
-
// let endIndx;
|
|
73
|
-
// if (n_ === undefined || idx === -1) {
|
|
74
|
-
// startIndx = forDebugging.bestIndx;
|
|
75
|
-
// endIndx = forDebugging.bestIndx + 1;
|
|
76
|
-
// } else {
|
|
77
|
-
// if (idx === undefined) {
|
|
78
|
-
// startIndx = 0;
|
|
79
|
-
// endIndx = candidateThreeProngs.length;
|
|
80
|
-
// } else {
|
|
81
|
-
// startIndx = idx;
|
|
82
|
-
// endIndx = idx + 1;
|
|
83
|
-
// }
|
|
84
|
-
// }
|
|
85
|
-
|
|
86
|
-
// //---------------------------------
|
|
87
|
-
// //---- Draw candidate three-prongs
|
|
88
|
-
// //---------------------------------
|
|
89
|
-
// for (let i=startIndx; i<endIndx; i++) {
|
|
90
|
-
// const circle = candidateThreeProngs[i].circle;
|
|
91
|
-
// if (forDebugging.bestIndx === i) {
|
|
92
|
-
// drawFs.dot(g, circle.center, 0.2, 'green');
|
|
93
|
-
// drawFs.circle(g, circle, 'black thin10 nofill');
|
|
94
|
-
// } else {
|
|
95
|
-
// drawFs.dot(g, circle.center, 0.2, 'cyan');
|
|
96
|
-
// drawFs.circle(g, circle, 'cyan thin5 nofill');
|
|
97
|
-
// }
|
|
98
|
-
// }
|
|
99
|
-
// }
|
|
100
|
-
// }
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
// /**
|
|
104
|
-
// * @internal
|
|
105
|
-
// * Shows the actual boundary for each iteration.
|
|
106
|
-
// * @param n The 3-prong's zero-based index.
|
|
107
|
-
// * @param idx The specific boundary iteration index to view. If ommitted will
|
|
108
|
-
// * show all.
|
|
109
|
-
// */
|
|
110
|
-
// function showBoundary(g: SVGGElement, n: number, idx: number): void {
|
|
111
|
-
// const debugInfo = _debug_.generated.elems.threeProng[n];
|
|
112
|
-
// //const g = debugInfo.generated.g;
|
|
113
|
-
|
|
114
|
-
// const candidateThreeProngs = debugInfo.candidateThreeProngs;
|
|
115
|
-
|
|
116
|
-
// const startIndx = idx === undefined ? 0 : idx;
|
|
117
|
-
// const endIndx = idx === undefined ? candidateThreeProngs.length : idx;
|
|
118
|
-
|
|
119
|
-
// // Draw relevant δs
|
|
120
|
-
// const cpss = debugInfo.cpss;
|
|
121
|
-
// let j = 0;
|
|
122
|
-
// // For each iteration of δ3s (indexed by j)
|
|
123
|
-
// for (let idx=1; idx<cpss.length-1; idx++) {
|
|
124
|
-
|
|
125
|
-
// if (!(j >= startIndx && j <= endIndx)) {
|
|
126
|
-
// j++;
|
|
127
|
-
// continue;
|
|
128
|
-
// }
|
|
129
|
-
|
|
130
|
-
// const δ3s = [
|
|
131
|
-
// cpss[0],
|
|
132
|
-
// cpss[idx],
|
|
133
|
-
// cpss[cpss.length-1]
|
|
134
|
-
// ];
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
// // For each of the 3 δs
|
|
138
|
-
// for (let i=0; i<3; i++) {
|
|
139
|
-
// const δ = δ3s[i];
|
|
140
|
-
// const δS = δ[0]; // Delta Start
|
|
141
|
-
// const δE = δ[1]; // Delta End
|
|
142
|
-
|
|
143
|
-
// const posS = δS.cp.pointOnShape;
|
|
144
|
-
// const posE = δE.cp.pointOnShape;
|
|
145
|
-
|
|
146
|
-
// const pS = posS.p;
|
|
147
|
-
// const pE = posE.p;
|
|
148
|
-
|
|
149
|
-
// const r = 1 + (i*0.5);
|
|
150
|
-
|
|
151
|
-
// if (equal(pS, pE)) {
|
|
152
|
-
// drawFs.crossHair(g, pS, 'red thin10 nofill', r);
|
|
153
|
-
// } else {
|
|
154
|
-
// drawFs.crossHair(g, pS, 'green thin10 nofill', r);
|
|
155
|
-
// drawFs.crossHair(g, pE, 'blue thin10 nofill', r);
|
|
156
|
-
// }
|
|
157
|
-
// }
|
|
158
|
-
|
|
159
|
-
// j++;
|
|
160
|
-
// }
|
|
161
|
-
// }
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
// /**
|
|
165
|
-
// * @internal
|
|
166
|
-
// * @param n The 3-prong's zero-based index.
|
|
167
|
-
// */
|
|
168
|
-
// function logδs(n: number): void {
|
|
169
|
-
// const threeProng = _debug_.generated.elems.threeProng[n];
|
|
170
|
-
|
|
171
|
-
// console.log(threeProng.cpss);
|
|
172
|
-
// }
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
// /**
|
|
176
|
-
// * @internal
|
|
177
|
-
// * @param p
|
|
178
|
-
// */
|
|
179
|
-
// function logNearest(
|
|
180
|
-
// showSpokes = true,
|
|
181
|
-
// showTrace = true,
|
|
182
|
-
// showBoundaries = true) {
|
|
183
|
-
|
|
184
|
-
// return function(g: SVGGElement, p: number[], showDelay = 1000) {
|
|
185
|
-
// const generated = _debug_.generated;
|
|
186
|
-
|
|
187
|
-
// const threeProng = getObjClosestTo<ThreeProngForDebugging>(
|
|
188
|
-
// p,
|
|
189
|
-
// generated.elems.threeProng,
|
|
190
|
-
// threeProng => threeProng.circle ? threeProng.circle.center : [0,0]
|
|
191
|
-
// )!;
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
// const circle = threeProng.circle;
|
|
195
|
-
// //const g = threeProng.generated.g;
|
|
196
|
-
|
|
197
|
-
// console.log(threeProng);
|
|
198
|
-
|
|
199
|
-
// const circle2 = {
|
|
200
|
-
// center: circle.center,
|
|
201
|
-
// radius: circle.radius || 1
|
|
202
|
-
// };
|
|
203
|
-
|
|
204
|
-
// //const draw = _debug_.fs.draw;
|
|
205
|
-
|
|
206
|
-
// drawFs.circle(g, circle2, 'blue thin10 nofill', showDelay);
|
|
207
|
-
// drawFs.crossHair(g, circle.center, 'red thin2 nofill', 2, showDelay);
|
|
208
|
-
|
|
209
|
-
// if (showSpokes) {
|
|
210
|
-
// drawFs.line(g, [threeProng.poss[0].p, circle.center], 'blue thin5 nofill', showDelay);
|
|
211
|
-
// drawFs.line(g, [threeProng.poss[1].p, circle.center], 'blue thin5 nofill', showDelay);
|
|
212
|
-
// drawFs.line(g, [threeProng.poss[2].p, circle.center], 'blue thin5 nofill', showDelay);
|
|
213
|
-
// }
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
// if (showBoundaries) {
|
|
217
|
-
// const boundaries = threeProng.boundaries;
|
|
218
|
-
// const boundaryS = boundaries[0];
|
|
219
|
-
// const boundaryE = boundaries[boundaries.length-1];
|
|
220
|
-
|
|
221
|
-
// drawFs.beziers(g, boundaryS, 'red thin20 nofill', showDelay);
|
|
222
|
-
// for (let i=1; i<boundaries.length-1; i++) {
|
|
223
|
-
// const boundary = boundaries[i];
|
|
224
|
-
// drawFs.beziers(g, boundary, 'green thin20 nofill', showDelay);
|
|
225
|
-
// }
|
|
226
|
-
// drawFs.beziers(g, boundaryE, 'blue thin20 nofill', showDelay);
|
|
227
|
-
// }
|
|
228
|
-
|
|
229
|
-
// if (showTrace) {
|
|
230
|
-
// const traces = threeProng.traces;
|
|
231
|
-
// for (const trace of traces) {
|
|
232
|
-
// drawFs.polyline(g, trace, 'red thin5 nofill', showDelay)
|
|
233
|
-
// }
|
|
234
|
-
// }
|
|
235
|
-
// }
|
|
236
|
-
// }
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
// /** @internal */
|
|
240
|
-
// const threeProngDebugFunctions: IThreeProngDebugFunctions = {
|
|
241
|
-
// drawSpokes,
|
|
242
|
-
// traceConvergence,
|
|
243
|
-
// showBoundary,
|
|
244
|
-
// logδs,
|
|
245
|
-
// logNearest
|
|
246
|
-
// }
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
// export { threeProngDebugFunctions }
|
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
// declare let _debug_: Debug;
|
|
2
|
-
|
|
3
|
-
// import { drawFs } from 'flo-draw';
|
|
4
|
-
// import { getObjClosestTo, distanceBetween, squaredDistanceBetween } from 'flo-vector2d';
|
|
5
|
-
// import { Debug, Generated } from '../debug.js';
|
|
6
|
-
// import { CpNode } from '../../cp-node/cp-node.js';
|
|
7
|
-
// import { Circle } from '../../geometry/circle.js';
|
|
8
|
-
// import { TwoProngForDebugging } from '../two-prong-for-debugging.js';
|
|
9
|
-
// import { ElemType_TwoProng } from '../../mat/elem-type-two-prong.js';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
// /** @internal */
|
|
13
|
-
// interface ITwoProngDebugFunctions {
|
|
14
|
-
// logδ : (n: number, type?: ElemType_TwoProng) => void,
|
|
15
|
-
// log : (n: number, type?: ElemType_TwoProng) => void,
|
|
16
|
-
// drawNormal : typeof drawNormal,
|
|
17
|
-
// logδBasic : (n: number) => void,
|
|
18
|
-
// logNearest : (
|
|
19
|
-
// showSpokes? : boolean,
|
|
20
|
-
// showTrace? : boolean,
|
|
21
|
-
// showBoundaries? : boolean
|
|
22
|
-
// ) => (g: SVGGElement, p: number[], showDelay?: number, scale?: number) => void,
|
|
23
|
-
// traceConvergence: typeof traceConvergence,
|
|
24
|
-
// }
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
// /**
|
|
28
|
-
// * @internal
|
|
29
|
-
// */
|
|
30
|
-
// function logδ(n: number, type: ElemType_TwoProng = 'twoProng_regular') {
|
|
31
|
-
// const δ =_debug_.generated.elems[type][n].δ;
|
|
32
|
-
|
|
33
|
-
// console.log(δ);
|
|
34
|
-
// }
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
// /**
|
|
38
|
-
// * @internal
|
|
39
|
-
// */
|
|
40
|
-
// function log(n: number, type: ElemType_TwoProng = 'twoProng_regular') {
|
|
41
|
-
// const twoProng = _debug_.generated.elems[type][n];
|
|
42
|
-
// console.log(twoProng);
|
|
43
|
-
// }
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
// /**
|
|
47
|
-
// * @internal
|
|
48
|
-
// */
|
|
49
|
-
// function drawNormal(
|
|
50
|
-
// g: SVGGElement,
|
|
51
|
-
// twoProng: TwoProngForDebugging,
|
|
52
|
-
// showDelay = 1000) {
|
|
53
|
-
|
|
54
|
-
// drawFs.line(
|
|
55
|
-
// g, [twoProng.pos.p, twoProng.circle.center], 'thin10 blue', showDelay
|
|
56
|
-
// );
|
|
57
|
-
// }
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
// /**
|
|
61
|
-
// * @internal
|
|
62
|
-
// */
|
|
63
|
-
// function logδBasic(
|
|
64
|
-
// n: number,
|
|
65
|
-
// type: ElemType_TwoProng = 'twoProng_regular') {
|
|
66
|
-
|
|
67
|
-
// const delta = _debug_.generated.elems[type][n].δ;
|
|
68
|
-
|
|
69
|
-
// function logδBasic_(x: CpNode) {
|
|
70
|
-
// const pos = x.cp.pointOnShape;
|
|
71
|
-
// return {
|
|
72
|
-
// bez: pos.curve.ps,
|
|
73
|
-
// t: pos.t
|
|
74
|
-
// }
|
|
75
|
-
// }
|
|
76
|
-
|
|
77
|
-
// console.log(logδBasic_(delta[0]));
|
|
78
|
-
// console.log(logδBasic_(delta[1]));
|
|
79
|
-
// }
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
// /**
|
|
83
|
-
// * @internal
|
|
84
|
-
// * Draws 3 lines from the given 3-prong center to its 3 contact points.
|
|
85
|
-
// * @param n - The 3-prong's zero-based index.
|
|
86
|
-
// */
|
|
87
|
-
// function drawSpokes(
|
|
88
|
-
// g: SVGGElement,
|
|
89
|
-
// twoProng: TwoProngForDebugging,
|
|
90
|
-
// showDelay = 1000): void {
|
|
91
|
-
|
|
92
|
-
// const cc = twoProng.circle.center;
|
|
93
|
-
// const { pos, circle, cpNode, xs, z, δ } = twoProng;
|
|
94
|
-
|
|
95
|
-
// drawFs.line(g, [pos.p, cc], 'thin5 red', showDelay);
|
|
96
|
-
// drawFs.line(g, [z, cc], 'thin5 red', showDelay);
|
|
97
|
-
// }
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
// /**
|
|
101
|
-
// * @internal
|
|
102
|
-
// */
|
|
103
|
-
// function logNearest(
|
|
104
|
-
// showSpokes?: boolean,
|
|
105
|
-
// showTrace?: boolean,
|
|
106
|
-
// showBoundaries?: boolean) {
|
|
107
|
-
|
|
108
|
-
// return (g: SVGGElement,
|
|
109
|
-
// p: number[],
|
|
110
|
-
// showDelay = 1000,
|
|
111
|
-
// scale = 1) => {
|
|
112
|
-
|
|
113
|
-
// const closestPerLoops: TwoProngForDebugging[] = [];
|
|
114
|
-
|
|
115
|
-
// const generated = _debug_.generated;
|
|
116
|
-
// const twoProng = getObjClosestTo<TwoProngForDebugging>(
|
|
117
|
-
// p,
|
|
118
|
-
// // generated.elems[type],
|
|
119
|
-
// generated.elems['twoProng_regular'],
|
|
120
|
-
// twoProng => twoProng.circle.center
|
|
121
|
-
// )!;
|
|
122
|
-
// closestPerLoops.push(twoProng!);
|
|
123
|
-
|
|
124
|
-
// console.log(twoProng);
|
|
125
|
-
|
|
126
|
-
// let n;
|
|
127
|
-
// //for (let i=0; i<_debug_.generated.elems[type].length; i++) {
|
|
128
|
-
// // const twoProng_ = _debug_.generated.elems[type][i];
|
|
129
|
-
// for (let i=0; i<_debug_.generated.elems['twoProng_regular'].length; i++) {
|
|
130
|
-
// const twoProng_ = _debug_.generated.elems['twoProng_regular'][i];
|
|
131
|
-
// if (twoProng_ === twoProng) {
|
|
132
|
-
// n = i;
|
|
133
|
-
// break;
|
|
134
|
-
// }
|
|
135
|
-
// }
|
|
136
|
-
|
|
137
|
-
// if (showSpokes) {
|
|
138
|
-
// drawSpokes(g, twoProng, showDelay)
|
|
139
|
-
// }
|
|
140
|
-
|
|
141
|
-
// if (n !== undefined && showTrace) {
|
|
142
|
-
// traceConvergence(g, twoProng, showDelay, scale);
|
|
143
|
-
// }
|
|
144
|
-
// }
|
|
145
|
-
// }
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
// /**
|
|
149
|
-
// * @internal
|
|
150
|
-
// * @param n - The 2-prong's zero-based index.
|
|
151
|
-
// * @param range
|
|
152
|
-
// */
|
|
153
|
-
// function traceConvergence(
|
|
154
|
-
// g: SVGGElement,
|
|
155
|
-
// twoProng: TwoProngForDebugging,
|
|
156
|
-
// showDelay = 1000,
|
|
157
|
-
// scale = 1) {
|
|
158
|
-
|
|
159
|
-
// const xs = twoProng.xs;
|
|
160
|
-
|
|
161
|
-
// console.log(twoProng);
|
|
162
|
-
// console.log(
|
|
163
|
-
// twoProng.xs.map(x => ({
|
|
164
|
-
// x: x.x,
|
|
165
|
-
// y: x.y,
|
|
166
|
-
// z: x.z,
|
|
167
|
-
// d: x.z ? squaredDistanceBetween(x.y.p, x.z.p) : 0,
|
|
168
|
-
// t: x.t,
|
|
169
|
-
// })
|
|
170
|
-
// )
|
|
171
|
-
// );
|
|
172
|
-
|
|
173
|
-
// console.log(xs.length)
|
|
174
|
-
// for (let i=0; i<xs.length; i++) {
|
|
175
|
-
// const x = twoProng.xs[i];
|
|
176
|
-
|
|
177
|
-
// const circle = { center: x.x, radius: distanceBetween(x.x, x.y.p) };
|
|
178
|
-
// drawFs.crossHair(g, x.x, 'red thin10 nofill', 0.002*scale, showDelay);
|
|
179
|
-
// drawFs.circle(g, circle, 'blue thin10 nofill', showDelay);
|
|
180
|
-
// if (x.z !== undefined) {
|
|
181
|
-
// drawFs.crossHair(
|
|
182
|
-
// g, x.z.p, 'yellow thin10 nofill', 0.001*scale, showDelay
|
|
183
|
-
// );
|
|
184
|
-
// }
|
|
185
|
-
// }
|
|
186
|
-
|
|
187
|
-
// // twoProngDebugFunctions.drawNormal(g, twoProng, showDelay);
|
|
188
|
-
// }
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
// /** @internal */
|
|
192
|
-
// const twoProngDebugFunctions: ITwoProngDebugFunctions = {
|
|
193
|
-
// logδ,
|
|
194
|
-
// log,
|
|
195
|
-
// drawNormal,
|
|
196
|
-
// logδBasic,
|
|
197
|
-
// traceConvergence,
|
|
198
|
-
// logNearest,
|
|
199
|
-
// }
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
// export { ITwoProngDebugFunctions, twoProngDebugFunctions };
|
|
203
|
-
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
// import { PointOnShape } from '../point-on-shape/point-on-shape.js';
|
|
2
|
-
// import { Circle } from '../geometry/circle.js';
|
|
3
|
-
// import { CpNode } from '../cp-node/cp-node.js';
|
|
4
|
-
// import { CurvePiece } from '../mat/bezier-piece.js';
|
|
5
|
-
// import { TwoProngForDebugging } from '../debug/two-prong-for-debugging.js';
|
|
6
|
-
// import { getTwoProngType } from '../mat/get-two-prong-type.js';
|
|
7
|
-
// import { ElemType_TwoProng } from '../mat/elem-type-two-prong.js';
|
|
8
|
-
// import { TXForDebugging } from './x-for-debugging.js';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
// /** @internal */
|
|
12
|
-
// function addDebugInfo(
|
|
13
|
-
// bezierPieces: CurvePiece[],
|
|
14
|
-
// failed: boolean,
|
|
15
|
-
// x: number[],
|
|
16
|
-
// y: PointOnShape,
|
|
17
|
-
// z: PointOnShape,
|
|
18
|
-
// circle: Circle,
|
|
19
|
-
// δ: CpNode[],
|
|
20
|
-
// xs: TXForDebugging[],
|
|
21
|
-
// holeClosing: boolean) {
|
|
22
|
-
|
|
23
|
-
// // xs.push({ x, y, z, t: y.t });
|
|
24
|
-
|
|
25
|
-
// // const twoProng: TwoProngForDebugging = {
|
|
26
|
-
// // generated: _debug_.generated,
|
|
27
|
-
// // bezierPieces,
|
|
28
|
-
// // pos: y,
|
|
29
|
-
// // δ,
|
|
30
|
-
// // z: z ? z.p : undefined!,
|
|
31
|
-
// // circle,
|
|
32
|
-
// // xs,
|
|
33
|
-
// // failed,
|
|
34
|
-
// // holeClosing,
|
|
35
|
-
// // notAdded: false,
|
|
36
|
-
// // deleted: false,
|
|
37
|
-
// // cpNode: undefined!
|
|
38
|
-
// // };
|
|
39
|
-
|
|
40
|
-
// // const twoProngType = getTwoProngType(twoProng) as ElemType_TwoProng;
|
|
41
|
-
// // _debug_.generated.elems[twoProngType].push(twoProng);
|
|
42
|
-
// }
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
// export { addDebugInfo }
|