@bitbybit-dev/manifold 1.2.0-rc.2 → 1.3.0-rc.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 (35) hide show
  1. package/lib/api/inputs/manifold-inputs.d.ts +521 -224
  2. package/lib/api/inputs/manifold-inputs.js +380 -135
  3. package/lib/api/manifold-service.d.ts +37 -11
  4. package/lib/api/manifold-service.js +37 -11
  5. package/lib/api/services/cross-section/cross-section-booleans.d.ts +66 -29
  6. package/lib/api/services/cross-section/cross-section-booleans.js +66 -29
  7. package/lib/api/services/cross-section/cross-section-evaluate.d.ts +38 -17
  8. package/lib/api/services/cross-section/cross-section-evaluate.js +38 -17
  9. package/lib/api/services/cross-section/cross-section-operations.d.ts +73 -33
  10. package/lib/api/services/cross-section/cross-section-operations.js +73 -33
  11. package/lib/api/services/cross-section/cross-section-shapes.d.ts +38 -17
  12. package/lib/api/services/cross-section/cross-section-shapes.js +38 -17
  13. package/lib/api/services/cross-section/cross-section-transforms.d.ts +64 -29
  14. package/lib/api/services/cross-section/cross-section-transforms.js +64 -29
  15. package/lib/api/services/cross-section/cross-section.d.ts +81 -20
  16. package/lib/api/services/cross-section/cross-section.js +81 -20
  17. package/lib/api/services/manifold/manifold-booleans.d.ts +139 -43
  18. package/lib/api/services/manifold/manifold-booleans.js +143 -43
  19. package/lib/api/services/manifold/manifold-evaluate.d.ts +134 -59
  20. package/lib/api/services/manifold/manifold-evaluate.js +141 -59
  21. package/lib/api/services/manifold/manifold-operations.d.ts +195 -108
  22. package/lib/api/services/manifold/manifold-operations.js +197 -110
  23. package/lib/api/services/manifold/manifold-shapes.d.ts +64 -26
  24. package/lib/api/services/manifold/manifold-shapes.js +66 -28
  25. package/lib/api/services/manifold/manifold-transforms.d.ts +100 -38
  26. package/lib/api/services/manifold/manifold-transforms.js +100 -38
  27. package/lib/api/services/manifold/manifold.d.ts +25 -8
  28. package/lib/api/services/manifold/manifold.js +25 -8
  29. package/lib/api/services/mesh/mesh-evaluate.d.ts +103 -32
  30. package/lib/api/services/mesh/mesh-evaluate.js +108 -33
  31. package/lib/api/services/mesh/mesh-operations.d.ts +12 -15
  32. package/lib/api/services/mesh/mesh-operations.js +12 -15
  33. package/lib/api/services/mesh/mesh.d.ts +4 -2
  34. package/lib/api/services/mesh/mesh.js +4 -2
  35. package/package.json +3 -3
