@bitbybit-dev/manifold 0.19.0-alpha.0

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 (51) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +63 -0
  3. package/babel.config.cjs +14 -0
  4. package/babel.config.d.cts +5 -0
  5. package/index.d.ts +1 -0
  6. package/index.js +4 -0
  7. package/lib/api/inputs/base-inputs.d.ts +38 -0
  8. package/lib/api/inputs/base-inputs.js +1 -0
  9. package/lib/api/inputs/index.d.ts +2 -0
  10. package/lib/api/inputs/index.js +2 -0
  11. package/lib/api/inputs/inputs.d.ts +2 -0
  12. package/lib/api/inputs/inputs.js +2 -0
  13. package/lib/api/inputs/manifold-inputs.d.ts +1131 -0
  14. package/lib/api/inputs/manifold-inputs.js +1270 -0
  15. package/lib/api/manifold-service.d.ts +14 -0
  16. package/lib/api/manifold-service.js +28 -0
  17. package/lib/api/services/cross-section/cross-section-booleans.d.ts +15 -0
  18. package/lib/api/services/cross-section/cross-section-booleans.js +44 -0
  19. package/lib/api/services/cross-section/cross-section-evaluate.d.ts +11 -0
  20. package/lib/api/services/cross-section/cross-section-evaluate.js +21 -0
  21. package/lib/api/services/cross-section/cross-section-operations.d.ts +13 -0
  22. package/lib/api/services/cross-section/cross-section-operations.js +34 -0
  23. package/lib/api/services/cross-section/cross-section-shapes.d.ts +10 -0
  24. package/lib/api/services/cross-section/cross-section-shapes.js +24 -0
  25. package/lib/api/services/cross-section/cross-section-transforms.d.ts +13 -0
  26. package/lib/api/services/cross-section/cross-section-transforms.js +26 -0
  27. package/lib/api/services/cross-section/cross-section.d.ts +20 -0
  28. package/lib/api/services/cross-section/cross-section.js +35 -0
  29. package/lib/api/services/index.d.ts +0 -0
  30. package/lib/api/services/index.js +0 -0
  31. package/lib/api/services/manifold/manifold-booleans.d.ts +18 -0
  32. package/lib/api/services/manifold/manifold-booleans.js +53 -0
  33. package/lib/api/services/manifold/manifold-evaluate.d.ts +19 -0
  34. package/lib/api/services/manifold/manifold-evaluate.js +45 -0
  35. package/lib/api/services/manifold/manifold-operations.d.ts +22 -0
  36. package/lib/api/services/manifold/manifold-operations.js +59 -0
  37. package/lib/api/services/manifold/manifold-shapes.d.ts +11 -0
  38. package/lib/api/services/manifold/manifold-shapes.js +29 -0
  39. package/lib/api/services/manifold/manifold-transforms.d.ts +16 -0
  40. package/lib/api/services/manifold/manifold-transforms.js +48 -0
  41. package/lib/api/services/manifold/manifold.d.ts +18 -0
  42. package/lib/api/services/manifold/manifold.js +27 -0
  43. package/lib/api/services/mesh/mesh-evaluate.d.ts +15 -0
  44. package/lib/api/services/mesh/mesh-evaluate.js +37 -0
  45. package/lib/api/services/mesh/mesh-operations.d.ts +7 -0
  46. package/lib/api/services/mesh/mesh-operations.js +8 -0
  47. package/lib/api/services/mesh/mesh.d.ts +9 -0
  48. package/lib/api/services/mesh/mesh.js +9 -0
  49. package/lib/index.d.ts +2 -0
  50. package/lib/index.js +2 -0
  51. package/package.json +94 -0
