xl-public-utils 1.0.6 → 1.0.7
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/index.d.ts +918 -901
- package/index.js +5 -5
- package/package.json +33 -8
- package/src/{bwip-js.mjs → bwip-js.js} +1 -1
- package/src/{drcUtils.mjs → drcUtils.js} +2 -2
- package/src/{exportPLY.mjs → exportPLY.js} +1 -2
- package/src/{exportSTL.mjs → exportSTL.js} +1 -1
- package/src/{qrcode.mjs → qrcode.js} +1 -1
- package/src/{utils.mjs → utils.js} +10 -0
- package/src/{vtkUtils.mjs → vtkUtils.js} +113 -17
- package/tsconfig.json +2 -2
- package/types/{bwip-js.d.mts → bwip-js.d.ts} +1 -1
- package/types/{drcUtils.d.mts → drcUtils.d.ts} +1 -1
- package/types/{exportPLY.d.mts → exportPLY.d.ts} +1 -1
- package/types/{exportSTL.d.mts → exportSTL.d.ts} +1 -1
- package/types/{utils.d.mts → utils.d.ts} +6 -0
- package/types/{vtkUtils.d.mts → vtkUtils.d.ts} +32 -7
- /package/src/{bwipp.mjs → bwipp.js} +0 -0
- /package/types/{bwipp.d.mts → bwipp.d.ts} +0 -0
- /package/types/{qrcode.d.mts → qrcode.d.ts} +0 -0
package/index.d.ts
CHANGED
|
@@ -1,901 +1,918 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
*
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
*
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
*
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
*
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
):
|
|
114
|
-
/**
|
|
115
|
-
*
|
|
116
|
-
* @
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
*
|
|
154
|
-
* @
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
*
|
|
205
|
-
* @
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
*
|
|
235
|
-
* @param {
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
*
|
|
242
|
-
* @
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
*
|
|
249
|
-
* @
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
*
|
|
265
|
-
* @
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
*
|
|
271
|
-
* @
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
* @
|
|
287
|
-
* @
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
*
|
|
293
|
-
* @
|
|
294
|
-
* @
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
*
|
|
328
|
-
*
|
|
329
|
-
*
|
|
330
|
-
*
|
|
331
|
-
*
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
*
|
|
344
|
-
* @
|
|
345
|
-
*
|
|
346
|
-
*
|
|
347
|
-
*
|
|
348
|
-
*
|
|
349
|
-
*
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
*
|
|
376
|
-
* @
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
*
|
|
383
|
-
* @
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
*
|
|
390
|
-
* @
|
|
391
|
-
* @
|
|
392
|
-
*/
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
*
|
|
396
|
-
* @
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
*
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
*
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
export function deduplicatePolyData(data: vtkPolyData): vtkPolyData;
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
*
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
/**
|
|
501
|
-
*
|
|
502
|
-
*/
|
|
503
|
-
vertices:
|
|
504
|
-
/**
|
|
505
|
-
*
|
|
506
|
-
*/
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
*
|
|
531
|
-
* @
|
|
532
|
-
* @
|
|
533
|
-
*/
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
*
|
|
537
|
-
* @param {
|
|
538
|
-
* @
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
*
|
|
551
|
-
* @
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
* @
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
* @
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
*
|
|
566
|
-
* @
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
):
|
|
574
|
-
/**
|
|
575
|
-
*
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
*
|
|
587
|
-
* @
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
/**
|
|
605
|
-
*
|
|
606
|
-
* @
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
*
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
*
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
*
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
/**
|
|
635
|
-
*
|
|
636
|
-
* @param {
|
|
637
|
-
* @
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
):
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
): void;
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
):
|
|
791
|
-
export function
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
): HTMLCanvasElement
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
export
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
export function
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
):
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
export function
|
|
882
|
-
fontid: number,
|
|
883
|
-
charcode: number,
|
|
884
|
-
width: number,
|
|
885
|
-
height: number
|
|
886
|
-
):
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
1
|
+
declare module "xl-public-utils" {
|
|
2
|
+
export interface QrCodeOptions {
|
|
3
|
+
/** 二维码类型,具体支持请查看文档 */
|
|
4
|
+
bcid?: string; // 默认值 'qrcode'
|
|
5
|
+
|
|
6
|
+
/** 最终图片宽度 */
|
|
7
|
+
width?: number; // 默认值 1056
|
|
8
|
+
|
|
9
|
+
/** 最终图片高度 */
|
|
10
|
+
height?: number; // 默认值 342
|
|
11
|
+
|
|
12
|
+
/** 二维码宽度 */
|
|
13
|
+
qrcodeW?: number; // 默认值 300
|
|
14
|
+
|
|
15
|
+
/** 二维码高度 */
|
|
16
|
+
qrcodeH?: number; // 默认值 300
|
|
17
|
+
|
|
18
|
+
/** 是否在右侧添加文字 */
|
|
19
|
+
addText?: boolean; // 默认值 true
|
|
20
|
+
|
|
21
|
+
/** 顶部距离 */
|
|
22
|
+
top?: number; // 默认值 10
|
|
23
|
+
|
|
24
|
+
/** 左侧距离 */
|
|
25
|
+
left?: number; // 默认值 10
|
|
26
|
+
|
|
27
|
+
/** 文字行高,换行后下一行文字的 y 位置计算为 fontSize * lineHeight */
|
|
28
|
+
lineHeight?: number; // 默认值 1
|
|
29
|
+
|
|
30
|
+
/** 文字大小 */
|
|
31
|
+
fontSize?: number; // 默认值 60
|
|
32
|
+
|
|
33
|
+
/** 字体类型 */
|
|
34
|
+
fontFamily?: string; // 默认值 '黑体'
|
|
35
|
+
|
|
36
|
+
/** 背景颜色 */
|
|
37
|
+
bgColor?: string; // 默认值 '#fff'
|
|
38
|
+
|
|
39
|
+
/** 文字距离二维码间隔 */
|
|
40
|
+
textLeftMargin?: number; // 默认值 20
|
|
41
|
+
|
|
42
|
+
/** 字体加粗 */
|
|
43
|
+
fontWeight?: boolean; // 默认值 700
|
|
44
|
+
|
|
45
|
+
/** 字体颜色 */
|
|
46
|
+
textColor?: string; // 默认值 '#000'
|
|
47
|
+
|
|
48
|
+
/** 右侧文字内容 */
|
|
49
|
+
textContent?: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export namespace vtkUtils {
|
|
53
|
+
/**
|
|
54
|
+
* 计算屏幕坐标到三维坐标
|
|
55
|
+
* @param {vtkRenderer} renderer vtkRenderer
|
|
56
|
+
* @param {number} x display x position
|
|
57
|
+
* @param {number} y display y position
|
|
58
|
+
* @param {number} z display z position
|
|
59
|
+
* @returns {[number, number, number]} 三维坐标
|
|
60
|
+
*/
|
|
61
|
+
export function computeDisplayToWorld(
|
|
62
|
+
renderer: vtkRenderer,
|
|
63
|
+
x: number,
|
|
64
|
+
y: number,
|
|
65
|
+
z: number
|
|
66
|
+
): [number, number, number];
|
|
67
|
+
/**
|
|
68
|
+
* 计算三维坐标到屏幕坐标
|
|
69
|
+
* @param {vtkRenderer} renderer vtkRenderer
|
|
70
|
+
* @param {number} x 三维坐标 x值
|
|
71
|
+
* @param {number} y 三维坐标 y值
|
|
72
|
+
* @param {number} z 三维坐标 z值
|
|
73
|
+
* @returns {[number, number, number]} 屏幕坐标
|
|
74
|
+
*/
|
|
75
|
+
export function computeWorldToDisplay(
|
|
76
|
+
renderer: vtkRenderer,
|
|
77
|
+
x: number,
|
|
78
|
+
y: number,
|
|
79
|
+
z: number
|
|
80
|
+
): [number, number, number];
|
|
81
|
+
/**
|
|
82
|
+
* 计算 w2l(word 2 local, word to local) 的变换矩阵
|
|
83
|
+
* @param {vec3} center 中心点
|
|
84
|
+
* @param {vec3} xaxis x轴
|
|
85
|
+
* @param {vec3} yaxis y轴
|
|
86
|
+
* @param {vec3} zaxis z轴
|
|
87
|
+
* @returns { mat4 } 变换矩阵
|
|
88
|
+
*/
|
|
89
|
+
export function getW2LMatrix(
|
|
90
|
+
center: vec3,
|
|
91
|
+
xaxis: vec3,
|
|
92
|
+
yaxis: vec3,
|
|
93
|
+
zaxis: vec3
|
|
94
|
+
): mat4;
|
|
95
|
+
/**
|
|
96
|
+
* 计算 l2w(local 2 word, local to word) 的变换矩阵
|
|
97
|
+
* @param {vec3} center 中心点
|
|
98
|
+
* @param {vec3} xaxis x轴
|
|
99
|
+
* @param {vec3} yaxis y轴
|
|
100
|
+
* @param {vec3} zaxis z轴
|
|
101
|
+
* @returns { mat4 } 变换矩阵
|
|
102
|
+
*/
|
|
103
|
+
export function getL2WMatrix(
|
|
104
|
+
center: vec3,
|
|
105
|
+
xaxis: vec3,
|
|
106
|
+
yaxis: vec3,
|
|
107
|
+
zaxis: vec3
|
|
108
|
+
): mat4;
|
|
109
|
+
/**
|
|
110
|
+
* 返回交互的interactorStyle
|
|
111
|
+
* @returns {vtkInteractorStyleManipulator} 交互的interactorStyle
|
|
112
|
+
*/
|
|
113
|
+
export function make3DInteractorStyle(): vtkInteractorStyleManipulator;
|
|
114
|
+
/**
|
|
115
|
+
* 移除并返回当前renderWindow的所有鼠标交互设定
|
|
116
|
+
* @param {vtkRenderWindowInteractor} interactor vtkRenderWindowInteractor
|
|
117
|
+
* @returns {any[]} 当前鼠标的所有交互Manipulators
|
|
118
|
+
*/
|
|
119
|
+
export function removeMouseInteraction(
|
|
120
|
+
interactor: vtkRenderWindowInteractor
|
|
121
|
+
): any[];
|
|
122
|
+
/**
|
|
123
|
+
* 给当前窗口设置交互Maintainers
|
|
124
|
+
* @param {vtkRenderWindowInteractor} interactor vtkRenderWindowInteractor
|
|
125
|
+
* @param {any[]} mm 所有的交互Maintainers
|
|
126
|
+
* @returns {void}
|
|
127
|
+
*/
|
|
128
|
+
export function resetAllMouseMaintainers(
|
|
129
|
+
interactor: vtkRenderWindowInteractor,
|
|
130
|
+
mm: any[]
|
|
131
|
+
): void;
|
|
132
|
+
/**
|
|
133
|
+
* 将点投影到平面上
|
|
134
|
+
* @param {vec3} point 需要投影的点
|
|
135
|
+
* @param {vec3} origin 平面中心点
|
|
136
|
+
* @param {vec3} normal 平面法向量
|
|
137
|
+
* @returns {vec3} 投影到平面之后的点
|
|
138
|
+
*/
|
|
139
|
+
export function projectPointToPlane(
|
|
140
|
+
point: vec3,
|
|
141
|
+
origin: vec3,
|
|
142
|
+
normal: vec3
|
|
143
|
+
): vec3;
|
|
144
|
+
/**
|
|
145
|
+
* 将向量投影到面上
|
|
146
|
+
*
|
|
147
|
+
* @param {vec3} vec - The vector to project.
|
|
148
|
+
* @param {vec3} norm - The normal vector of the plane (assumed to be normalized).
|
|
149
|
+
* @returns {vec3} - The projected vector on the plane.
|
|
150
|
+
*/
|
|
151
|
+
export function projectVecToPlane(vec: vec3, norm: vec3): vec3;
|
|
152
|
+
/**
|
|
153
|
+
* 将直线外一点投影到直线(两个点)上
|
|
154
|
+
* @param {vec3} point 直线外一点
|
|
155
|
+
* @param {vec3} begin 直线开始点
|
|
156
|
+
* @param {vec3} end 直线结束点
|
|
157
|
+
* @returns {vec3} 投影后的点
|
|
158
|
+
*/
|
|
159
|
+
export function projectPointOnPoints(
|
|
160
|
+
point: vec3,
|
|
161
|
+
begin: vec3,
|
|
162
|
+
end: vec3
|
|
163
|
+
): vec3;
|
|
164
|
+
/**
|
|
165
|
+
* 将点投影到直线(point+dir)上
|
|
166
|
+
* @param {vec3} point 直线外的点
|
|
167
|
+
* @param {vec3} linePoint 直线任意一点
|
|
168
|
+
* @param {vec3} lineDir 直线方向
|
|
169
|
+
* @returns {vec3} 投影到直线上后的点
|
|
170
|
+
*/
|
|
171
|
+
export function projectPointToLine(
|
|
172
|
+
point: vec3,
|
|
173
|
+
linePoint: vec3,
|
|
174
|
+
lineDir: vec3
|
|
175
|
+
): vec3;
|
|
176
|
+
/**
|
|
177
|
+
* 获取曲线外一点到曲线最近点的索引
|
|
178
|
+
* @param {vec3} point 曲线外一点
|
|
179
|
+
* @param {vec3[]} points 曲线
|
|
180
|
+
* @returns {number} 返回离点最近的曲线点索引
|
|
181
|
+
*/
|
|
182
|
+
export function getPointToPointsMinIndex(
|
|
183
|
+
point: vec3,
|
|
184
|
+
points: vec3[]
|
|
185
|
+
): number;
|
|
186
|
+
/**
|
|
187
|
+
* 获取点到曲线的最近距离
|
|
188
|
+
* @param {vec3} point 曲线外一点
|
|
189
|
+
* @param {vec3[]} points 曲线
|
|
190
|
+
* @returns {number} 返回点到曲线的最近距离
|
|
191
|
+
*/
|
|
192
|
+
export function getPointToPointsMinDist(
|
|
193
|
+
point: vec3,
|
|
194
|
+
points: vec3[]
|
|
195
|
+
): number;
|
|
196
|
+
/**
|
|
197
|
+
* 获取点到曲线的最近点
|
|
198
|
+
* @param {vec3} point 曲线外一点
|
|
199
|
+
* @param {vec3[]} points 曲线
|
|
200
|
+
* @returns {vec3} 返回点到曲线的最近点
|
|
201
|
+
*/
|
|
202
|
+
export function getPointToPointsMinPoint(point: vec3, points: vec3[]): vec3;
|
|
203
|
+
/**
|
|
204
|
+
* 获取直线外一点到直线的距离
|
|
205
|
+
* @param {vec3} point 直线外一点
|
|
206
|
+
* @param {vec3} begin 直线开始点
|
|
207
|
+
* @param {vec3} end 直线结束点
|
|
208
|
+
* @returns {number} 点到直线的距离
|
|
209
|
+
*/
|
|
210
|
+
export function getPointToLineDist(
|
|
211
|
+
point: vec3,
|
|
212
|
+
begin: vec3,
|
|
213
|
+
end: vec3
|
|
214
|
+
): number;
|
|
215
|
+
/**
|
|
216
|
+
* 计算点到平面的距离
|
|
217
|
+
* @param {vec3} point 任意一点
|
|
218
|
+
* @param {vec3} origin 平面上一点
|
|
219
|
+
* @param {vec3} normal 平面法向量,要求单位化
|
|
220
|
+
* @returns {number}
|
|
221
|
+
*/
|
|
222
|
+
export function getPointToPlaneDist(
|
|
223
|
+
point: vec3,
|
|
224
|
+
origin: vec3,
|
|
225
|
+
normal: vec3
|
|
226
|
+
): number;
|
|
227
|
+
/**
|
|
228
|
+
* 对一个polydata应用矩阵变化,直接改变点位置
|
|
229
|
+
* @param {mat4} mt4 变换矩阵
|
|
230
|
+
* @param {vtkPolyData} data 需要应用变换的polydata
|
|
231
|
+
*/
|
|
232
|
+
export function pointsApplyMat4(mt4: mat4, data: vtkPolyData): void;
|
|
233
|
+
/**
|
|
234
|
+
* 将点应用矩阵变换
|
|
235
|
+
* @param {vec3} point 三维点
|
|
236
|
+
* @param {mat4} matrix 变换矩阵
|
|
237
|
+
* @returns {vec3} 应用矩阵变换之后的点
|
|
238
|
+
*/
|
|
239
|
+
export function pointTransformByMat4(point: vec3, matrix: mat4): vec3;
|
|
240
|
+
/**
|
|
241
|
+
* 将向量应用矩阵变换
|
|
242
|
+
* @param {vec3} vec 向量
|
|
243
|
+
* @param {mat4} matrix 变换矩阵
|
|
244
|
+
* @returns {vec3} 应用矩阵变换之后的向量
|
|
245
|
+
*/
|
|
246
|
+
export function vecTransfromByMat4(vec: vec3, matrix: mat4): vec3;
|
|
247
|
+
/**
|
|
248
|
+
* 获取mesh的ply文件Blob
|
|
249
|
+
* @param {vtkPolyData} mesh 网格polydata
|
|
250
|
+
* @param {'ascii' | 'binary'} [format='ascii'] format 导出文件格式
|
|
251
|
+
* @returns {Blob} 网格的ply文件Blob
|
|
252
|
+
*/
|
|
253
|
+
export function createPlyBlob(
|
|
254
|
+
mesh: vtkPolyData,
|
|
255
|
+
format?: "ascii" | "binary"
|
|
256
|
+
): Blob;
|
|
257
|
+
/**
|
|
258
|
+
* 获取mesh的stl文件Blob,由于STL文件过大,只使用Binary格式
|
|
259
|
+
* @param {vtkPolyData} mesh 网格polydata
|
|
260
|
+
* @returns {Blob} 网格的BinarySTL文件Blob
|
|
261
|
+
*/
|
|
262
|
+
export function createStlBlob(mesh: vtkPolyData): Blob;
|
|
263
|
+
/**
|
|
264
|
+
* 将网格压缩为drc文件,导出drc需要先加载draco_encode.js,并调用initDrcCoder初始化
|
|
265
|
+
* @param {vtkPolyData} mesh 网格文件
|
|
266
|
+
* @returns {Blob} drc文件
|
|
267
|
+
*/
|
|
268
|
+
export function createDrcBlob(mesh: vtkPolyData): Blob;
|
|
269
|
+
/**
|
|
270
|
+
* 将网格输出为对应类型的Blob,均采用默认参数,导出drc需要先加载draco_encode.js,并调用initDrcCoder初始化
|
|
271
|
+
* @param {vtkPolyData} mesh 网格文件
|
|
272
|
+
* @param {'ply' | 'stl' | 'drc' } type 输出类型
|
|
273
|
+
* @returns {Blob} 对应类型的Blob
|
|
274
|
+
*/
|
|
275
|
+
export function createMeshTypeBlob(
|
|
276
|
+
mesh: vtkPolyData,
|
|
277
|
+
type: "ply" | "stl" | "drc"
|
|
278
|
+
): Blob;
|
|
279
|
+
/**
|
|
280
|
+
* 计算一组三维点的中心点
|
|
281
|
+
* @param {vec3[]} points 三维点数组
|
|
282
|
+
* @returns {vec3} 中心点
|
|
283
|
+
*/
|
|
284
|
+
export function getPointsCenter(points: vec3[]): vec3;
|
|
285
|
+
/**
|
|
286
|
+
* @typedef Position
|
|
287
|
+
* @property {number} x 对应vtk坐标系的x值
|
|
288
|
+
* @property {number} y 对应vtk坐标系的y值
|
|
289
|
+
* @property {number} z 0
|
|
290
|
+
*/
|
|
291
|
+
/**
|
|
292
|
+
* 计算js事件对应vtk事件的position
|
|
293
|
+
* @param {HTMLElement} el vtkViewDom
|
|
294
|
+
* @param {MouseEvent} event 二维鼠标事件
|
|
295
|
+
* @returns {Position} 对应vtk坐标系的xyz值
|
|
296
|
+
*/
|
|
297
|
+
export function getScreenEventPositionFor(
|
|
298
|
+
el: HTMLElement,
|
|
299
|
+
event: MouseEvent
|
|
300
|
+
): Position;
|
|
301
|
+
/**
|
|
302
|
+
* 将数值数组转换为vec3数组
|
|
303
|
+
* @param {number[] | Float32Array} dataList
|
|
304
|
+
* @returns {vec3[]} 格式化之后的数组
|
|
305
|
+
*/
|
|
306
|
+
export function formatNumberArrayToVec3Array(
|
|
307
|
+
dataList: number[] | Float32Array
|
|
308
|
+
): vec3[];
|
|
309
|
+
/**
|
|
310
|
+
* 简单的数值平均插值
|
|
311
|
+
* @param {number} from 开始数值
|
|
312
|
+
* @param {number} to 结束数值
|
|
313
|
+
* @param {number} step 步长
|
|
314
|
+
* @returns {number[]} 插值的数值
|
|
315
|
+
*/
|
|
316
|
+
export function calculateSimpleLerp(
|
|
317
|
+
from: number,
|
|
318
|
+
to: number,
|
|
319
|
+
step: number
|
|
320
|
+
): number[];
|
|
321
|
+
/**
|
|
322
|
+
* 将 mat3 解析为 3 个自由度的 欧拉角(Eular)(弧度)
|
|
323
|
+
* @param {mat3} rmat 3 * 3的矩阵
|
|
324
|
+
* @param {[number, number, number]} eular 输出的欧拉角度数(弧度)
|
|
325
|
+
* @returns {[number, number, number]} 3个自由度的欧拉角
|
|
326
|
+
* @example
|
|
327
|
+
* const mt4: mat4;
|
|
328
|
+
* const mt3 = mat3.fromMat4(mt3, mt4);
|
|
329
|
+
* mat3.transpose(mt3, mt3);
|
|
330
|
+
* let eular = [0, 0, 0];
|
|
331
|
+
* convMatrix2EularZYX(mt3, eular);
|
|
332
|
+
*/
|
|
333
|
+
export function convMatrix2EularZYX(
|
|
334
|
+
rmat: mat3,
|
|
335
|
+
eular: [number, number, number]
|
|
336
|
+
): [number, number, number];
|
|
337
|
+
/**
|
|
338
|
+
* 将欧拉角(Eular)转换为mat3
|
|
339
|
+
* @param {mat3} rmat 变换矩阵
|
|
340
|
+
* @param {number} xangle 对应欧拉角x 弧度
|
|
341
|
+
* @param {number} yangle 对应欧拉角y 弧度
|
|
342
|
+
* @param {number} zangle 对应欧拉加z 弧度
|
|
343
|
+
* @returns {mat3} 对应变换矩阵
|
|
344
|
+
* @example
|
|
345
|
+
* const rotateX = 0.5;
|
|
346
|
+
* const rotateY = 0.5;
|
|
347
|
+
* const rotateZ = 0.5;
|
|
348
|
+
* const mt3 = mat3.create();
|
|
349
|
+
* convEular2matrixZYX(mt3, [rotateX, rotateY, rotateZ])
|
|
350
|
+
*/
|
|
351
|
+
export function convEular2matrixZYX(
|
|
352
|
+
rmat: mat3,
|
|
353
|
+
xangle: number,
|
|
354
|
+
yangle: number,
|
|
355
|
+
zangle: number
|
|
356
|
+
): mat3;
|
|
357
|
+
/**
|
|
358
|
+
* 将drc
|
|
359
|
+
* @param {vtkPolyData} mesh 网格polyData
|
|
360
|
+
* @param {mat4} [matrix] 变换矩阵
|
|
361
|
+
* @returns {string} drc压缩之后的网格base64
|
|
362
|
+
*/
|
|
363
|
+
export function enCodeMeshToBase64(
|
|
364
|
+
mesh: vtkPolyData,
|
|
365
|
+
matrix?: mat4
|
|
366
|
+
): string;
|
|
367
|
+
/**
|
|
368
|
+
* 将一圈有序点按指定size进行平滑
|
|
369
|
+
* @param {vec3[]} points 一圈有序点
|
|
370
|
+
* @param {number} smaSize=3 平滑点的数量通常值为奇数
|
|
371
|
+
* @returns {vec3[]} 平滑之后的点
|
|
372
|
+
*/
|
|
373
|
+
export function smaPoint(points: vec3[], smaSize?: number): vec3[];
|
|
374
|
+
/**
|
|
375
|
+
* 将一段有序点按指定size进行平滑
|
|
376
|
+
* @param {vec3[]} points 一段有序点
|
|
377
|
+
* @param {number} smaSize=3 平滑点的数量通常值为奇数
|
|
378
|
+
* @returns {vec3[]} 平滑之后的点
|
|
379
|
+
*/
|
|
380
|
+
export function smaPointNotRound(points: vec3[], smaSize?: number): vec3[];
|
|
381
|
+
/**
|
|
382
|
+
* 表示一个包含三个轴向的对象
|
|
383
|
+
* @typedef {Object} AxisObject
|
|
384
|
+
* @property {vec3} x - x轴
|
|
385
|
+
* @property {vec3} y - y轴
|
|
386
|
+
* @property {vec3} z - z轴
|
|
387
|
+
*/
|
|
388
|
+
/**
|
|
389
|
+
* 获取一个矩阵的三个轴向
|
|
390
|
+
* @param {mat4} matrix 4 * 4 的矩阵
|
|
391
|
+
* @returns {AxisObject} 三个轴向
|
|
392
|
+
*/
|
|
393
|
+
export function getAxisFormMat4(matrix: mat4): AxisObject;
|
|
394
|
+
/**
|
|
395
|
+
* 计算 w2l(word 2 local, word to local) 的变换矩阵
|
|
396
|
+
* @param {vec3} center 中心点
|
|
397
|
+
* @param {vec3} xaxis x轴
|
|
398
|
+
* @param {vec3} yaxis y轴
|
|
399
|
+
* @param {vec3} zaxis z轴
|
|
400
|
+
* @returns { mat4 } 变换矩阵
|
|
401
|
+
*/
|
|
402
|
+
export function getmatw2l(
|
|
403
|
+
center: vec3,
|
|
404
|
+
xaxis: vec3,
|
|
405
|
+
yaxis: vec3,
|
|
406
|
+
zaxis: vec3
|
|
407
|
+
): mat4;
|
|
408
|
+
/**
|
|
409
|
+
* 计算 l2w(local 2 word, local to word) 的变换矩阵
|
|
410
|
+
* @param {vec3} center 中心点
|
|
411
|
+
* @param {vec3} xaxis x轴
|
|
412
|
+
* @param {vec3} yaxis y轴
|
|
413
|
+
* @param {vec3} zaxis z轴
|
|
414
|
+
* @returns { mat4 } 变换矩阵
|
|
415
|
+
*/
|
|
416
|
+
export function getmatofl2w(
|
|
417
|
+
center: vec3,
|
|
418
|
+
xaxis: vec3,
|
|
419
|
+
yaxis: vec3,
|
|
420
|
+
zaxis: vec3
|
|
421
|
+
): mat4;
|
|
422
|
+
/**
|
|
423
|
+
* vtkPolyData的顶点去重 用于3倍顶点的stl和老版本的vtkMarchingCube
|
|
424
|
+
* @param {vtkPolyData} data 网格的vtkPolyData
|
|
425
|
+
* @returns {vtkPolyData} 去重之后的vtkPolyData
|
|
426
|
+
*/
|
|
427
|
+
export function deduplicatePolyData(data: vtkPolyData): vtkPolyData;
|
|
428
|
+
/**
|
|
429
|
+
* 判断一个矩阵是否是正交矩阵
|
|
430
|
+
* @param {mat4} matrix 矩阵
|
|
431
|
+
* @returns {boolean} 是否是正交矩阵
|
|
432
|
+
*/
|
|
433
|
+
export function isRotationMatrix(matrix: mat4): boolean;
|
|
434
|
+
/**
|
|
435
|
+
* 将vtkPolyData进行三角化
|
|
436
|
+
* @param {vtkPolyData} _polydata 需要三角化的vtkPolydata
|
|
437
|
+
* @returns {vtkPolyData} 三角化之后的vtkPolydata
|
|
438
|
+
*/
|
|
439
|
+
export function trianglePolys(_polydata: vtkPolyData): vtkPolyData;
|
|
440
|
+
/**
|
|
441
|
+
* 加载网格
|
|
442
|
+
* @param {string | File | Blob} file 文件或者文件链接
|
|
443
|
+
* @param {'drc' | 'stl' | 'ply'} [type] 文件类型,当file为string | File的时候可以不传根据文件后缀自动获取,drc需要先进行初始化
|
|
444
|
+
* @param {boolean} [process] 是否需要预先对数据进行处理,stl默认(去重)
|
|
445
|
+
* @returns {Promise<vtkPolyData>} vtkPolyData
|
|
446
|
+
*/
|
|
447
|
+
export function loadMeshData(file: string | File | Blob, type?: "drc" | "stl" | "ply", process?: boolean): Promise<vtkPolyData>;
|
|
448
|
+
export type Position = {
|
|
449
|
+
/**
|
|
450
|
+
* 对应vtk坐标系的x值
|
|
451
|
+
*/
|
|
452
|
+
x: number;
|
|
453
|
+
/**
|
|
454
|
+
* 对应vtk坐标系的y值
|
|
455
|
+
*/
|
|
456
|
+
y: number;
|
|
457
|
+
/**
|
|
458
|
+
* 0
|
|
459
|
+
*/
|
|
460
|
+
z: number;
|
|
461
|
+
};
|
|
462
|
+
/**
|
|
463
|
+
* 表示一个包含三个轴向的对象
|
|
464
|
+
*/
|
|
465
|
+
export type AxisObject = {
|
|
466
|
+
/**
|
|
467
|
+
* - x轴
|
|
468
|
+
*/
|
|
469
|
+
x: vec3;
|
|
470
|
+
/**
|
|
471
|
+
* - y轴
|
|
472
|
+
*/
|
|
473
|
+
y: vec3;
|
|
474
|
+
/**
|
|
475
|
+
* - z轴
|
|
476
|
+
*/
|
|
477
|
+
z: vec3;
|
|
478
|
+
};
|
|
479
|
+
}
|
|
480
|
+
export namespace drcUtils {
|
|
481
|
+
export type AttrOption = {
|
|
482
|
+
/**
|
|
483
|
+
* 颜色数组
|
|
484
|
+
*/
|
|
485
|
+
colors?: number[];
|
|
486
|
+
/**
|
|
487
|
+
* 属性数组
|
|
488
|
+
*/
|
|
489
|
+
generics?: number[];
|
|
490
|
+
/**
|
|
491
|
+
* 法向量数组
|
|
492
|
+
*/
|
|
493
|
+
normals?: number[];
|
|
494
|
+
};
|
|
495
|
+
export type DrcMeshData = {
|
|
496
|
+
/**
|
|
497
|
+
* 网格面数组
|
|
498
|
+
*/
|
|
499
|
+
faces: Uint32Array;
|
|
500
|
+
/**
|
|
501
|
+
* 网格点数组
|
|
502
|
+
*/
|
|
503
|
+
vertices: Float32Array;
|
|
504
|
+
/**
|
|
505
|
+
* 颜色数组
|
|
506
|
+
*/
|
|
507
|
+
colors?: Float32Array;
|
|
508
|
+
/**
|
|
509
|
+
* 属性数组
|
|
510
|
+
*/
|
|
511
|
+
generics?: Float32Array;
|
|
512
|
+
/**
|
|
513
|
+
* 法向量数组
|
|
514
|
+
*/
|
|
515
|
+
normals?: Float32Array;
|
|
516
|
+
};
|
|
517
|
+
export type Decoder = any;
|
|
518
|
+
export type Mesh = {
|
|
519
|
+
/**
|
|
520
|
+
* 点信息
|
|
521
|
+
*/
|
|
522
|
+
vertices: number[][];
|
|
523
|
+
/**
|
|
524
|
+
* 面信息
|
|
525
|
+
*/
|
|
526
|
+
faces: number[][];
|
|
527
|
+
};
|
|
528
|
+
/**
|
|
529
|
+
* @typedef {Object} AttrOption
|
|
530
|
+
* @property {number[]} [colors] 颜色数组
|
|
531
|
+
* @property {number[]} [generics] 属性数组
|
|
532
|
+
* @property {number[]} [normals] 法向量数组
|
|
533
|
+
*/
|
|
534
|
+
/**
|
|
535
|
+
* 将数据进行压缩
|
|
536
|
+
* @param {number[]} vertices 网格点
|
|
537
|
+
* @param {number[]} faces 网格面,必须是三角化之后的面,每连续的三个点索引标识一个面
|
|
538
|
+
* @param {number} byteLength=14 byteLength 压缩率
|
|
539
|
+
* @param {AttrOption} [attr] 其他需要压缩的属性
|
|
540
|
+
* @returns {Int8Array} 压缩之后的DRC数据
|
|
541
|
+
*/
|
|
542
|
+
export function enCodeMeshByVF(
|
|
543
|
+
vertices: number[],
|
|
544
|
+
faces: number[],
|
|
545
|
+
byteLength?: number,
|
|
546
|
+
attr?: AttrOption
|
|
547
|
+
): Int8Array;
|
|
548
|
+
/**
|
|
549
|
+
* 使用drc压缩点
|
|
550
|
+
* @param {vec3[] | number[]} points 点数组
|
|
551
|
+
* @returns {Int8Array} 压缩之后的drc data
|
|
552
|
+
*/
|
|
553
|
+
export function enCodePointCloud(points: vec3[] | number[]): Int8Array;
|
|
554
|
+
/**
|
|
555
|
+
* 解压drc格式的点云数据
|
|
556
|
+
* @param {ArrayBuffer} byteArray drc点数据
|
|
557
|
+
* @returns {Float32Array} 点数组
|
|
558
|
+
*/
|
|
559
|
+
export function decodePointCloud(byteArray: ArrayBuffer): Float32Array;
|
|
560
|
+
/**
|
|
561
|
+
* @typedef {Object} DrcMeshData
|
|
562
|
+
* @property {Uint32Array} faces 网格面数组
|
|
563
|
+
* @property {Float32Array} vertices 网格点数组
|
|
564
|
+
* @property {Float32Array} [colors] 颜色数组
|
|
565
|
+
* @property {Float32Array} [generics] 属性数组
|
|
566
|
+
* @property {Float32Array} [normals] 法向量数组
|
|
567
|
+
*/
|
|
568
|
+
/**
|
|
569
|
+
* 解压drc格式的网格数据
|
|
570
|
+
* @param {ArrayBuffer} byteArray drc网格数据
|
|
571
|
+
* @returns {DrcMeshData} 网格数据
|
|
572
|
+
*/
|
|
573
|
+
export function decodeDrcBufferArray(byteArray: ArrayBuffer): DrcMeshData;
|
|
574
|
+
/**
|
|
575
|
+
* @typedef {Object} Decoder
|
|
576
|
+
*/
|
|
577
|
+
/**
|
|
578
|
+
* 输入一个Drc数据,反会对应的解压器
|
|
579
|
+
* @param {ArrayBuffer} arrayBuffer 输入的数据
|
|
580
|
+
* @returns {Decoder} drc解压类
|
|
581
|
+
*/
|
|
582
|
+
export function decodeBuffer(arrayBuffer: ArrayBuffer): Decoder;
|
|
583
|
+
/**
|
|
584
|
+
* 获取decoder中的属性
|
|
585
|
+
* @param {Decoder} dracoGeometry DRC Decoder
|
|
586
|
+
* @param {number} attributeId 需要获取的属性id
|
|
587
|
+
* @returns {Float32Array} 对应decoder中的属性
|
|
588
|
+
*/
|
|
589
|
+
export function getDracoAttributeAsFloat32Array(
|
|
590
|
+
dracoGeometry: Decoder,
|
|
591
|
+
attributeId: number
|
|
592
|
+
): Float32Array;
|
|
593
|
+
/**
|
|
594
|
+
* 将点数据使用drc压缩处理为 base64 string
|
|
595
|
+
* @param {vec3[] | number[]} points 点数据
|
|
596
|
+
* @returns {string} drc压缩之后的base64数据
|
|
597
|
+
*/
|
|
598
|
+
export function enCloudPointTobase64(points: vec3[] | number[]): string;
|
|
599
|
+
/**
|
|
600
|
+
* @typedef {Object} Mesh
|
|
601
|
+
* @property {number[][]} vertices 点信息
|
|
602
|
+
* @property {number[][]} faces 面信息
|
|
603
|
+
*/
|
|
604
|
+
/**
|
|
605
|
+
* 使用drc压缩网格信息
|
|
606
|
+
* @param {Mesh | vtkPolyData} mesh
|
|
607
|
+
* @param {number} byteLength=14 压缩率
|
|
608
|
+
* @param {AttrOption} [attr] 其他需要压缩的属性
|
|
609
|
+
* @returns {Int8Array} 压缩之后的DRC数据
|
|
610
|
+
*/
|
|
611
|
+
export function enCodeMesh(
|
|
612
|
+
mesh: Mesh | vtkPolyData,
|
|
613
|
+
byteLength?: number,
|
|
614
|
+
attr?: AttrOption
|
|
615
|
+
): Int8Array;
|
|
616
|
+
/**
|
|
617
|
+
* 初始化Draco文件
|
|
618
|
+
*/
|
|
619
|
+
export function initDrcCoder(): void;
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
export namespace utils {
|
|
623
|
+
/**
|
|
624
|
+
* 获取当前屏幕分辨率(百分制,默认100)
|
|
625
|
+
* @returns {number} 当前屏幕分辨率
|
|
626
|
+
*/
|
|
627
|
+
export function getRatio(): number;
|
|
628
|
+
/**
|
|
629
|
+
* 将Base64转换为ArrayBuffer
|
|
630
|
+
* @param {string} base64String
|
|
631
|
+
* @returns {ArrayBuffer} base64的ArrayBuffer
|
|
632
|
+
*/
|
|
633
|
+
export function base64ToArrayBuffer(base64String: string): ArrayBuffer;
|
|
634
|
+
/**
|
|
635
|
+
* 将Int8Array转换为Base64格式的字符串
|
|
636
|
+
* @param {Int8Array} int8
|
|
637
|
+
* @returns {string} base64格式的字符串
|
|
638
|
+
*/
|
|
639
|
+
export function int8ArrayToBase64(int8: Int8Array): string;
|
|
640
|
+
/**
|
|
641
|
+
* 将ArrayBuffer转换为Base64格式的字符串
|
|
642
|
+
* @param {ArrayBuffer} outputBuffer
|
|
643
|
+
* @returns {string} base64格式的字符串
|
|
644
|
+
*/
|
|
645
|
+
export function arrayBufferToBase64(outputBuffer: ArrayBuffer): string;
|
|
646
|
+
/**
|
|
647
|
+
* 获取当前屏幕分辨率(百分制,默认100)
|
|
648
|
+
* @returns {number} 当前屏幕分辨率
|
|
649
|
+
*/
|
|
650
|
+
export function detectZoom(): number;
|
|
651
|
+
}
|
|
652
|
+
export namespace qrcode {
|
|
653
|
+
/**
|
|
654
|
+
* 生成一个二维码图片,可以在二维码右侧添加二维码文字内容信息
|
|
655
|
+
* @param {string} content 二维码内容
|
|
656
|
+
* @param {QrCodeOptions} options 图片参数
|
|
657
|
+
* @returns {string} 返回图片的base64
|
|
658
|
+
*/
|
|
659
|
+
export function generateQRCodeWithText(
|
|
660
|
+
content: string,
|
|
661
|
+
options?: QrCodeOptions
|
|
662
|
+
): string | false;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
export namespace BwipJs {
|
|
666
|
+
export interface BwippOptions {
|
|
667
|
+
includecheck?: boolean | undefined;
|
|
668
|
+
includecheckintext?: boolean | undefined;
|
|
669
|
+
|
|
670
|
+
parse?: boolean | undefined;
|
|
671
|
+
parsefnc?: boolean | undefined;
|
|
672
|
+
|
|
673
|
+
height?: number | undefined;
|
|
674
|
+
width?: number | undefined;
|
|
675
|
+
|
|
676
|
+
inkspread?: number | undefined;
|
|
677
|
+
inkspreadh?: number | undefined;
|
|
678
|
+
inkspreadv?: number | undefined;
|
|
679
|
+
dotty?: boolean | undefined;
|
|
680
|
+
|
|
681
|
+
binarytext?: boolean | undefined; // really a bwip-js option but better positioned here
|
|
682
|
+
includetext?: boolean | undefined;
|
|
683
|
+
textfont?: string | undefined;
|
|
684
|
+
textsize?: number | undefined;
|
|
685
|
+
textgaps?: number | undefined;
|
|
686
|
+
alttext?: string | undefined;
|
|
687
|
+
|
|
688
|
+
textxalign?:
|
|
689
|
+
| "offleft"
|
|
690
|
+
| "left"
|
|
691
|
+
| "center"
|
|
692
|
+
| "right"
|
|
693
|
+
| "offright"
|
|
694
|
+
| "justify"
|
|
695
|
+
| undefined;
|
|
696
|
+
textyalign?: "below" | "center" | "above" | undefined;
|
|
697
|
+
textxoffset?: number | undefined;
|
|
698
|
+
textyoffset?: number | undefined;
|
|
699
|
+
|
|
700
|
+
showborder?: boolean | undefined;
|
|
701
|
+
borderwidth?: number | undefined;
|
|
702
|
+
borderleft?: number | undefined;
|
|
703
|
+
borderright?: number | undefined;
|
|
704
|
+
bordertop?: number | undefined;
|
|
705
|
+
boraderbottom?: number | undefined;
|
|
706
|
+
|
|
707
|
+
barcolor?: string | undefined;
|
|
708
|
+
backgroundcolor?: string | undefined;
|
|
709
|
+
bordercolor?: string | undefined;
|
|
710
|
+
textcolor?: string | undefined;
|
|
711
|
+
|
|
712
|
+
addontextxoffset?: number | undefined;
|
|
713
|
+
addontextyoffset?: number | undefined;
|
|
714
|
+
addontextfont?: string | undefined;
|
|
715
|
+
addontextsize?: number | undefined;
|
|
716
|
+
|
|
717
|
+
guardwhitespace?: boolean | undefined;
|
|
718
|
+
guardwidth?: number | undefined;
|
|
719
|
+
guardheight?: number | undefined;
|
|
720
|
+
guardleftpos?: number | undefined;
|
|
721
|
+
guardrightpos?: number | undefined;
|
|
722
|
+
guardleftypos?: number | undefined;
|
|
723
|
+
guardrightypos?: number | undefined;
|
|
724
|
+
}
|
|
725
|
+
export interface RenderOptions extends BwippOptions {
|
|
726
|
+
bcid: string;
|
|
727
|
+
text: string;
|
|
728
|
+
|
|
729
|
+
scaleX?: number | undefined;
|
|
730
|
+
scaleY?: number | undefined;
|
|
731
|
+
scale?: number | undefined;
|
|
732
|
+
|
|
733
|
+
rotate?: "N" | "R" | "L" | "I" | undefined;
|
|
734
|
+
|
|
735
|
+
paddingwidth?: number | undefined;
|
|
736
|
+
paddingheight?: number | undefined;
|
|
737
|
+
|
|
738
|
+
paddingleft?: number | undefined;
|
|
739
|
+
paddingright?: number | undefined;
|
|
740
|
+
paddingtop?: number | undefined;
|
|
741
|
+
paddingbottom?: number | undefined;
|
|
742
|
+
|
|
743
|
+
monochrome?: boolean | undefined;
|
|
744
|
+
sizelimit?: number | undefined;
|
|
745
|
+
}
|
|
746
|
+
export interface RawOptions extends BwippOptions {
|
|
747
|
+
bcid: string;
|
|
748
|
+
text: string;
|
|
749
|
+
}
|
|
750
|
+
export interface DrawingContext<T> {
|
|
751
|
+
setopts?(options: RenderOptions): void;
|
|
752
|
+
scale(sx: number, sy: number): [number, number] | null;
|
|
753
|
+
measure(
|
|
754
|
+
str: string,
|
|
755
|
+
font: string,
|
|
756
|
+
fwidth: number,
|
|
757
|
+
fheight: number
|
|
758
|
+
): { width: number; ascent: number; descent: number };
|
|
759
|
+
init(width: number, height: number): void;
|
|
760
|
+
line(
|
|
761
|
+
x0: number,
|
|
762
|
+
y0: number,
|
|
763
|
+
x1: number,
|
|
764
|
+
y1: number,
|
|
765
|
+
lw: number,
|
|
766
|
+
rgb: string
|
|
767
|
+
): void;
|
|
768
|
+
polygon(pts: Array<[number, number]>): void;
|
|
769
|
+
hexagon(
|
|
770
|
+
pts: [
|
|
771
|
+
[number, number],
|
|
772
|
+
[number, number],
|
|
773
|
+
[number, number],
|
|
774
|
+
[number, number],
|
|
775
|
+
[number, number]
|
|
776
|
+
]
|
|
777
|
+
): void;
|
|
778
|
+
ellipse(x: number, y: number, rx: number, ry: number, ccw: boolean): void;
|
|
779
|
+
fill(rgb: string): void;
|
|
780
|
+
text(
|
|
781
|
+
x: number,
|
|
782
|
+
y: number,
|
|
783
|
+
str: string,
|
|
784
|
+
rgb: string,
|
|
785
|
+
font: { name: string; width: number; height: number; dx: number }
|
|
786
|
+
): void;
|
|
787
|
+
end(): T;
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
export function toSVG(opts: RenderOptions): string;
|
|
791
|
+
export function drawingSVG(): DrawingContext<string>;
|
|
792
|
+
|
|
793
|
+
export function toCanvas(
|
|
794
|
+
canvas: string | HTMLCanvasElement,
|
|
795
|
+
opts: RenderOptions
|
|
796
|
+
): HTMLCanvasElement;
|
|
797
|
+
export function drawingCanvas(
|
|
798
|
+
canvas: string | HTMLCanvasElement
|
|
799
|
+
): DrawingContext<HTMLCanvasElement>;
|
|
800
|
+
|
|
801
|
+
export function datamatrix(
|
|
802
|
+
canvas: string | HTMLCanvasElement,
|
|
803
|
+
opts: RenderOptions
|
|
804
|
+
): HTMLCanvasElement;
|
|
805
|
+
export function datamatrix<T>(
|
|
806
|
+
opts: RenderOptions,
|
|
807
|
+
drawing: DrawingContext<Promise<T>>
|
|
808
|
+
): Promise<T>;
|
|
809
|
+
export function datamatrix<T>(
|
|
810
|
+
opts: RenderOptions,
|
|
811
|
+
drawing: DrawingContext<T>
|
|
812
|
+
): T;
|
|
813
|
+
|
|
814
|
+
export function qrcode(
|
|
815
|
+
canvas: string | HTMLCanvasElement,
|
|
816
|
+
opts: RenderOptions
|
|
817
|
+
): HTMLCanvasElement;
|
|
818
|
+
export function qrcode<T>(
|
|
819
|
+
opts: RenderOptions,
|
|
820
|
+
drawing: DrawingContext<Promise<T>>
|
|
821
|
+
): Promise<T>;
|
|
822
|
+
export function qrcode<T>(
|
|
823
|
+
opts: RenderOptions,
|
|
824
|
+
drawing: DrawingContext<T>
|
|
825
|
+
): T;
|
|
826
|
+
export function render<T>(
|
|
827
|
+
params: RenderOptions,
|
|
828
|
+
drawing: DrawingContext<T>
|
|
829
|
+
): T;
|
|
830
|
+
export function raw(
|
|
831
|
+
bcid: string,
|
|
832
|
+
text: string,
|
|
833
|
+
opts?: BwippOptions
|
|
834
|
+
):
|
|
835
|
+
| Array<{ bbs: number[]; bhs: number[]; sbs: number[] }>
|
|
836
|
+
| Array<{
|
|
837
|
+
pixs: number[];
|
|
838
|
+
pixx: number;
|
|
839
|
+
pixy: number;
|
|
840
|
+
height: number;
|
|
841
|
+
width: number;
|
|
842
|
+
}>;
|
|
843
|
+
export const BWIPP_VERSION: string;
|
|
844
|
+
export const BWIPJS_VERSION: string;
|
|
845
|
+
|
|
846
|
+
export function loadFont(name: string, data: string | Uint8Array): void;
|
|
847
|
+
export function loadFont(
|
|
848
|
+
name: string,
|
|
849
|
+
mult: number,
|
|
850
|
+
data: string | Uint8Array
|
|
851
|
+
): void;
|
|
852
|
+
export function loadFont(
|
|
853
|
+
name: string,
|
|
854
|
+
multy: number,
|
|
855
|
+
multx: number,
|
|
856
|
+
data: string | Uint8Array
|
|
857
|
+
): void;
|
|
858
|
+
|
|
859
|
+
export namespace FontLib {
|
|
860
|
+
export interface PathData
|
|
861
|
+
extends Array<
|
|
862
|
+
| { type: "M"; x: number; y: number }
|
|
863
|
+
| { type: "L"; x: number; y: number }
|
|
864
|
+
| { type: "Q"; x: number; y: number; cx: number; cy: number }
|
|
865
|
+
| {
|
|
866
|
+
type: "C";
|
|
867
|
+
x: number;
|
|
868
|
+
y: number;
|
|
869
|
+
cx1: number;
|
|
870
|
+
cy1: number;
|
|
871
|
+
cx2: number;
|
|
872
|
+
cy2: number;
|
|
873
|
+
}
|
|
874
|
+
> {
|
|
875
|
+
ascent: number;
|
|
876
|
+
descent: number;
|
|
877
|
+
advance: number;
|
|
878
|
+
}
|
|
879
|
+
export function lookup(font: string): number;
|
|
880
|
+
export function monochrome(mono: boolean): void;
|
|
881
|
+
export function getglyph(
|
|
882
|
+
fontid: number,
|
|
883
|
+
charcode: number,
|
|
884
|
+
width: number,
|
|
885
|
+
height: number
|
|
886
|
+
): {
|
|
887
|
+
glyph: number;
|
|
888
|
+
top: number;
|
|
889
|
+
left: number;
|
|
890
|
+
width: number;
|
|
891
|
+
height: number;
|
|
892
|
+
advance: number;
|
|
893
|
+
pixels: Uint8Array;
|
|
894
|
+
bytes: Uint8Array;
|
|
895
|
+
cachekey: string;
|
|
896
|
+
offset: number;
|
|
897
|
+
};
|
|
898
|
+
export function getpaths(
|
|
899
|
+
fontid: number,
|
|
900
|
+
charcode: number,
|
|
901
|
+
width: number,
|
|
902
|
+
height: number
|
|
903
|
+
): PathData;
|
|
904
|
+
export function loadFont(name: string, data: string | Uint8Array): void;
|
|
905
|
+
export function loadFont(
|
|
906
|
+
name: string,
|
|
907
|
+
mult: number,
|
|
908
|
+
data: string | Uint8Array
|
|
909
|
+
): void;
|
|
910
|
+
export function loadFont(
|
|
911
|
+
name: string,
|
|
912
|
+
multy: number,
|
|
913
|
+
multx: number,
|
|
914
|
+
data: string | Uint8Array
|
|
915
|
+
): void;
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
}
|