@@ -65,29 +65,75 @@ export declare namespace Manifold {
65
65
  * WebAssembly for rendering or export.
66
66
  */
67
67
  class DecomposedManifoldMeshDto {
68
+ /**
69
+ * How many numbers each vertex carries in `vertProperties`; the position takes the first three.
70
+ */
68
71
  numProp: number;
72
+ /**
73
+ * All vertex properties in one flat list, `numProp` numbers per vertex, position first.
74
+ */
69
75
  vertProperties: Float32Array;
76
+ /**
77
+ * The triangles as a flat list of vertex indexes, three per triangle.
78
+ */
70
79
  triVerts: Uint32Array;
80
+ /**
81
+ * For each merged vertex, the index of the property vertex that is merged away; pairs with
82
+ * `mergeToVert`.
83
+ * @optional true
84
+ */
71
85
  mergeFromVert?: Uint32Array | undefined;
86
+ /**
87
+ * For each merged vertex, the index of the property vertex it is merged into; pairs with
88
+ * `mergeFromVert`.
89
+ * @optional true
90
+ */
72
91
  mergeToVert?: Uint32Array | undefined;
92
+ /**
93
+ * Where each triangle run starts in `triVerts`, one entry per run plus a final end marker.
94
+ * @optional true
95
+ */
73
96
  runIndex?: Uint32Array | undefined;
97
+ /**
98
+ * The id of the original shape each run of triangles came from, one per run.
99
+ * @optional true
100
+ */
74
101
  runOriginalID?: Uint32Array | undefined;
102
+ /**
103
+ * The placement of each run as 12 numbers of a column-major 3x4 matrix, one per run.
104
+ * @optional true
105
+ */
75
106
  runTransform?: Float32Array | undefined;
107
+ /**
108
+ * For each triangle, the id of the flat face it belongs to, so coplanar triangles can be
109
+ * grouped.
110
+ * @optional true
111
+ */
76
112
  faceID?: Uint32Array | undefined;
113
+ /**
114
+ * The smoothing tangent of each half-edge as four numbers, direction and weight, when the solid
115
+ * was smoothed.
116
+ * @optional true
117
+ */
77
118
  halfedgeTangent?: Float32Array | undefined;
78
119
  }
120
+ /**
121
+ * A solid or cross-section and how to draw it, for the renderer packages: face color, opacity and
122
+ * material for a solid, line color and width for a cross-section.
123
+ */
79
124
  class DrawManifoldOrCrossSectionDto<T, M> {
80
125
  /**
81
126
  * Provide options without default values
82
127
  */
83
128
  constructor(manifoldOrCrossSection?: T, faceOpacity?: number, faceMaterial?: M, faceColour?: Base.Color, crossSectionColour?: Base.Color, crossSectionWidth?: number, crossSectionOpacity?: number, computeNormals?: boolean, drawTwoSided?: boolean, backFaceColour?: Base.Color, backFaceOpacity?: number);
84
129
  /**
85
- * Manifold geometry
130
+ * The solid or cross-section to draw.
86
131
  * @default undefined
132
+ * @optional true
87
133
  */
88
134
  manifoldOrCrossSection?: T | undefined;
89
135
  /**
90
- * Face opacity value between 0 and 1
136
+ * How opaque the faces are, from 0 for invisible to 1 for solid.
91
137
  * @default 1
92
138
  * @minimum 0
93
139
  * @maximum 1
@@ -95,28 +141,28 @@ export declare namespace Manifold {
95
141
  */
96
142
  faceOpacity: number;
97
143
  /**
98
- * Face material
144
+ * A material for the faces from the rendering engine; when given it replaces the face color.
99
145
  * @default undefined
100
146
  * @optional true
101
147
  */
102
148
  faceMaterial?: M | undefined;
103
149
  /**
104
- * Hex colour string for face colour
150
+ * The color of the faces as a hex string such as `#ff0000`.
105
151
  * @default #ff0000
106
152
  */
107
153
  faceColour: Base.Color;
108
154
  /**
109
- * Hex colour string for cross section drawing
155
+ * The color of a cross-section's lines as a hex string.
110
156
  * @default #ff00ff
111
157
  */
112
158
  crossSectionColour: Base.Color;
113
159
  /**
114
- * Width of cross section lines
160
+ * How thick a cross-section's lines are drawn.
115
161
  * @default 2
116
162
  */
117
163
  crossSectionWidth: number;
118
164
  /**
119
- * Cross section opacity value between 0 and 1
165
+ * How opaque a cross-section's lines are, from 0 to 1.
120
166
  * @default 1
121
167
  * @minimum 0
122
168
  * @maximum 1
@@ -124,22 +170,23 @@ export declare namespace Manifold {
124
170
  */
125
171
  crossSectionOpacity: number;
126
172
  /**
127
- * Compute normals for the shape
173
+ * When true, normals are computed for the mesh so it shades smoothly.
128
174
  * @default false
129
175
  */
130
176
  computeNormals: boolean;
131
177
  /**
132
- * Draw two-sided faces with different colors for front and back. This helps visualize face orientation.
178
+ * When true, the back of each face is drawn in its own color, which shows which way faces
179
+ * point.
133
180
  * @default true
134
181
  */
135
182
  drawTwoSided: boolean;
136
183
  /**
137
- * Hex colour string for back face colour (negative side of the face). Only used when drawTwoSided is true.
184
+ * The color of the back of the faces as a hex string; used only with `drawTwoSided`.
138
185
  * @default #0000ff
139
186
  */
140
187
  backFaceColour: Base.Color;
141
188
  /**
142
- * Back face opacity value between 0 and 1. Only used when drawTwoSided is true.
189
+ * How opaque the back of the faces is, from 0 to 1; used only with `drawTwoSided`.
143
190
  * @default 1
144
191
  * @minimum 0
145
192
  * @maximum 1
@@ -147,29 +194,34 @@ export declare namespace Manifold {
147
194
  */
148
195
  backFaceOpacity: number;
149
196
  }
197
+ /**
198
+ * Solids or cross-sections and how to draw them, for the renderer packages: the same options as
199
+ * `DrawManifoldOrCrossSectionDto`, applied to every shape in the list.
200
+ */
150
201
  class DrawManifoldsOrCrossSectionsDto<T, M> {
151
202
  /**
152
203
  * Provide options without default values
153
204
  */
154
205
  constructor(manifoldsOrCrossSections?: T[], faceOpacity?: number, faceMaterial?: M, faceColour?: Base.Color, crossSectionColour?: Base.Color, crossSectionWidth?: number, crossSectionOpacity?: number, computeNormals?: boolean, drawTwoSided?: boolean, backFaceColour?: Base.Color, backFaceOpacity?: number);
155
206
  /**
156
- * Manifold geometry
207
+ * The solids or cross-sections to draw with the same options.
157
208
  * @default undefined
209
+ * @optional true
158
210
  */
159
211
  manifoldsOrCrossSections?: T[] | undefined;
160
212
  /**
161
- * Face material
213
+ * A material for the faces from the rendering engine; when given it replaces the face color.
162
214
  * @default undefined
163
215
  * @optional true
164
216
  */
165
217
  faceMaterial?: M | undefined;
166
218
  /**
167
- * Hex colour string for face colour
219
+ * The color of the faces as a hex string such as `#ff0000`.
168
220
  * @default #ff0000
169
221
  */
170
222
  faceColour: Base.Color;
171
223
  /**
172
- * Face opacity value between 0 and 1
224
+ * How opaque the faces are, from 0 for invisible to 1 for solid.
173
225
  * @default 1
174
226
  * @minimum 0
175
227
  * @maximum 1
@@ -177,17 +229,17 @@ export declare namespace Manifold {
177
229
  */
178
230
  faceOpacity: number;
179
231
  /**
180
- * Hex colour string for cross section drawing
232
+ * The color of a cross-section's lines as a hex string.
181
233
  * @default #ff00ff
182
234
  */
183
235
  crossSectionColour: Base.Color;
184
236
  /**
185
- * Width of cross section lines
237
+ * How thick a cross-section's lines are drawn.
186
238
  * @default 2
187
239
  */
188
240
  crossSectionWidth: number;
189
241
  /**
190
- * Cross section opacity value between 0 and 1
242
+ * How opaque a cross-section's lines are, from 0 to 1.
191
243
  * @default 1
192
244
  * @minimum 0
193
245
  * @maximum 1
@@ -195,22 +247,23 @@ export declare namespace Manifold {
195
247
  */
196
248
  crossSectionOpacity: number;
197
249
  /**
198
- * Compute normals for the shape
250
+ * When true, normals are computed for the meshes so they shade smoothly.
199
251
  * @default false
200
252
  */
201
253
  computeNormals: boolean;
202
254
  /**
203
- * Draw two-sided faces with different colors for front and back. This helps visualize face orientation.
255
+ * When true, the back of each face is drawn in its own color, which shows which way faces
256
+ * point.
204
257
  * @default true
205
258
  */
206
259
  drawTwoSided: boolean;
207
260
  /**
208
- * Hex colour string for back face colour (negative side of the face). Only used when drawTwoSided is true.
261
+ * The color of the back of the faces as a hex string; used only with `drawTwoSided`.
209
262
  * @default #0000ff
210
263
  */
211
264
  backFaceColour: Base.Color;
212
265
  /**
213
- * Back face opacity value between 0 and 1. Only used when drawTwoSided is true.
266
+ * How opaque the back of the faces is, from 0 to 1; used only with `drawTwoSided`.
214
267
  * @default 1
215
268
  * @minimum 0
216
269
  * @maximum 1
@@ -218,73 +271,95 @@ export declare namespace Manifold {
218
271
  */
219
272
  backFaceOpacity: number;
220
273
  }
274
+ /**
275
+ * Mesh data for `manifold.shapes.manifoldFromMesh`, which builds a solid from it.
276
+ */
221
277
  class CreateFromMeshDto {
222
278
  constructor(mesh?: DecomposedManifoldMeshDto);
223
279
  /**
224
- * Mesh definition
280
+ * The mesh data, in the form `manifoldToMesh` hands out; it must describe a closed,
281
+ * consistently oriented surface.
225
282
  */
226
283
  mesh: DecomposedManifoldMeshDto;
227
284
  }
285
+ /**
286
+ * Triangles as points for `manifold.shapes.fromPolygonPoints`, which builds a solid from them.
287
+ */
228
288
  class FromPolygonPointsDto {
229
289
  constructor(polygonPoints?: Base.Point3[][]);
230
290
  /**
231
- * Points describing polygons
291
+ * The triangles, each three points, together forming a closed surface.
232
292
  */
233
293
  polygonPoints: Base.Point3[][];
234
294
  }
295
+ /**
296
+ * One polygon as points and the fill options for `crossSection.crossSectionFromPoints`.
297
+ */
235
298
  class CrossSectionFromPolygonPointsDto {
236
299
  constructor(points?: Base.Point3[], fillRule?: fillRuleEnum, removeDuplicates?: boolean, tolerance?: number);
237
300
  /**
238
- * Points describing a single polygon
301
+ * The polygon's points in order; only X and Y are used.
239
302
  */
240
303
  points: Base.Point3[];
241
304
  /**
242
- * Fill rule for polygon interpretation
305
+ * Which regions of a self-crossing polygon count as inside: even-odd, non-zero, positive or
306
+ * negative winding.
243
307
  * @default positive
244
308
  */
245
309
  fillRule?: fillRuleEnum | undefined;
246
310
  /**
247
- * Remove consecutive duplicate points before creating polygon
311
+ * When true, consecutive repeated points, the last and first included, are dropped before
312
+ * building.
248
313
  * @default false
249
314
  */
250
315
  removeDuplicates?: boolean | undefined;
251
316
  /**
252
- * Tolerance for duplicate removal
317
+ * How close two points must be to count as repeated, in model units.
253
318
  * @default 1e-7
254
319
  */
255
320
  tolerance?: number | undefined;
256
321
  }
322
+ /**
323
+ * Several polygons as points and the fill options for `crossSection.crossSectionFromPolygons`, for
324
+ * outlines with holes.
325
+ */
257
326
  class CrossSectionFromPolygonsPointsDto {
258
327
  constructor(polygonPoints?: Base.Point3[][], fillRule?: fillRuleEnum, removeDuplicates?: boolean, tolerance?: number);
259
328
  /**
260
- * Points describing multiple polygons
329
+ * One list of points per polygon; only X and Y are used.
261
330
  */
262
331
  polygonPoints: Base.Point3[][];
263
332
  /**
264
- * Fill rule for polygon interpretation
333
+ * Which regions count as inside where polygons overlap: even-odd, non-zero, positive or
334
+ * negative winding.
265
335
  * @default positive
266
336
  */
267
337
  fillRule?: fillRuleEnum | undefined;
268
338
  /**
269
- * Remove consecutive duplicate points before creating polygons
339
+ * When true, consecutive repeated points in each polygon, the last and first included, are
340
+ * dropped before building.
270
341
  * @default false
271
342
  */
272
343
  removeDuplicates?: boolean | undefined;
273
344
  /**
274
- * Tolerance for duplicate removal
345
+ * How close two points must be to count as repeated, in model units.
275
346
  * @default 1e-7
276
347
  */
277
348
  tolerance?: number | undefined;
278
349
  }
350
+ /**
351
+ * A size and a placement for `manifold.shapes.cube`.
352
+ */
279
353
  class CubeDto {
280
354
  constructor(center?: boolean, size?: number);
281
355
  /**
282
- * Place cube on the center
356
+ * When true, the box is centered on the origin; when false its corner sits there and it extends
357
+ * along the positive axes.
283
358
  * @default true
284
359
  */
285
360
  center: boolean;
286
361
  /**
287
- * Size of the cube
362
+ * The side length of the cube, in model units.
288
363
  * @default 1
289
364
  * @minimum 0
290
365
  * @maximum Infinity
@@ -292,28 +367,36 @@ export declare namespace Manifold {
292
367
  */
293
368
  size: number;
294
369
  }
370
+ /**
371
+ * Polygons as 2D points and a fill rule for `crossSection.shapes.create`.
372
+ */
295
373
  class CreateContourSectionDto {
296
374
  constructor(polygons?: Base.Vector2[][], fillRule?: fillRuleEnum);
297
375
  /**
298
- * Polygons to use for the contour section
376
+ * The polygons, each a list of 2D points; overlapping ones are fused.
299
377
  * @default undefined
300
378
  */
301
379
  polygons: Base.Vector2[][];
302
380
  /**
303
- * Fill rule for the contour section
381
+ * Which regions count as inside where polygons overlap: even-odd, non-zero, positive or
382
+ * negative winding.
304
383
  * @default EvenOdd
305
384
  */
306
385
  fillRule: fillRuleEnum;
307
386
  }
387
+ /**
388
+ * A side length and a placement for `crossSection.shapes.square`.
389
+ */
308
390
  class SquareDto {
309
391
  constructor(center?: boolean, size?: number);
310
392
  /**
311
- * Place cube on the center
393
+ * When true, the square is centered on the origin; when false its corner sits there.
312
394
  * @default false
313
395
  */
314
396
  center: boolean;
315
397
  /**
316
- * Size of the cube
398
+ * The side length, one number for a square or two for a rectangle along X and Y, in model
399
+ * units.
317
400
  * @default 1
318
401
  * @minimum 0
319
402
  * @maximum Infinity
@@ -321,10 +404,13 @@ export declare namespace Manifold {
321
404
  */
322
405
  size: number;
323
406
  }
407
+ /**
408
+ * A radius and a segment count for `manifold.shapes.sphere`.
409
+ */
324
410
  class SphereDto {
325
411
  constructor(radius?: number, circularSegments?: number);
326
412
  /**
327
- * Radius of the sphere
413
+ * The distance from the center to the surface, in model units.
328
414
  * @default 1
329
415
  * @minimum 0
330
416
  * @maximum Infinity
@@ -332,18 +418,22 @@ export declare namespace Manifold {
332
418
  */
333
419
  radius: number;
334
420
  /**
335
- * Circular segments of the sphere
336
- * @default 32
337
- * @minimum 0
338
- * @maximum Infinity
339
- * @step 1
340
- */
421
+ * How many segments go around the sphere; rounded up to a multiple of four.
422
+ * @default 32
423
+ * @minimum 0
424
+ * @maximum Infinity
425
+ * @step 1
426
+ */
341
427
  circularSegments: number;
342
428
  }
429
+ /**
430
+ * The size and placement of a cylinder or cone for `manifold.shapes.cylinder`, which stands it
431
+ * along Z.
432
+ */
343
433
  class CylinderDto {
344
434
  constructor(height?: number, radiusLow?: number, radiusHigh?: number, circularSegments?: number, center?: boolean);
345
435
  /**
346
- * Height of the cylinder
436
+ * The height along Z, in model units.
347
437
  * @default 1
348
438
  * @minimum 0
349
439
  * @maximum Infinity
@@ -351,7 +441,7 @@ export declare namespace Manifold {
351
441
  */
352
442
  height: number;
353
443
  /**
354
- * Radius of the cylinder
444
+ * The radius of the bottom circle, in model units; must be above 0.
355
445
  * @default 1
356
446
  * @minimum 0
357
447
  * @maximum Infinity
@@ -359,7 +449,8 @@ export declare namespace Manifold {
359
449
  */
360
450
  radiusLow: number;
361
451
  /**
362
- * Radius of the cylinder
452
+ * The radius of the top circle, in model units: equal to `radiusLow` for a cylinder, smaller
453
+ * for a truncated cone, 0 for a pointed cone.
363
454
  * @default 1
364
455
  * @minimum 0
365
456
  * @maximum Infinity
@@ -367,7 +458,7 @@ export declare namespace Manifold {
367
458
  */
368
459
  radiusHigh: number;
369
460
  /**
370
- * Circular segments of the cylinder
461
+ * How many flat sides go around the cylinder; more is rounder.
371
462
  * @default 32
372
463
  * @minimum 0
373
464
  * @maximum Infinity
@@ -375,15 +466,18 @@ export declare namespace Manifold {
375
466
  */
376
467
  circularSegments: number;
377
468
  /**
378
- * Place cylinder on the center
469
+ * When true, the cylinder is centered on the origin; when false it stands on the XY plane.
379
470
  * @default true
380
471
  */
381
472
  center: boolean;
382
473
  }
474
+ /**
475
+ * A radius and a segment count for `crossSection.shapes.circle`.
476
+ */
383
477
  class CircleDto {
384
478
  constructor(radius?: number, circularSegments?: number);
385
479
  /**
386
- * Radius of the cylinder
480
+ * The distance from the center to the outline, in model units.
387
481
  * @default 1
388
482
  * @minimum 0
389
483
  * @maximum Infinity
@@ -391,7 +485,7 @@ export declare namespace Manifold {
391
485
  */
392
486
  radius: number;
393
487
  /**
394
- * Circular segments of the cylinder
488
+ * How many straight sides the circle is drawn with; more is rounder.
395
489
  * @default 32
396
490
  * @minimum 0
397
491
  * @maximum Infinity
@@ -399,10 +493,13 @@ export declare namespace Manifold {
399
493
  */
400
494
  circularSegments: number;
401
495
  }
496
+ /**
497
+ * Two sides and a placement for `crossSection.shapes.rectangle`.
498
+ */
402
499
  class RectangleDto {
403
500
  constructor(length?: number, height?: number, center?: boolean);
404
501
  /**
405
- * Length of the rectangle
502
+ * The side along X, in model units.
406
503
  * @default 1
407
504
  * @minimum 0
408
505
  * @maximum Infinity
@@ -410,7 +507,7 @@ export declare namespace Manifold {
410
507
  */
411
508
  length: number;
412
509
  /**
413
- * Height of the rectangle
510
+ * The side along Y, in model units.
414
511
  * @default 1
415
512
  * @minimum 0
416
513
  * @maximum Infinity
@@ -418,29 +515,34 @@ export declare namespace Manifold {
418
515
  */
419
516
  height: number;
420
517
  /**
421
- * Place rectangle on the center
518
+ * When true, the rectangle is centered on the origin; when false its corner sits there.
422
519
  * @default false
423
520
  */
424
521
  center: boolean;
425
522
  }
523
+ /**
524
+ * One solid for the methods that take nothing else, such as `manifold.evaluate.volume` or
525
+ * `manifold.operations.hull`.
526
+ */
426
527
  class ManifoldDto<T> {
427
528
  constructor(manifold?: T);
428
529
  /**
429
- * Manifold shape
530
+ * The solid to work on; it is not changed.
430
531
  */
431
532
  manifold: T;
432
533
  }
534
+ /**
535
+ * A solid, a channel and a sharp angle for `manifold.operations.calculateNormals`.
536
+ */
433
537
  class CalculateNormalsDto<T> {
434
538
  constructor(manifold?: T, normalIdx?: number, minSharpAngle?: number);
435
539
  /**
436
- * Manifold shape
540
+ * The solid to compute normals for.
437
541
  */
438
542
  manifold: T;
439
543
  /**
440
- * The property channel in which to store the X
441
- * values of the normals. The X, Y, and Z channels will be sequential. The
442
- * property set will be automatically expanded to include up through normalIdx
443
- * + 2.
544
+ * The property channel that receives the X of each normal; Y and Z follow in the next two, and
545
+ * channels are added as needed.
444
546
  * @default 0
445
547
  * @minimum 0
446
548
  * @maximum Infinity
@@ -448,12 +550,8 @@ export declare namespace Manifold {
448
550
  */
449
551
  normalIdx: number;
450
552
  /**
451
- * Any edges with angles greater than this value will
452
- * remain sharp, getting different normal vector properties on each side of
453
- * the edge. By default, no edges are sharp and all normals are shared. With a
454
- * value of zero, the model is faceted and all normals match their triangle
455
- * normals, but in this case it would be better not to calculate normals at
456
- * all. The value is in degrees.
553
+ * Edges bent more than this, in degrees, get separate normals on each side and stay crisp; at 0
554
+ * every triangle keeps its own normal.
457
555
  * @default 0
458
556
  * @minimum 0
459
557
  * @maximum Infinity
@@ -461,17 +559,18 @@ export declare namespace Manifold {
461
559
  */
462
560
  minSharpAngle: number;
463
561
  }
562
+ /**
563
+ * A solid and two channels for `manifold.operations.calculateCurvature`.
564
+ */
464
565
  class CalculateCurvatureDto<T> {
465
566
  constructor(manifold?: T);
466
567
  /**
467
- * Manifold shape
568
+ * The solid to compute curvature for.
468
569
  */
469
570
  manifold: T;
470
571
  /**
471
- * The property channel index in which to store the
472
- * Gaussian curvature. An index < 0 will be ignored (stores nothing). The
473
- * property set will be automatically expanded to include the channel
474
- * index specified.
572
+ * The property channel that receives the Gaussian curvature, the product of the two principal
573
+ * curvatures; below 0 skips it.
475
574
  * @default 0
476
575
  * @minimum 0
477
576
  * @maximum Infinity
@@ -479,10 +578,8 @@ export declare namespace Manifold {
479
578
  */
480
579
  gaussianIdx: number;
481
580
  /**
482
- * The property channel index in which to store the mean
483
- * curvature. An index < 0 will be ignored (stores nothing). The property
484
- * set will be automatically expanded to include the channel index
485
- * specified. The mean curvature is a scalar value that describes the
581
+ * The property channel that receives the mean curvature, the sum of the two principal
582
+ * curvatures; below 0 skips it.
486
583
  * @default 1
487
584
  * @minimum 0
488
585
  * @maximum Infinity
@@ -490,25 +587,31 @@ export declare namespace Manifold {
490
587
  */
491
588
  meanIdx: number;
492
589
  }
590
+ /**
591
+ * A count for `manifold.operations.reserveIds`, which reserves that many mesh ids.
592
+ */
493
593
  class CountDto {
494
594
  constructor(count?: number);
495
595
  /**
496
- * Nr to count
596
+ * How many ids to reserve.
497
597
  */
498
598
  count: number;
499
599
  }
600
+ /**
601
+ * Two solids and a search distance for `manifold.evaluate.minGap`.
602
+ */
500
603
  class ManifoldsMinGapDto<T> {
501
604
  constructor(manifold1?: T, manifold2?: T, searchLength?: number);
502
605
  /**
503
- * Manifold shape
606
+ * The first solid.
504
607
  */
505
608
  manifold1: T;
506
609
  /**
507
- * Manifold shape
610
+ * The second solid.
508
611
  */
509
612
  manifold2: T;
510
613
  /**
511
- * Length of the search gap
614
+ * How far apart the solids may be before the search gives up, in model units.
512
615
  * @default 100
513
616
  * @minimum 0
514
617
  * @maximum Infinity
@@ -516,16 +619,50 @@ export declare namespace Manifold {
516
619
  */
517
620
  searchLength: number;
518
621
  }
622
+ /**
623
+ * A solid and a ray segment for `manifold.evaluate.rayCast`.
624
+ */
625
+ class RayCastDto<T> {
626
+ constructor(manifold?: T, origin?: Base.Point3, endpoint?: Base.Point3);
627
+ /**
628
+ * The solid to cast the ray at.
629
+ */
630
+ manifold: T;
631
+ /**
632
+ * Where the ray segment starts.
633
+ * @default [0,0,0]
634
+ */
635
+ origin: Base.Point3;
636
+ /**
637
+ * Where the ray segment ends; nothing beyond it is hit.
638
+ * @default [0,0,10]
639
+ */
640
+ endpoint: Base.Point3;
641
+ }
642
+ /**
643
+ * One place a ray segment crosses the surface of a solid, as `manifold.evaluate.rayCast` reports
644
+ * it: the triangle's original face, how far along the segment it lies as a fraction of the
645
+ * segment's length (0 at the origin, 1 at the endpoint), the point and the surface normal there.
646
+ */
647
+ type RayHit = {
648
+ faceID: number;
649
+ distance: number;
650
+ position: Base.Point3;
651
+ normal: Base.Vector3;
652
+ };
653
+ /**
654
+ * A solid and a tolerance for `manifold.operations.refineToTolerance` and
655
+ * `manifold.operations.setTolerance`.
656
+ */
519
657
  class ManifoldRefineToleranceDto<T> {
520
658
  constructor(manifold?: T, tolerance?: number);
521
659
  /**
522
- * Manifold shape
660
+ * The solid to work on.
523
661
  */
524
662
  manifold: T;
525
663
  /**
526
- * The desired maximum distance between the faceted mesh
527
- * produced and the exact smoothly curving surface. All vertices are exactly
528
- * on the surface, within rounding error.
664
+ * The largest distance allowed between the triangles and the smooth surface they stand for, in
665
+ * model units.
529
666
  * @default 1e-6
530
667
  * @minimum 0
531
668
  * @maximum Infinity
@@ -533,14 +670,17 @@ export declare namespace Manifold {
533
670
  */
534
671
  tolerance: number;
535
672
  }
673
+ /**
674
+ * A solid and an edge length for `manifold.operations.refineToLength`.
675
+ */
536
676
  class ManifoldRefineLengthDto<T> {
537
677
  constructor(manifold?: T, length?: number);
538
678
  /**
539
- * Manifold shape
679
+ * The solid to refine.
540
680
  */
541
681
  manifold: T;
542
682
  /**
543
- * Length of the manifold
683
+ * The rough length every edge is split down to, in model units.
544
684
  * @default 0.1
545
685
  * @minimum 0
546
686
  * @maximum Infinity
@@ -548,14 +688,17 @@ export declare namespace Manifold {
548
688
  */
549
689
  length: number;
550
690
  }
691
+ /**
692
+ * A solid and a count for `manifold.operations.refine`.
693
+ */
551
694
  class ManifoldRefineDto<T> {
552
695
  constructor(manifold?: T, number?: number);
553
696
  /**
554
- * Manifold shape
697
+ * The solid to refine.
555
698
  */
556
699
  manifold: T;
557
700
  /**
558
- * The number of pieces to split every edge into. Must be > 1.
701
+ * How many pieces every edge is split into; must be more than 1 to change anything.
559
702
  * @default 1
560
703
  * @minimum 0
561
704
  * @maximum Infinity
@@ -563,16 +706,18 @@ export declare namespace Manifold {
563
706
  */
564
707
  number: number;
565
708
  }
709
+ /**
710
+ * A solid and a normal channel for `manifold.operations.smoothByNormals`.
711
+ */
566
712
  class ManifoldSmoothByNormalsDto<T> {
567
713
  constructor(manifold?: T, normalIdx?: number);
568
714
  /**
569
- * Manifold shape
715
+ * The solid to mark for smoothing.
570
716
  */
571
717
  manifold: T;
572
718
  /**
573
- * The first property channel of the normals. NumProp must be
574
- * at least normalIdx + 3. Any vertex where multiple normals exist and don't
575
- * agree will result in a sharp edge.
719
+ * The first of the three property channels holding the normals; the solid must have at least
720
+ * that many plus three.
576
721
  * @default 0
577
722
  * @minimum 0
578
723
  * @maximum Infinity
@@ -580,31 +725,37 @@ export declare namespace Manifold {
580
725
  */
581
726
  normalIdx: number;
582
727
  }
728
+ /**
729
+ * A solid and a tolerance for `manifold.operations.simplify`.
730
+ */
583
731
  class ManifoldSimplifyDto<T> {
584
732
  constructor(manifold?: T, tolerance?: number);
585
733
  /**
586
- * Manifold shape
734
+ * The solid to simplify.
587
735
  */
588
736
  manifold: T;
589
737
  /**
590
- * The maximum distance between the original and simplified meshes.
591
- * If not given or is less than the current tolerance, the current tolerance is used.
592
- * The result will contain a subset of the original verts and all surfaces will have moved by less than tolerance.
738
+ * How far surfaces may move while vertices are removed, in model units; left out or below the
739
+ * solid's own tolerance, that tolerance is used.
593
740
  * @default undefined
594
741
  * @minimum 0
595
742
  * @maximum Infinity
596
743
  * @step 0.001
744
+ * @optional true
597
745
  */
598
746
  tolerance?: number | undefined;
599
747
  }
748
+ /**
749
+ * A solid, a property count and a fill function for `manifold.operations.setProperties`.
750
+ */
600
751
  class ManifoldSetPropertiesDto<T> {
601
752
  constructor(manifold?: T, numProp?: number, propFunc?: (newProp: number[], position: Base.Vector3, oldProp: number[]) => void);
602
753
  /**
603
- * Manifold shape
754
+ * The solid whose vertex properties are rewritten.
604
755
  */
605
756
  manifold: T;
606
757
  /**
607
- * The new number of properties per vertex
758
+ * How many properties each vertex has afterwards.
608
759
  * @default 3
609
760
  * @minimum 3
610
761
  * @maximum Infinity
@@ -612,24 +763,24 @@ export declare namespace Manifold {
612
763
  */
613
764
  numProp: number;
614
765
  /**
615
- * A function that modifies the properties of a given vertex.
616
- * Note: undefined behavior will result if you read past the number of input properties or write past the number of output properties.
766
+ * A function that receives the new property array, the vertex position and the old properties,
767
+ * and fills the new array in place.
617
768
  * @default undefined
618
769
  */
619
770
  propFunc: (newProp: number[], position: Base.Vector3, oldProp: number[]) => void;
620
771
  }
772
+ /**
773
+ * A solid and the smoothing settings for `manifold.operations.smoothOut`.
774
+ */
621
775
  class ManifoldSmoothOutDto<T> {
622
776
  constructor(manifold?: T, minSharpAngle?: number, minSmoothness?: number);
623
777
  /**
624
- * Manifold shape
778
+ * The solid to mark for smoothing.
625
779
  */
626
780
  manifold: T;
627
781
  /**
628
- * Any edges with angles greater
629
- * than this value will remain sharp. The rest will be smoothed to G1
630
- * continuity, with the caveat that flat faces of three or more triangles will
631
- * always remain flat. With a value of zero, the model is faceted, but in this
632
- * case there is no point in smoothing.
782
+ * Edges bent more than this, in degrees, stay sharp; the rest are smoothed. At 0 nothing is
783
+ * smoothed.
633
784
  * @default 60
634
785
  * @minimum -Infinity
635
786
  * @maximum Infinity
@@ -637,10 +788,7 @@ export declare namespace Manifold {
637
788
  */
638
789
  minSharpAngle: number;
639
790
  /**
640
- * The smoothness applied to
641
- * sharp angles. The default gives a hard edge, while values > 0 will give a
642
- * small fillet on these sharp edges. A value of 1 is equivalent to a
643
- * minSharpAngle of 180 - all edges will be smooth.
791
+ * How much the sharp edges are rounded, from 0 for a hard edge to 1 for fully smooth.
644
792
  * @default 0
645
793
  * @minimum 0
646
794
  * @maximum 1
@@ -648,21 +796,27 @@ export declare namespace Manifold {
648
796
  */
649
797
  minSmoothness: number;
650
798
  }
799
+ /**
800
+ * Points and solids for `manifold.operations.hullPoints`, which wraps them all in one convex hull.
801
+ */
651
802
  class HullPointsDto<T> {
652
803
  constructor(points?: T);
653
804
  /**
654
- * Points to hull
805
+ * The points and solids to wrap, in any mix.
655
806
  */
656
807
  points: T;
657
808
  }
809
+ /**
810
+ * A solid and a height for `manifold.operations.slice`.
811
+ */
658
812
  class SliceDto<T> {
659
813
  constructor(manifold?: T);
660
814
  /**
661
- * Manifold shape
815
+ * The solid to cut.
662
816
  */
663
817
  manifold: T;
664
818
  /**
665
- * Height of the slice
819
+ * The Z height of the cutting plane, which is parallel to the XY plane.
666
820
  * @default 0.5
667
821
  * @minimum 0
668
822
  * @maximum Infinity
@@ -670,21 +824,28 @@ export declare namespace Manifold {
670
824
  */
671
825
  height: number;
672
826
  }
827
+ /**
828
+ * Mesh data for the methods that read it whole, such as `mesh.evaluate.numTri` and
829
+ * `mesh.operations.merge`.
830
+ */
673
831
  class MeshDto<T> {
674
832
  constructor(mesh?: T);
675
833
  /**
676
- * Mesh
834
+ * The mesh data, as `manifoldToMesh` hands it out.
677
835
  */
678
836
  mesh: T;
679
837
  }
838
+ /**
839
+ * Mesh data and a vertex index for `mesh.evaluate.position` and `mesh.evaluate.extras`.
840
+ */
680
841
  class MeshVertexIndexDto<T> {
681
842
  constructor(mesh?: T, vertexIndex?: number);
682
843
  /**
683
- * Mesh
844
+ * The mesh data to read.
684
845
  */
685
846
  mesh: T;
686
847
  /**
687
- * Vertex index
848
+ * The position of the vertex, counting from 0.
688
849
  * @default 0
689
850
  * @minimum 0
690
851
  * @maximum Infinity
@@ -692,14 +853,17 @@ export declare namespace Manifold {
692
853
  */
693
854
  vertexIndex: number;
694
855
  }
856
+ /**
857
+ * Mesh data and a run index for `mesh.evaluate.transform`.
858
+ */
695
859
  class MeshTriangleRunIndexDto<T> {
696
860
  constructor(mesh?: T, triangleRunIndex?: number);
697
861
  /**
698
- * Mesh
862
+ * The mesh data to read.
699
863
  */
700
864
  mesh: T;
701
865
  /**
702
- * Triangle run index
866
+ * The position of the triangle run, counting from 0.
703
867
  * @default 0
704
868
  * @minimum 0
705
869
  * @maximum Infinity
@@ -707,14 +871,17 @@ export declare namespace Manifold {
707
871
  */
708
872
  triangleRunIndex: number;
709
873
  }
874
+ /**
875
+ * Mesh data and a half-edge index for `mesh.evaluate.tangent`.
876
+ */
710
877
  class MeshHalfEdgeIndexDto<T> {
711
878
  constructor(mesh?: T, halfEdgeIndex?: number);
712
879
  /**
713
- * Mesh
880
+ * The mesh data to read.
714
881
  */
715
882
  mesh: T;
716
883
  /**
717
- * Half edge index
884
+ * The position of the half-edge, counting from 0: three per triangle, in triangle order.
718
885
  * @default 0
719
886
  * @minimum 0
720
887
  * @maximum Infinity
@@ -722,14 +889,17 @@ export declare namespace Manifold {
722
889
  */
723
890
  halfEdgeIndex: number;
724
891
  }
892
+ /**
893
+ * Mesh data and a triangle index for `mesh.evaluate.verts`.
894
+ */
725
895
  class MeshTriangleIndexDto<T> {
726
896
  constructor(mesh?: T, triangleIndex?: number);
727
897
  /**
728
- * Mesh
898
+ * The mesh data to read.
729
899
  */
730
900
  mesh: T;
731
901
  /**
732
- * Triangle index
902
+ * The position of the triangle, counting from 0.
733
903
  * @default 0
734
904
  * @minimum 0
735
905
  * @maximum Infinity
@@ -737,28 +907,39 @@ export declare namespace Manifold {
737
907
  */
738
908
  triangleIndex: number;
739
909
  }
910
+ /**
911
+ * One cross-section for the methods that take nothing else, such as `crossSection.evaluate.area` or
912
+ * `crossSection.operations.hull`.
913
+ */
740
914
  class CrossSectionDto<T> {
741
915
  constructor(crossSection?: T);
742
916
  /**
743
- * Cross section
917
+ * The cross-section to work on; it is not changed.
744
918
  */
745
919
  crossSection: T;
746
920
  }
921
+ /**
922
+ * Several cross-sections for the methods that take a list, such as `crossSection.booleans.union`.
923
+ */
747
924
  class CrossSectionsDto<T> {
748
925
  constructor(crossSections?: T[]);
749
926
  /**
750
- * Cross sections
927
+ * The cross-sections, in the order the method uses them.
751
928
  */
752
929
  crossSections: T[];
753
930
  }
931
+ /**
932
+ * A cross-section and the sweep settings for `crossSection.operations.extrude`, which grows it
933
+ * along Z into a solid.
934
+ */
754
935
  class ExtrudeDto<T> {
755
936
  constructor(crossSection?: T);
756
937
  /**
757
- * Extrude cross section shape
938
+ * The flat outline to extrude.
758
939
  */
759
940
  crossSection: T;
760
941
  /**
761
- * Height of the extrusion
942
+ * How far the outline is swept along Z, in model units.
762
943
  * @default 1
763
944
  * @minimum 0
764
945
  * @maximum Infinity
@@ -766,7 +947,8 @@ export declare namespace Manifold {
766
947
  */
767
948
  height: number;
768
949
  /**
769
- * Number of divisions
950
+ * How many extra copies of the outline are inserted along the way; more keeps a twist or taper
951
+ * smooth.
770
952
  * @default 1
771
953
  * @minimum 0
772
954
  * @maximum Infinity
@@ -774,7 +956,7 @@ export declare namespace Manifold {
774
956
  */
775
957
  nDivisions: number;
776
958
  /**
777
- * Twist degrees
959
+ * How far the top is turned against the bottom, in degrees.
778
960
  * @default 0
779
961
  * @minimum -Infinity
780
962
  * @maximum Infinity
@@ -782,7 +964,7 @@ export declare namespace Manifold {
782
964
  */
783
965
  twistDegrees: number;
784
966
  /**
785
- * Scale top
967
+ * How much the top is scaled along X; 1 keeps it, 0 with `scaleTopY` at 0 makes a cone.
786
968
  * @default 1
787
969
  * @minimum 0
788
970
  * @maximum Infinity
@@ -790,7 +972,7 @@ export declare namespace Manifold {
790
972
  */
791
973
  scaleTopX: number;
792
974
  /**
793
- * Scale top
975
+ * How much the top is scaled along Y; 1 keeps it, 0 with `scaleTopX` at 0 makes a cone.
794
976
  * @default 1
795
977
  * @minimum 0
796
978
  * @maximum Infinity
@@ -798,19 +980,23 @@ export declare namespace Manifold {
798
980
  */
799
981
  scaleTopY: number;
800
982
  /**
801
- * Center the extrusion
983
+ * When true, the solid is centered on the XY plane; when false it stands on it.
802
984
  * @default true
803
- */
985
+ */
804
986
  center: boolean;
805
987
  }
988
+ /**
989
+ * A cross-section and the turn settings for `crossSection.operations.revolve`, which spins it into
990
+ * a solid.
991
+ */
806
992
  class RevolveDto<T> {
807
993
  constructor(crossSection?: T, revolveDegrees?: number, matchProfile?: boolean, circularSegments?: number);
808
994
  /**
809
- * Revolve cross section shape
995
+ * The flat profile to spin; only the part on the positive X side is used.
810
996
  */
811
997
  crossSection: T;
812
998
  /**
813
- * Extrude cross section shape
999
+ * How far to spin, in degrees; 360 gives a full turn.
814
1000
  * @default 360
815
1001
  * @minimum 0
816
1002
  * @maximum Infinity
@@ -818,12 +1004,13 @@ export declare namespace Manifold {
818
1004
  */
819
1005
  revolveDegrees: number;
820
1006
  /**
821
- * 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.
1007
+ * When true, the result is turned back to keep the profile's orientation; when false it stands
1008
+ * along Z as the kernel makes it.
822
1009
  * @default true
823
1010
  */
824
1011
  matchProfile: boolean;
825
1012
  /**
826
- * Circular segments
1013
+ * How many segments go around the turn; more is rounder.
827
1014
  * @default 32
828
1015
  * @minimum 0
829
1016
  * @maximum Infinity
@@ -831,16 +1018,18 @@ export declare namespace Manifold {
831
1018
  */
832
1019
  circularSegments: number;
833
1020
  }
1021
+ /**
1022
+ * A cross-section and the offset settings for `crossSection.operations.offset`.
1023
+ */
834
1024
  class OffsetDto<T> {
835
1025
  constructor(crossSection?: T, delta?: number, joinType?: manifoldJoinTypeEnum, miterLimit?: number, circularSegments?: number);
836
1026
  /**
837
- * Revolve cross section shape
1027
+ * The outline to offset.
838
1028
  */
839
1029
  crossSection: T;
840
1030
  /**
841
- * Positive deltas will cause the expansion of outlining contours
842
- * to expand, and retraction of inner (hole) contours. Negative deltas will
843
- * have the opposite effect.
1031
+ * How far the outline moves, in model units: positive grows outer contours and shrinks holes,
1032
+ * negative does the opposite.
844
1033
  * @default 1
845
1034
  * @minimum -Infinity
846
1035
  * @maximum Infinity
@@ -848,18 +1037,13 @@ export declare namespace Manifold {
848
1037
  */
849
1038
  delta: number;
850
1039
  /**
851
- * The join type specifying the treatment of contour joins
852
- * (corners).
1040
+ * How corners are treated: `round`, `square`, `miter` or `bevel`.
853
1041
  * @default round
854
1042
  */
855
1043
  joinType: manifoldJoinTypeEnum;
856
1044
  /**
857
- * The maximum distance in multiples of delta that vertices
858
- * can be offset from their original positions with before squaring is
859
- * applied, **when the join type is Miter** (default is 2, which is the
860
- * minimum allowed). See the [Clipper2
861
- * MiterLimit](http://www.angusj.com/clipper2/Docs/Units/Clipper.Offset/Classes/ClipperOffset/Properties/MiterLimit.htm)
862
- * page for a visual example.
1045
+ * For `miter` joins, how far a corner may reach as a multiple of `delta` before it is squared
1046
+ * off; 2 is the smallest allowed.
863
1047
  * @default 2
864
1048
  * @minimum 2
865
1049
  * @maximum Infinity
@@ -867,10 +1051,7 @@ export declare namespace Manifold {
867
1051
  */
868
1052
  miterLimit: number;
869
1053
  /**
870
- * Number of segments per 360 degrees of
871
- * <B>JoinType::Round</B> corners (roughly, the number of vertices that
872
- * will be added to each contour). Default is calculated by the static Quality
873
- * defaults according to the radius.
1054
+ * For `round` joins, how many segments a full circle of rounding gets.
874
1055
  * @default 32
875
1056
  * @minimum 0
876
1057
  * @maximum Infinity
@@ -878,14 +1059,17 @@ export declare namespace Manifold {
878
1059
  */
879
1060
  circularSegments: number;
880
1061
  }
1062
+ /**
1063
+ * A cross-section and a distance for `crossSection.operations.simplify`.
1064
+ */
881
1065
  class SimplifyDto<T> {
882
1066
  constructor(crossSection?: T, epsilon?: number);
883
1067
  /**
884
- * Revolve cross section shape
1068
+ * The outline to simplify.
885
1069
  */
886
1070
  crossSection: T;
887
1071
  /**
888
- * Extrude cross section shape
1072
+ * Points closer than this, in model units, to the line between their neighbors are dropped.
889
1073
  * @default 1e-6
890
1074
  * @minimum 0
891
1075
  * @maximum Infinity
@@ -893,57 +1077,73 @@ export declare namespace Manifold {
893
1077
  */
894
1078
  epsilon: number;
895
1079
  }
1080
+ /**
1081
+ * Cross-sections or polygons for `crossSection.operations.compose`, which packs them into one
1082
+ * cross-section.
1083
+ */
896
1084
  class ComposeDto<T> {
897
1085
  constructor(polygons?: T);
898
1086
  /**
899
- * Polygons to compose
1087
+ * The cross-sections or polygons to pack together.
900
1088
  */
901
1089
  polygons: T;
902
1090
  }
1091
+ /**
1092
+ * A cross-section and a direction for `crossSection.transforms.mirror`.
1093
+ */
903
1094
  class MirrorCrossSectionDto<T> {
904
1095
  constructor(crossSection?: T, normal?: Base.Vector2);
905
1096
  /**
906
- * Manifold shape
1097
+ * The outline to mirror.
907
1098
  */
908
1099
  crossSection: T;
909
1100
  /**
910
- * The normal vector of the plane to be mirrored over
1101
+ * The normal of the mirror line through the origin; `[1, 0]` mirrors left to right.
911
1102
  * @default [1,0]
912
1103
  */
913
1104
  normal: Base.Vector2;
914
1105
  }
1106
+ /**
1107
+ * A cross-section and two factors for `crossSection.transforms.scale2D`.
1108
+ */
915
1109
  class Scale2DCrossSectionDto<T> {
916
1110
  constructor(crossSection?: T, vector?: Base.Vector2);
917
1111
  /**
918
- * Manifold shape
1112
+ * The outline to scale.
919
1113
  */
920
1114
  crossSection: T;
921
1115
  /**
922
- * The normal vector of the plane to be mirrored over
1116
+ * The factors along X and Y, about the origin; 1 keeps an axis as it is.
923
1117
  * @default [2,2]
924
1118
  */
925
1119
  vector: Base.Vector2;
926
1120
  }
1121
+ /**
1122
+ * A cross-section and a vector for `crossSection.transforms.translate`.
1123
+ */
927
1124
  class TranslateCrossSectionDto<T> {
928
1125
  constructor(crossSection?: T, vector?: Base.Vector2);
929
1126
  /**
930
- * Manifold shape
1127
+ * The outline to move.
931
1128
  */
932
1129
  crossSection: T;
933
1130
  /**
934
- * The translation vector
1131
+ * The 2D vector the outline moves by, in model units.
935
1132
  * @default undefined
936
1133
  */
937
1134
  vector: Base.Vector2;
938
1135
  }
1136
+ /**
1137
+ * A cross-section and an angle for `crossSection.transforms.rotate`.
1138
+ */
939
1139
  class RotateCrossSectionDto<T> {
940
1140
  constructor(crossSection?: T, degrees?: number);
941
1141
  /**
942
- * Manifold shape
1142
+ * The outline to rotate.
943
1143
  */
944
1144
  crossSection: T;
945
1145
  /**
946
- * The rotation vector in eulers
1146
+ * The rotation about the origin, in degrees, counterclockwise.
947
1147
  * @default 45
948
1148
  * @minimum -Infinity
949
1149
  * @maximum Infinity
@@ -951,26 +1151,32 @@ export declare namespace Manifold {
951
1151
  */
952
1152
  degrees: number;
953
1153
  }
1154
+ /**
1155
+ * A cross-section and a factor for `crossSection.transforms.scale`.
1156
+ */
954
1157
  class ScaleCrossSectionDto<T> {
955
1158
  constructor(crossSection?: T, factor?: number);
956
1159
  /**
957
- * Manifold shape
1160
+ * The outline to scale.
958
1161
  */
959
1162
  crossSection: T;
960
1163
  /**
961
- * The normal vector of the plane to be mirrored over
1164
+ * The uniform scale about the origin; 2 doubles every size.
962
1165
  * @default 2
963
1166
  */
964
1167
  factor: number;
965
1168
  }
1169
+ /**
1170
+ * A cross-section and two distances for `crossSection.transforms.translateXY`.
1171
+ */
966
1172
  class TranslateXYCrossSectionDto<T> {
967
1173
  constructor(crossSection?: T, x?: number, y?: number);
968
1174
  /**
969
- * Manifold shape
1175
+ * The outline to move.
970
1176
  */
971
1177
  crossSection: T;
972
1178
  /**
973
- * The translation X axis
1179
+ * How far to move along X, in model units.
974
1180
  * @default 0
975
1181
  * @minimum -Infinity
976
1182
  * @maximum Infinity
@@ -978,7 +1184,7 @@ export declare namespace Manifold {
978
1184
  */
979
1185
  x: number;
980
1186
  /**
981
- * The translation Y axis
1187
+ * How far to move along Y, in model units.
982
1188
  * @default 0
983
1189
  * @minimum -Infinity
984
1190
  * @maximum Infinity
@@ -986,98 +1192,123 @@ export declare namespace Manifold {
986
1192
  */
987
1193
  y: number;
988
1194
  }
1195
+ /**
1196
+ * A cross-section and a 3x3 matrix for `crossSection.transforms.transform`.
1197
+ */
989
1198
  class TransformCrossSectionDto<T> {
990
1199
  constructor(crossSection?: T, transform?: Base.TransformMatrix3x3);
991
1200
  /**
992
- * Cross section
1201
+ * The outline to transform.
993
1202
  */
994
1203
  crossSection: T;
995
1204
  /**
996
- * The transform matrix to apply
1205
+ * The 3x3 matrix as 9 numbers, any combination of move, turn, scale and shear in the plane.
997
1206
  * @default undefined
998
1207
  */
999
1208
  transform: Base.TransformMatrix3x3;
1000
1209
  }
1210
+ /**
1211
+ * A cross-section and a function for `crossSection.transforms.warp`.
1212
+ */
1001
1213
  class CrossSectionWarpDto<T> {
1002
1214
  constructor(crossSection?: T, warpFunc?: (vert: Base.Vector2) => void);
1003
1215
  /**
1004
- * Cross section
1216
+ * The outline to warp.
1005
1217
  */
1006
1218
  crossSection: T;
1007
1219
  /**
1008
- * A function that modifies a given vertex position
1220
+ * A function that receives each 2D point and changes it in place.
1009
1221
  * @default undefined
1010
1222
  */
1011
1223
  warpFunc: (vert: Base.Vector2) => void;
1012
1224
  }
1225
+ /**
1226
+ * A solid and a plane normal for `manifold.transforms.mirror`.
1227
+ */
1013
1228
  class MirrorDto<T> {
1014
1229
  constructor(manifold?: T, normal?: Base.Vector3);
1015
1230
  /**
1016
- * Manifold shape
1231
+ * The solid to mirror.
1017
1232
  */
1018
1233
  manifold: T;
1019
1234
  /**
1020
- * The normal vector of the plane to be mirrored over
1235
+ * The normal of the mirror plane through the origin; a zero vector gives an empty solid.
1021
1236
  * @default [1,0,0]
1022
1237
  */
1023
1238
  normal: Base.Vector3;
1024
1239
  }
1240
+ /**
1241
+ * A solid and three factors for `manifold.transforms.scale3D` and `manifold.transforms.scale`.
1242
+ */
1025
1243
  class Scale3DDto<T> {
1026
1244
  constructor(manifold?: T, vector?: Base.Vector3);
1027
1245
  /**
1028
- * Manifold shape
1246
+ * The solid to scale.
1029
1247
  */
1030
1248
  manifold: T;
1031
1249
  /**
1032
- * The normal vector of the plane to be mirrored over
1250
+ * The factors along X, Y and Z, about the origin; 1 keeps an axis as it is, 2 doubles it.
1033
1251
  * @default [2,2,2]
1034
1252
  */
1035
1253
  vector: Base.Vector3;
1036
1254
  }
1255
+ /**
1256
+ * A solid and a vector for `manifold.transforms.translate`.
1257
+ */
1037
1258
  class TranslateDto<T> {
1038
1259
  constructor(manifold?: T, vector?: Base.Vector3);
1039
1260
  /**
1040
- * Manifold shape
1261
+ * The solid to move.
1041
1262
  */
1042
1263
  manifold: T;
1043
1264
  /**
1044
- * The translation vector
1265
+ * The vector the solid moves by, in model units.
1045
1266
  * @default undefined
1046
1267
  */
1047
1268
  vector: Base.Vector3;
1048
1269
  }
1270
+ /**
1271
+ * A solid and several vectors for `manifold.transforms.translateByVectors`, one moved copy per
1272
+ * vector.
1273
+ */
1049
1274
  class TranslateByVectorsDto<T> {
1050
1275
  constructor(manifold?: T, vectors?: Base.Vector3[]);
1051
1276
  /**
1052
- * Manifold shape
1277
+ * The solid to copy and move.
1053
1278
  */
1054
1279
  manifold: T;
1055
1280
  /**
1056
- * The translation vector
1281
+ * One vector per copy, in model units.
1057
1282
  * @default undefined
1058
1283
  */
1059
1284
  vectors: Base.Vector3[];
1060
1285
  }
1286
+ /**
1287
+ * A solid and three angles for `manifold.transforms.rotate`.
1288
+ */
1061
1289
  class RotateDto<T> {
1062
1290
  constructor(manifold?: T, vector?: Base.Vector3);
1063
1291
  /**
1064
- * Manifold shape
1292
+ * The solid to rotate.
1065
1293
  */
1066
1294
  manifold: T;
1067
1295
  /**
1068
- * The rotation vector in eulers
1296
+ * The Euler angles about X, Y and Z in degrees, applied in that order about the origin.
1069
1297
  * @default undefined
1070
1298
  */
1071
1299
  vector: Base.Vector3;
1072
1300
  }
1301
+ /**
1302
+ * A solid and three separate angles for `manifold.transforms.rotateXYZ`.
1303
+ */
1073
1304
  class RotateXYZDto<T> {
1074
1305
  constructor(manifold?: T, x?: number, y?: number, z?: number);
1075
1306
  /**
1076
- * Manifold shape
1307
+ * The solid to rotate.
1077
1308
  */
1078
1309
  manifold: T;
1079
1310
  /**
1080
- * The rotation vector in eulers on X axis
1311
+ * The rotation about the X axis in degrees, applied first.
1081
1312
  * @default 0
1082
1313
  * @minimum -Infinity
1083
1314
  * @maximum Infinity
@@ -1085,7 +1316,7 @@ export declare namespace Manifold {
1085
1316
  */
1086
1317
  x: number;
1087
1318
  /**
1088
- * The rotation vector in eulers on Y axis
1319
+ * The rotation about the Y axis in degrees, applied second.
1089
1320
  * @default 0
1090
1321
  * @minimum -Infinity
1091
1322
  * @maximum Infinity
@@ -1093,7 +1324,7 @@ export declare namespace Manifold {
1093
1324
  */
1094
1325
  y: number;
1095
1326
  /**
1096
- * The rotation vector in eulers on Z axis
1327
+ * The rotation about the Z axis in degrees, applied last.
1097
1328
  * @default 0
1098
1329
  * @minimum -Infinity
1099
1330
  * @maximum Infinity
@@ -1101,26 +1332,33 @@ export declare namespace Manifold {
1101
1332
  */
1102
1333
  z: number;
1103
1334
  }
1335
+ /**
1336
+ * A solid and a factor for uniform scaling; currently unused by the library, which scales through
1337
+ * `Scale3DDto`.
1338
+ */
1104
1339
  class ScaleDto<T> {
1105
1340
  constructor(manifold?: T, factor?: number);
1106
1341
  /**
1107
- * Manifold shape
1342
+ * The solid to scale.
1108
1343
  */
1109
1344
  manifold: T;
1110
1345
  /**
1111
- * The normal vector of the plane to be mirrored over
1346
+ * The uniform scale about the origin; 2 doubles every size.
1112
1347
  * @default 2
1113
1348
  */
1114
1349
  factor: number;
1115
1350
  }
1351
+ /**
1352
+ * A solid and three distances for `manifold.transforms.translateXYZ`.
1353
+ */
1116
1354
  class TranslateXYZDto<T> {
1117
1355
  constructor(manifold?: T, x?: number, y?: number, z?: number);
1118
1356
  /**
1119
- * Manifold shape
1357
+ * The solid to move.
1120
1358
  */
1121
1359
  manifold: T;
1122
1360
  /**
1123
- * The translation X axis
1361
+ * How far to move along X, in model units.
1124
1362
  * @default 0
1125
1363
  * @minimum -Infinity
1126
1364
  * @maximum Infinity
@@ -1128,7 +1366,7 @@ export declare namespace Manifold {
1128
1366
  */
1129
1367
  x: number;
1130
1368
  /**
1131
- * The translation Y axis
1369
+ * How far to move along Y, in model units.
1132
1370
  * @default 0
1133
1371
  * @minimum -Infinity
1134
1372
  * @maximum Infinity
@@ -1136,7 +1374,7 @@ export declare namespace Manifold {
1136
1374
  */
1137
1375
  y: number;
1138
1376
  /**
1139
- * The translation Z axis
1377
+ * How far to move along Z, in model units.
1140
1378
  * @default 0
1141
1379
  * @minimum -Infinity
1142
1380
  * @maximum Infinity
@@ -1144,88 +1382,111 @@ export declare namespace Manifold {
1144
1382
  */
1145
1383
  z: number;
1146
1384
  }
1385
+ /**
1386
+ * A solid and a 4x4 matrix for `manifold.transforms.transform`.
1387
+ */
1147
1388
  class TransformDto<T> {
1148
1389
  constructor(manifold?: T, transform?: Base.TransformMatrix);
1149
1390
  /**
1150
- * Manifold shape
1391
+ * The solid to transform.
1151
1392
  */
1152
1393
  manifold: T;
1153
1394
  /**
1154
- * The transform matrix to apply
1395
+ * The column-major 4x4 matrix of 16 numbers; the translation sits at indexes 12 to 14.
1155
1396
  * @default undefined
1156
1397
  */
1157
1398
  transform: Base.TransformMatrix;
1158
1399
  }
1400
+ /**
1401
+ * A solid and several 4x4 matrices for `manifold.transforms.transforms`, applied first to last.
1402
+ */
1159
1403
  class TransformsDto<T> {
1160
1404
  constructor(manifold?: T, transforms?: Base.TransformMatrixes);
1161
1405
  /**
1162
- * Manifold shape
1406
+ * The solid to transform.
1163
1407
  */
1164
1408
  manifold: T;
1165
1409
  /**
1166
- * The transform matrixes to apply
1410
+ * The column-major matrices, applied one after another; the list must not be empty.
1167
1411
  * @default undefined
1168
1412
  */
1169
1413
  transforms: Base.TransformMatrixes;
1170
1414
  }
1415
+ /**
1416
+ * A solid and a function for `manifold.transforms.warp`.
1417
+ */
1171
1418
  class ManifoldWarpDto<T> {
1172
1419
  constructor(manifold?: T, warpFunc?: (vert: Base.Vector3) => void);
1173
1420
  /**
1174
- * Manifold shape
1421
+ * The solid to warp.
1175
1422
  */
1176
1423
  manifold: T;
1177
1424
  /**
1178
- * A function that modifies a given vertex position
1425
+ * A function that receives each vertex position and changes it in place.
1179
1426
  * @default undefined
1180
1427
  */
1181
1428
  warpFunc: (vert: Base.Vector3) => void;
1182
1429
  }
1430
+ /**
1431
+ * Two cross-sections for the pairwise methods of `crossSection.booleans`.
1432
+ */
1183
1433
  class TwoCrossSectionsDto<T> {
1184
1434
  constructor(crossSection1?: T, crossSection2?: T);
1185
1435
  /**
1186
- * Manifold shape
1436
+ * The first cross-section; for a subtraction, the one cut from.
1187
1437
  */
1188
1438
  crossSection1: T;
1189
1439
  /**
1190
- * Manifold shape
1440
+ * The second cross-section; for a subtraction, the one cut with.
1191
1441
  */
1192
1442
  crossSection2: T;
1193
1443
  }
1444
+ /**
1445
+ * Two solids for the pairwise methods of `manifold.booleans`.
1446
+ */
1194
1447
  class TwoManifoldsDto<T> {
1195
1448
  constructor(manifold1?: T, manifold2?: T);
1196
1449
  /**
1197
- * Manifold shape
1450
+ * The first solid; for a subtraction, the one cut from.
1198
1451
  */
1199
1452
  manifold1: T;
1200
1453
  /**
1201
- * Manifold shape
1454
+ * The second solid; for a subtraction, the one cut with.
1202
1455
  */
1203
1456
  manifold2: T;
1204
1457
  }
1458
+ /**
1459
+ * A solid and a cutter for `manifold.booleans.split`.
1460
+ */
1205
1461
  class SplitManifoldsDto<T> {
1206
1462
  constructor(manifoldToSplit?: T, manifoldCutter?: T);
1207
1463
  /**
1208
- * Manifold that will be split
1464
+ * The solid that is cut in two.
1209
1465
  */
1210
1466
  manifoldToSplit: T;
1211
1467
  /**
1212
- * Manifold cutter
1468
+ * The solid that does the cutting; the pieces are what lies inside it and outside it.
1213
1469
  */
1214
1470
  manifoldCutter: T;
1215
1471
  }
1472
+ /**
1473
+ * A solid and a plane for `manifold.booleans.trimByPlane`, which keeps the part on the normal's
1474
+ * side.
1475
+ */
1216
1476
  class TrimByPlaneDto<T> {
1217
1477
  constructor(manifold?: T, normal?: Base.Vector3, originOffset?: number);
1218
1478
  /**
1219
- * Manifold that will be trimmed
1479
+ * The solid to trim.
1220
1480
  */
1221
1481
  manifold: T;
1222
1482
  /**
1223
- * The normal vector of the plane to be mirrored over
1483
+ * The normal of the cutting plane; the kept part lies on the side it points to, and its length
1484
+ * does not matter.
1224
1485
  * @default [1,0,0]
1225
1486
  */
1226
1487
  normal: Base.Vector3;
1227
1488
  /**
1228
- * The offset from the origin
1489
+ * How far the plane sits from the origin along the normal, in model units.
1229
1490
  * @default 0
1230
1491
  * @minimum -Infinity
1231
1492
  * @maximum Infinity
@@ -1233,19 +1494,23 @@ export declare namespace Manifold {
1233
1494
  */
1234
1495
  originOffset: number;
1235
1496
  }
1497
+ /**
1498
+ * A solid and a plane for `manifold.booleans.splitByPlane`, which keeps both pieces.
1499
+ */
1236
1500
  class SplitByPlaneDto<T> {
1237
1501
  constructor(manifold?: T, normal?: Base.Vector3, originOffset?: number);
1238
1502
  /**
1239
- * Manifold that will be split
1503
+ * The solid to split.
1240
1504
  */
1241
1505
  manifold: T;
1242
1506
  /**
1243
- * The normal vector of the plane to be mirrored over
1507
+ * The normal of the cutting plane; the first piece lies on the side it points to, and its
1508
+ * length does not matter.
1244
1509
  * @default [1,0,0]
1245
1510
  */
1246
1511
  normal: Base.Vector3;
1247
1512
  /**
1248
- * The offset from the origin
1513
+ * How far the plane sits from the origin along the normal, in model units.
1249
1514
  * @default 0
1250
1515
  * @minimum -Infinity
1251
1516
  * @maximum Infinity
@@ -1253,85 +1518,117 @@ export declare namespace Manifold {
1253
1518
  */
1254
1519
  originOffset: number;
1255
1520
  }
1521
+ /**
1522
+ * A solid, a plane normal and several distances for `manifold.booleans.splitByPlaneOnOffsets`,
1523
+ * which cuts the solid into slabs.
1524
+ */
1256
1525
  class SplitByPlaneOnOffsetsDto<T> {
1257
1526
  constructor(manifold?: T, normal?: Base.Vector3, originOffsets?: number[]);
1258
1527
  /**
1259
- * Manifold that will be split
1528
+ * The solid to cut into slabs.
1260
1529
  */
1261
1530
  manifold: T;
1262
1531
  /**
1263
- * The normal vector of the plane to be mirrored over
1532
+ * The normal shared by every cutting plane; its length does not matter.
1264
1533
  * @default [1,0,0]
1265
1534
  */
1266
1535
  normal: Base.Vector3;
1267
1536
  /**
1268
- * The offsets from the origin
1537
+ * How far each plane sits from the origin along the normal, in model units, in increasing
1538
+ * order.
1269
1539
  * @default [0]
1270
1540
  */
1271
1541
  originOffsets: number[];
1272
1542
  }
1543
+ /**
1544
+ * Several solids for the methods that take a list, such as `manifold.booleans.union` or
1545
+ * `manifold.operations.compose`.
1546
+ */
1273
1547
  class ManifoldsDto<T> {
1274
1548
  constructor(manifolds?: T[]);
1275
1549
  /**
1276
- * Manifolds
1550
+ * The solids, in the order the method uses them.
1277
1551
  */
1278
1552
  manifolds: T[];
1279
1553
  }
1554
+ /**
1555
+ * A solid and an optional normal channel for `manifold.manifoldToMesh`.
1556
+ */
1280
1557
  class ManifoldToMeshDto<T> {
1281
1558
  constructor(manifold?: T, normalIdx?: number);
1282
1559
  /**
1283
- * Manifold shape
1560
+ * The solid to turn into mesh data.
1284
1561
  */
1285
1562
  manifold: T;
1286
1563
  /**
1287
- * Optional normal index
1564
+ * The property channel holding the normals, when the solid carries them.
1565
+ * @optional true
1288
1566
  */
1289
1567
  normalIdx?: number | undefined;
1290
1568
  }
1569
+ /**
1570
+ * Several solids and optional normal channels for `manifold.manifoldsToMeshes`.
1571
+ */
1291
1572
  class ManifoldsToMeshesDto<T> {
1292
1573
  constructor(manifolds?: T[], normalIdx?: number[]);
1293
1574
  /**
1294
- * Manifold shape
1575
+ * The solids to turn into mesh data, one mesh each.
1295
1576
  */
1296
1577
  manifolds: T[];
1297
1578
  /**
1298
- * Optional normal indexes
1579
+ * One normal channel per solid, when they carry normals.
1580
+ * @optional true
1299
1581
  */
1300
1582
  normalIdx?: number[] | undefined;
1301
1583
  }
1584
+ /**
1585
+ * A solid or cross-section and an optional normal channel for `decomposeManifoldOrCrossSection`.
1586
+ */
1302
1587
  class DecomposeManifoldOrCrossSectionDto<T> {
1303
1588
  constructor(manifoldOrCrossSection?: T, normalIdx?: number);
1304
1589
  /**
1305
- * Manifold shape
1590
+ * The solid or cross-section to turn into plain data.
1306
1591
  */
1307
1592
  manifoldOrCrossSection: T;
1308
1593
  /**
1309
- * Optional normal index
1594
+ * The property channel holding the normals of a solid, when it carries them.
1595
+ * @optional true
1310
1596
  */
1311
1597
  normalIdx?: number | undefined;
1312
1598
  }
1599
+ /**
1600
+ * One solid or cross-section for the methods that accept either.
1601
+ */
1313
1602
  class ManifoldOrCrossSectionDto<T> {
1314
1603
  constructor(manifoldOrCrossSection?: T);
1315
1604
  /**
1316
- * Manifold or cross section
1605
+ * The solid or cross-section to work on.
1317
1606
  */
1318
1607
  manifoldOrCrossSection: T;
1319
1608
  }
1609
+ /**
1610
+ * Several solids or cross-sections for the methods that accept either kind in a list.
1611
+ */
1320
1612
  class ManifoldsOrCrossSectionsDto<T> {
1321
1613
  constructor(manifoldsOrCrossSections?: T[]);
1322
1614
  /**
1323
- * Manifolds or cross sections
1615
+ * The solids or cross-sections, in the order the method uses them.
1324
1616
  */
1325
1617
  manifoldsOrCrossSections: T[];
1326
1618
  }
1619
+ /**
1620
+ * Several solids or cross-sections and optional normal channels for
1621
+ * `decomposeManifoldsOrCrossSections`.
1622
+ */
1327
1623
  class DecomposeManifoldsOrCrossSectionsDto<T> {
1328
1624
  constructor(manifoldsOrCrossSections?: T[], normalIdx?: number[]);
1329
1625
  /**
1330
- * Manifold shape
1626
+ * The solids or cross-sections to turn into plain data, one result each.
1331
1627
  */
1332
1628
  manifoldsOrCrossSections: T[];
1333
1629
  /**
1334
- * Optional normal indexes
1630
+ * One normal channel per shape, for the solids that carry normals.
1631
+ * @optional true
1335
1632
  */
1336
1633
  normalIdx?: number[] | undefined;
1337
1634
  }