@huaqiu/js-gerbv 0.1.15 → 0.1.26

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.
Files changed (47) hide show
  1. package/CMakeLists.txt +16 -3
  2. package/README.md +50 -6
  3. package/examples/example.js +266 -0
  4. package/examples/example.py +30 -0
  5. package/index.js +292 -19
  6. package/lib/add-text.js +552 -0
  7. package/lib/fill-holes.js +648 -0
  8. package/lib/hershey-futural.json +1 -0
  9. package/lib/spline.js +211 -0
  10. package/lib/system-font.js +166 -0
  11. package/package.json +8 -3
  12. package/prebuilds/darwin-arm64/gerbv_node.node +0 -0
  13. package/prebuilds/darwin-arm64/libX11.6.dylib +0 -0
  14. package/prebuilds/darwin-arm64/libXau.6.dylib +0 -0
  15. package/prebuilds/darwin-arm64/libXdmcp.6.dylib +0 -0
  16. package/prebuilds/darwin-arm64/libXext.6.dylib +0 -0
  17. package/prebuilds/darwin-arm64/libXrender.1.dylib +0 -0
  18. package/prebuilds/darwin-arm64/libbrotlicommon.1.dylib +0 -0
  19. package/prebuilds/darwin-arm64/libbrotlidec.1.dylib +0 -0
  20. package/prebuilds/darwin-arm64/libcairo.2.dylib +0 -0
  21. package/prebuilds/darwin-arm64/libfontconfig.1.dylib +0 -0
  22. package/prebuilds/darwin-arm64/libfreetype.6.dylib +0 -0
  23. package/prebuilds/darwin-arm64/libpixman-1.0.dylib +0 -0
  24. package/prebuilds/darwin-arm64/libpng16.16.dylib +0 -0
  25. package/prebuilds/darwin-arm64/libxcb-render.0.dylib +0 -0
  26. package/prebuilds/darwin-arm64/libxcb-shm.0.dylib +0 -0
  27. package/prebuilds/darwin-arm64/libxcb.1.dylib +0 -0
  28. package/prebuilds/darwin-arm64/meta.json +1 -1
  29. package/prebuilds/win32-x64/gerbv_node.node +0 -0
  30. package/prebuilds/win32-x64/libbrotlicommon.dll +0 -0
  31. package/prebuilds/win32-x64/libbrotlidec.dll +0 -0
  32. package/prebuilds/win32-x64/libbz2-1.dll +0 -0
  33. package/prebuilds/win32-x64/libcairo-2.dll +0 -0
  34. package/prebuilds/win32-x64/libexpat-1.dll +0 -0
  35. package/prebuilds/win32-x64/libfontconfig-1.dll +0 -0
  36. package/prebuilds/win32-x64/libfreetype-6.dll +0 -0
  37. package/prebuilds/win32-x64/libgraphite2.dll +0 -0
  38. package/prebuilds/win32-x64/libharfbuzz-0.dll +0 -0
  39. package/prebuilds/win32-x64/libpixman-1-0.dll +0 -0
  40. package/prebuilds/win32-x64/libpng16-16.dll +0 -0
  41. package/prebuilds/win32-x64/meta.json +1 -1
  42. package/scripts/cmake-build.js +8 -0
  43. package/scripts/pack-prebuild.js +110 -4
  44. package/scripts/smoke.js +216 -3
  45. package/src/addon.cc +525 -4
  46. package/src/export_png.cc +416 -0
  47. package/src/export_png.h +50 -0