@@ -0,0 +1,1270 @@
1
+ // tslint:disable-next-line: no-namespace
2
+ export var Manifold;
3
+ (function (Manifold) {
4
+ let fillRuleEnum;
5
+ (function (fillRuleEnum) {
6
+ fillRuleEnum["evenOdd"] = "EvenOdd";
7
+ fillRuleEnum["nonZero"] = "NonZero";
8
+ fillRuleEnum["positive"] = "Positive";
9
+ fillRuleEnum["negative"] = "Negative";
10
+ })(fillRuleEnum = Manifold.fillRuleEnum || (Manifold.fillRuleEnum = {}));
11
+ let manifoldJoinTypeEnum;
12
+ (function (manifoldJoinTypeEnum) {
13
+ manifoldJoinTypeEnum["square"] = "Square";
14
+ manifoldJoinTypeEnum["round"] = "Round";
15
+ manifoldJoinTypeEnum["miter"] = "Miter";
16
+ })(manifoldJoinTypeEnum = Manifold.manifoldJoinTypeEnum || (Manifold.manifoldJoinTypeEnum = {}));
17
+ class DecomposedManifoldMeshDto {
18
+ }
19
+ Manifold.DecomposedManifoldMeshDto = DecomposedManifoldMeshDto;
20
+ class DrawManifoldOrCrossSectionDto {
21
+ /**
22
+ * Provide options without default values
23
+ */
24
+ constructor(manifoldOrCrossSection, faceOpacity, faceMaterial, faceColour, crossSectionColour, crossSectionWidth, crossSectionOpacity, computeNormals) {
25
+ /**
26
+ * Face opacity value between 0 and 1
27
+ * @default 1
28
+ * @minimum 0
29
+ * @maximum 1
30
+ * @step 0.1
31
+ */
32
+ this.faceOpacity = 1;
33
+ /**
34
+ * Hex colour string for face colour
35
+ * @default #ff0000
36
+ */
37
+ this.faceColour = "#ff0000";
38
+ /**
39
+ * Hex colour string for cross section drawing
40
+ * @default #ff00ff
41
+ */
42
+ this.crossSectionColour = "#ff00ff";
43
+ /**
44
+ * Width of cross section lines
45
+ * @default 2
46
+ */
47
+ this.crossSectionWidth = 2;
48
+ /**
49
+ * Cross section opacity value between 0 and 1
50
+ * @default 1
51
+ * @minimum 0
52
+ * @maximum 1
53
+ * @step 0.1
54
+ */
55
+ this.crossSectionOpacity = 1;
56
+ /**
57
+ * Compute normals for the shape
58
+ * @default false
59
+ */
60
+ this.computeNormals = false;
61
+ if (manifoldOrCrossSection !== undefined) {
62
+ this.manifoldOrCrossSection = manifoldOrCrossSection;
63
+ }
64
+ if (faceOpacity !== undefined) {
65
+ this.faceOpacity = faceOpacity;
66
+ }
67
+ if (faceMaterial !== undefined) {
68
+ this.faceMaterial = faceMaterial;
69
+ }
70
+ if (faceColour !== undefined) {
71
+ this.faceColour = faceColour;
72
+ }
73
+ if (crossSectionColour !== undefined) {
74
+ this.crossSectionColour = crossSectionColour;
75
+ }
76
+ if (crossSectionWidth !== undefined) {
77
+ this.crossSectionWidth = crossSectionWidth;
78
+ }
79
+ if (crossSectionOpacity !== undefined) {
80
+ this.crossSectionOpacity = crossSectionOpacity;
81
+ }
82
+ if (computeNormals !== undefined) {
83
+ this.computeNormals = computeNormals;
84
+ }
85
+ }
86
+ }
87
+ Manifold.DrawManifoldOrCrossSectionDto = DrawManifoldOrCrossSectionDto;
88
+ class DrawManifoldsOrCrossSectionsDto {
89
+ /**
90
+ * Provide options without default values
91
+ */
92
+ constructor(manifoldsOrCrossSections, faceOpacity, faceMaterial, faceColour, crossSectionColour, crossSectionWidth, crossSectionOpacity, computeNormals) {
93
+ /**
94
+ * Hex colour string for face colour
95
+ * @default #ff0000
96
+ */
97
+ this.faceColour = "#ff0000";
98
+ /**
99
+ * Face opacity value between 0 and 1
100
+ * @default 1
101
+ * @minimum 0
102
+ * @maximum 1
103
+ * @step 0.1
104
+ */
105
+ this.faceOpacity = 1;
106
+ /**
107
+ * Hex colour string for cross section drawing
108
+ * @default #ff00ff
109
+ */
110
+ this.crossSectionColour = "#ff00ff";
111
+ /**
112
+ * Width of cross section lines
113
+ * @default 2
114
+ */
115
+ this.crossSectionWidth = 2;
116
+ /**
117
+ * Cross section opacity value between 0 and 1
118
+ * @default 1
119
+ * @minimum 0
120
+ * @maximum 1
121
+ * @step 0.1
122
+ */
123
+ this.crossSectionOpacity = 1;
124
+ /**
125
+ * Compute normals for the shape
126
+ * @default false
127
+ */
128
+ this.computeNormals = false;
129
+ if (manifoldsOrCrossSections !== undefined) {
130
+ this.manifoldsOrCrossSections = manifoldsOrCrossSections;
131
+ }
132
+ if (faceOpacity !== undefined) {
133
+ this.faceOpacity = faceOpacity;
134
+ }
135
+ if (faceMaterial !== undefined) {
136
+ this.faceMaterial = faceMaterial;
137
+ }
138
+ if (faceColour !== undefined) {
139
+ this.faceColour = faceColour;
140
+ }
141
+ if (crossSectionColour !== undefined) {
142
+ this.crossSectionColour = crossSectionColour;
143
+ }
144
+ if (crossSectionWidth !== undefined) {
145
+ this.crossSectionWidth = crossSectionWidth;
146
+ }
147
+ if (crossSectionOpacity !== undefined) {
148
+ this.crossSectionOpacity = crossSectionOpacity;
149
+ }
150
+ if (computeNormals !== undefined) {
151
+ this.computeNormals = computeNormals;
152
+ }
153
+ }
154
+ }
155
+ Manifold.DrawManifoldsOrCrossSectionsDto = DrawManifoldsOrCrossSectionsDto;
156
+ class CreateFromMeshDto {
157
+ constructor(mesh) {
158
+ if (mesh !== undefined) {
159
+ this.mesh = mesh;
160
+ }
161
+ }
162
+ }
163
+ Manifold.CreateFromMeshDto = CreateFromMeshDto;
164
+ class CubeDto {
165
+ constructor(center, size) {
166
+ /**
167
+ * Place cube on the center
168
+ * @default true
169
+ */
170
+ this.center = true;
171
+ /**
172
+ * Size of the cube
173
+ * @default 1
174
+ * @minimum 0
175
+ * @maximum Infinity
176
+ * @step 0.1
177
+ */
178
+ this.size = 1;
179
+ if (center !== undefined) {
180
+ this.center = center;
181
+ }
182
+ if (size !== undefined) {
183
+ this.size = size;
184
+ }
185
+ }
186
+ }
187
+ Manifold.CubeDto = CubeDto;
188
+ class CreateContourSectionDto {
189
+ constructor(polygons, fillRule) {
190
+ /**
191
+ * Fill rule for the contour section
192
+ * @default EvenOdd
193
+ */
194
+ this.fillRule = fillRuleEnum.evenOdd;
195
+ if (polygons !== undefined) {
196
+ this.polygons = polygons;
197
+ }
198
+ if (fillRule !== undefined) {
199
+ this.fillRule = fillRule;
200
+ }
201
+ }
202
+ }
203
+ Manifold.CreateContourSectionDto = CreateContourSectionDto;
204
+ class SquareDto {
205
+ constructor(center, size) {
206
+ /**
207
+ * Place cube on the center
208
+ * @default false
209
+ */
210
+ this.center = false;
211
+ /**
212
+ * Size of the cube
213
+ * @default 1
214
+ * @minimum 0
215
+ * @maximum Infinity
216
+ * @step 0.1
217
+ */
218
+ this.size = 1;
219
+ if (center !== undefined) {
220
+ this.center = center;
221
+ }
222
+ if (size !== undefined) {
223
+ this.size = size;
224
+ }
225
+ }
226
+ }
227
+ Manifold.SquareDto = SquareDto;
228
+ class SphereDto {
229
+ constructor(radius, circularSegments) {
230
+ /**
231
+ * Radius of the sphere
232
+ * @default 1
233
+ * @minimum 0
234
+ * @maximum Infinity
235
+ * @step 0.1
236
+ */
237
+ this.radius = 1;
238
+ if (radius !== undefined) {
239
+ this.radius = radius;
240
+ }
241
+ if (circularSegments !== undefined) {
242
+ this.circularSegments = circularSegments;
243
+ }
244
+ }
245
+ }
246
+ Manifold.SphereDto = SphereDto;
247
+ class CylinderDto {
248
+ constructor(height, radiusLow, radiusHigh, circularSegments, center) {
249
+ /**
250
+ * Height of the cylinder
251
+ * @default 1
252
+ * @minimum 0
253
+ * @maximum Infinity
254
+ * @step 0.1
255
+ */
256
+ this.height = 1;
257
+ /**
258
+ * Radius of the cylinder
259
+ * @default 1
260
+ * @minimum 0
261
+ * @maximum Infinity
262
+ * @step 0.1
263
+ */
264
+ this.radiusLow = 1;
265
+ /**
266
+ * Radius of the cylinder
267
+ * @default 1
268
+ * @minimum 0
269
+ * @maximum Infinity
270
+ * @step 0.1
271
+ */
272
+ this.radiusHigh = 1;
273
+ /**
274
+ * Circular segments of the cylinder
275
+ * @default 32
276
+ * @minimum 0
277
+ * @maximum Infinity
278
+ * @step 1
279
+ */
280
+ this.circularSegments = 32;
281
+ /**
282
+ * Place cylinder on the center
283
+ * @default true
284
+ */
285
+ this.center = true;
286
+ if (height !== undefined) {
287
+ this.height = height;
288
+ }
289
+ if (radiusLow !== undefined) {
290
+ this.radiusLow = radiusLow;
291
+ }
292
+ if (radiusHigh !== undefined) {
293
+ this.radiusHigh = radiusHigh;
294
+ }
295
+ if (circularSegments !== undefined) {
296
+ this.circularSegments = circularSegments;
297
+ }
298
+ if (center !== undefined) {
299
+ this.center = center;
300
+ }
301
+ }
302
+ }
303
+ Manifold.CylinderDto = CylinderDto;
304
+ class CircleDto {
305
+ constructor(radius, circularSegments) {
306
+ /**
307
+ * Radius of the cylinder
308
+ * @default 1
309
+ * @minimum 0
310
+ * @maximum Infinity
311
+ * @step 0.1
312
+ */
313
+ this.radius = 1;
314
+ /**
315
+ * Circular segments of the cylinder
316
+ * @default 32
317
+ * @minimum 0
318
+ * @maximum Infinity
319
+ * @step 1
320
+ */
321
+ this.circularSegments = 32;
322
+ if (radius !== undefined) {
323
+ this.radius = radius;
324
+ }
325
+ if (circularSegments !== undefined) {
326
+ this.circularSegments = circularSegments;
327
+ }
328
+ }
329
+ }
330
+ Manifold.CircleDto = CircleDto;
331
+ class RectangleDto {
332
+ constructor(length, height, center) {
333
+ /**
334
+ * Length of the rectangle
335
+ * @default 1
336
+ * @minimum 0
337
+ * @maximum Infinity
338
+ * @step 0.1
339
+ */
340
+ this.length = 1;
341
+ /**
342
+ * Height of the rectangle
343
+ * @default 1
344
+ * @minimum 0
345
+ * @maximum Infinity
346
+ * @step 0.1
347
+ */
348
+ this.height = 1;
349
+ /**
350
+ * Place rectangle on the center
351
+ * @default false
352
+ */
353
+ this.center = false;
354
+ if (length !== undefined) {
355
+ this.length = length;
356
+ }
357
+ if (height !== undefined) {
358
+ this.height = height;
359
+ }
360
+ if (center !== undefined) {
361
+ this.center = center;
362
+ }
363
+ }
364
+ }
365
+ Manifold.RectangleDto = RectangleDto;
366
+ class ManifoldDto {
367
+ constructor(manifold) {
368
+ if (manifold !== undefined) {
369
+ this.manifold = manifold;
370
+ }
371
+ }
372
+ }
373
+ Manifold.ManifoldDto = ManifoldDto;
374
+ class CalculateNormalsDto {
375
+ constructor(manifold, normalIdx, minSharpAngle) {
376
+ /**
377
+ * The property channel in which to store the X
378
+ * values of the normals. The X, Y, and Z channels will be sequential. The
379
+ * property set will be automatically expanded to include up through normalIdx
380
+ * + 2.
381
+ * @default 0
382
+ * @minimum 0
383
+ * @maximum Infinity
384
+ * @step 1
385
+ */
386
+ this.normalIdx = 0;
387
+ /**
388
+ * Any edges with angles greater than this value will
389
+ * remain sharp, getting different normal vector properties on each side of
390
+ * the edge. By default, no edges are sharp and all normals are shared. With a
391
+ * value of zero, the model is faceted and all normals match their triangle
392
+ * normals, but in this case it would be better not to calculate normals at
393
+ * all. The value is in degrees.
394
+ * @default 0
395
+ * @minimum 0
396
+ * @maximum Infinity
397
+ * @step 1
398
+ */
399
+ this.minSharpAngle = 0;
400
+ if (manifold !== undefined) {
401
+ this.manifold = manifold;
402
+ }
403
+ if (normalIdx !== undefined) {
404
+ this.normalIdx = normalIdx;
405
+ }
406
+ if (minSharpAngle !== undefined) {
407
+ this.minSharpAngle = minSharpAngle;
408
+ }
409
+ }
410
+ }
411
+ Manifold.CalculateNormalsDto = CalculateNormalsDto;
412
+ class CalculateCurvatureDto {
413
+ constructor(manifold) {
414
+ if (manifold !== undefined) {
415
+ this.manifold = manifold;
416
+ }
417
+ }
418
+ }
419
+ Manifold.CalculateCurvatureDto = CalculateCurvatureDto;
420
+ class CountDto {
421
+ constructor(count) {
422
+ if (count !== undefined) {
423
+ this.count = count;
424
+ }
425
+ }
426
+ }
427
+ Manifold.CountDto = CountDto;
428
+ class ManifoldsMinGapDto {
429
+ constructor(manifold1, manifold2, searchLength) {
430
+ /**
431
+ * Length of the search gap
432
+ * @default 100
433
+ * @minimum 0
434
+ * @maximum Infinity
435
+ * @step 10
436
+ */
437
+ this.searchLength = 100;
438
+ if (manifold1 !== undefined) {
439
+ this.manifold1 = manifold1;
440
+ }
441
+ if (manifold2 !== undefined) {
442
+ this.manifold2 = manifold2;
443
+ }
444
+ if (searchLength !== undefined) {
445
+ this.searchLength = searchLength;
446
+ }
447
+ }
448
+ }
449
+ Manifold.ManifoldsMinGapDto = ManifoldsMinGapDto;
450
+ class ManifoldRefineToleranceDto {
451
+ constructor(manifold, tolerance) {
452
+ /**
453
+ * The desired maximum distance between the faceted mesh
454
+ * produced and the exact smoothly curving surface. All vertices are exactly
455
+ * on the surface, within rounding error.
456
+ * @default 1e-6
457
+ * @minimum 0
458
+ * @maximum Infinity
459
+ * @step 1e-7
460
+ */
461
+ this.tolerance = 1e-6;
462
+ if (manifold !== undefined) {
463
+ this.manifold = manifold;
464
+ }
465
+ if (tolerance !== undefined) {
466
+ this.tolerance = tolerance;
467
+ }
468
+ }
469
+ }
470
+ Manifold.ManifoldRefineToleranceDto = ManifoldRefineToleranceDto;
471
+ class ManifoldRefineLengthDto {
472
+ constructor(manifold, length) {
473
+ /**
474
+ * Length of the manifold
475
+ * @default 0.1
476
+ * @minimum 0
477
+ * @maximum Infinity
478
+ * @step 0.1
479
+ */
480
+ this.length = 0.1;
481
+ if (manifold !== undefined) {
482
+ this.manifold = manifold;
483
+ }
484
+ if (length !== undefined) {
485
+ this.length = length;
486
+ }
487
+ }
488
+ }
489
+ Manifold.ManifoldRefineLengthDto = ManifoldRefineLengthDto;
490
+ class ManifoldRefineDto {
491
+ constructor(manifold, number) {
492
+ /**
493
+ * The number of pieces to split every edge into. Must be > 1.
494
+ * @default 1
495
+ * @minimum 0
496
+ * @maximum Infinity
497
+ * @step 1
498
+ */
499
+ this.number = 1;
500
+ if (manifold !== undefined) {
501
+ this.manifold = manifold;
502
+ }
503
+ if (number !== undefined) {
504
+ this.number = number;
505
+ }
506
+ }
507
+ }
508
+ Manifold.ManifoldRefineDto = ManifoldRefineDto;
509
+ class ManifoldSmoothByNormalsDto {
510
+ constructor(manifold, normalIdx) {
511
+ /**
512
+ * The first property channel of the normals. NumProp must be
513
+ * at least normalIdx + 3. Any vertex where multiple normals exist and don't
514
+ * agree will result in a sharp edge.
515
+ * @default 0
516
+ * @minimum 0
517
+ * @maximum Infinity
518
+ * @step 1
519
+ */
520
+ this.normalIdx = 0;
521
+ if (manifold !== undefined) {
522
+ this.manifold = manifold;
523
+ }
524
+ if (normalIdx !== undefined) {
525
+ this.normalIdx = normalIdx;
526
+ }
527
+ }
528
+ }
529
+ Manifold.ManifoldSmoothByNormalsDto = ManifoldSmoothByNormalsDto;
530
+ class ManifoldSmoothOutDto {
531
+ constructor(manifold, minSharpAngle, minSmoothness) {
532
+ /**
533
+ * Any edges with angles greater
534
+ * than this value will remain sharp. The rest will be smoothed to G1
535
+ * continuity, with the caveat that flat faces of three or more triangles will
536
+ * always remain flat. With a value of zero, the model is faceted, but in this
537
+ * case there is no point in smoothing.
538
+ * @default 60
539
+ * @minimum -Infinity
540
+ * @maximum Infinity
541
+ * @step 1
542
+ */
543
+ this.minSharpAngle = 60;
544
+ /**
545
+ * The smoothness applied to
546
+ * sharp angles. The default gives a hard edge, while values > 0 will give a
547
+ * small fillet on these sharp edges. A value of 1 is equivalent to a
548
+ * minSharpAngle of 180 - all edges will be smooth.
549
+ * @default 0
550
+ * @minimum 0
551
+ * @maximum 1
552
+ * @step 0.1
553
+ */
554
+ this.minSmoothness = 0;
555
+ if (manifold !== undefined) {
556
+ this.manifold = manifold;
557
+ }
558
+ if (minSharpAngle !== undefined) {
559
+ this.minSharpAngle = minSharpAngle;
560
+ }
561
+ if (minSmoothness !== undefined) {
562
+ this.minSmoothness = minSmoothness;
563
+ }
564
+ }
565
+ }
566
+ Manifold.ManifoldSmoothOutDto = ManifoldSmoothOutDto;
567
+ class HullPointsDto {
568
+ constructor(points) {
569
+ if (points !== undefined) {
570
+ this.points = points;
571
+ }
572
+ }
573
+ }
574
+ Manifold.HullPointsDto = HullPointsDto;
575
+ class SliceDto {
576
+ constructor(manifold) {
577
+ /**
578
+ * Height of the slice
579
+ * @default 0.5
580
+ * @minimum 0
581
+ * @maximum Infinity
582
+ * @step 0.1
583
+ */
584
+ this.height = 0.5;
585
+ if (manifold !== undefined) {
586
+ this.manifold = manifold;
587
+ }
588
+ }
589
+ }
590
+ Manifold.SliceDto = SliceDto;
591
+ class MeshDto {
592
+ constructor(mesh) {
593
+ if (mesh !== undefined) {
594
+ this.mesh = mesh;
595
+ }
596
+ }
597
+ }
598
+ Manifold.MeshDto = MeshDto;
599
+ class MeshVertexIndexDto {
600
+ constructor(mesh, vertexIndex) {
601
+ if (mesh !== undefined) {
602
+ this.mesh = mesh;
603
+ }
604
+ if (vertexIndex !== undefined) {
605
+ this.vertexIndex = vertexIndex;
606
+ }
607
+ }
608
+ }
609
+ Manifold.MeshVertexIndexDto = MeshVertexIndexDto;
610
+ class MeshTriangleRunIndexDto {
611
+ constructor(mesh, triangleRunIndex) {
612
+ if (mesh !== undefined) {
613
+ this.mesh = mesh;
614
+ }
615
+ if (triangleRunIndex !== undefined) {
616
+ this.triangleRunIndex = triangleRunIndex;
617
+ }
618
+ }
619
+ }
620
+ Manifold.MeshTriangleRunIndexDto = MeshTriangleRunIndexDto;
621
+ class MeshHalfEdgeIndexDto {
622
+ constructor(mesh, halfEdgeIndex) {
623
+ if (mesh !== undefined) {
624
+ this.mesh = mesh;
625
+ }
626
+ if (halfEdgeIndex !== undefined) {
627
+ this.halfEdgeIndex = halfEdgeIndex;
628
+ }
629
+ }
630
+ }
631
+ Manifold.MeshHalfEdgeIndexDto = MeshHalfEdgeIndexDto;
632
+ class MeshTriangleIndexDto {
633
+ constructor(mesh, triangleIndex) {
634
+ if (mesh !== undefined) {
635
+ this.mesh = mesh;
636
+ }
637
+ if (triangleIndex !== undefined) {
638
+ this.triangleIndex = triangleIndex;
639
+ }
640
+ }
641
+ }
642
+ Manifold.MeshTriangleIndexDto = MeshTriangleIndexDto;
643
+ class CrossSectionDto {
644
+ constructor(crossSection) {
645
+ if (crossSection !== undefined) {
646
+ this.crossSection = crossSection;
647
+ }
648
+ }
649
+ }
650
+ Manifold.CrossSectionDto = CrossSectionDto;
651
+ class CrossSectionsDto {
652
+ constructor(crossSections) {
653
+ if (crossSections !== undefined) {
654
+ this.crossSections = crossSections;
655
+ }
656
+ }
657
+ }
658
+ Manifold.CrossSectionsDto = CrossSectionsDto;
659
+ class ExtrudeDto {
660
+ constructor(crossSection) {
661
+ /**
662
+ * Height of the extrusion
663
+ * @default 1
664
+ * @minimum 0
665
+ * @maximum Infinity
666
+ * @step 0.1
667
+ */
668
+ this.height = 1;
669
+ /**
670
+ * Number of divisions
671
+ * @default 1
672
+ * @minimum 0
673
+ * @maximum Infinity
674
+ * @step 1
675
+ */
676
+ this.nDivisions = 1;
677
+ /**
678
+ * Twist degrees
679
+ * @default 0
680
+ * @minimum -Infinity
681
+ * @maximum Infinity
682
+ * @step 1
683
+ */
684
+ this.twistDegrees = 0;
685
+ /**
686
+ * Scale top
687
+ * @default 1
688
+ * @minimum 0
689
+ * @maximum Infinity
690
+ * @step 0.1
691
+ */
692
+ this.scaleTopX = 1;
693
+ /**
694
+ * Scale top
695
+ * @default 1
696
+ * @minimum 0
697
+ * @maximum Infinity
698
+ * @step 0.1
699
+ */
700
+ this.scaleTopY = 1;
701
+ /**
702
+ * Center the extrusion
703
+ * @default true
704
+ */
705
+ this.center = true;
706
+ if (crossSection !== undefined) {
707
+ this.crossSection = crossSection;
708
+ }
709
+ }
710
+ }
711
+ Manifold.ExtrudeDto = ExtrudeDto;
712
+ class RevolveDto {
713
+ constructor(crossSection, revolveDegrees, matchProfile, circularSegments) {
714
+ /**
715
+ * Default manifold library will adjust profile when generating revolved shape. We prefer it to be matching the profile by default. Set to false to use default manifold library behavior.
716
+ * @default true
717
+ */
718
+ this.matchProfile = true;
719
+ /**
720
+ * Circular segments
721
+ * @default 32
722
+ * @minimum 0
723
+ * @maximum Infinity
724
+ * @step 1
725
+ */
726
+ this.circularSegments = 32;
727
+ if (crossSection !== undefined) {
728
+ this.crossSection = crossSection;
729
+ }
730
+ if (revolveDegrees !== undefined) {
731
+ this.revolveDegrees = revolveDegrees;
732
+ }
733
+ if (matchProfile !== undefined) {
734
+ this.matchProfile = matchProfile;
735
+ }
736
+ if (circularSegments !== undefined) {
737
+ this.circularSegments = circularSegments;
738
+ }
739
+ }
740
+ }
741
+ Manifold.RevolveDto = RevolveDto;
742
+ class OffsetDto {
743
+ constructor(crossSection, delta, joinType, miterLimit, circularSegments) {
744
+ /**
745
+ * The join type specifying the treatment of contour joins
746
+ * (corners).
747
+ * @default round
748
+ */
749
+ this.joinType = manifoldJoinTypeEnum.round;
750
+ /**
751
+ * The maximum distance in multiples of delta that vertices
752
+ * can be offset from their original positions with before squaring is
753
+ * applied, **when the join type is Miter** (default is 2, which is the
754
+ * minimum allowed). See the [Clipper2
755
+ * MiterLimit](http://www.angusj.com/clipper2/Docs/Units/Clipper.Offset/Classes/ClipperOffset/Properties/MiterLimit.htm)
756
+ * page for a visual example.
757
+ * @default 2
758
+ * @minimum 2
759
+ * @maximum Infinity
760
+ * @step 0.1
761
+ */
762
+ this.miterLimit = 2;
763
+ /**
764
+ * Number of segments per 360 degrees of
765
+ * <B>JoinType::Round</B> corners (roughly, the number of vertices that
766
+ * will be added to each contour). Default is calculated by the static Quality
767
+ * defaults according to the radius.
768
+ * @default 32
769
+ * @minimum 0
770
+ * @maximum Infinity
771
+ * @step 1
772
+ */
773
+ this.circularSegments = 32;
774
+ if (crossSection !== undefined) {
775
+ this.crossSection = crossSection;
776
+ }
777
+ if (delta !== undefined) {
778
+ this.delta = delta;
779
+ }
780
+ if (joinType !== undefined) {
781
+ this.joinType = joinType;
782
+ }
783
+ if (miterLimit !== undefined) {
784
+ this.miterLimit = miterLimit;
785
+ }
786
+ if (circularSegments !== undefined) {
787
+ this.circularSegments = circularSegments;
788
+ }
789
+ }
790
+ }
791
+ Manifold.OffsetDto = OffsetDto;
792
+ class SimplifyDto {
793
+ constructor(crossSection, epsilon) {
794
+ /**
795
+ * Extrude cross section shape
796
+ * @default 1e-6
797
+ * @minimum 0
798
+ * @maximum Infinity
799
+ * @step 1e-7
800
+ */
801
+ this.epsilon = 1e-6;
802
+ if (crossSection !== undefined) {
803
+ this.crossSection = crossSection;
804
+ }
805
+ if (epsilon !== undefined) {
806
+ this.epsilon = epsilon;
807
+ }
808
+ }
809
+ }
810
+ Manifold.SimplifyDto = SimplifyDto;
811
+ class ComposeDto {
812
+ constructor(polygons) {
813
+ if (polygons !== undefined) {
814
+ this.polygons = polygons;
815
+ }
816
+ }
817
+ }
818
+ Manifold.ComposeDto = ComposeDto;
819
+ class MirrorCrossSectionDto {
820
+ constructor(crossSection, normal) {
821
+ /**
822
+ * The normal vector of the plane to be mirrored over
823
+ * @default [1,0]
824
+ */
825
+ this.normal = [1, 0];
826
+ if (crossSection !== undefined) {
827
+ this.crossSection = crossSection;
828
+ }
829
+ if (normal !== undefined) {
830
+ this.normal = normal;
831
+ }
832
+ }
833
+ }
834
+ Manifold.MirrorCrossSectionDto = MirrorCrossSectionDto;
835
+ class Scale2DCrossSectionDto {
836
+ constructor(crossSection, vector) {
837
+ /**
838
+ * The normal vector of the plane to be mirrored over
839
+ * @default [2,2]
840
+ */
841
+ this.vector = [2, 2];
842
+ if (crossSection !== undefined) {
843
+ this.crossSection = crossSection;
844
+ }
845
+ if (vector !== undefined) {
846
+ this.vector = vector;
847
+ }
848
+ }
849
+ }
850
+ Manifold.Scale2DCrossSectionDto = Scale2DCrossSectionDto;
851
+ class TranslateCrossSectionDto {
852
+ constructor(crossSection, vector) {
853
+ if (crossSection !== undefined) {
854
+ this.crossSection = crossSection;
855
+ }
856
+ if (vector !== undefined) {
857
+ this.vector = vector;
858
+ }
859
+ }
860
+ }
861
+ Manifold.TranslateCrossSectionDto = TranslateCrossSectionDto;
862
+ class RotateCrossSectionDto {
863
+ constructor(crossSection, degrees) {
864
+ if (crossSection !== undefined) {
865
+ this.crossSection = crossSection;
866
+ }
867
+ if (degrees !== undefined) {
868
+ this.degrees = degrees;
869
+ }
870
+ }
871
+ }
872
+ Manifold.RotateCrossSectionDto = RotateCrossSectionDto;
873
+ class ScaleCrossSectionDto {
874
+ constructor(crossSection, factor) {
875
+ /**
876
+ * The normal vector of the plane to be mirrored over
877
+ * @default 2
878
+ */
879
+ this.factor = 2;
880
+ if (crossSection !== undefined) {
881
+ this.crossSection = crossSection;
882
+ }
883
+ if (factor !== undefined) {
884
+ this.factor = factor;
885
+ }
886
+ }
887
+ }
888
+ Manifold.ScaleCrossSectionDto = ScaleCrossSectionDto;
889
+ class TranslateXYCrossSectionDto {
890
+ constructor(crossSection, x, y) {
891
+ /**
892
+ * The translation X axis
893
+ * @default 0
894
+ * @minimum -Infinity
895
+ * @maximum Infinity
896
+ * @step 1
897
+ */
898
+ this.x = 0;
899
+ /**
900
+ * The translation Y axis
901
+ * @default 0
902
+ * @minimum -Infinity
903
+ * @maximum Infinity
904
+ * @step 1
905
+ */
906
+ this.y = 0;
907
+ if (crossSection !== undefined) {
908
+ this.crossSection = crossSection;
909
+ }
910
+ if (x !== undefined) {
911
+ this.x = x;
912
+ }
913
+ if (y !== undefined) {
914
+ this.y = y;
915
+ }
916
+ }
917
+ }
918
+ Manifold.TranslateXYCrossSectionDto = TranslateXYCrossSectionDto;
919
+ class TransformCrossSectionDto {
920
+ constructor(crossSection, transform) {
921
+ if (crossSection !== undefined) {
922
+ this.crossSection = crossSection;
923
+ }
924
+ if (transform !== undefined) {
925
+ this.transform = transform;
926
+ }
927
+ }
928
+ }
929
+ Manifold.TransformCrossSectionDto = TransformCrossSectionDto;
930
+ class MirrorDto {
931
+ constructor(manifold, normal) {
932
+ /**
933
+ * The normal vector of the plane to be mirrored over
934
+ * @default [1,0,0]
935
+ */
936
+ this.normal = [1, 0, 0];
937
+ if (manifold !== undefined) {
938
+ this.manifold = manifold;
939
+ }
940
+ if (normal !== undefined) {
941
+ this.normal = normal;
942
+ }
943
+ }
944
+ }
945
+ Manifold.MirrorDto = MirrorDto;
946
+ class Scale3DDto {
947
+ constructor(manifold, vector) {
948
+ /**
949
+ * The normal vector of the plane to be mirrored over
950
+ * @default [2,2,2]
951
+ */
952
+ this.vector = [2, 2, 2];
953
+ if (manifold !== undefined) {
954
+ this.manifold = manifold;
955
+ }
956
+ if (vector !== undefined) {
957
+ this.vector = vector;
958
+ }
959
+ }
960
+ }
961
+ Manifold.Scale3DDto = Scale3DDto;
962
+ class TranslateDto {
963
+ constructor(manifold, vector) {
964
+ if (manifold !== undefined) {
965
+ this.manifold = manifold;
966
+ }
967
+ if (vector !== undefined) {
968
+ this.vector = vector;
969
+ }
970
+ }
971
+ }
972
+ Manifold.TranslateDto = TranslateDto;
973
+ class TranslateByVectorsDto {
974
+ constructor(manifold, vectors) {
975
+ if (manifold !== undefined) {
976
+ this.manifold = manifold;
977
+ }
978
+ if (vectors !== undefined) {
979
+ this.vectors = vectors;
980
+ }
981
+ }
982
+ }
983
+ Manifold.TranslateByVectorsDto = TranslateByVectorsDto;
984
+ class RotateDto {
985
+ constructor(manifold, vector) {
986
+ if (manifold !== undefined) {
987
+ this.manifold = manifold;
988
+ }
989
+ if (vector !== undefined) {
990
+ this.vector = vector;
991
+ }
992
+ }
993
+ }
994
+ Manifold.RotateDto = RotateDto;
995
+ class RotateXYZDto {
996
+ constructor(manifold, x, y, z) {
997
+ /**
998
+ * The rotation vector in eulers on X axis
999
+ * @default 0
1000
+ * @minimum -Infinity
1001
+ * @maximum Infinity
1002
+ * @step 1
1003
+ */
1004
+ this.x = 0;
1005
+ /**
1006
+ * The rotation vector in eulers on Y axis
1007
+ * @default 0
1008
+ * @minimum -Infinity
1009
+ * @maximum Infinity
1010
+ * @step 1
1011
+ */
1012
+ this.y = 0;
1013
+ /**
1014
+ * The rotation vector in eulers on Z axis
1015
+ * @default 0
1016
+ * @minimum -Infinity
1017
+ * @maximum Infinity
1018
+ * @step 1
1019
+ */
1020
+ this.z = 0;
1021
+ if (manifold !== undefined) {
1022
+ this.manifold = manifold;
1023
+ }
1024
+ if (x !== undefined) {
1025
+ this.x = x;
1026
+ }
1027
+ if (y !== undefined) {
1028
+ this.y = y;
1029
+ }
1030
+ if (z !== undefined) {
1031
+ this.z = z;
1032
+ }
1033
+ }
1034
+ }
1035
+ Manifold.RotateXYZDto = RotateXYZDto;
1036
+ class ScaleDto {
1037
+ constructor(manifold, factor) {
1038
+ /**
1039
+ * The normal vector of the plane to be mirrored over
1040
+ * @default 2
1041
+ */
1042
+ this.factor = 2;
1043
+ if (manifold !== undefined) {
1044
+ this.manifold = manifold;
1045
+ }
1046
+ if (factor !== undefined) {
1047
+ this.factor = factor;
1048
+ }
1049
+ }
1050
+ }
1051
+ Manifold.ScaleDto = ScaleDto;
1052
+ class TranslateXYZDto {
1053
+ constructor(manifold, x, y, z) {
1054
+ /**
1055
+ * The translation X axis
1056
+ * @default 0
1057
+ * @minimum -Infinity
1058
+ * @maximum Infinity
1059
+ * @step 1
1060
+ */
1061
+ this.x = 0;
1062
+ /**
1063
+ * The translation Y axis
1064
+ * @default 0
1065
+ * @minimum -Infinity
1066
+ * @maximum Infinity
1067
+ * @step 1
1068
+ */
1069
+ this.y = 0;
1070
+ /**
1071
+ * The translation Z axis
1072
+ * @default 0
1073
+ * @minimum -Infinity
1074
+ * @maximum Infinity
1075
+ * @step 1
1076
+ */
1077
+ this.z = 0;
1078
+ if (manifold !== undefined) {
1079
+ this.manifold = manifold;
1080
+ }
1081
+ if (x !== undefined) {
1082
+ this.x = x;
1083
+ }
1084
+ if (y !== undefined) {
1085
+ this.y = y;
1086
+ }
1087
+ if (z !== undefined) {
1088
+ this.z = z;
1089
+ }
1090
+ }
1091
+ }
1092
+ Manifold.TranslateXYZDto = TranslateXYZDto;
1093
+ class TransformDto {
1094
+ constructor(manifold, transform) {
1095
+ if (manifold !== undefined) {
1096
+ this.manifold = manifold;
1097
+ }
1098
+ if (transform !== undefined) {
1099
+ this.transform = transform;
1100
+ }
1101
+ }
1102
+ }
1103
+ Manifold.TransformDto = TransformDto;
1104
+ class TransformsDto {
1105
+ constructor(manifold, transforms) {
1106
+ if (manifold !== undefined) {
1107
+ this.manifold = manifold;
1108
+ }
1109
+ if (transforms !== undefined) {
1110
+ this.transforms = transforms;
1111
+ }
1112
+ }
1113
+ }
1114
+ Manifold.TransformsDto = TransformsDto;
1115
+ class TwoCrossSectionsDto {
1116
+ constructor(crossSection1, crossSection2) {
1117
+ if (crossSection1 !== undefined) {
1118
+ this.crossSection1 = crossSection1;
1119
+ }
1120
+ if (crossSection2 !== undefined) {
1121
+ this.crossSection2 = crossSection2;
1122
+ }
1123
+ }
1124
+ }
1125
+ Manifold.TwoCrossSectionsDto = TwoCrossSectionsDto;
1126
+ class TwoManifoldsDto {
1127
+ constructor(manifold1, manifold2) {
1128
+ if (manifold1 !== undefined) {
1129
+ this.manifold1 = manifold1;
1130
+ }
1131
+ if (manifold2 !== undefined) {
1132
+ this.manifold2 = manifold2;
1133
+ }
1134
+ }
1135
+ }
1136
+ Manifold.TwoManifoldsDto = TwoManifoldsDto;
1137
+ class SplitManifoldsDto {
1138
+ constructor(manifoldToSplit, manifoldCutter) {
1139
+ if (manifoldToSplit !== undefined) {
1140
+ this.manifoldToSplit = manifoldToSplit;
1141
+ }
1142
+ if (manifoldCutter !== undefined) {
1143
+ this.manifoldCutter = manifoldCutter;
1144
+ }
1145
+ }
1146
+ }
1147
+ Manifold.SplitManifoldsDto = SplitManifoldsDto;
1148
+ class TrimByPlaneDto {
1149
+ constructor(manifold, normal, originOffset) {
1150
+ /**
1151
+ * The normal vector of the plane to be mirrored over
1152
+ * @default [1,0,0]
1153
+ */
1154
+ this.normal = [1, 0, 0];
1155
+ /**
1156
+ * The offset from the origin
1157
+ * @default 0
1158
+ * @minimum -Infinity
1159
+ * @maximum Infinity
1160
+ * @step 0.1
1161
+ */
1162
+ this.originOffset = 0;
1163
+ if (manifold !== undefined) {
1164
+ this.manifold = manifold;
1165
+ }
1166
+ if (normal !== undefined) {
1167
+ this.normal = normal;
1168
+ }
1169
+ if (originOffset !== undefined) {
1170
+ this.originOffset = originOffset;
1171
+ }
1172
+ }
1173
+ }
1174
+ Manifold.TrimByPlaneDto = TrimByPlaneDto;
1175
+ class SplitByPlaneDto {
1176
+ constructor(manifold, normal, originOffset) {
1177
+ /**
1178
+ * The normal vector of the plane to be mirrored over
1179
+ * @default [1,0,0]
1180
+ */
1181
+ this.normal = [1, 0, 0];
1182
+ /**
1183
+ * The offset from the origin
1184
+ * @default 0
1185
+ * @minimum -Infinity
1186
+ * @maximum Infinity
1187
+ * @step 0.1
1188
+ */
1189
+ this.originOffset = 0;
1190
+ if (manifold !== undefined) {
1191
+ this.manifold = manifold;
1192
+ }
1193
+ if (normal !== undefined) {
1194
+ this.normal = normal;
1195
+ }
1196
+ if (originOffset !== undefined) {
1197
+ this.originOffset = originOffset;
1198
+ }
1199
+ }
1200
+ }
1201
+ Manifold.SplitByPlaneDto = SplitByPlaneDto;
1202
+ class ManifoldsDto {
1203
+ constructor(manifolds) {
1204
+ if (manifolds !== undefined) {
1205
+ this.manifolds = manifolds;
1206
+ }
1207
+ }
1208
+ }
1209
+ Manifold.ManifoldsDto = ManifoldsDto;
1210
+ class ManifoldToMeshDto {
1211
+ constructor(manifold, normalIdx) {
1212
+ if (manifold !== undefined) {
1213
+ this.manifold = manifold;
1214
+ }
1215
+ if (normalIdx !== undefined) {
1216
+ this.normalIdx = normalIdx;
1217
+ }
1218
+ }
1219
+ }
1220
+ Manifold.ManifoldToMeshDto = ManifoldToMeshDto;
1221
+ class ManifoldsToMeshesDto {
1222
+ constructor(manifolds, normalIdx) {
1223
+ if (manifolds !== undefined) {
1224
+ this.manifolds = manifolds;
1225
+ }
1226
+ if (normalIdx !== undefined) {
1227
+ this.normalIdx = normalIdx;
1228
+ }
1229
+ }
1230
+ }
1231
+ Manifold.ManifoldsToMeshesDto = ManifoldsToMeshesDto;
1232
+ class DecomposeManifoldOrCrossSectionDto {
1233
+ constructor(manifoldOrCrossSection, normalIdx) {
1234
+ if (manifoldOrCrossSection !== undefined) {
1235
+ this.manifoldOrCrossSection = manifoldOrCrossSection;
1236
+ }
1237
+ if (normalIdx !== undefined) {
1238
+ this.normalIdx = normalIdx;
1239
+ }
1240
+ }
1241
+ }
1242
+ Manifold.DecomposeManifoldOrCrossSectionDto = DecomposeManifoldOrCrossSectionDto;
1243
+ class ManifoldOrCrossSectionDto {
1244
+ constructor(manifoldOrCrossSection) {
1245
+ if (manifoldOrCrossSection !== undefined) {
1246
+ this.manifoldOrCrossSection = manifoldOrCrossSection;
1247
+ }
1248
+ }
1249
+ }
1250
+ Manifold.ManifoldOrCrossSectionDto = ManifoldOrCrossSectionDto;
1251
+ class ManifoldsOrCrossSectionsDto {
1252
+ constructor(manifoldsOrCrossSections) {
1253
+ if (manifoldsOrCrossSections !== undefined) {
1254
+ this.manifoldsOrCrossSections = manifoldsOrCrossSections;
1255
+ }
1256
+ }
1257
+ }
1258
+ Manifold.ManifoldsOrCrossSectionsDto = ManifoldsOrCrossSectionsDto;
1259
+ class DecomposeManifoldsOrCrossSectionsDto {
1260
+ constructor(manifoldsOrCrossSections, normalIdx) {
1261
+ if (manifoldsOrCrossSections !== undefined) {
1262
+ this.manifoldsOrCrossSections = manifoldsOrCrossSections;
1263
+ }
1264
+ if (normalIdx !== undefined) {
1265
+ this.normalIdx = normalIdx;
1266
+ }
1267
+ }
1268
+ }
1269
+ Manifold.DecomposeManifoldsOrCrossSectionsDto = DecomposeManifoldsOrCrossSectionsDto;
1270
+ })(Manifold || (Manifold = {}));