@@ -0,0 +1,648 @@
1
+ /**
2
+ * 带孔填充:将外环+孔三角化为仅 dark 多边形,避免 Gerber %LPC*%。
3
+ *
4
+ * 孔与外环关系:
5
+ * - 完全在内:正常挖孔
6
+ * - 完全在外:丢弃(禁止 clear 打到其它铜皮 → 「负负得正」)
7
+ * - 部分/压边相交:取 hole ∩ outer,只挖交集
8
+ */
9
+ "use strict";
10
+
11
+ const { sampleSplineCmd } = require("./spline.js");
12
+
13
+ /**
14
+ * @returns {((vertices:number[], holes?:number[], dim?:number)=>number[])|null}
15
+ */
16
+ function loadEarcut() {
17
+ try {
18
+ const mod = require("earcut");
19
+ const fn = typeof mod === "function" ? mod : mod.default || mod.earcut;
20
+ return typeof fn === "function" ? fn : null;
21
+ } catch (_) {
22
+ return null;
23
+ }
24
+ }
25
+
26
+ function loadPolygonClipping() {
27
+ try {
28
+ return require("polygon-clipping");
29
+ } catch (_) {
30
+ return null;
31
+ }
32
+ }
33
+
34
+ /**
35
+ * @param {number} cx
36
+ * @param {number} cy
37
+ * @param {number} x0
38
+ * @param {number} y0
39
+ * @param {number} x1
40
+ * @param {number} y1
41
+ * @param {boolean} cw
42
+ * @param {number} [steps]
43
+ */
44
+ function sampleArc(cx, cy, x0, y0, x1, y1, cw, steps) {
45
+ const a0 = Math.atan2(y0 - cy, x0 - cx);
46
+ let a1 = Math.atan2(y1 - cy, x1 - cx);
47
+ const r = Math.hypot(x0 - cx, y0 - cy);
48
+ if (!(r > 1e-15)) return [{ x: x1, y: y1 }];
49
+ let d = a1 - a0;
50
+ if (cw) {
51
+ while (d > 0) d -= Math.PI * 2;
52
+ if (d === 0) d = -Math.PI * 2;
53
+ } else {
54
+ while (d < 0) d += Math.PI * 2;
55
+ if (d === 0) d = Math.PI * 2;
56
+ }
57
+ // 圆环等大弧需要更密采样,避免 keyhole/闭合处出现缺口
58
+ const n = Math.max(16, steps || Math.ceil((Math.abs(d) / Math.PI) * 32));
59
+ const out = [];
60
+ for (let i = 1; i <= n; i++) {
61
+ const a = a0 + (d * i) / n;
62
+ out.push({ x: cx + r * Math.cos(a), y: cy + r * Math.sin(a) });
63
+ }
64
+ return out;
65
+ }
66
+
67
+ function sampleQuad(x0, y0, c1x, c1y, x1, y1, steps) {
68
+ const out = [];
69
+ const n = Math.max(4, steps | 0);
70
+ for (let i = 1; i <= n; i++) {
71
+ const t = i / n;
72
+ const u = 1 - t;
73
+ out.push({
74
+ x: u * u * x0 + 2 * u * t * c1x + t * t * x1,
75
+ y: u * u * y0 + 2 * u * t * c1y + t * t * y1,
76
+ });
77
+ }
78
+ return out;
79
+ }
80
+
81
+ function sampleCubic(x0, y0, c1x, c1y, c2x, c2y, x1, y1, steps) {
82
+ const out = [];
83
+ const n = Math.max(6, steps | 0);
84
+ for (let i = 1; i <= n; i++) {
85
+ const t = i / n;
86
+ const u = 1 - t;
87
+ out.push({
88
+ x:
89
+ u * u * u * x0 +
90
+ 3 * u * u * t * c1x +
91
+ 3 * u * t * t * c2x +
92
+ t * t * t * x1,
93
+ y:
94
+ u * u * u * y0 +
95
+ 3 * u * u * t * c1y +
96
+ 3 * u * t * t * c2y +
97
+ t * t * t * y1,
98
+ });
99
+ }
100
+ return out;
101
+ }
102
+
103
+ /**
104
+ * 轮廓命令 → 折线点(不闭合重复首点)。
105
+ * @param {object[]} cmds {t:'L'|'A'|'B2'|'B3'|'S', ...}
106
+ * @returns {{x:number,y:number}[]}
107
+ */
108
+ function cmdsToRing(cmds) {
109
+ /** @type {{x:number,y:number}[]} */
110
+ const pts = [];
111
+ let curX = 0;
112
+ let curY = 0;
113
+ let has = false;
114
+
115
+ function push(x, y) {
116
+ if (pts.length) {
117
+ const last = pts[pts.length - 1];
118
+ if (Math.abs(last.x - x) < 1e-12 && Math.abs(last.y - y) < 1e-12) return;
119
+ }
120
+ pts.push({ x, y });
121
+ curX = x;
122
+ curY = y;
123
+ has = true;
124
+ }
125
+
126
+ for (const c of cmds || []) {
127
+ if (c.t === "L") {
128
+ push(c.x, c.y);
129
+ } else if (c.t === "A" && has) {
130
+ for (const p of sampleArc(c.cx, c.cy, curX, curY, c.x, c.y, !!c.cw, 24)) {
131
+ push(p.x, p.y);
132
+ }
133
+ } else if (c.t === "B2" && has) {
134
+ for (const p of sampleQuad(curX, curY, c.c1x, c.c1y, c.x, c.y, 8)) {
135
+ push(p.x, p.y);
136
+ }
137
+ } else if (c.t === "B3" && has) {
138
+ for (const p of sampleCubic(
139
+ curX,
140
+ curY,
141
+ c.c1x,
142
+ c.c1y,
143
+ c.c2x,
144
+ c.c2y,
145
+ c.x,
146
+ c.y,
147
+ 12
148
+ )) {
149
+ push(p.x, p.y);
150
+ }
151
+ } else if (c.t === "S" && has) {
152
+ for (const p of sampleSplineCmd(curX, curY, c)) {
153
+ push(p.x, p.y);
154
+ }
155
+ }
156
+ }
157
+
158
+ if (pts.length >= 2) {
159
+ const a = pts[0];
160
+ const b = pts[pts.length - 1];
161
+ if (Math.abs(a.x - b.x) < 1e-12 && Math.abs(a.y - b.y) < 1e-12) pts.pop();
162
+ }
163
+ return pts;
164
+ }
165
+
166
+ /**
167
+ * @param {{x:number,y:number}[]} pts
168
+ */
169
+ function signedArea(pts) {
170
+ let a = 0;
171
+ const n = pts.length;
172
+ if (n < 3) return 0;
173
+ for (let i = 0; i < n; i++) {
174
+ const p = pts[i];
175
+ const q = pts[(i + 1) % n];
176
+ a += p.x * q.y - q.x * p.y;
177
+ }
178
+ return a / 2;
179
+ }
180
+
181
+ function pointInPoly(x, y, poly) {
182
+ let inside = false;
183
+ for (let i = 0, j = poly.length - 1; i < poly.length; j = i++) {
184
+ const xi = poly[i].x;
185
+ const yi = poly[i].y;
186
+ const xj = poly[j].x;
187
+ const yj = poly[j].y;
188
+ const intersect =
189
+ yi > y !== yj > y &&
190
+ x < ((xj - xi) * (y - yi)) / (yj - yi + 0.0) + xi;
191
+ if (intersect) inside = !inside;
192
+ }
193
+ return inside;
194
+ }
195
+
196
+ /** @param {{x:number,y:number}[]} pts */
197
+ function toPcRing(pts) {
198
+ const r = pts.map((p) => [p.x, p.y]);
199
+ if (
200
+ r.length &&
201
+ (r[0][0] !== r[r.length - 1][0] || r[0][1] !== r[r.length - 1][1])
202
+ ) {
203
+ r.push([r[0][0], r[0][1]]);
204
+ }
205
+ return r;
206
+ }
207
+
208
+ /** @param {number[][]} ring */
209
+ function fromPcRing(ring) {
210
+ /** @type {{x:number,y:number}[]} */
211
+ const pts = [];
212
+ for (const xy of ring || []) {
213
+ if (!xy || xy.length < 2) continue;
214
+ const x = xy[0];
215
+ const y = xy[1];
216
+ if (pts.length) {
217
+ const last = pts[pts.length - 1];
218
+ if (Math.abs(last.x - x) < 1e-12 && Math.abs(last.y - y) < 1e-12) continue;
219
+ }
220
+ pts.push({ x, y });
221
+ }
222
+ if (pts.length >= 2) {
223
+ const a = pts[0];
224
+ const b = pts[pts.length - 1];
225
+ if (Math.abs(a.x - b.x) < 1e-12 && Math.abs(a.y - b.y) < 1e-12) pts.pop();
226
+ }
227
+ return pts;
228
+ }
229
+
230
+ /**
231
+ * hole ∩ outer → 若干环(仅保留落在外环内的挖孔区域)。
232
+ * 孔完全在内时原样保留(不走 clipper,避免同心圆等被裁出细缝)。
233
+ * @param {{x:number,y:number}[]} outer
234
+ * @param {{x:number,y:number}[]} hole
235
+ * @returns {{x:number,y:number}[][]}
236
+ */
237
+ function clipHoleToOuter(outer, hole) {
238
+ if (hole.length < 3) return [];
239
+
240
+ let allIn = true;
241
+ for (const p of hole) {
242
+ if (!pointInPoly(p.x, p.y, outer)) {
243
+ allIn = false;
244
+ break;
245
+ }
246
+ }
247
+ if (allIn) {
248
+ // 孔完全在内:直接用,避免 polygon-clipping 数值缝
249
+ return [hole];
250
+ }
251
+
252
+ // 快速排除:孔顶点全在外且外环顶点也不在孔内 → 无交
253
+ let anyOuterInHole = false;
254
+ for (const p of outer) {
255
+ if (pointInPoly(p.x, p.y, hole)) {
256
+ anyOuterInHole = true;
257
+ break;
258
+ }
259
+ }
260
+ const pc = loadPolygonClipping();
261
+ if (!pc || typeof pc.intersection !== "function") {
262
+ // 无裁剪库:相交/在外一律丢弃(偏保守,禁止越界 clear)
263
+ return [];
264
+ }
265
+
266
+ let inter;
267
+ try {
268
+ inter = pc.intersection([toPcRing(outer)], [toPcRing(hole)]);
269
+ } catch (_) {
270
+ return [];
271
+ }
272
+ if (!inter || !inter.length) return [];
273
+
274
+ /** @type {{x:number,y:number}[][]} */
275
+ const out = [];
276
+ for (const poly of inter) {
277
+ if (!poly || !poly[0]) continue;
278
+ const ring = fromPcRing(poly[0]);
279
+ if (ring.length >= 3 && Math.abs(signedArea(ring)) > 1e-18) {
280
+ out.push(ring);
281
+ }
282
+ }
283
+ return out;
284
+ }
285
+
286
+ /**
287
+ * 规范化挖孔列表:丢弃外环外的孔;压边/部分相交的孔裁成交集。
288
+ * @param {{x:number,y:number}[]} outer
289
+ * @param {{x:number,y:number}[][]} holes
290
+ * @returns {{x:number,y:number}[][]}
291
+ */
292
+ function sanitizeHoles(outer, holes) {
293
+ if (!outer || outer.length < 3) return [];
294
+ /** @type {{x:number,y:number}[][]} */
295
+ const out = [];
296
+ for (const h of holes || []) {
297
+ if (!h || h.length < 3) continue;
298
+ if (Math.abs(signedArea(h)) <= 1e-18) continue;
299
+ const clipped = clipHoleToOuter(outer, h);
300
+ for (const c of clipped) {
301
+ if (c.length >= 3 && Math.abs(signedArea(c)) > 1e-18) out.push(c);
302
+ }
303
+ }
304
+ return out;
305
+ }
306
+
307
+ /** @param {{x:number,y:number}[]} pts */
308
+ function dedupeConsecutive(pts) {
309
+ /** @type {{x:number,y:number}[]} */
310
+ const out = [];
311
+ for (const p of pts) {
312
+ if (!out.length) {
313
+ out.push(p);
314
+ continue;
315
+ }
316
+ const last = out[out.length - 1];
317
+ if (Math.abs(last.x - p.x) < 1e-12 && Math.abs(last.y - p.y) < 1e-12) continue;
318
+ out.push(p);
319
+ }
320
+ if (out.length >= 2) {
321
+ const a = out[0];
322
+ const b = out[out.length - 1];
323
+ if (Math.abs(a.x - b.x) < 1e-12 && Math.abs(a.y - b.y) < 1e-12) out.pop();
324
+ }
325
+ return out;
326
+ }
327
+
328
+ /**
329
+ * 保证环绕向:ccw=true → 面积≥0。
330
+ * @param {{x:number,y:number}[]} ring
331
+ * @param {boolean} ccw
332
+ */
333
+ function ensureWinding(ring, ccw) {
334
+ const a = signedArea(ring);
335
+ if (ccw && a < 0) return ring.slice().reverse();
336
+ if (!ccw && a > 0) return ring.slice().reverse();
337
+ return ring;
338
+ }
339
+
340
+ function dist2(a, b) {
341
+ const dx = a.x - b.x;
342
+ const dy = a.y - b.y;
343
+ return dx * dx + dy * dy;
344
+ }
345
+
346
+ /**
347
+ * 射线与多边形边求交:o + t*d 与边 a→b,t>eps, u∈[0,1]。
348
+ * @returns {{x:number,y:number,edge:number,t:number}|null}
349
+ */
350
+ function raycastPoly(poly, ox, oy, dx, dy) {
351
+ const n = poly.length;
352
+ let bestT = Infinity;
353
+ /** @type {{x:number,y:number,edge:number,t:number}|null} */
354
+ let best = null;
355
+ const eps = 1e-9;
356
+ for (let i = 0; i < n; i++) {
357
+ const a = poly[i];
358
+ const b = poly[(i + 1) % n];
359
+ const ex = b.x - a.x;
360
+ const ey = b.y - a.y;
361
+ const det = dx * ey - dy * ex;
362
+ if (Math.abs(det) < 1e-15) continue;
363
+ const sx = a.x - ox;
364
+ const sy = a.y - oy;
365
+ const t = (sx * ey - sy * ex) / det;
366
+ const u = (sx * dy - sy * dx) / det;
367
+ if (t > eps && u >= -eps && u <= 1 + eps && t < bestT) {
368
+ bestT = t;
369
+ const uu = Math.max(0, Math.min(1, u));
370
+ best = {
371
+ x: a.x + ex * uu,
372
+ y: a.y + ey * uu,
373
+ edge: i,
374
+ t,
375
+ };
376
+ }
377
+ }
378
+ return best;
379
+ }
380
+
381
+ /**
382
+ * 在边 edge 上插入点 p,返回新环(不闭合重复)。
383
+ * @param {{x:number,y:number}[]} ring
384
+ * @param {number} edge
385
+ * @param {{x:number,y:number}} p
386
+ */
387
+ function insertOnEdge(ring, edge, p) {
388
+ const out = ring.slice();
389
+ const a = out[edge];
390
+ const b = out[(edge + 1) % out.length];
391
+ if (Math.abs(a.x - p.x) < 1e-12 && Math.abs(a.y - p.y) < 1e-12) return { ring: out, index: edge };
392
+ if (Math.abs(b.x - p.x) < 1e-12 && Math.abs(b.y - p.y) < 1e-12)
393
+ return { ring: out, index: (edge + 1) % out.length };
394
+ out.splice(edge + 1, 0, { x: p.x, y: p.y });
395
+ return { ring: out, index: edge + 1 };
396
+ }
397
+
398
+ /**
399
+ * Gerber 规范 cut-in:仅水平/垂直桥接,往返两段完全重合(Ucamco 4.10.3 / 4.10.4.7)。
400
+ * 外环 CCW + 孔 CW;单轮廓 dark G36,不依赖 %LPC*%(部分在线查看器忽略 polarity)。
401
+ * @param {{x:number,y:number}[]} outer
402
+ * @param {{x:number,y:number}[][]} holes
403
+ * @returns {{x:number,y:number}[]|null}
404
+ */
405
+ function ringsToCutIn(outer, holes) {
406
+ if (!outer || outer.length < 3) return null;
407
+ let result = ensureWinding(
408
+ outer.map((p) => ({ x: p.x, y: p.y })),
409
+ true
410
+ );
411
+ /** @type {{x:number,y:number}[][]} */
412
+ const pending = (holes || [])
413
+ .filter((h) => h && h.length >= 3)
414
+ .map((h) => ensureWinding(h.map((p) => ({ x: p.x, y: p.y })), false));
415
+
416
+ const dirs = [
417
+ { dx: -1, dy: 0 },
418
+ { dx: 1, dy: 0 },
419
+ { dx: 0, dy: -1 },
420
+ { dx: 0, dy: 1 },
421
+ ];
422
+
423
+ while (pending.length) {
424
+ let best = null;
425
+ let bestH = 0;
426
+ for (let h = 0; h < pending.length; h++) {
427
+ const hole = pending[h];
428
+ for (let j = 0; j < hole.length; j++) {
429
+ const hj = hole[j];
430
+ for (const d of dirs) {
431
+ const hit = raycastPoly(result, hj.x, hj.y, d.dx, d.dy);
432
+ if (!hit || !(hit.t > 1e-6)) continue;
433
+ const mx = (hj.x + hit.x) / 2;
434
+ const my = (hj.y + hit.y) / 2;
435
+ if (!pointInPoly(mx, my, result)) continue;
436
+ if (pointInPoly(mx, my, hole)) continue;
437
+ // 水平或垂直
438
+ if (
439
+ Math.abs(hj.x - hit.x) > 1e-9 &&
440
+ Math.abs(hj.y - hit.y) > 1e-9
441
+ ) {
442
+ continue;
443
+ }
444
+ if (!best || hit.t < best.t) {
445
+ best = { hit, j, t: hit.t, hx: hj.x, hy: hj.y };
446
+ bestH = h;
447
+ }
448
+ }
449
+ }
450
+ }
451
+ if (!best) return null;
452
+
453
+ const hole = pending.splice(bestH, 1)[0];
454
+ const { ring: withHit, index: oi } = insertOnEdge(
455
+ result,
456
+ best.hit.edge,
457
+ best.hit
458
+ );
459
+ // 桥接点用同一坐标对象,保证往返完全重合
460
+ const bridge = { x: withHit[oi].x, y: withHit[oi].y };
461
+ withHit[oi] = bridge;
462
+ const holePt = { x: best.hx, y: best.hy };
463
+ let hj = best.j;
464
+ // 对齐到孔上最近点(数值)
465
+ for (let j = 0; j < hole.length; j++) {
466
+ if (
467
+ Math.abs(hole[j].x - holePt.x) < 1e-12 &&
468
+ Math.abs(hole[j].y - holePt.y) < 1e-12
469
+ ) {
470
+ hj = j;
471
+ hole[j] = holePt;
472
+ break;
473
+ }
474
+ }
475
+
476
+ const outerRot = withHit.slice(oi).concat(withHit.slice(0, oi));
477
+ const holeRot = hole.slice(hj).concat(hole.slice(0, hj));
478
+ /** @type {{x:number,y:number}[]} */
479
+ const joined = [];
480
+ joined.push(bridge);
481
+ for (let k = 0; k < holeRot.length; k++) joined.push(holeRot[k]);
482
+ joined.push(holePt); // 闭合孔
483
+ joined.push(bridge); // 沿 cut-in 返回(与去程重合)
484
+ for (let k = 1; k < outerRot.length; k++) joined.push(outerRot[k]);
485
+ joined.push(bridge); // 闭合外环
486
+ result = dedupeConsecutive(joined);
487
+ // 不要把 bridge 去重掉往返——dedupeConsecutive 只去连续重复
488
+ if (result.length < 3) return null;
489
+ }
490
+ return result;
491
+ }
492
+
493
+ /**
494
+ * 外环+孔 → 单条 keyhole 轮廓(任意角度桥接,仅作回退)。
495
+ * @param {{x:number,y:number}[]} outer
496
+ * @param {{x:number,y:number}[][]} holes
497
+ * @returns {{x:number,y:number}[]|null}
498
+ */
499
+ function ringsToKeyhole(outer, holes) {
500
+ if (!outer || outer.length < 3) return null;
501
+ let result = ensureWinding(outer.slice(), true);
502
+ /** @type {{x:number,y:number}[][]} */
503
+ const pending = (holes || [])
504
+ .filter((h) => h && h.length >= 3)
505
+ .map((h) => ensureWinding(h.slice(), false));
506
+
507
+ while (pending.length) {
508
+ let bestH = 0;
509
+ let bestI = 0;
510
+ let bestJ = 0;
511
+ let bestD = Infinity;
512
+ for (let h = 0; h < pending.length; h++) {
513
+ const hole = pending[h];
514
+ for (let i = 0; i < result.length; i++) {
515
+ for (let j = 0; j < hole.length; j++) {
516
+ const d = dist2(result[i], hole[j]);
517
+ if (d < bestD) {
518
+ bestD = d;
519
+ bestH = h;
520
+ bestI = i;
521
+ bestJ = j;
522
+ }
523
+ }
524
+ }
525
+ }
526
+ const hole = pending.splice(bestH, 1)[0];
527
+ const outerRot = result.slice(bestI).concat(result.slice(0, bestI));
528
+ const holeRot = hole.slice(bestJ).concat(hole.slice(0, bestJ));
529
+ /** @type {{x:number,y:number}[]} */
530
+ const joined = [];
531
+ for (let k = 0; k < outerRot.length; k++) joined.push(outerRot[k]);
532
+ joined.push(outerRot[0]);
533
+ for (let k = 0; k < holeRot.length; k++) joined.push(holeRot[k]);
534
+ joined.push(holeRot[0]);
535
+ joined.push(outerRot[0]);
536
+ result = dedupeConsecutive(joined);
537
+ if (result.length < 3) return null;
538
+ }
539
+ return result;
540
+ }
541
+
542
+ /**
543
+ * @param {{x:number,y:number}[]} outer
544
+ * @param {{x:number,y:number}[][]} holes
545
+ * @returns {{x:number,y:number}[][]} 三角形点列(每项 3 点)— keyhole 失败时回退
546
+ */
547
+ function triangulate(outer, holes) {
548
+ const earcut = loadEarcut();
549
+ if (!earcut || outer.length < 3) return [];
550
+
551
+ const safeHoles = sanitizeHoles(outer, holes);
552
+
553
+ const vertices = [];
554
+ const holeIndices = [];
555
+ for (const p of outer) vertices.push(p.x, p.y);
556
+ for (const h of safeHoles) {
557
+ if (!h || h.length < 3) continue;
558
+ holeIndices.push(vertices.length / 2);
559
+ for (const p of h) vertices.push(p.x, p.y);
560
+ }
561
+ const idx = earcut(
562
+ vertices,
563
+ holeIndices.length ? holeIndices : undefined,
564
+ 2
565
+ );
566
+ /** @type {{x:number,y:number}[][]} */
567
+ const tris = [];
568
+ for (let i = 0; i + 2 < idx.length; i += 3) {
569
+ const a = idx[i] * 2;
570
+ const b = idx[i + 1] * 2;
571
+ const c = idx[i + 2] * 2;
572
+ tris.push([
573
+ { x: vertices[a], y: vertices[a + 1] },
574
+ { x: vertices[b], y: vertices[b + 1] },
575
+ { x: vertices[c], y: vertices[c + 1] },
576
+ ]);
577
+ }
578
+ return tris;
579
+ }
580
+
581
+ /**
582
+ * 带孔填充 → 单条 dark 轮廓(优先 H/V cut-in)。
583
+ *
584
+ * 为什么不用 %LPC*% 作为默认:
585
+ * onlinegerberviewer 等基于 tracespace 的查看器会解析 LP,但 plot 区域时不应用
586
+ * clear polarity,导致挖空消失。Gerber 规范 cut-in(4.10.4.7)不依赖 polarity。
587
+ *
588
+ * 孔先 sanitize(在外丢弃、相交裁剪)。cut-in 失败时回退 LPC。
589
+ *
590
+ * @param {(cmds:object[], clear?:boolean)=>void} drawContour
591
+ * @param {object[]} outerCmds
592
+ * @param {object[][]} holeCmdsList
593
+ * @param {unknown} [_nativePoly] 保留参数兼容旧调用,忽略
594
+ * @returns {boolean}
595
+ */
596
+ function fillWithHolesNoLpc(drawContour, outerCmds, holeCmdsList, _nativePoly) {
597
+ const outer = cmdsToRing(outerCmds);
598
+ if (outer.length < 3) return false;
599
+
600
+ const rawHoles = (holeCmdsList || [])
601
+ .map((h) => cmdsToRing(h))
602
+ .filter((h) => h.length >= 3);
603
+ const holes = sanitizeHoles(outer, rawHoles);
604
+
605
+ if (!holes.length) {
606
+ drawContour(
607
+ ensureWinding(outer, true).map((p) => ({ t: "L", x: p.x, y: p.y })),
608
+ false
609
+ );
610
+ return true;
611
+ }
612
+
613
+ const cut =
614
+ ringsToCutIn(outer, holes) || ringsToKeyhole(outer, holes);
615
+ if (cut && cut.length >= 3) {
616
+ drawContour(
617
+ cut.map((p) => ({ t: "L", x: p.x, y: p.y })),
618
+ false
619
+ );
620
+ return true;
621
+ }
622
+
623
+ // 回退:规范推荐的 polarity 挖空(专业 CAM 可用;部分在线查看器无效)
624
+ drawContour(
625
+ ensureWinding(outer, true).map((p) => ({ t: "L", x: p.x, y: p.y })),
626
+ false
627
+ );
628
+ for (const h of holes) {
629
+ drawContour(
630
+ ensureWinding(h, false).map((p) => ({ t: "L", x: p.x, y: p.y })),
631
+ true
632
+ );
633
+ }
634
+ return true;
635
+ }
636
+
637
+ module.exports = {
638
+ cmdsToRing,
639
+ triangulate,
640
+ ringsToKeyhole,
641
+ ringsToCutIn,
642
+ sanitizeHoles,
643
+ clipHoleToOuter,
644
+ fillWithHolesNoLpc,
645
+ loadEarcut,
646
+ signedArea,
647
+ pointInPoly,
648
+ };
@@ -0,0 +1 @@
1
+ {"name":"futural","capHeight":21,"baseline":22,"ascent":25.0,"descent":7.0,"glyphs":{"!":{"o":5,"s":[[5.0,1.0,5.0,15.0],[5.0,20.0,4.0,21.0,5.0,22.0,6.0,21.0,5.0,20.0]]},"\"":{"o":8,"s":[[4.0,1.0,4.0,8.0],[12.0,1.0,12.0,8.0]]},"#":{"o":11,"s":[[11.0,-3.0,4.0,29.0],[17.0,-3.0,10.0,29.0],[4.0,10.0,18.0,10.0],[3.0,16.0,17.0,16.0]]},"$":{"o":10,"s":[[8.0,-3.0,8.0,26.0],[12.0,-3.0,12.0,26.0],[17.0,4.0,15.0,2.0,12.0,1.0,8.0,1.0,5.0,2.0,3.0,4.0,3.0,6.0,4.0,8.0,5.0,9.0,7.0,10.0,13.0,12.0,15.0,13.0,16.0,14.0,17.0,16.0,17.0,19.0,15.0,21.0,12.0,22.0,8.0,22.0,5.0,21.0,3.0,19.0]]},"%":{"o":12,"s":[[21.0,1.0,3.0,22.0],[8.0,1.0,10.0,3.0,10.0,5.0,9.0,7.0,7.0,8.0,5.0,8.0,3.0,6.0,3.0,4.0,4.0,2.0,6.0,1.0,8.0,1.0,10.0,2.0,13.0,3.0,16.0,3.0,19.0,2.0,21.0,1.0],[17.0,15.0,15.0,16.0,14.0,18.0,14.0,20.0,16.0,22.0,18.0,22.0,20.0,21.0,21.0,19.0,21.0,17.0,19.0,15.0,17.0,15.0]]},"&":{"o":13,"s":[[23.0,10.0,23.0,9.0,22.0,8.0,21.0,8.0,20.0,9.0,19.0,11.0,17.0,16.0,15.0,19.0,13.0,21.0,11.0,22.0,7.0,22.0,5.0,21.0,4.0,20.0,3.0,18.0,3.0,16.0,4.0,14.0,5.0,13.0,12.0,9.0,13.0,8.0,14.0,6.0,14.0,4.0,13.0,2.0,11.0,1.0,9.0,2.0,8.0,4.0,8.0,6.0,9.0,9.0,11.0,12.0,16.0,19.0,18.0,21.0,20.0,22.0,22.0,22.0,23.0,21.0,23.0,20.0]]},"'":{"o":5,"s":[[5.0,3.0,4.0,2.0,5.0,1.0,6.0,2.0,6.0,4.0,5.0,6.0,4.0,7.0]]},"(":{"o":7,"s":[[11.0,-3.0,9.0,-1.0,7.0,2.0,5.0,6.0,4.0,11.0,4.0,15.0,5.0,20.0,7.0,24.0,9.0,27.0,11.0,29.0]]},")":{"o":7,"s":[[3.0,-3.0,5.0,-1.0,7.0,2.0,9.0,6.0,10.0,11.0,10.0,15.0,9.0,20.0,7.0,24.0,5.0,27.0,3.0,29.0]]},"*":{"o":8,"s":[[8.0,7.0,8.0,19.0],[3.0,10.0,13.0,16.0],[13.0,10.0,3.0,16.0]]},"+":{"o":13,"s":[[13.0,4.0,13.0,22.0],[4.0,13.0,22.0,13.0]]},",":{"o":4,"s":[[5.0,18.0,4.0,19.0,3.0,18.0,4.0,17.0,5.0,18.0,5.0,20.0,3.0,22.0]]},"-":{"o":13,"s":[[4.0,13.0,22.0,13.0]]},".":{"o":4,"s":[[4.0,17.0,3.0,18.0,4.0,19.0,5.0,18.0,4.0,17.0]]},"/":{"o":11,"s":[[20.0,-3.0,2.0,29.0]]},"0":{"o":10,"s":[[9.0,1.0,6.0,2.0,4.0,5.0,3.0,10.0,3.0,13.0,4.0,18.0,6.0,21.0,9.0,22.0,11.0,22.0,14.0,21.0,16.0,18.0,17.0,13.0,17.0,10.0,16.0,5.0,14.0,2.0,11.0,1.0,9.0,1.0]]},"1":{"o":10,"s":[[6.0,5.0,8.0,4.0,11.0,1.0,11.0,22.0]]},"2":{"o":10,"s":[[4.0,6.0,4.0,5.0,5.0,3.0,6.0,2.0,8.0,1.0,12.0,1.0,14.0,2.0,15.0,3.0,16.0,5.0,16.0,7.0,15.0,9.0,13.0,12.0,3.0,22.0,17.0,22.0]]},"3":{"o":10,"s":[[5.0,1.0,16.0,1.0,10.0,9.0,13.0,9.0,15.0,10.0,16.0,11.0,17.0,14.0,17.0,16.0,16.0,19.0,14.0,21.0,11.0,22.0,8.0,22.0,5.0,21.0,4.0,20.0,3.0,18.0]]},"4":{"o":10,"s":[[13.0,1.0,3.0,15.0,18.0,15.0],[13.0,1.0,13.0,22.0]]},"5":{"o":10,"s":[[15.0,1.0,5.0,1.0,4.0,10.0,5.0,9.0,8.0,8.0,11.0,8.0,14.0,9.0,16.0,11.0,17.0,14.0,17.0,16.0,16.0,19.0,14.0,21.0,11.0,22.0,8.0,22.0,5.0,21.0,4.0,20.0,3.0,18.0]]},"6":{"o":10,"s":[[16.0,4.0,15.0,2.0,12.0,1.0,10.0,1.0,7.0,2.0,5.0,5.0,4.0,10.0,4.0,15.0,5.0,19.0,7.0,21.0,10.0,22.0,11.0,22.0,14.0,21.0,16.0,19.0,17.0,16.0,17.0,15.0,16.0,12.0,14.0,10.0,11.0,9.0,10.0,9.0,7.0,10.0,5.0,12.0,4.0,15.0]]},"7":{"o":10,"s":[[17.0,1.0,7.0,22.0],[3.0,1.0,17.0,1.0]]},"8":{"o":10,"s":[[8.0,1.0,5.0,2.0,4.0,4.0,4.0,6.0,5.0,8.0,7.0,9.0,11.0,10.0,14.0,11.0,16.0,13.0,17.0,15.0,17.0,18.0,16.0,20.0,15.0,21.0,12.0,22.0,8.0,22.0,5.0,21.0,4.0,20.0,3.0,18.0,3.0,15.0,4.0,13.0,6.0,11.0,9.0,10.0,13.0,9.0,15.0,8.0,16.0,6.0,16.0,4.0,15.0,2.0,12.0,1.0,8.0,1.0]]},"9":{"o":10,"s":[[16.0,8.0,15.0,11.0,13.0,13.0,10.0,14.0,9.0,14.0,6.0,13.0,4.0,11.0,3.0,8.0,3.0,7.0,4.0,4.0,6.0,2.0,9.0,1.0,10.0,1.0,13.0,2.0,15.0,4.0,16.0,8.0,16.0,13.0,15.0,18.0,13.0,21.0,10.0,22.0,8.0,22.0,5.0,21.0,4.0,19.0]]},":":{"o":4,"s":[[4.0,10.0,3.0,11.0,4.0,12.0,5.0,11.0,4.0,10.0],[4.0,17.0,3.0,18.0,4.0,19.0,5.0,18.0,4.0,17.0]]},";":{"o":4,"s":[[4.0,10.0,3.0,11.0,4.0,12.0,5.0,11.0,4.0,10.0],[5.0,18.0,4.0,19.0,3.0,18.0,4.0,17.0,5.0,18.0,5.0,20.0,3.0,22.0]]},"<":{"o":12,"s":[[20.0,4.0,4.0,13.0,20.0,22.0]]},"=":{"o":13,"s":[[4.0,10.0,22.0,10.0],[4.0,16.0,22.0,16.0]]},">":{"o":12,"s":[[4.0,4.0,20.0,13.0,4.0,22.0]]},"?":{"o":9,"s":[[3.0,6.0,3.0,5.0,4.0,3.0,5.0,2.0,7.0,1.0,11.0,1.0,13.0,2.0,14.0,3.0,15.0,5.0,15.0,7.0,14.0,9.0,13.0,10.0,9.0,12.0,9.0,15.0],[9.0,20.0,8.0,21.0,9.0,22.0,10.0,21.0,9.0,20.0]]},"@":{"o":14,"s":[[18.0,9.0,17.0,7.0,15.0,6.0,12.0,6.0,10.0,7.0,9.0,8.0,8.0,11.0,8.0,14.0,9.0,16.0,11.0,17.0,14.0,17.0,16.0,16.0,17.0,14.0],[12.0,6.0,10.0,8.0,9.0,11.0,9.0,14.0,10.0,16.0,11.0,17.0],[18.0,6.0,17.0,14.0,17.0,16.0,19.0,17.0,21.0,17.0,23.0,15.0,24.0,12.0,24.0,10.0,23.0,7.0,22.0,5.0,20.0,3.0,18.0,2.0,15.0,1.0,12.0,1.0,9.0,2.0,7.0,3.0,5.0,5.0,4.0,7.0,3.0,10.0,3.0,13.0,4.0,16.0,5.0,18.0,7.0,20.0,9.0,21.0,12.0,22.0,15.0,22.0,18.0,21.0,20.0,20.0,21.0,19.0],[19.0,6.0,18.0,14.0,18.0,16.0,19.0,17.0]]},"A":{"o":9,"s":[[9.0,1.0,1.0,22.0],[9.0,1.0,17.0,22.0],[4.0,15.0,14.0,15.0]]},"B":{"o":10,"s":[[4.0,1.0,4.0,22.0],[4.0,1.0,13.0,1.0,16.0,2.0,17.0,3.0,18.0,5.0,18.0,7.0,17.0,9.0,16.0,10.0,13.0,11.0],[4.0,11.0,13.0,11.0,16.0,12.0,17.0,13.0,18.0,15.0,18.0,18.0,17.0,20.0,16.0,21.0,13.0,22.0,4.0,22.0]]},"C":{"o":11,"s":[[18.0,6.0,17.0,4.0,15.0,2.0,13.0,1.0,9.0,1.0,7.0,2.0,5.0,4.0,4.0,6.0,3.0,9.0,3.0,14.0,4.0,17.0,5.0,19.0,7.0,21.0,9.0,22.0,13.0,22.0,15.0,21.0,17.0,19.0,18.0,17.0]]},"D":{"o":10,"s":[[4.0,1.0,4.0,22.0],[4.0,1.0,11.0,1.0,14.0,2.0,16.0,4.0,17.0,6.0,18.0,9.0,18.0,14.0,17.0,17.0,16.0,19.0,14.0,21.0,11.0,22.0,4.0,22.0]]},"E":{"o":9,"s":[[4.0,1.0,4.0,22.0],[4.0,1.0,17.0,1.0],[4.0,11.0,12.0,11.0],[4.0,22.0,17.0,22.0]]},"F":{"o":8,"s":[[4.0,1.0,4.0,22.0],[4.0,1.0,17.0,1.0],[4.0,11.0,12.0,11.0]]},"G":{"o":11,"s":[[18.0,6.0,17.0,4.0,15.0,2.0,13.0,1.0,9.0,1.0,7.0,2.0,5.0,4.0,4.0,6.0,3.0,9.0,3.0,14.0,4.0,17.0,5.0,19.0,7.0,21.0,9.0,22.0,13.0,22.0,15.0,21.0,17.0,19.0,18.0,17.0,18.0,14.0],[13.0,14.0,18.0,14.0]]},"H":{"o":11,"s":[[4.0,1.0,4.0,22.0],[18.0,1.0,18.0,22.0],[4.0,11.0,18.0,11.0]]},"I":{"o":4,"s":[[4.0,1.0,4.0,22.0]]},"J":{"o":8,"s":[[12.0,1.0,12.0,17.0,11.0,20.0,10.0,21.0,8.0,22.0,6.0,22.0,4.0,21.0,3.0,20.0,2.0,17.0,2.0,15.0]]},"K":{"o":10,"s":[[4.0,1.0,4.0,22.0],[18.0,1.0,4.0,15.0],[9.0,10.0,18.0,22.0]]},"L":{"o":7,"s":[[4.0,1.0,4.0,22.0],[4.0,22.0,16.0,22.0]]},"M":{"o":12,"s":[[4.0,1.0,4.0,22.0],[4.0,1.0,12.0,22.0],[20.0,1.0,12.0,22.0],[20.0,1.0,20.0,22.0]]},"N":{"o":11,"s":[[4.0,1.0,4.0,22.0],[4.0,1.0,18.0,22.0],[18.0,1.0,18.0,22.0]]},"O":{"o":11,"s":[[9.0,1.0,7.0,2.0,5.0,4.0,4.0,6.0,3.0,9.0,3.0,14.0,4.0,17.0,5.0,19.0,7.0,21.0,9.0,22.0,13.0,22.0,15.0,21.0,17.0,19.0,18.0,17.0,19.0,14.0,19.0,9.0,18.0,6.0,17.0,4.0,15.0,2.0,13.0,1.0,9.0,1.0]]},"P":{"o":10,"s":[[4.0,1.0,4.0,22.0],[4.0,1.0,13.0,1.0,16.0,2.0,17.0,3.0,18.0,5.0,18.0,8.0,17.0,10.0,16.0,11.0,13.0,12.0,4.0,12.0]]},"Q":{"o":11,"s":[[9.0,1.0,7.0,2.0,5.0,4.0,4.0,6.0,3.0,9.0,3.0,14.0,4.0,17.0,5.0,19.0,7.0,21.0,9.0,22.0,13.0,22.0,15.0,21.0,17.0,19.0,18.0,17.0,19.0,14.0,19.0,9.0,18.0,6.0,17.0,4.0,15.0,2.0,13.0,1.0,9.0,1.0],[12.0,18.0,18.0,24.0]]},"R":{"o":10,"s":[[4.0,1.0,4.0,22.0],[4.0,1.0,13.0,1.0,16.0,2.0,17.0,3.0,18.0,5.0,18.0,7.0,17.0,9.0,16.0,10.0,13.0,11.0,4.0,11.0],[11.0,11.0,18.0,22.0]]},"S":{"o":10,"s":[[17.0,4.0,15.0,2.0,12.0,1.0,8.0,1.0,5.0,2.0,3.0,4.0,3.0,6.0,4.0,8.0,5.0,9.0,7.0,10.0,13.0,12.0,15.0,13.0,16.0,14.0,17.0,16.0,17.0,19.0,15.0,21.0,12.0,22.0,8.0,22.0,5.0,21.0,3.0,19.0]]},"T":{"o":8,"s":[[8.0,1.0,8.0,22.0],[1.0,1.0,15.0,1.0]]},"U":{"o":11,"s":[[4.0,1.0,4.0,16.0,5.0,19.0,7.0,21.0,10.0,22.0,12.0,22.0,15.0,21.0,17.0,19.0,18.0,16.0,18.0,1.0]]},"V":{"o":9,"s":[[1.0,1.0,9.0,22.0],[17.0,1.0,9.0,22.0]]},"W":{"o":12,"s":[[2.0,1.0,7.0,22.0],[12.0,1.0,7.0,22.0],[12.0,1.0,17.0,22.0],[22.0,1.0,17.0,22.0]]},"X":{"o":10,"s":[[3.0,1.0,17.0,22.0],[17.0,1.0,3.0,22.0]]},"Y":{"o":9,"s":[[1.0,1.0,9.0,11.0,9.0,22.0],[17.0,1.0,9.0,11.0]]},"Z":{"o":10,"s":[[17.0,1.0,3.0,22.0],[3.0,1.0,17.0,1.0],[3.0,22.0,17.0,22.0]]},"[":{"o":7,"s":[[4.0,-3.0,4.0,29.0],[5.0,-3.0,5.0,29.0],[4.0,-3.0,11.0,-3.0],[4.0,29.0,11.0,29.0]]},"\\":{"o":7,"s":[[0.0,1.0,14.0,25.0]]},"]":{"o":7,"s":[[9.0,-3.0,9.0,29.0],[10.0,-3.0,10.0,29.0],[3.0,-3.0,10.0,-3.0],[3.0,29.0,10.0,29.0]]},"^":{"o":8,"s":[[8.0,-1.0,0.0,13.0],[8.0,-1.0,16.0,13.0]]},"_":{"o":9,"s":[[0.0,29.0,18.0,29.0]]},"`":{"o":4,"s":[[5.0,6.0,3.0,8.0,3.0,10.0,4.0,11.0,5.0,10.0,4.0,9.0,3.0,10.0]]},"a":{"o":10,"s":[[15.0,8.0,15.0,22.0],[15.0,11.0,13.0,9.0,11.0,8.0,8.0,8.0,6.0,9.0,4.0,11.0,3.0,14.0,3.0,16.0,4.0,19.0,6.0,21.0,8.0,22.0,11.0,22.0,13.0,21.0,15.0,19.0]]},"b":{"o":9,"s":[[4.0,1.0,4.0,22.0],[4.0,11.0,6.0,9.0,8.0,8.0,11.0,8.0,13.0,9.0,15.0,11.0,16.0,14.0,16.0,16.0,15.0,19.0,13.0,21.0,11.0,22.0,8.0,22.0,6.0,21.0,4.0,19.0]]},"c":{"o":9,"s":[[15.0,11.0,13.0,9.0,11.0,8.0,8.0,8.0,6.0,9.0,4.0,11.0,3.0,14.0,3.0,16.0,4.0,19.0,6.0,21.0,8.0,22.0,11.0,22.0,13.0,21.0,15.0,19.0]]},"d":{"o":10,"s":[[15.0,1.0,15.0,22.0],[15.0,11.0,13.0,9.0,11.0,8.0,8.0,8.0,6.0,9.0,4.0,11.0,3.0,14.0,3.0,16.0,4.0,19.0,6.0,21.0,8.0,22.0,11.0,22.0,13.0,21.0,15.0,19.0]]},"e":{"o":9,"s":[[3.0,14.0,15.0,14.0,15.0,12.0,14.0,10.0,13.0,9.0,11.0,8.0,8.0,8.0,6.0,9.0,4.0,11.0,3.0,14.0,3.0,16.0,4.0,19.0,6.0,21.0,8.0,22.0,11.0,22.0,13.0,21.0,15.0,19.0]]},"f":{"o":7,"s":[[10.0,1.0,8.0,1.0,6.0,2.0,5.0,5.0,5.0,22.0],[2.0,8.0,9.0,8.0]]},"g":{"o":10,"s":[[15.0,8.0,15.0,24.0,14.0,27.0,13.0,28.0,11.0,29.0,8.0,29.0,6.0,28.0],[15.0,11.0,13.0,9.0,11.0,8.0,8.0,8.0,6.0,9.0,4.0,11.0,3.0,14.0,3.0,16.0,4.0,19.0,6.0,21.0,8.0,22.0,11.0,22.0,13.0,21.0,15.0,19.0]]},"h":{"o":10,"s":[[4.0,1.0,4.0,22.0],[4.0,12.0,7.0,9.0,9.0,8.0,12.0,8.0,14.0,9.0,15.0,12.0,15.0,22.0]]},"i":{"o":4,"s":[[3.0,1.0,4.0,2.0,5.0,1.0,4.0,0.0,3.0,1.0],[4.0,8.0,4.0,22.0]]},"j":{"o":5,"s":[[5.0,1.0,6.0,2.0,7.0,1.0,6.0,0.0,5.0,1.0],[6.0,8.0,6.0,25.0,5.0,28.0,3.0,29.0,1.0,29.0]]},"k":{"o":8,"s":[[4.0,1.0,4.0,22.0],[14.0,8.0,4.0,18.0],[8.0,14.0,15.0,22.0]]},"l":{"o":4,"s":[[4.0,1.0,4.0,22.0]]},"m":{"o":15,"s":[[4.0,8.0,4.0,22.0],[4.0,12.0,7.0,9.0,9.0,8.0,12.0,8.0,14.0,9.0,15.0,12.0,15.0,22.0],[15.0,12.0,18.0,9.0,20.0,8.0,23.0,8.0,25.0,9.0,26.0,12.0,26.0,22.0]]},"n":{"o":10,"s":[[4.0,8.0,4.0,22.0],[4.0,12.0,7.0,9.0,9.0,8.0,12.0,8.0,14.0,9.0,15.0,12.0,15.0,22.0]]},"o":{"o":10,"s":[[8.0,8.0,6.0,9.0,4.0,11.0,3.0,14.0,3.0,16.0,4.0,19.0,6.0,21.0,8.0,22.0,11.0,22.0,13.0,21.0,15.0,19.0,16.0,16.0,16.0,14.0,15.0,11.0,13.0,9.0,11.0,8.0,8.0,8.0]]},"p":{"o":9,"s":[[4.0,8.0,4.0,29.0],[4.0,11.0,6.0,9.0,8.0,8.0,11.0,8.0,13.0,9.0,15.0,11.0,16.0,14.0,16.0,16.0,15.0,19.0,13.0,21.0,11.0,22.0,8.0,22.0,6.0,21.0,4.0,19.0]]},"q":{"o":10,"s":[[15.0,8.0,15.0,29.0],[15.0,11.0,13.0,9.0,11.0,8.0,8.0,8.0,6.0,9.0,4.0,11.0,3.0,14.0,3.0,16.0,4.0,19.0,6.0,21.0,8.0,22.0,11.0,22.0,13.0,21.0,15.0,19.0]]},"r":{"o":6,"s":[[4.0,8.0,4.0,22.0],[4.0,14.0,5.0,11.0,7.0,9.0,9.0,8.0,12.0,8.0]]},"s":{"o":9,"s":[[14.0,11.0,13.0,9.0,10.0,8.0,7.0,8.0,4.0,9.0,3.0,11.0,4.0,13.0,6.0,14.0,11.0,15.0,13.0,16.0,14.0,18.0,14.0,19.0,13.0,21.0,10.0,22.0,7.0,22.0,4.0,21.0,3.0,19.0]]},"t":{"o":7,"s":[[5.0,1.0,5.0,18.0,6.0,21.0,8.0,22.0,10.0,22.0],[2.0,8.0,9.0,8.0]]},"u":{"o":10,"s":[[4.0,8.0,4.0,18.0,5.0,21.0,7.0,22.0,10.0,22.0,12.0,21.0,15.0,18.0],[15.0,8.0,15.0,22.0]]},"v":{"o":8,"s":[[2.0,8.0,8.0,22.0],[14.0,8.0,8.0,22.0]]},"w":{"o":11,"s":[[3.0,8.0,7.0,22.0],[11.0,8.0,7.0,22.0],[11.0,8.0,15.0,22.0],[19.0,8.0,15.0,22.0]]},"x":{"o":9,"s":[[3.0,8.0,14.0,22.0],[14.0,8.0,3.0,22.0]]},"y":{"o":8,"s":[[2.0,8.0,8.0,22.0],[14.0,8.0,8.0,22.0,6.0,26.0,4.0,28.0,2.0,29.0,1.0,29.0]]},"z":{"o":9,"s":[[14.0,8.0,3.0,22.0],[3.0,8.0,14.0,8.0],[3.0,22.0,14.0,22.0]]},"{":{"o":7,"s":[[9.0,-3.0,7.0,-2.0,6.0,-1.0,5.0,1.0,5.0,3.0,6.0,5.0,7.0,6.0,8.0,8.0,8.0,10.0,6.0,12.0],[7.0,-2.0,6.0,0.0,6.0,2.0,7.0,4.0,8.0,5.0,9.0,7.0,9.0,9.0,8.0,11.0,4.0,13.0,8.0,15.0,9.0,17.0,9.0,19.0,8.0,21.0,7.0,22.0,6.0,24.0,6.0,26.0,7.0,28.0],[6.0,14.0,8.0,16.0,8.0,18.0,7.0,20.0,6.0,21.0,5.0,23.0,5.0,25.0,6.0,27.0,7.0,28.0,9.0,29.0]]},"|":{"o":4,"s":[[4.0,-3.0,4.0,29.0]]},"}":{"o":7,"s":[[5.0,-3.0,7.0,-2.0,8.0,-1.0,9.0,1.0,9.0,3.0,8.0,5.0,7.0,6.0,6.0,8.0,6.0,10.0,8.0,12.0],[7.0,-2.0,8.0,0.0,8.0,2.0,7.0,4.0,6.0,5.0,5.0,7.0,5.0,9.0,6.0,11.0,10.0,13.0,6.0,15.0,5.0,17.0,5.0,19.0,6.0,21.0,7.0,22.0,8.0,24.0,8.0,26.0,7.0,28.0],[8.0,14.0,6.0,16.0,6.0,18.0,7.0,20.0,8.0,21.0,9.0,23.0,9.0,25.0,8.0,27.0,7.0,28.0,5.0,29.0]]},"~":{"o":12,"s":[[3.0,16.0,3.0,14.0,4.0,11.0,6.0,10.0,8.0,10.0,10.0,11.0,14.0,14.0,16.0,15.0,18.0,15.0,20.0,14.0,21.0,12.0],[3.0,14.0,4.0,12.0,6.0,11.0,8.0,11.0,10.0,12.0,14.0,15.0,16.0,16.0,18.0,16.0,20.0,15.0,21.0,12.0,21.0,10.0]]}," ":{"o":10,"s":[]}}}