@bitbybit-dev/jscad 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.
- package/jscad-generated.js +10 -27484
- package/lib/api/inputs/jscad-inputs.d.ts +562 -263
- package/lib/api/inputs/jscad-inputs.js +483 -213
- package/lib/api/jscad-service.d.ts +94 -19
- package/lib/api/jscad-service.js +94 -19
- package/lib/api/services/jscad-booleans.d.ts +81 -23
- package/lib/api/services/jscad-booleans.js +84 -24
- package/lib/api/services/jscad-colors.d.ts +14 -5
- package/lib/api/services/jscad-colors.js +14 -5
- package/lib/api/services/jscad-expansions.d.ts +29 -8
- package/lib/api/services/jscad-expansions.js +33 -16
- package/lib/api/services/jscad-extrusions.d.ts +50 -14
- package/lib/api/services/jscad-extrusions.js +50 -14
- package/lib/api/services/jscad-hulls.d.ts +42 -10
- package/lib/api/services/jscad-hulls.js +45 -11
- package/lib/api/services/jscad-path.d.ts +85 -25
- package/lib/api/services/jscad-path.js +85 -25
- package/lib/api/services/jscad-polygon.d.ts +105 -35
- package/lib/api/services/jscad-polygon.js +105 -35
- package/lib/api/services/jscad-shapes.d.ts +190 -62
- package/lib/api/services/jscad-shapes.js +193 -64
- package/lib/api/services/jscad-text.d.ts +38 -11
- package/lib/api/services/jscad-text.js +38 -11
- package/package.json +7 -7
|
@@ -11,13 +11,20 @@
|
|
|
11
11
|
*/
|
|
12
12
|
export var JSCAD;
|
|
13
13
|
(function (JSCAD) {
|
|
14
|
+
/**
|
|
15
|
+
* A polyline as a plain list of points, the form `polygon.createFromPolyline`,
|
|
16
|
+
* `path.createFromPolyline` and `path.appendPolyline` read; only X and Y of each point are used by
|
|
17
|
+
* them.
|
|
18
|
+
*/
|
|
14
19
|
class PolylinePropertiesDto {
|
|
15
20
|
/**
|
|
16
21
|
* Provide options without default values
|
|
17
22
|
*/
|
|
18
23
|
constructor(points, isClosed) {
|
|
19
24
|
/**
|
|
20
|
-
*
|
|
25
|
+
* Whether the last point joins back to the first; the JSCAD methods decide closure on their own
|
|
26
|
+
* and ignore this flag
|
|
27
|
+
* @optional true
|
|
21
28
|
*/
|
|
22
29
|
this.isClosed = false;
|
|
23
30
|
if (points !== undefined) {
|
|
@@ -65,6 +72,10 @@ export var JSCAD;
|
|
|
65
72
|
*/
|
|
66
73
|
jscadTextAlignEnum["right"] = "right";
|
|
67
74
|
})(jscadTextAlignEnum = JSCAD.jscadTextAlignEnum || (JSCAD.jscadTextAlignEnum = {}));
|
|
75
|
+
/**
|
|
76
|
+
* Feeds `toPolygonPoints` and `shapeToMesh` on the JSCAD service with the one entity to turn into
|
|
77
|
+
* triangles or mesh data; a 2D shape is given a tiny thickness on the way.
|
|
78
|
+
*/
|
|
68
79
|
class MeshDto {
|
|
69
80
|
constructor(mesh) {
|
|
70
81
|
if (mesh !== undefined) {
|
|
@@ -73,6 +84,10 @@ export var JSCAD;
|
|
|
73
84
|
}
|
|
74
85
|
}
|
|
75
86
|
JSCAD.MeshDto = MeshDto;
|
|
87
|
+
/**
|
|
88
|
+
* Feeds `shapesToMeshes` on the JSCAD service with the entities to turn into mesh data, one result
|
|
89
|
+
* per entry in the same order.
|
|
90
|
+
*/
|
|
76
91
|
class MeshesDto {
|
|
77
92
|
constructor(meshes) {
|
|
78
93
|
if (meshes !== undefined) {
|
|
@@ -81,13 +96,17 @@ export var JSCAD;
|
|
|
81
96
|
}
|
|
82
97
|
}
|
|
83
98
|
JSCAD.MeshesDto = MeshesDto;
|
|
99
|
+
/**
|
|
100
|
+
* The options `draw.drawAnyAsync` passes on when the entity is one JSCAD solid or 2D shape: color,
|
|
101
|
+
* opacity, visibility, the two-sided rendering and the mesh to reuse when redrawing.
|
|
102
|
+
*/
|
|
84
103
|
class DrawSolidMeshDto {
|
|
85
104
|
/**
|
|
86
105
|
* Provide options without default values
|
|
87
106
|
*/
|
|
88
107
|
constructor(mesh, opacity, colours, updatable, hidden, jscadMesh, drawTwoSided, backFaceColour, backFaceOpacity) {
|
|
89
108
|
/**
|
|
90
|
-
*
|
|
109
|
+
* How opaque the faces are, from 0 for invisible to 1 for solid
|
|
91
110
|
* @default 1
|
|
92
111
|
* @minimum 0
|
|
93
112
|
* @maximum 1
|
|
@@ -95,32 +114,36 @@ export var JSCAD;
|
|
|
95
114
|
*/
|
|
96
115
|
this.opacity = 1;
|
|
97
116
|
/**
|
|
98
|
-
* Hex
|
|
117
|
+
* Hex color of the faces; a list uses its first entry. An entity colored with `colors.colorize`
|
|
118
|
+
* keeps its own color instead
|
|
99
119
|
* @default #444444
|
|
100
120
|
*/
|
|
101
121
|
this.colours = "#444444";
|
|
102
122
|
/**
|
|
103
|
-
*
|
|
123
|
+
* When true, the drawn mesh can be refreshed in place on later draws by passing it back as
|
|
124
|
+
* `jscadMesh`
|
|
104
125
|
* @default false
|
|
105
126
|
*/
|
|
106
127
|
this.updatable = false;
|
|
107
128
|
/**
|
|
108
|
-
*
|
|
129
|
+
* When true, the mesh is created but not shown until it is made visible
|
|
109
130
|
* @default false
|
|
110
131
|
*/
|
|
111
132
|
this.hidden = false;
|
|
112
133
|
/**
|
|
113
|
-
*
|
|
134
|
+
* When true, the back of every face is drawn as well, in `backFaceColour`, which helps to see
|
|
135
|
+
* face orientation
|
|
114
136
|
* @default true
|
|
115
137
|
*/
|
|
116
138
|
this.drawTwoSided = true;
|
|
117
139
|
/**
|
|
118
|
-
* Hex
|
|
140
|
+
* Hex color of the back faces, the side the face normal points away from; used only when
|
|
141
|
+
* `drawTwoSided` is true
|
|
119
142
|
* @default #0000ff
|
|
120
143
|
*/
|
|
121
144
|
this.backFaceColour = "#0000ff";
|
|
122
145
|
/**
|
|
123
|
-
*
|
|
146
|
+
* How opaque the back faces are, from 0 to 1; used only when `drawTwoSided` is true
|
|
124
147
|
* @default 1
|
|
125
148
|
* @minimum 0
|
|
126
149
|
* @maximum 1
|
|
@@ -157,13 +180,17 @@ export var JSCAD;
|
|
|
157
180
|
}
|
|
158
181
|
}
|
|
159
182
|
JSCAD.DrawSolidMeshDto = DrawSolidMeshDto;
|
|
183
|
+
/**
|
|
184
|
+
* The options `draw.drawAnyAsync` passes on when the entity is a list of JSCAD solids or 2D shapes:
|
|
185
|
+
* colors, opacity, visibility, the two-sided rendering and the parent mesh to reuse when redrawing.
|
|
186
|
+
*/
|
|
160
187
|
class DrawSolidMeshesDto {
|
|
161
188
|
/**
|
|
162
189
|
* Provide options without default values
|
|
163
190
|
*/
|
|
164
191
|
constructor(meshes, opacity, colours, updatable, hidden, jscadMesh, drawTwoSided, backFaceColour, backFaceOpacity) {
|
|
165
192
|
/**
|
|
166
|
-
*
|
|
193
|
+
* How opaque the faces are, from 0 for invisible to 1 for solid
|
|
167
194
|
* @default 1
|
|
168
195
|
* @minimum 0
|
|
169
196
|
* @maximum 1
|
|
@@ -171,32 +198,36 @@ export var JSCAD;
|
|
|
171
198
|
*/
|
|
172
199
|
this.opacity = 1;
|
|
173
200
|
/**
|
|
174
|
-
* Hex
|
|
201
|
+
* Hex color of the faces; a list with one entry per entity colors each in turn, any other list
|
|
202
|
+
* uses its first entry. Colorized entities keep their own color
|
|
175
203
|
* @default #444444
|
|
176
204
|
*/
|
|
177
205
|
this.colours = "#444444";
|
|
178
206
|
/**
|
|
179
|
-
*
|
|
207
|
+
* When true, the drawn meshes can be refreshed in place on later draws by passing the parent
|
|
208
|
+
* back as `jscadMesh`
|
|
180
209
|
* @default false
|
|
181
210
|
*/
|
|
182
211
|
this.updatable = false;
|
|
183
212
|
/**
|
|
184
|
-
*
|
|
213
|
+
* When true, the meshes are created but not shown until they are made visible
|
|
185
214
|
* @default false
|
|
186
215
|
*/
|
|
187
216
|
this.hidden = false;
|
|
188
217
|
/**
|
|
189
|
-
*
|
|
218
|
+
* When true, the back of every face is drawn as well, in `backFaceColour`, which helps to see
|
|
219
|
+
* face orientation
|
|
190
220
|
* @default true
|
|
191
221
|
*/
|
|
192
222
|
this.drawTwoSided = true;
|
|
193
223
|
/**
|
|
194
|
-
* Hex
|
|
224
|
+
* Hex color of the back faces, the side the face normal points away from; used only when
|
|
225
|
+
* `drawTwoSided` is true
|
|
195
226
|
* @default #0000ff
|
|
196
227
|
*/
|
|
197
228
|
this.backFaceColour = "#0000ff";
|
|
198
229
|
/**
|
|
199
|
-
*
|
|
230
|
+
* How opaque the back faces are, from 0 to 1; used only when `drawTwoSided` is true
|
|
200
231
|
* @default 1
|
|
201
232
|
* @minimum 0
|
|
202
233
|
* @maximum 1
|
|
@@ -233,18 +264,22 @@ export var JSCAD;
|
|
|
233
264
|
}
|
|
234
265
|
}
|
|
235
266
|
JSCAD.DrawSolidMeshesDto = DrawSolidMeshesDto;
|
|
267
|
+
/**
|
|
268
|
+
* The options `draw.drawAnyAsync` passes on when the entity is a JSCAD 2D path, drawn as a line
|
|
269
|
+
* through its points: color, opacity, line width and the line to reuse when redrawing.
|
|
270
|
+
*/
|
|
236
271
|
class DrawPathDto {
|
|
237
272
|
/**
|
|
238
273
|
* Provide options without default values
|
|
239
274
|
*/
|
|
240
275
|
constructor(path, colour, opacity, width, updatable, pathMesh) {
|
|
241
276
|
/**
|
|
242
|
-
*
|
|
277
|
+
* Hex color of the line; a path colored with `colors.colorize` keeps its own color instead
|
|
243
278
|
* @default #444444
|
|
244
279
|
*/
|
|
245
280
|
this.colour = "#444444";
|
|
246
281
|
/**
|
|
247
|
-
*
|
|
282
|
+
* How opaque the line is, from 0 for invisible to 1 for solid
|
|
248
283
|
* @default 1
|
|
249
284
|
* @minimum 0
|
|
250
285
|
* @maximum 1
|
|
@@ -252,7 +287,7 @@ export var JSCAD;
|
|
|
252
287
|
*/
|
|
253
288
|
this.opacity = 1;
|
|
254
289
|
/**
|
|
255
|
-
*
|
|
290
|
+
* Thickness of the drawn line
|
|
256
291
|
* @default 10
|
|
257
292
|
* @minimum 0
|
|
258
293
|
* @maximum Infinity
|
|
@@ -260,7 +295,8 @@ export var JSCAD;
|
|
|
260
295
|
*/
|
|
261
296
|
this.width = 10;
|
|
262
297
|
/**
|
|
263
|
-
*
|
|
298
|
+
* When true, the drawn line can be refreshed in place on later draws by passing it back as
|
|
299
|
+
* `pathMesh`
|
|
264
300
|
* @default false
|
|
265
301
|
*/
|
|
266
302
|
this.updatable = false;
|
|
@@ -285,6 +321,10 @@ export var JSCAD;
|
|
|
285
321
|
}
|
|
286
322
|
}
|
|
287
323
|
JSCAD.DrawPathDto = DrawPathDto;
|
|
324
|
+
/**
|
|
325
|
+
* Feeds `transformSolids` on the JSCAD service: the solids to move and the matrix, or matrices,
|
|
326
|
+
* applied to each of them.
|
|
327
|
+
*/
|
|
288
328
|
class TransformSolidsDto {
|
|
289
329
|
constructor(meshes, transformation) {
|
|
290
330
|
if (meshes !== undefined) {
|
|
@@ -296,6 +336,10 @@ export var JSCAD;
|
|
|
296
336
|
}
|
|
297
337
|
}
|
|
298
338
|
JSCAD.TransformSolidsDto = TransformSolidsDto;
|
|
339
|
+
/**
|
|
340
|
+
* Feeds `transformSolid` on the JSCAD service: the solid to move and the matrix, or matrices,
|
|
341
|
+
* applied to it.
|
|
342
|
+
*/
|
|
299
343
|
class TransformSolidDto {
|
|
300
344
|
constructor(mesh, transformation) {
|
|
301
345
|
if (mesh !== undefined) {
|
|
@@ -307,6 +351,9 @@ export var JSCAD;
|
|
|
307
351
|
}
|
|
308
352
|
}
|
|
309
353
|
JSCAD.TransformSolidDto = TransformSolidDto;
|
|
354
|
+
/**
|
|
355
|
+
* Feeds `downloadSolidSTL` on the JSCAD service: the solid to write and the name of the STL file.
|
|
356
|
+
*/
|
|
310
357
|
class DownloadSolidDto {
|
|
311
358
|
constructor(mesh, fileName) {
|
|
312
359
|
if (mesh !== undefined) {
|
|
@@ -318,10 +365,14 @@ export var JSCAD;
|
|
|
318
365
|
}
|
|
319
366
|
}
|
|
320
367
|
JSCAD.DownloadSolidDto = DownloadSolidDto;
|
|
368
|
+
/**
|
|
369
|
+
* Feeds `downloadGeometryDxf` and `downloadGeometry3MF` on the JSCAD service: the geometry to
|
|
370
|
+
* write, the file name and optional options for the file writer.
|
|
371
|
+
*/
|
|
321
372
|
class DownloadGeometryDto {
|
|
322
373
|
constructor(geometry, fileName, options) {
|
|
323
374
|
/**
|
|
324
|
-
*
|
|
375
|
+
* Name of the downloaded file without the extension, which is added
|
|
325
376
|
* @default jscad-geometry
|
|
326
377
|
*/
|
|
327
378
|
this.fileName = "jscad-geometry";
|
|
@@ -337,6 +388,10 @@ export var JSCAD;
|
|
|
337
388
|
}
|
|
338
389
|
}
|
|
339
390
|
JSCAD.DownloadGeometryDto = DownloadGeometryDto;
|
|
391
|
+
/**
|
|
392
|
+
* Feeds `downloadSolidsSTL` on the JSCAD service: the solids to write into one STL file and the
|
|
393
|
+
* file's name.
|
|
394
|
+
*/
|
|
340
395
|
class DownloadSolidsDto {
|
|
341
396
|
constructor(meshes, fileName) {
|
|
342
397
|
if (meshes !== undefined) {
|
|
@@ -348,10 +403,14 @@ export var JSCAD;
|
|
|
348
403
|
}
|
|
349
404
|
}
|
|
350
405
|
JSCAD.DownloadSolidsDto = DownloadSolidsDto;
|
|
406
|
+
/**
|
|
407
|
+
* Feeds `colors.colorize`: the geometry to tint, one entity or a list, and the color it is drawn in
|
|
408
|
+
* from then on.
|
|
409
|
+
*/
|
|
351
410
|
class ColorizeDto {
|
|
352
411
|
constructor(geometry, color) {
|
|
353
412
|
/**
|
|
354
|
-
* Hex color string
|
|
413
|
+
* Hex color string the geometry is always drawn in, ahead of the drawing options
|
|
355
414
|
* @default #0000ff
|
|
356
415
|
*/
|
|
357
416
|
this.color = "#0000ff";
|
|
@@ -364,6 +423,11 @@ export var JSCAD;
|
|
|
364
423
|
}
|
|
365
424
|
}
|
|
366
425
|
JSCAD.ColorizeDto = ColorizeDto;
|
|
426
|
+
/**
|
|
427
|
+
* Feeds `booleans.union`, `booleans.intersect` and `booleans.subtract` with any number of inputs;
|
|
428
|
+
* for `subtract` the first entry is the one being cut. All entries must be of one kind, solids or
|
|
429
|
+
* 2D shapes.
|
|
430
|
+
*/
|
|
367
431
|
class BooleanObjectsDto {
|
|
368
432
|
constructor(meshes) {
|
|
369
433
|
if (meshes !== undefined) {
|
|
@@ -372,6 +436,10 @@ export var JSCAD;
|
|
|
372
436
|
}
|
|
373
437
|
}
|
|
374
438
|
JSCAD.BooleanObjectsDto = BooleanObjectsDto;
|
|
439
|
+
/**
|
|
440
|
+
* Feeds `booleans.unionTwo`, `booleans.intersectTwo` and `booleans.subtractTwo` with exactly two
|
|
441
|
+
* inputs of one kind, solids or 2D shapes; for `subtractTwo`, `second` is cut out of `first`.
|
|
442
|
+
*/
|
|
375
443
|
class BooleanTwoObjectsDto {
|
|
376
444
|
constructor(first, second) {
|
|
377
445
|
if (first !== undefined) {
|
|
@@ -383,6 +451,10 @@ export var JSCAD;
|
|
|
383
451
|
}
|
|
384
452
|
}
|
|
385
453
|
JSCAD.BooleanTwoObjectsDto = BooleanTwoObjectsDto;
|
|
454
|
+
/**
|
|
455
|
+
* Feeds `booleans.subtractFrom`: `from` is the base and every entry of `meshes` is cut out of it.
|
|
456
|
+
* All must be of one kind, solids or 2D shapes.
|
|
457
|
+
*/
|
|
386
458
|
class BooleanObjectsFromDto {
|
|
387
459
|
constructor(from, meshes) {
|
|
388
460
|
if (from !== undefined) {
|
|
@@ -394,48 +466,27 @@ export var JSCAD;
|
|
|
394
466
|
}
|
|
395
467
|
}
|
|
396
468
|
JSCAD.BooleanObjectsFromDto = BooleanObjectsFromDto;
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
*/
|
|
406
|
-
this.delta = 0.1;
|
|
407
|
-
/**
|
|
408
|
-
* Type of corner to create during of expansion; edge, chamfer, round
|
|
409
|
-
* @default edge
|
|
410
|
-
*/
|
|
411
|
-
this.corners = solidCornerTypeEnum.edge;
|
|
412
|
-
/**
|
|
413
|
-
* Integer number of segments when creating round corners
|
|
414
|
-
* @default 24
|
|
415
|
-
* @minimum 0
|
|
416
|
-
* @maximum Infinity
|
|
417
|
-
* @step 1
|
|
418
|
-
*/
|
|
419
|
-
this.segments = 24;
|
|
420
|
-
if (geometry !== undefined) {
|
|
421
|
-
this.geometry = geometry;
|
|
422
|
-
}
|
|
423
|
-
if (delta !== undefined) {
|
|
424
|
-
this.delta = delta;
|
|
425
|
-
}
|
|
426
|
-
if (corners !== undefined) {
|
|
427
|
-
this.corners = corners;
|
|
428
|
-
}
|
|
429
|
-
if (segments !== undefined) {
|
|
430
|
-
this.segments = segments;
|
|
469
|
+
/**
|
|
470
|
+
* Feeds `booleans.minkowskiSum` with the solids to sweep over one another; unlike the other
|
|
471
|
+
* booleans this one takes solids only, a 2D shape is refused.
|
|
472
|
+
*/
|
|
473
|
+
class MinkowskiSumDto {
|
|
474
|
+
constructor(meshes) {
|
|
475
|
+
if (meshes !== undefined) {
|
|
476
|
+
this.meshes = meshes;
|
|
431
477
|
}
|
|
432
478
|
}
|
|
433
479
|
}
|
|
434
|
-
JSCAD.
|
|
435
|
-
|
|
480
|
+
JSCAD.MinkowskiSumDto = MinkowskiSumDto;
|
|
481
|
+
/**
|
|
482
|
+
* Feeds `expansions.expand` and `expansions.offset`: the geometry, the signed distance to move its
|
|
483
|
+
* boundary by and how the corners are shaped on the way.
|
|
484
|
+
*/
|
|
485
|
+
class ExpansionDto {
|
|
436
486
|
constructor(geometry, delta, corners, segments) {
|
|
437
487
|
/**
|
|
438
|
-
*
|
|
488
|
+
* How far the boundary moves, in model units: positive grows the geometry, negative shrinks it
|
|
489
|
+
* (a solid accepts positive only)
|
|
439
490
|
* @default 0.1
|
|
440
491
|
* @minimum -Infinity
|
|
441
492
|
* @maximum Infinity
|
|
@@ -443,12 +494,14 @@ export var JSCAD;
|
|
|
443
494
|
*/
|
|
444
495
|
this.delta = 0.1;
|
|
445
496
|
/**
|
|
446
|
-
*
|
|
497
|
+
* How a convex corner is shaped: `edge` keeps it sharp, `chamfer` cuts it flat, `round` curves
|
|
498
|
+
* it; a solid accepts `round` only
|
|
447
499
|
* @default edge
|
|
448
500
|
*/
|
|
449
501
|
this.corners = solidCornerTypeEnum.edge;
|
|
450
502
|
/**
|
|
451
|
-
*
|
|
503
|
+
* Number of straight pieces a `round` corner is made of over a full circle; more makes it
|
|
504
|
+
* smoother
|
|
452
505
|
* @default 24
|
|
453
506
|
* @minimum 0
|
|
454
507
|
* @maximum Infinity
|
|
@@ -469,11 +522,15 @@ export var JSCAD;
|
|
|
469
522
|
}
|
|
470
523
|
}
|
|
471
524
|
}
|
|
472
|
-
JSCAD.
|
|
525
|
+
JSCAD.ExpansionDto = ExpansionDto;
|
|
526
|
+
/**
|
|
527
|
+
* Feeds `extrusions.extrudeLinear`: the flat shape, how far it rises along Z and the optional twist
|
|
528
|
+
* applied on the way up.
|
|
529
|
+
*/
|
|
473
530
|
class ExtrudeLinearDto {
|
|
474
531
|
constructor(geometry, height, twistAngle, twistSteps) {
|
|
475
532
|
/**
|
|
476
|
-
*
|
|
533
|
+
* How far the shape rises along Z, in model units; negative extrudes downward
|
|
477
534
|
* @default 1
|
|
478
535
|
* @minimum -Infinity
|
|
479
536
|
* @maximum Infinity
|
|
@@ -481,7 +538,8 @@ export var JSCAD;
|
|
|
481
538
|
*/
|
|
482
539
|
this.height = 1;
|
|
483
540
|
/**
|
|
484
|
-
*
|
|
541
|
+
* How far the top is turned relative to the bottom around Z, in degrees; 0 gives a straight
|
|
542
|
+
* extrusion
|
|
485
543
|
* @default 90
|
|
486
544
|
* @minimum -Infinity
|
|
487
545
|
* @maximum Infinity
|
|
@@ -489,7 +547,8 @@ export var JSCAD;
|
|
|
489
547
|
*/
|
|
490
548
|
this.twistAngle = 90;
|
|
491
549
|
/**
|
|
492
|
-
* Number of twist
|
|
550
|
+
* Number of slices the twist is built from, at least 1; more makes a smoother twist and a
|
|
551
|
+
* heavier mesh
|
|
493
552
|
* @default 15
|
|
494
553
|
* @minimum 0
|
|
495
554
|
* @maximum Infinity
|
|
@@ -511,6 +570,10 @@ export var JSCAD;
|
|
|
511
570
|
}
|
|
512
571
|
}
|
|
513
572
|
JSCAD.ExtrudeLinearDto = ExtrudeLinearDto;
|
|
573
|
+
/**
|
|
574
|
+
* Feeds `hulls.hull` and `hulls.hullChain` with the entities to wrap, all of one kind: solids, 2D
|
|
575
|
+
* shapes or paths. For `hullChain` the order is the order they connect in.
|
|
576
|
+
*/
|
|
514
577
|
class HullDto {
|
|
515
578
|
constructor(meshes) {
|
|
516
579
|
if (meshes !== undefined) {
|
|
@@ -519,10 +582,25 @@ export var JSCAD;
|
|
|
519
582
|
}
|
|
520
583
|
}
|
|
521
584
|
JSCAD.HullDto = HullDto;
|
|
585
|
+
/**
|
|
586
|
+
* Feeds `hulls.isConvex` with the one solid to examine.
|
|
587
|
+
*/
|
|
588
|
+
class SolidDto {
|
|
589
|
+
constructor(mesh) {
|
|
590
|
+
if (mesh !== undefined) {
|
|
591
|
+
this.mesh = mesh;
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
JSCAD.SolidDto = SolidDto;
|
|
596
|
+
/**
|
|
597
|
+
* Feeds `extrusions.extrudeRectangular`: the outline to build a wall along, the wall's height along
|
|
598
|
+
* Z and its half thickness.
|
|
599
|
+
*/
|
|
522
600
|
class ExtrudeRectangularDto {
|
|
523
601
|
constructor(geometry, height, size) {
|
|
524
602
|
/**
|
|
525
|
-
*
|
|
603
|
+
* How tall the wall is along Z, in model units, standing on the XY plane
|
|
526
604
|
* @default 1
|
|
527
605
|
* @minimum 0
|
|
528
606
|
* @maximum Infinity
|
|
@@ -530,7 +608,8 @@ export var JSCAD;
|
|
|
530
608
|
*/
|
|
531
609
|
this.height = 1;
|
|
532
610
|
/**
|
|
533
|
-
*
|
|
611
|
+
* How far the wall reaches to each side of the outline, in model units, so the wall is twice
|
|
612
|
+
* this thick
|
|
534
613
|
* @default 1
|
|
535
614
|
* @minimum 0
|
|
536
615
|
* @maximum Infinity
|
|
@@ -549,10 +628,14 @@ export var JSCAD;
|
|
|
549
628
|
}
|
|
550
629
|
}
|
|
551
630
|
JSCAD.ExtrudeRectangularDto = ExtrudeRectangularDto;
|
|
631
|
+
/**
|
|
632
|
+
* Feeds `extrusions.extrudeRectangularPoints`: the points of the line to build a wall along, the
|
|
633
|
+
* wall's height along Z and its half thickness.
|
|
634
|
+
*/
|
|
552
635
|
class ExtrudeRectangularPointsDto {
|
|
553
636
|
constructor(points, height, size) {
|
|
554
637
|
/**
|
|
555
|
-
*
|
|
638
|
+
* How tall the wall is along Z, in model units, standing on the XY plane
|
|
556
639
|
* @default 1
|
|
557
640
|
* @minimum 0
|
|
558
641
|
* @maximum Infinity
|
|
@@ -560,7 +643,8 @@ export var JSCAD;
|
|
|
560
643
|
*/
|
|
561
644
|
this.height = 1;
|
|
562
645
|
/**
|
|
563
|
-
*
|
|
646
|
+
* How far the wall reaches to each side of the line, in model units, so the wall is twice this
|
|
647
|
+
* thick
|
|
564
648
|
* @default 1
|
|
565
649
|
* @minimum 0
|
|
566
650
|
* @maximum Infinity
|
|
@@ -579,10 +663,14 @@ export var JSCAD;
|
|
|
579
663
|
}
|
|
580
664
|
}
|
|
581
665
|
JSCAD.ExtrudeRectangularPointsDto = ExtrudeRectangularPointsDto;
|
|
666
|
+
/**
|
|
667
|
+
* Feeds `extrusions.extrudeRotate`: the flat profile to spin around the Z axis, how far and from
|
|
668
|
+
* where to spin it, and how finely the round result is faceted.
|
|
669
|
+
*/
|
|
582
670
|
class ExtrudeRotateDto {
|
|
583
671
|
constructor(polygon, angle, startAngle, segments) {
|
|
584
672
|
/**
|
|
585
|
-
*
|
|
673
|
+
* How far to revolve, in degrees: 360 makes a full ring, the default 90 a quarter
|
|
586
674
|
* @default 90
|
|
587
675
|
* @minimum -Infinity
|
|
588
676
|
* @maximum Infinity
|
|
@@ -590,7 +678,7 @@ export var JSCAD;
|
|
|
590
678
|
*/
|
|
591
679
|
this.angle = 90;
|
|
592
680
|
/**
|
|
593
|
-
*
|
|
681
|
+
* Where the revolution starts, in degrees from the X axis
|
|
594
682
|
* @default 0
|
|
595
683
|
* @minimum -Infinity
|
|
596
684
|
* @maximum Infinity
|
|
@@ -598,7 +686,8 @@ export var JSCAD;
|
|
|
598
686
|
*/
|
|
599
687
|
this.startAngle = 0;
|
|
600
688
|
/**
|
|
601
|
-
* Number of
|
|
689
|
+
* Number of steps in a full turn; a partial angle uses proportionally fewer. Fewer than 3
|
|
690
|
+
* throws an error
|
|
602
691
|
* @default 24
|
|
603
692
|
* @minimum 0
|
|
604
693
|
* @maximum Infinity
|
|
@@ -620,6 +709,10 @@ export var JSCAD;
|
|
|
620
709
|
}
|
|
621
710
|
}
|
|
622
711
|
JSCAD.ExtrudeRotateDto = ExtrudeRotateDto;
|
|
712
|
+
/**
|
|
713
|
+
* Feeds `polygon.createFromPolyline` with the polyline whose points become the outline of a filled
|
|
714
|
+
* 2D shape.
|
|
715
|
+
*/
|
|
623
716
|
class PolylineDto {
|
|
624
717
|
constructor(polyline) {
|
|
625
718
|
if (polyline !== undefined) {
|
|
@@ -628,6 +721,10 @@ export var JSCAD;
|
|
|
628
721
|
}
|
|
629
722
|
}
|
|
630
723
|
JSCAD.PolylineDto = PolylineDto;
|
|
724
|
+
/**
|
|
725
|
+
* Feeds `polygon.createFromCurve` with a NURBS curve, which is sampled into points to outline a
|
|
726
|
+
* filled 2D shape.
|
|
727
|
+
*/
|
|
631
728
|
class CurveDto {
|
|
632
729
|
constructor(curve) {
|
|
633
730
|
if (curve !== undefined) {
|
|
@@ -636,6 +733,10 @@ export var JSCAD;
|
|
|
636
733
|
}
|
|
637
734
|
}
|
|
638
735
|
JSCAD.CurveDto = CurveDto;
|
|
736
|
+
/**
|
|
737
|
+
* Feeds `polygon.createFromPoints` with the outline points of a filled 2D shape, listed in order
|
|
738
|
+
* around it.
|
|
739
|
+
*/
|
|
639
740
|
class PointsDto {
|
|
640
741
|
constructor(points) {
|
|
641
742
|
if (points !== undefined) {
|
|
@@ -644,6 +745,10 @@ export var JSCAD;
|
|
|
644
745
|
}
|
|
645
746
|
}
|
|
646
747
|
JSCAD.PointsDto = PointsDto;
|
|
748
|
+
/**
|
|
749
|
+
* Feeds `path.close` and `polygon.createFromPath` with the one 2D path to work on; a 2D shape or a
|
|
750
|
+
* solid throws an error.
|
|
751
|
+
*/
|
|
647
752
|
class PathDto {
|
|
648
753
|
constructor(path) {
|
|
649
754
|
if (path !== undefined) {
|
|
@@ -652,10 +757,14 @@ export var JSCAD;
|
|
|
652
757
|
}
|
|
653
758
|
}
|
|
654
759
|
JSCAD.PathDto = PathDto;
|
|
760
|
+
/**
|
|
761
|
+
* Feeds `path.createFromPoints`: the points a new 2D path runs through and whether it closes back
|
|
762
|
+
* to the first.
|
|
763
|
+
*/
|
|
655
764
|
class PathFromPointsDto {
|
|
656
765
|
constructor(points, closed) {
|
|
657
766
|
/**
|
|
658
|
-
*
|
|
767
|
+
* When true, the last point joins back to the first and the path accepts no more points
|
|
659
768
|
* @default false
|
|
660
769
|
*/
|
|
661
770
|
this.closed = false;
|
|
@@ -668,6 +777,10 @@ export var JSCAD;
|
|
|
668
777
|
}
|
|
669
778
|
}
|
|
670
779
|
JSCAD.PathFromPointsDto = PathFromPointsDto;
|
|
780
|
+
/**
|
|
781
|
+
* Feeds `path.createPathsFromPoints` with several point lists, one 2D path each; a list ending on
|
|
782
|
+
* its first point makes a closed path.
|
|
783
|
+
*/
|
|
671
784
|
class PathsFromPointsDto {
|
|
672
785
|
constructor(pointsLists) {
|
|
673
786
|
if (pointsLists !== undefined) {
|
|
@@ -676,10 +789,14 @@ export var JSCAD;
|
|
|
676
789
|
}
|
|
677
790
|
}
|
|
678
791
|
JSCAD.PathsFromPointsDto = PathsFromPointsDto;
|
|
792
|
+
/**
|
|
793
|
+
* Feeds `path.createFromPolyline`: the polyline a new 2D path runs through and whether it closes
|
|
794
|
+
* back to the first point.
|
|
795
|
+
*/
|
|
679
796
|
class PathFromPolylineDto {
|
|
680
797
|
constructor(polyline, closed) {
|
|
681
798
|
/**
|
|
682
|
-
*
|
|
799
|
+
* When true, the last point joins back to the first and the path accepts no more points
|
|
683
800
|
* @default false
|
|
684
801
|
*/
|
|
685
802
|
this.closed = false;
|
|
@@ -692,17 +809,9 @@ export var JSCAD;
|
|
|
692
809
|
}
|
|
693
810
|
}
|
|
694
811
|
JSCAD.PathFromPolylineDto = PathFromPolylineDto;
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
this.curve = curve;
|
|
699
|
-
}
|
|
700
|
-
if (path !== undefined) {
|
|
701
|
-
this.path = path;
|
|
702
|
-
}
|
|
703
|
-
}
|
|
704
|
-
}
|
|
705
|
-
JSCAD.PathAppendCurveDto = PathAppendCurveDto;
|
|
812
|
+
/**
|
|
813
|
+
* Feeds `path.appendPoints`: an open 2D path and the points to add after its last point.
|
|
814
|
+
*/
|
|
706
815
|
class PathAppendPointsDto {
|
|
707
816
|
constructor(points, path) {
|
|
708
817
|
if (points !== undefined) {
|
|
@@ -714,6 +823,10 @@ export var JSCAD;
|
|
|
714
823
|
}
|
|
715
824
|
}
|
|
716
825
|
JSCAD.PathAppendPointsDto = PathAppendPointsDto;
|
|
826
|
+
/**
|
|
827
|
+
* Feeds `path.appendPolyline`: an open 2D path and the polyline whose points are added after its
|
|
828
|
+
* last point.
|
|
829
|
+
*/
|
|
717
830
|
class PathAppendPolylineDto {
|
|
718
831
|
constructor(polyline, path) {
|
|
719
832
|
if (polyline !== undefined) {
|
|
@@ -725,15 +838,20 @@ export var JSCAD;
|
|
|
725
838
|
}
|
|
726
839
|
}
|
|
727
840
|
JSCAD.PathAppendPolylineDto = PathAppendPolylineDto;
|
|
841
|
+
/**
|
|
842
|
+
* Feeds `path.appendArc`: an open 2D path with at least one point, the point the arc ends on, the
|
|
843
|
+
* ellipse the arc is cut from and which of the four fitting arcs to take.
|
|
844
|
+
*/
|
|
728
845
|
class PathAppendArcDto {
|
|
729
846
|
constructor(path, endPoint, xAxisRotation, clockwise, large, segments, radiusX, radiusY) {
|
|
730
847
|
/**
|
|
731
|
-
*
|
|
848
|
+
* Where the arc ends, as a 2D point in the XY plane
|
|
732
849
|
* @default [1, 1]
|
|
733
850
|
*/
|
|
734
851
|
this.endPoint = [1, 1];
|
|
735
852
|
/**
|
|
736
|
-
*
|
|
853
|
+
* Tilt of the ellipse the arc is cut from, in degrees from the X axis; it changes nothing for a
|
|
854
|
+
* circle
|
|
737
855
|
* @default 90
|
|
738
856
|
* @minimum -Infinity
|
|
739
857
|
* @maximum Infinity
|
|
@@ -741,17 +859,18 @@ export var JSCAD;
|
|
|
741
859
|
*/
|
|
742
860
|
this.xAxisRotation = 90;
|
|
743
861
|
/**
|
|
744
|
-
*
|
|
862
|
+
* When true, the arc turns clockwise from the start to the end point; false turns
|
|
863
|
+
* counter-clockwise
|
|
745
864
|
* @default true
|
|
746
865
|
*/
|
|
747
866
|
this.clockwise = true;
|
|
748
867
|
/**
|
|
749
|
-
*
|
|
868
|
+
* When true, the longer of the two arcs between the points is taken, more than half the ellipse
|
|
750
869
|
* @default false
|
|
751
870
|
*/
|
|
752
871
|
this.large = false;
|
|
753
872
|
/**
|
|
754
|
-
* Number of
|
|
873
|
+
* Number of straight pieces for a full ellipse; the arc gets its proportional share
|
|
755
874
|
* @default 24
|
|
756
875
|
* @minimum 0
|
|
757
876
|
* @maximum Infinity
|
|
@@ -759,7 +878,8 @@ export var JSCAD;
|
|
|
759
878
|
*/
|
|
760
879
|
this.segments = 24;
|
|
761
880
|
/**
|
|
762
|
-
*
|
|
881
|
+
* Half width of the ellipse along its own X axis, in model units; scaled up when too small to
|
|
882
|
+
* reach the end point
|
|
763
883
|
* @default 1
|
|
764
884
|
* @minimum -Infinity
|
|
765
885
|
* @maximum Infinity
|
|
@@ -767,7 +887,8 @@ export var JSCAD;
|
|
|
767
887
|
*/
|
|
768
888
|
this.radiusX = 1;
|
|
769
889
|
/**
|
|
770
|
-
*
|
|
890
|
+
* Half height of the ellipse along its own Y axis, in model units; equal to `radiusX` for a
|
|
891
|
+
* circular arc
|
|
771
892
|
* @default 1
|
|
772
893
|
* @minimum -Infinity
|
|
773
894
|
* @maximum Infinity
|
|
@@ -801,15 +922,19 @@ export var JSCAD;
|
|
|
801
922
|
}
|
|
802
923
|
}
|
|
803
924
|
JSCAD.PathAppendArcDto = PathAppendArcDto;
|
|
925
|
+
/**
|
|
926
|
+
* Feeds `polygon.circle`: a filled circle in the XY plane, given by its 2D center, radius and the
|
|
927
|
+
* number of straight sides that approximate it.
|
|
928
|
+
*/
|
|
804
929
|
class CircleDto {
|
|
805
930
|
constructor(center, radius, segments) {
|
|
806
931
|
/**
|
|
807
|
-
*
|
|
932
|
+
* The 2D center point, as X and Y in the plane
|
|
808
933
|
* @default [0, 0]
|
|
809
934
|
*/
|
|
810
935
|
this.center = [0, 0];
|
|
811
936
|
/**
|
|
812
|
-
*
|
|
937
|
+
* Distance from the center to the rim, in model units
|
|
813
938
|
* @default 1
|
|
814
939
|
* @minimum -Infinity
|
|
815
940
|
* @maximum Infinity
|
|
@@ -817,7 +942,7 @@ export var JSCAD;
|
|
|
817
942
|
*/
|
|
818
943
|
this.radius = 1;
|
|
819
944
|
/**
|
|
820
|
-
*
|
|
945
|
+
* Number of straight sides around the circle; more makes it rounder
|
|
821
946
|
* @default 24
|
|
822
947
|
* @minimum 0
|
|
823
948
|
* @maximum Infinity
|
|
@@ -836,20 +961,24 @@ export var JSCAD;
|
|
|
836
961
|
}
|
|
837
962
|
}
|
|
838
963
|
JSCAD.CircleDto = CircleDto;
|
|
964
|
+
/**
|
|
965
|
+
* Feeds `polygon.ellipse`: a filled ellipse in the XY plane, given by its 2D center, its two
|
|
966
|
+
* half-sizes and the number of straight sides that approximate it.
|
|
967
|
+
*/
|
|
839
968
|
class EllipseDto {
|
|
840
969
|
constructor(center, radius, segments) {
|
|
841
970
|
/**
|
|
842
|
-
*
|
|
971
|
+
* The 2D center point, as X and Y in the plane
|
|
843
972
|
* @default [0, 0]
|
|
844
973
|
*/
|
|
845
974
|
this.center = [0, 0];
|
|
846
975
|
/**
|
|
847
|
-
*
|
|
976
|
+
* The half width along X and the half height along Y, in model units, as `[x, y]`
|
|
848
977
|
* @default [1, 2]
|
|
849
978
|
*/
|
|
850
979
|
this.radius = [1, 2];
|
|
851
980
|
/**
|
|
852
|
-
*
|
|
981
|
+
* Number of straight sides around the ellipse; more makes it rounder
|
|
853
982
|
* @default 24
|
|
854
983
|
* @minimum 0
|
|
855
984
|
* @maximum Infinity
|
|
@@ -868,15 +997,19 @@ export var JSCAD;
|
|
|
868
997
|
}
|
|
869
998
|
}
|
|
870
999
|
JSCAD.EllipseDto = EllipseDto;
|
|
1000
|
+
/**
|
|
1001
|
+
* Feeds `polygon.square`: a filled square in the XY plane with sides parallel to the axes, given by
|
|
1002
|
+
* its 2D center and side length.
|
|
1003
|
+
*/
|
|
871
1004
|
class SquareDto {
|
|
872
1005
|
constructor(center, size) {
|
|
873
1006
|
/**
|
|
874
|
-
*
|
|
1007
|
+
* The 2D center point, as X and Y in the plane
|
|
875
1008
|
* @default [0, 0]
|
|
876
1009
|
*/
|
|
877
1010
|
this.center = [0, 0];
|
|
878
1011
|
/**
|
|
879
|
-
*
|
|
1012
|
+
* Length of each side, in model units
|
|
880
1013
|
* @default 1
|
|
881
1014
|
* @minimum -Infinity
|
|
882
1015
|
* @maximum Infinity
|
|
@@ -892,15 +1025,19 @@ export var JSCAD;
|
|
|
892
1025
|
}
|
|
893
1026
|
}
|
|
894
1027
|
JSCAD.SquareDto = SquareDto;
|
|
1028
|
+
/**
|
|
1029
|
+
* Feeds `polygon.rectangle`: a filled rectangle in the XY plane with sides parallel to the axes,
|
|
1030
|
+
* given by its 2D center, width along X and length along Y.
|
|
1031
|
+
*/
|
|
895
1032
|
class RectangleDto {
|
|
896
1033
|
constructor(center, width, length) {
|
|
897
1034
|
/**
|
|
898
|
-
*
|
|
1035
|
+
* The 2D center point, as X and Y in the plane
|
|
899
1036
|
* @default [0, 0]
|
|
900
1037
|
*/
|
|
901
1038
|
this.center = [0, 0];
|
|
902
1039
|
/**
|
|
903
|
-
*
|
|
1040
|
+
* Full size along X, in model units
|
|
904
1041
|
* @default 1
|
|
905
1042
|
* @minimum -Infinity
|
|
906
1043
|
* @maximum Infinity
|
|
@@ -908,7 +1045,7 @@ export var JSCAD;
|
|
|
908
1045
|
*/
|
|
909
1046
|
this.width = 1;
|
|
910
1047
|
/**
|
|
911
|
-
*
|
|
1048
|
+
* Full size along Y, in model units
|
|
912
1049
|
* @default 1
|
|
913
1050
|
* @minimum -Infinity
|
|
914
1051
|
* @maximum Infinity
|
|
@@ -927,15 +1064,21 @@ export var JSCAD;
|
|
|
927
1064
|
}
|
|
928
1065
|
}
|
|
929
1066
|
JSCAD.RectangleDto = RectangleDto;
|
|
1067
|
+
/**
|
|
1068
|
+
* Feeds `polygon.roundedRectangle`: a filled rectangle in the XY plane whose four corners are
|
|
1069
|
+
* rounded, given by its 2D center, its sizes, the corner radius and how finely the corners are
|
|
1070
|
+
* faceted.
|
|
1071
|
+
*/
|
|
930
1072
|
class RoundedRectangleDto {
|
|
931
1073
|
constructor(center, roundRadius, segments, width, length) {
|
|
932
1074
|
/**
|
|
933
|
-
*
|
|
1075
|
+
* The 2D center point, as X and Y in the plane
|
|
934
1076
|
* @default [0, 0]
|
|
935
1077
|
*/
|
|
936
1078
|
this.center = [0, 0];
|
|
937
1079
|
/**
|
|
938
|
-
*
|
|
1080
|
+
* Radius of each rounded corner, in model units; it must be less than half of the smaller side
|
|
1081
|
+
* or an error is thrown
|
|
939
1082
|
* @default 0.2
|
|
940
1083
|
* @minimum -Infinity
|
|
941
1084
|
* @maximum Infinity
|
|
@@ -943,7 +1086,8 @@ export var JSCAD;
|
|
|
943
1086
|
*/
|
|
944
1087
|
this.roundRadius = 0.2;
|
|
945
1088
|
/**
|
|
946
|
-
* Number of
|
|
1089
|
+
* Number of straight pieces a full circle of rounding is made of, so each corner gets a
|
|
1090
|
+
* quarter; more makes it smoother
|
|
947
1091
|
* @default 24
|
|
948
1092
|
* @minimum 0
|
|
949
1093
|
* @maximum Infinity
|
|
@@ -951,7 +1095,7 @@ export var JSCAD;
|
|
|
951
1095
|
*/
|
|
952
1096
|
this.segments = 24;
|
|
953
1097
|
/**
|
|
954
|
-
*
|
|
1098
|
+
* Full size along X, in model units
|
|
955
1099
|
* @default 1
|
|
956
1100
|
* @minimum -Infinity
|
|
957
1101
|
* @maximum Infinity
|
|
@@ -959,7 +1103,7 @@ export var JSCAD;
|
|
|
959
1103
|
*/
|
|
960
1104
|
this.width = 1;
|
|
961
1105
|
/**
|
|
962
|
-
*
|
|
1106
|
+
* Full size along Y, in model units
|
|
963
1107
|
* @default 1
|
|
964
1108
|
* @minimum -Infinity
|
|
965
1109
|
* @maximum Infinity
|
|
@@ -984,15 +1128,19 @@ export var JSCAD;
|
|
|
984
1128
|
}
|
|
985
1129
|
}
|
|
986
1130
|
JSCAD.RoundedRectangleDto = RoundedRectangleDto;
|
|
1131
|
+
/**
|
|
1132
|
+
* Feeds `polygon.star`: a filled star in the XY plane, given by its 2D center, how many tips it
|
|
1133
|
+
* has, how far the tips and the notches between them reach and where the first tip points.
|
|
1134
|
+
*/
|
|
987
1135
|
class StarDto {
|
|
988
1136
|
constructor(center, vertices, density, outerRadius, innerRadius, startAngle) {
|
|
989
1137
|
/**
|
|
990
|
-
*
|
|
1138
|
+
* The 2D center point, as X and Y in the plane
|
|
991
1139
|
* @default [0, 0]
|
|
992
1140
|
*/
|
|
993
1141
|
this.center = [0, 0];
|
|
994
1142
|
/**
|
|
995
|
-
* Number of
|
|
1143
|
+
* Number of tips; the star has as many notches between them
|
|
996
1144
|
* @default 10
|
|
997
1145
|
* @minimum 0
|
|
998
1146
|
* @maximum Infinity
|
|
@@ -1000,7 +1148,8 @@ export var JSCAD;
|
|
|
1000
1148
|
*/
|
|
1001
1149
|
this.vertices = 10;
|
|
1002
1150
|
/**
|
|
1003
|
-
*
|
|
1151
|
+
* Read only when `innerRadius` is 0: how many tips apart the edges connect, 2 for a pentagram,
|
|
1152
|
+
* from which the notch radius is derived
|
|
1004
1153
|
* @default 1
|
|
1005
1154
|
* @minimum 0
|
|
1006
1155
|
* @maximum Infinity
|
|
@@ -1008,7 +1157,7 @@ export var JSCAD;
|
|
|
1008
1157
|
*/
|
|
1009
1158
|
this.density = 1;
|
|
1010
1159
|
/**
|
|
1011
|
-
*
|
|
1160
|
+
* Distance from the center to each tip, in model units
|
|
1012
1161
|
* @default 2
|
|
1013
1162
|
* @minimum 0
|
|
1014
1163
|
* @maximum Infinity
|
|
@@ -1016,7 +1165,7 @@ export var JSCAD;
|
|
|
1016
1165
|
*/
|
|
1017
1166
|
this.outerRadius = 2;
|
|
1018
1167
|
/**
|
|
1019
|
-
*
|
|
1168
|
+
* Distance from the center to each notch, in model units; 0 lets `density` decide it
|
|
1020
1169
|
* @default 1
|
|
1021
1170
|
* @minimum 0
|
|
1022
1171
|
* @maximum Infinity
|
|
@@ -1024,7 +1173,7 @@ export var JSCAD;
|
|
|
1024
1173
|
*/
|
|
1025
1174
|
this.innerRadius = 1;
|
|
1026
1175
|
/**
|
|
1027
|
-
*
|
|
1176
|
+
* Direction of the first tip, in degrees counter-clockwise from the X axis
|
|
1028
1177
|
* @default 0
|
|
1029
1178
|
* @minimum -Infinity
|
|
1030
1179
|
* @maximum Infinity
|
|
@@ -1052,15 +1201,19 @@ export var JSCAD;
|
|
|
1052
1201
|
}
|
|
1053
1202
|
}
|
|
1054
1203
|
JSCAD.StarDto = StarDto;
|
|
1204
|
+
/**
|
|
1205
|
+
* Feeds `shapes.cube`: a cube with faces parallel to the axes, given by its center point and edge
|
|
1206
|
+
* length.
|
|
1207
|
+
*/
|
|
1055
1208
|
class CubeDto {
|
|
1056
1209
|
constructor(center, size) {
|
|
1057
1210
|
/**
|
|
1058
|
-
*
|
|
1211
|
+
* The point the cube is centered on, so half the edge length lies on each side of it
|
|
1059
1212
|
* @default [0, 0, 0]
|
|
1060
1213
|
*/
|
|
1061
1214
|
this.center = [0, 0, 0];
|
|
1062
1215
|
/**
|
|
1063
|
-
*
|
|
1216
|
+
* Length of every edge, in model units
|
|
1064
1217
|
* @default 1
|
|
1065
1218
|
* @minimum -Infinity
|
|
1066
1219
|
* @maximum Infinity
|
|
@@ -1076,10 +1229,14 @@ export var JSCAD;
|
|
|
1076
1229
|
}
|
|
1077
1230
|
}
|
|
1078
1231
|
JSCAD.CubeDto = CubeDto;
|
|
1232
|
+
/**
|
|
1233
|
+
* Feeds `shapes.cubesOnCenterPoints`: one cube of the same edge length on every center point,
|
|
1234
|
+
* coming back in the same order.
|
|
1235
|
+
*/
|
|
1079
1236
|
class CubeCentersDto {
|
|
1080
1237
|
constructor(centers, size) {
|
|
1081
1238
|
/**
|
|
1082
|
-
*
|
|
1239
|
+
* Length of every edge of every cube, in model units
|
|
1083
1240
|
* @default 1
|
|
1084
1241
|
* @minimum 0
|
|
1085
1242
|
* @maximum Infinity
|
|
@@ -1095,15 +1252,19 @@ export var JSCAD;
|
|
|
1095
1252
|
}
|
|
1096
1253
|
}
|
|
1097
1254
|
JSCAD.CubeCentersDto = CubeCentersDto;
|
|
1255
|
+
/**
|
|
1256
|
+
* Feeds `shapes.cuboid`: a box with faces parallel to the axes, given by its center point and its
|
|
1257
|
+
* sizes along X, Y and Z.
|
|
1258
|
+
*/
|
|
1098
1259
|
class CuboidDto {
|
|
1099
1260
|
constructor(center, width, length, height) {
|
|
1100
1261
|
/**
|
|
1101
|
-
*
|
|
1262
|
+
* The point the box is centered on, so half of each size lies on each side of it
|
|
1102
1263
|
* @default [0, 0, 0]
|
|
1103
1264
|
*/
|
|
1104
1265
|
this.center = [0, 0, 0];
|
|
1105
1266
|
/**
|
|
1106
|
-
*
|
|
1267
|
+
* Full size along X, in model units
|
|
1107
1268
|
* @default 1
|
|
1108
1269
|
* @minimum 0
|
|
1109
1270
|
* @maximum Infinity
|
|
@@ -1111,7 +1272,7 @@ export var JSCAD;
|
|
|
1111
1272
|
*/
|
|
1112
1273
|
this.width = 1;
|
|
1113
1274
|
/**
|
|
1114
|
-
*
|
|
1275
|
+
* Full size along Z, in model units
|
|
1115
1276
|
* @default 1
|
|
1116
1277
|
* @minimum 0
|
|
1117
1278
|
* @maximum Infinity
|
|
@@ -1119,7 +1280,7 @@ export var JSCAD;
|
|
|
1119
1280
|
*/
|
|
1120
1281
|
this.length = 1;
|
|
1121
1282
|
/**
|
|
1122
|
-
*
|
|
1283
|
+
* Full size along Y, in model units
|
|
1123
1284
|
* @default 1
|
|
1124
1285
|
* @minimum 0
|
|
1125
1286
|
* @maximum Infinity
|
|
@@ -1141,10 +1302,14 @@ export var JSCAD;
|
|
|
1141
1302
|
}
|
|
1142
1303
|
}
|
|
1143
1304
|
JSCAD.CuboidDto = CuboidDto;
|
|
1305
|
+
/**
|
|
1306
|
+
* Feeds `shapes.cuboidsOnCenterPoints`: one box of the same sizes on every center point, coming
|
|
1307
|
+
* back in the same order.
|
|
1308
|
+
*/
|
|
1144
1309
|
class CuboidCentersDto {
|
|
1145
1310
|
constructor(centers, width, length, height) {
|
|
1146
1311
|
/**
|
|
1147
|
-
*
|
|
1312
|
+
* Full size of every box along X, in model units
|
|
1148
1313
|
* @default 1
|
|
1149
1314
|
* @minimum 0
|
|
1150
1315
|
* @maximum Infinity
|
|
@@ -1152,7 +1317,7 @@ export var JSCAD;
|
|
|
1152
1317
|
*/
|
|
1153
1318
|
this.width = 1;
|
|
1154
1319
|
/**
|
|
1155
|
-
*
|
|
1320
|
+
* Full size of every box along Z, in model units
|
|
1156
1321
|
* @default 1
|
|
1157
1322
|
* @minimum 0
|
|
1158
1323
|
* @maximum Infinity
|
|
@@ -1160,7 +1325,7 @@ export var JSCAD;
|
|
|
1160
1325
|
*/
|
|
1161
1326
|
this.length = 1;
|
|
1162
1327
|
/**
|
|
1163
|
-
*
|
|
1328
|
+
* Full size of every box along Y, in model units
|
|
1164
1329
|
* @default 1
|
|
1165
1330
|
* @minimum 0
|
|
1166
1331
|
* @maximum Infinity
|
|
@@ -1182,23 +1347,28 @@ export var JSCAD;
|
|
|
1182
1347
|
}
|
|
1183
1348
|
}
|
|
1184
1349
|
JSCAD.CuboidCentersDto = CuboidCentersDto;
|
|
1350
|
+
/**
|
|
1351
|
+
* Feeds `shapes.roundedCuboid`: a box with every edge and corner rounded, given by its center, its
|
|
1352
|
+
* sizes along X, Y and Z, the rounding radius and how finely the rounding is faceted.
|
|
1353
|
+
*/
|
|
1185
1354
|
class RoundedCuboidDto {
|
|
1186
1355
|
constructor(center, roundRadius, width, length, height, segments) {
|
|
1187
1356
|
/**
|
|
1188
|
-
*
|
|
1357
|
+
* The point the box is centered on, so half of each size lies on each side of it
|
|
1189
1358
|
* @default [0, 0, 0]
|
|
1190
1359
|
*/
|
|
1191
1360
|
this.center = [0, 0, 0];
|
|
1192
1361
|
/**
|
|
1193
|
-
* Radius
|
|
1362
|
+
* Radius of the rounding on every edge, in model units; it must be less than half of the
|
|
1363
|
+
* smallest side or an error is thrown
|
|
1194
1364
|
* @default 0.1
|
|
1195
1365
|
* @minimum 0
|
|
1196
1366
|
* @maximum Infinity
|
|
1197
1367
|
* @step 0.1
|
|
1198
1368
|
*/
|
|
1199
|
-
this.roundRadius = 1;
|
|
1369
|
+
this.roundRadius = 0.1;
|
|
1200
1370
|
/**
|
|
1201
|
-
*
|
|
1371
|
+
* Full size along X, in model units, rounding included
|
|
1202
1372
|
* @default 1
|
|
1203
1373
|
* @minimum 0
|
|
1204
1374
|
* @maximum Infinity
|
|
@@ -1206,7 +1376,7 @@ export var JSCAD;
|
|
|
1206
1376
|
*/
|
|
1207
1377
|
this.width = 1;
|
|
1208
1378
|
/**
|
|
1209
|
-
*
|
|
1379
|
+
* Full size along Z, in model units, rounding included
|
|
1210
1380
|
* @default 1
|
|
1211
1381
|
* @minimum 0
|
|
1212
1382
|
* @maximum Infinity
|
|
@@ -1214,7 +1384,7 @@ export var JSCAD;
|
|
|
1214
1384
|
*/
|
|
1215
1385
|
this.length = 1;
|
|
1216
1386
|
/**
|
|
1217
|
-
*
|
|
1387
|
+
* Full size along Y, in model units, rounding included
|
|
1218
1388
|
* @default 1
|
|
1219
1389
|
* @minimum 0
|
|
1220
1390
|
* @maximum Infinity
|
|
@@ -1222,7 +1392,7 @@ export var JSCAD;
|
|
|
1222
1392
|
*/
|
|
1223
1393
|
this.height = 1;
|
|
1224
1394
|
/**
|
|
1225
|
-
*
|
|
1395
|
+
* Number of straight pieces a full circle of rounding is made of; more makes the edges smoother
|
|
1226
1396
|
* @default 24
|
|
1227
1397
|
* @minimum 0
|
|
1228
1398
|
* @maximum Infinity
|
|
@@ -1250,10 +1420,15 @@ export var JSCAD;
|
|
|
1250
1420
|
}
|
|
1251
1421
|
}
|
|
1252
1422
|
JSCAD.RoundedCuboidDto = RoundedCuboidDto;
|
|
1423
|
+
/**
|
|
1424
|
+
* Feeds `shapes.roundedCuboidsOnCenterPoints`: one rounded box of the same sizes and rounding on
|
|
1425
|
+
* every center point, coming back in the same order.
|
|
1426
|
+
*/
|
|
1253
1427
|
class RoundedCuboidCentersDto {
|
|
1254
1428
|
constructor(centers, roundRadius, width, length, height, segments) {
|
|
1255
1429
|
/**
|
|
1256
|
-
* Radius
|
|
1430
|
+
* Radius of the rounding on every edge, in model units; it must be less than half of the
|
|
1431
|
+
* smallest side or an error is thrown
|
|
1257
1432
|
* @default 0.1
|
|
1258
1433
|
* @minimum 0
|
|
1259
1434
|
* @maximum Infinity
|
|
@@ -1261,7 +1436,7 @@ export var JSCAD;
|
|
|
1261
1436
|
*/
|
|
1262
1437
|
this.roundRadius = 0.1;
|
|
1263
1438
|
/**
|
|
1264
|
-
*
|
|
1439
|
+
* Full size of every box along X, in model units, rounding included
|
|
1265
1440
|
* @default 1
|
|
1266
1441
|
* @minimum 0
|
|
1267
1442
|
* @maximum Infinity
|
|
@@ -1269,7 +1444,7 @@ export var JSCAD;
|
|
|
1269
1444
|
*/
|
|
1270
1445
|
this.width = 1;
|
|
1271
1446
|
/**
|
|
1272
|
-
*
|
|
1447
|
+
* Full size of every box along Z, in model units, rounding included
|
|
1273
1448
|
* @default 1
|
|
1274
1449
|
* @minimum 0
|
|
1275
1450
|
* @maximum Infinity
|
|
@@ -1277,7 +1452,7 @@ export var JSCAD;
|
|
|
1277
1452
|
*/
|
|
1278
1453
|
this.length = 1;
|
|
1279
1454
|
/**
|
|
1280
|
-
*
|
|
1455
|
+
* Full size of every box along Y, in model units, rounding included
|
|
1281
1456
|
* @default 1
|
|
1282
1457
|
* @minimum 0
|
|
1283
1458
|
* @maximum Infinity
|
|
@@ -1285,7 +1460,7 @@ export var JSCAD;
|
|
|
1285
1460
|
*/
|
|
1286
1461
|
this.height = 1;
|
|
1287
1462
|
/**
|
|
1288
|
-
*
|
|
1463
|
+
* Number of straight pieces a full circle of rounding is made of; more makes the edges smoother
|
|
1289
1464
|
* @default 24
|
|
1290
1465
|
* @minimum 0
|
|
1291
1466
|
* @maximum Infinity
|
|
@@ -1313,15 +1488,19 @@ export var JSCAD;
|
|
|
1313
1488
|
}
|
|
1314
1489
|
}
|
|
1315
1490
|
JSCAD.RoundedCuboidCentersDto = RoundedCuboidCentersDto;
|
|
1491
|
+
/**
|
|
1492
|
+
* Feeds `shapes.cylinderElliptic`: a cylinder standing along Z with an elliptical cross-section
|
|
1493
|
+
* that can differ between its two ends, so it also makes cones and tapers.
|
|
1494
|
+
*/
|
|
1316
1495
|
class CylidnerEllipticDto {
|
|
1317
1496
|
constructor(center, height, startRadius, endRadius, segments) {
|
|
1318
1497
|
/**
|
|
1319
|
-
*
|
|
1498
|
+
* The point halfway up the axis; half the height lies above it along Z and half below
|
|
1320
1499
|
* @default [0, 0, 0]
|
|
1321
1500
|
*/
|
|
1322
1501
|
this.center = [0, 0, 0];
|
|
1323
1502
|
/**
|
|
1324
|
-
*
|
|
1503
|
+
* Full length along Z, in model units
|
|
1325
1504
|
* @default 1
|
|
1326
1505
|
* @minimum 0
|
|
1327
1506
|
* @maximum Infinity
|
|
@@ -1329,17 +1508,17 @@ export var JSCAD;
|
|
|
1329
1508
|
*/
|
|
1330
1509
|
this.height = 1;
|
|
1331
1510
|
/**
|
|
1332
|
-
*
|
|
1511
|
+
* The X and Y radii of the bottom end, in model units, as `[x, y]`
|
|
1333
1512
|
* @default [1, 2]
|
|
1334
1513
|
*/
|
|
1335
1514
|
this.startRadius = [1, 2];
|
|
1336
1515
|
/**
|
|
1337
|
-
*
|
|
1516
|
+
* The X and Y radii of the top end, in model units, as `[x, y]`; `[0, 0]` closes it to a point
|
|
1338
1517
|
* @default [2, 3]
|
|
1339
1518
|
*/
|
|
1340
1519
|
this.endRadius = [2, 3];
|
|
1341
1520
|
/**
|
|
1342
|
-
*
|
|
1521
|
+
* Number of flat sides around the cylinder; more makes it rounder
|
|
1343
1522
|
* @default 24
|
|
1344
1523
|
* @minimum 0
|
|
1345
1524
|
* @maximum Infinity
|
|
@@ -1364,10 +1543,14 @@ export var JSCAD;
|
|
|
1364
1543
|
}
|
|
1365
1544
|
}
|
|
1366
1545
|
JSCAD.CylidnerEllipticDto = CylidnerEllipticDto;
|
|
1546
|
+
/**
|
|
1547
|
+
* Feeds `shapes.cylinderEllipticOnCenterPoints`: one elliptic cylinder of the same size on every
|
|
1548
|
+
* center point, coming back in the same order.
|
|
1549
|
+
*/
|
|
1367
1550
|
class CylidnerCentersEllipticDto {
|
|
1368
1551
|
constructor(centers, height, startRadius, endRadius, segments) {
|
|
1369
1552
|
/**
|
|
1370
|
-
*
|
|
1553
|
+
* Full length of every cylinder along Z, in model units
|
|
1371
1554
|
* @default 1
|
|
1372
1555
|
* @minimum 0
|
|
1373
1556
|
* @maximum Infinity
|
|
@@ -1375,17 +1558,18 @@ export var JSCAD;
|
|
|
1375
1558
|
*/
|
|
1376
1559
|
this.height = 1;
|
|
1377
1560
|
/**
|
|
1378
|
-
*
|
|
1561
|
+
* The X and Y radii of every bottom end, in model units, as `[x, y]`
|
|
1379
1562
|
* @default [1, 2]
|
|
1380
1563
|
*/
|
|
1381
1564
|
this.startRadius = [1, 2];
|
|
1382
1565
|
/**
|
|
1383
|
-
*
|
|
1566
|
+
* The X and Y radii of every top end, in model units, as `[x, y]`; `[0, 0]` closes them to a
|
|
1567
|
+
* point
|
|
1384
1568
|
* @default [2, 3]
|
|
1385
1569
|
*/
|
|
1386
1570
|
this.endRadius = [2, 3];
|
|
1387
1571
|
/**
|
|
1388
|
-
*
|
|
1572
|
+
* Number of flat sides around each cylinder; more makes them rounder
|
|
1389
1573
|
* @default 24
|
|
1390
1574
|
* @minimum 0
|
|
1391
1575
|
* @maximum Infinity
|
|
@@ -1410,15 +1594,19 @@ export var JSCAD;
|
|
|
1410
1594
|
}
|
|
1411
1595
|
}
|
|
1412
1596
|
JSCAD.CylidnerCentersEllipticDto = CylidnerCentersEllipticDto;
|
|
1597
|
+
/**
|
|
1598
|
+
* Feeds `shapes.cylinder`: a round cylinder standing along Z, given by the point halfway up its
|
|
1599
|
+
* axis, its height, its radius and how many flat sides approximate it.
|
|
1600
|
+
*/
|
|
1413
1601
|
class CylidnerDto {
|
|
1414
1602
|
constructor(center, height, radius, segments) {
|
|
1415
1603
|
/**
|
|
1416
|
-
*
|
|
1604
|
+
* The point halfway up the axis; half the height lies above it along Z and half below
|
|
1417
1605
|
* @default [0, 0, 0]
|
|
1418
1606
|
*/
|
|
1419
1607
|
this.center = [0, 0, 0];
|
|
1420
1608
|
/**
|
|
1421
|
-
*
|
|
1609
|
+
* Full length along Z, in model units
|
|
1422
1610
|
* @default 1
|
|
1423
1611
|
* @minimum 0
|
|
1424
1612
|
* @maximum Infinity
|
|
@@ -1426,7 +1614,7 @@ export var JSCAD;
|
|
|
1426
1614
|
*/
|
|
1427
1615
|
this.height = 1;
|
|
1428
1616
|
/**
|
|
1429
|
-
*
|
|
1617
|
+
* Distance from the axis to the side, in model units
|
|
1430
1618
|
* @default 1
|
|
1431
1619
|
* @minimum 0
|
|
1432
1620
|
* @maximum Infinity
|
|
@@ -1434,7 +1622,7 @@ export var JSCAD;
|
|
|
1434
1622
|
*/
|
|
1435
1623
|
this.radius = 1;
|
|
1436
1624
|
/**
|
|
1437
|
-
*
|
|
1625
|
+
* Number of flat sides around the cylinder; more makes it rounder
|
|
1438
1626
|
* @default 24
|
|
1439
1627
|
* @minimum 0
|
|
1440
1628
|
* @maximum Infinity
|
|
@@ -1456,15 +1644,21 @@ export var JSCAD;
|
|
|
1456
1644
|
}
|
|
1457
1645
|
}
|
|
1458
1646
|
JSCAD.CylidnerDto = CylidnerDto;
|
|
1647
|
+
/**
|
|
1648
|
+
* Feeds `shapes.roundedCylinder`: a cylinder standing along Z whose two rims are rounded, given by
|
|
1649
|
+
* the point halfway up its axis, the rounding radius, its height and radius and how finely it is
|
|
1650
|
+
* faceted.
|
|
1651
|
+
*/
|
|
1459
1652
|
class RoundedCylidnerDto {
|
|
1460
1653
|
constructor(center, roundRadius, height, radius, segments) {
|
|
1461
1654
|
/**
|
|
1462
|
-
*
|
|
1655
|
+
* The point halfway up the axis; half the height lies above it along Z and half below
|
|
1463
1656
|
* @default [0, 0, 0]
|
|
1464
1657
|
*/
|
|
1465
1658
|
this.center = [0, 0, 0];
|
|
1466
1659
|
/**
|
|
1467
|
-
*
|
|
1660
|
+
* Radius of the rounding on both rims, in model units; the height must be more than twice it or
|
|
1661
|
+
* an error is thrown
|
|
1468
1662
|
* @default 0.1
|
|
1469
1663
|
* @minimum 0
|
|
1470
1664
|
* @maximum Infinity
|
|
@@ -1472,7 +1666,7 @@ export var JSCAD;
|
|
|
1472
1666
|
*/
|
|
1473
1667
|
this.roundRadius = 0.1;
|
|
1474
1668
|
/**
|
|
1475
|
-
*
|
|
1669
|
+
* Full length along Z, in model units, rounding included
|
|
1476
1670
|
* @default 1
|
|
1477
1671
|
* @minimum 0
|
|
1478
1672
|
* @maximum Infinity
|
|
@@ -1480,7 +1674,7 @@ export var JSCAD;
|
|
|
1480
1674
|
*/
|
|
1481
1675
|
this.height = 1;
|
|
1482
1676
|
/**
|
|
1483
|
-
*
|
|
1677
|
+
* Distance from the axis to the side, in model units
|
|
1484
1678
|
* @default 1
|
|
1485
1679
|
* @minimum 0
|
|
1486
1680
|
* @maximum Infinity
|
|
@@ -1488,7 +1682,7 @@ export var JSCAD;
|
|
|
1488
1682
|
*/
|
|
1489
1683
|
this.radius = 1;
|
|
1490
1684
|
/**
|
|
1491
|
-
*
|
|
1685
|
+
* Number of flat sides around the cylinder and pieces in the rounding; more makes it smoother
|
|
1492
1686
|
* @default 24
|
|
1493
1687
|
* @minimum 0
|
|
1494
1688
|
* @maximum Infinity
|
|
@@ -1513,20 +1707,24 @@ export var JSCAD;
|
|
|
1513
1707
|
}
|
|
1514
1708
|
}
|
|
1515
1709
|
JSCAD.RoundedCylidnerDto = RoundedCylidnerDto;
|
|
1710
|
+
/**
|
|
1711
|
+
* Feeds `shapes.ellipsoid`: a sphere stretched separately along X, Y and Z, given by its center,
|
|
1712
|
+
* its three radii and how finely it is faceted.
|
|
1713
|
+
*/
|
|
1516
1714
|
class EllipsoidDto {
|
|
1517
1715
|
constructor(center, radius, segments) {
|
|
1518
1716
|
/**
|
|
1519
|
-
*
|
|
1717
|
+
* The point the ellipsoid is centered on
|
|
1520
1718
|
* @default [0, 0, 0]
|
|
1521
1719
|
*/
|
|
1522
1720
|
this.center = [0, 0, 0];
|
|
1523
1721
|
/**
|
|
1524
|
-
*
|
|
1722
|
+
* The half sizes along X, Y and Z, in model units, as `[x, y, z]`; equal values make a sphere
|
|
1525
1723
|
* @default [1, 2, 3]
|
|
1526
1724
|
*/
|
|
1527
1725
|
this.radius = [1, 2, 3];
|
|
1528
1726
|
/**
|
|
1529
|
-
*
|
|
1727
|
+
* Number of facets around the ellipsoid; more makes it smoother
|
|
1530
1728
|
* @default 24
|
|
1531
1729
|
* @minimum 0
|
|
1532
1730
|
* @maximum Infinity
|
|
@@ -1545,15 +1743,19 @@ export var JSCAD;
|
|
|
1545
1743
|
}
|
|
1546
1744
|
}
|
|
1547
1745
|
JSCAD.EllipsoidDto = EllipsoidDto;
|
|
1746
|
+
/**
|
|
1747
|
+
* Feeds `shapes.ellipsoidsOnCenterPoints`: one ellipsoid of the same radii on every center point,
|
|
1748
|
+
* coming back in the same order.
|
|
1749
|
+
*/
|
|
1548
1750
|
class EllipsoidCentersDto {
|
|
1549
1751
|
constructor(centers, radius, segments) {
|
|
1550
1752
|
/**
|
|
1551
|
-
*
|
|
1753
|
+
* The half sizes of every ellipsoid along X, Y and Z, in model units, as `[x, y, z]`
|
|
1552
1754
|
* @default [1, 2, 3]
|
|
1553
1755
|
*/
|
|
1554
1756
|
this.radius = [1, 2, 3];
|
|
1555
1757
|
/**
|
|
1556
|
-
*
|
|
1758
|
+
* Number of facets around each ellipsoid; more makes them smoother
|
|
1557
1759
|
* @default 24
|
|
1558
1760
|
* @minimum 0
|
|
1559
1761
|
* @maximum Infinity
|
|
@@ -1572,15 +1774,19 @@ export var JSCAD;
|
|
|
1572
1774
|
}
|
|
1573
1775
|
}
|
|
1574
1776
|
JSCAD.EllipsoidCentersDto = EllipsoidCentersDto;
|
|
1777
|
+
/**
|
|
1778
|
+
* Feeds `shapes.geodesicSphere`: a sphere made of evenly sized triangles, given by its center, its
|
|
1779
|
+
* radius and how finely the twenty starting faces are subdivided.
|
|
1780
|
+
*/
|
|
1575
1781
|
class GeodesicSphereDto {
|
|
1576
1782
|
constructor(center, radius, frequency) {
|
|
1577
1783
|
/**
|
|
1578
|
-
*
|
|
1784
|
+
* The point the sphere is centered on
|
|
1579
1785
|
* @default [0, 0, 0]
|
|
1580
1786
|
*/
|
|
1581
1787
|
this.center = [0, 0, 0];
|
|
1582
1788
|
/**
|
|
1583
|
-
*
|
|
1789
|
+
* Distance from the center to the surface, in model units
|
|
1584
1790
|
* @default 1
|
|
1585
1791
|
* @minimum 0
|
|
1586
1792
|
* @maximum Infinity
|
|
@@ -1588,7 +1794,8 @@ export var JSCAD;
|
|
|
1588
1794
|
*/
|
|
1589
1795
|
this.radius = 1;
|
|
1590
1796
|
/**
|
|
1591
|
-
*
|
|
1797
|
+
* How finely each of the twenty starting faces is subdivided; used in whole multiples of 6, at
|
|
1798
|
+
* least 6, and higher is rounder
|
|
1592
1799
|
* @default 12
|
|
1593
1800
|
* @minimum 0
|
|
1594
1801
|
* @maximum Infinity
|
|
@@ -1607,10 +1814,14 @@ export var JSCAD;
|
|
|
1607
1814
|
}
|
|
1608
1815
|
}
|
|
1609
1816
|
JSCAD.GeodesicSphereDto = GeodesicSphereDto;
|
|
1817
|
+
/**
|
|
1818
|
+
* Feeds `shapes.geodesicSpheresOnCenterPoints`: one geodesic sphere of the same radius on every
|
|
1819
|
+
* center point, coming back in the same order.
|
|
1820
|
+
*/
|
|
1610
1821
|
class GeodesicSphereCentersDto {
|
|
1611
1822
|
constructor(centers, radius, frequency) {
|
|
1612
1823
|
/**
|
|
1613
|
-
*
|
|
1824
|
+
* Distance from each center to its surface, in model units
|
|
1614
1825
|
* @default 1
|
|
1615
1826
|
* @minimum 0
|
|
1616
1827
|
* @maximum Infinity
|
|
@@ -1618,7 +1829,8 @@ export var JSCAD;
|
|
|
1618
1829
|
*/
|
|
1619
1830
|
this.radius = 1;
|
|
1620
1831
|
/**
|
|
1621
|
-
*
|
|
1832
|
+
* How finely each of the twenty starting faces is subdivided; used in whole multiples of 6, at
|
|
1833
|
+
* least 6, and higher is rounder
|
|
1622
1834
|
* @default 12
|
|
1623
1835
|
* @minimum 0
|
|
1624
1836
|
* @maximum Infinity
|
|
@@ -1637,10 +1849,14 @@ export var JSCAD;
|
|
|
1637
1849
|
}
|
|
1638
1850
|
}
|
|
1639
1851
|
JSCAD.GeodesicSphereCentersDto = GeodesicSphereCentersDto;
|
|
1852
|
+
/**
|
|
1853
|
+
* Feeds `shapes.cylindersOnCenterPoints`: one round cylinder of the same size standing along Z on
|
|
1854
|
+
* every center point, coming back in the same order.
|
|
1855
|
+
*/
|
|
1640
1856
|
class CylidnerCentersDto {
|
|
1641
1857
|
constructor(centers, height, radius, segments) {
|
|
1642
1858
|
/**
|
|
1643
|
-
*
|
|
1859
|
+
* Full length of every cylinder along Z, in model units
|
|
1644
1860
|
* @default 1
|
|
1645
1861
|
* @minimum 0
|
|
1646
1862
|
* @maximum Infinity
|
|
@@ -1648,7 +1864,7 @@ export var JSCAD;
|
|
|
1648
1864
|
*/
|
|
1649
1865
|
this.height = 1;
|
|
1650
1866
|
/**
|
|
1651
|
-
*
|
|
1867
|
+
* Distance from the axis to the side of every cylinder, in model units
|
|
1652
1868
|
* @default 1
|
|
1653
1869
|
* @minimum 0
|
|
1654
1870
|
* @maximum Infinity
|
|
@@ -1656,7 +1872,7 @@ export var JSCAD;
|
|
|
1656
1872
|
*/
|
|
1657
1873
|
this.radius = 1;
|
|
1658
1874
|
/**
|
|
1659
|
-
*
|
|
1875
|
+
* Number of flat sides around each cylinder; more makes them rounder
|
|
1660
1876
|
* @default 24
|
|
1661
1877
|
* @minimum 0
|
|
1662
1878
|
* @maximum Infinity
|
|
@@ -1678,10 +1894,15 @@ export var JSCAD;
|
|
|
1678
1894
|
}
|
|
1679
1895
|
}
|
|
1680
1896
|
JSCAD.CylidnerCentersDto = CylidnerCentersDto;
|
|
1897
|
+
/**
|
|
1898
|
+
* Feeds `shapes.roundedCylindersOnCenterPoints`: one rounded cylinder of the same size on every
|
|
1899
|
+
* center point, coming back in the same order.
|
|
1900
|
+
*/
|
|
1681
1901
|
class RoundedCylidnerCentersDto {
|
|
1682
1902
|
constructor(centers, roundRadius, height, radius, segments) {
|
|
1683
1903
|
/**
|
|
1684
|
-
*
|
|
1904
|
+
* Radius of the rounding on both rims of every cylinder, in model units; the height must be
|
|
1905
|
+
* more than twice it or an error is thrown
|
|
1685
1906
|
* @default 0.1
|
|
1686
1907
|
* @minimum 0
|
|
1687
1908
|
* @maximum Infinity
|
|
@@ -1689,7 +1910,7 @@ export var JSCAD;
|
|
|
1689
1910
|
*/
|
|
1690
1911
|
this.roundRadius = 0.1;
|
|
1691
1912
|
/**
|
|
1692
|
-
*
|
|
1913
|
+
* Full length of every cylinder along Z, in model units, rounding included
|
|
1693
1914
|
* @default 1
|
|
1694
1915
|
* @minimum 0
|
|
1695
1916
|
* @maximum Infinity
|
|
@@ -1697,7 +1918,7 @@ export var JSCAD;
|
|
|
1697
1918
|
*/
|
|
1698
1919
|
this.height = 1;
|
|
1699
1920
|
/**
|
|
1700
|
-
*
|
|
1921
|
+
* Distance from the axis to the side of every cylinder, in model units
|
|
1701
1922
|
* @default 1
|
|
1702
1923
|
* @minimum 0
|
|
1703
1924
|
* @maximum Infinity
|
|
@@ -1705,7 +1926,8 @@ export var JSCAD;
|
|
|
1705
1926
|
*/
|
|
1706
1927
|
this.radius = 1;
|
|
1707
1928
|
/**
|
|
1708
|
-
*
|
|
1929
|
+
* Number of flat sides around each cylinder and pieces in the rounding; more makes them
|
|
1930
|
+
* smoother
|
|
1709
1931
|
* @default 24
|
|
1710
1932
|
* @minimum 0
|
|
1711
1933
|
* @maximum Infinity
|
|
@@ -1730,15 +1952,19 @@ export var JSCAD;
|
|
|
1730
1952
|
}
|
|
1731
1953
|
}
|
|
1732
1954
|
JSCAD.RoundedCylidnerCentersDto = RoundedCylidnerCentersDto;
|
|
1955
|
+
/**
|
|
1956
|
+
* Feeds `shapes.sphere`: a sphere given by its center point, its radius and how many facets
|
|
1957
|
+
* approximate it.
|
|
1958
|
+
*/
|
|
1733
1959
|
class SphereDto {
|
|
1734
1960
|
constructor(center, radius, segments) {
|
|
1735
1961
|
/**
|
|
1736
|
-
*
|
|
1962
|
+
* The point the sphere is centered on
|
|
1737
1963
|
* @default [0, 0, 0]
|
|
1738
1964
|
*/
|
|
1739
1965
|
this.center = [0, 0, 0];
|
|
1740
1966
|
/**
|
|
1741
|
-
*
|
|
1967
|
+
* Distance from the center to the surface, in model units
|
|
1742
1968
|
* @default 1
|
|
1743
1969
|
* @minimum 0
|
|
1744
1970
|
* @maximum Infinity
|
|
@@ -1746,7 +1972,7 @@ export var JSCAD;
|
|
|
1746
1972
|
*/
|
|
1747
1973
|
this.radius = 1;
|
|
1748
1974
|
/**
|
|
1749
|
-
*
|
|
1975
|
+
* Number of facets around the sphere; more makes it rounder
|
|
1750
1976
|
* @default 24
|
|
1751
1977
|
* @minimum 0
|
|
1752
1978
|
* @maximum Infinity
|
|
@@ -1765,10 +1991,14 @@ export var JSCAD;
|
|
|
1765
1991
|
}
|
|
1766
1992
|
}
|
|
1767
1993
|
JSCAD.SphereDto = SphereDto;
|
|
1994
|
+
/**
|
|
1995
|
+
* Feeds `shapes.spheresOnCenterPoints`: one sphere of the same radius on every center point, coming
|
|
1996
|
+
* back in the same order.
|
|
1997
|
+
*/
|
|
1768
1998
|
class SphereCentersDto {
|
|
1769
1999
|
constructor(centers, radius, segments) {
|
|
1770
2000
|
/**
|
|
1771
|
-
*
|
|
2001
|
+
* Distance from each center to its surface, in model units
|
|
1772
2002
|
* @default 1
|
|
1773
2003
|
* @minimum 0
|
|
1774
2004
|
* @maximum Infinity
|
|
@@ -1776,7 +2006,7 @@ export var JSCAD;
|
|
|
1776
2006
|
*/
|
|
1777
2007
|
this.radius = 1;
|
|
1778
2008
|
/**
|
|
1779
|
-
*
|
|
2009
|
+
* Number of facets around each sphere; more makes them rounder
|
|
1780
2010
|
* @default 24
|
|
1781
2011
|
* @minimum 0
|
|
1782
2012
|
* @maximum Infinity
|
|
@@ -1795,15 +2025,20 @@ export var JSCAD;
|
|
|
1795
2025
|
}
|
|
1796
2026
|
}
|
|
1797
2027
|
JSCAD.SphereCentersDto = SphereCentersDto;
|
|
2028
|
+
/**
|
|
2029
|
+
* Feeds `shapes.torus`: a ring with a round cross-section lying flat in the XY plane around
|
|
2030
|
+
* `center`, given by the ring and tube radii, the facet counts of each and the angles that can
|
|
2031
|
+
* leave the ring partly open.
|
|
2032
|
+
*/
|
|
1798
2033
|
class TorusDto {
|
|
1799
2034
|
constructor(center, innerRadius, outerRadius, innerSegments, outerSegments, innerRotation, outerRotation, startAngle) {
|
|
1800
2035
|
/**
|
|
1801
|
-
*
|
|
2036
|
+
* The point the ring is centered on, in model units
|
|
1802
2037
|
* @default [0, 0, 0]
|
|
1803
2038
|
*/
|
|
1804
2039
|
this.center = [0, 0, 0];
|
|
1805
2040
|
/**
|
|
1806
|
-
*
|
|
2041
|
+
* Radius of the tube itself, in model units; it must be less than `outerRadius`
|
|
1807
2042
|
* @default 1
|
|
1808
2043
|
* @minimum 0
|
|
1809
2044
|
* @maximum Infinity
|
|
@@ -1811,7 +2046,8 @@ export var JSCAD;
|
|
|
1811
2046
|
*/
|
|
1812
2047
|
this.innerRadius = 1;
|
|
1813
2048
|
/**
|
|
1814
|
-
*
|
|
2049
|
+
* Distance from the ring's center to the middle of the tube, in model units, so the ring spans
|
|
2050
|
+
* twice the sum of both radii
|
|
1815
2051
|
* @default 2
|
|
1816
2052
|
* @minimum 0
|
|
1817
2053
|
* @maximum Infinity
|
|
@@ -1819,7 +2055,7 @@ export var JSCAD;
|
|
|
1819
2055
|
*/
|
|
1820
2056
|
this.outerRadius = 2;
|
|
1821
2057
|
/**
|
|
1822
|
-
* Number of
|
|
2058
|
+
* Number of flat pieces around the tube's cross-section; more makes the tube rounder
|
|
1823
2059
|
* @default 24
|
|
1824
2060
|
* @minimum 0
|
|
1825
2061
|
* @maximum Infinity
|
|
@@ -1827,7 +2063,7 @@ export var JSCAD;
|
|
|
1827
2063
|
*/
|
|
1828
2064
|
this.innerSegments = 24;
|
|
1829
2065
|
/**
|
|
1830
|
-
* Number of
|
|
2066
|
+
* Number of flat pieces around the ring; more makes the ring rounder
|
|
1831
2067
|
* @default 24
|
|
1832
2068
|
* @minimum 0
|
|
1833
2069
|
* @maximum Infinity
|
|
@@ -1835,7 +2071,8 @@ export var JSCAD;
|
|
|
1835
2071
|
*/
|
|
1836
2072
|
this.outerSegments = 24;
|
|
1837
2073
|
/**
|
|
1838
|
-
*
|
|
2074
|
+
* Turn of the tube's cross-section about its own center, in degrees; it shows when
|
|
2075
|
+
* `innerSegments` is low enough for the facets to be visible
|
|
1839
2076
|
* @default 0
|
|
1840
2077
|
* @minimum -Infinity
|
|
1841
2078
|
* @maximum Infinity
|
|
@@ -1843,7 +2080,8 @@ export var JSCAD;
|
|
|
1843
2080
|
*/
|
|
1844
2081
|
this.innerRotation = 0;
|
|
1845
2082
|
/**
|
|
1846
|
-
*
|
|
2083
|
+
* How far the tube is swept around the ring, in degrees; 360 closes the ring and less leaves it
|
|
2084
|
+
* open
|
|
1847
2085
|
* @default 360
|
|
1848
2086
|
* @minimum -Infinity
|
|
1849
2087
|
* @maximum Infinity
|
|
@@ -1851,7 +2089,7 @@ export var JSCAD;
|
|
|
1851
2089
|
*/
|
|
1852
2090
|
this.outerRotation = 360;
|
|
1853
2091
|
/**
|
|
1854
|
-
*
|
|
2092
|
+
* Where the sweep around the ring starts, in degrees from the X axis
|
|
1855
2093
|
* @default 0
|
|
1856
2094
|
* @minimum -Infinity
|
|
1857
2095
|
* @maximum Infinity
|
|
@@ -1885,15 +2123,21 @@ export var JSCAD;
|
|
|
1885
2123
|
}
|
|
1886
2124
|
}
|
|
1887
2125
|
JSCAD.TorusDto = TorusDto;
|
|
2126
|
+
/**
|
|
2127
|
+
* Feeds `text.createVectorText` with the text and the font options: where the text starts, how tall
|
|
2128
|
+
* a capital letter is, the spacing of lines and letters, the alignment of several lines and the
|
|
2129
|
+
* stroke compensation. `CylinderTextDto` and `SphereTextDto` reuse them.
|
|
2130
|
+
*/
|
|
1888
2131
|
class TextDto {
|
|
1889
2132
|
constructor(text, segments, xOffset, yOffset, height, lineSpacing, letterSpacing, align, extrudeOffset) {
|
|
1890
2133
|
/**
|
|
1891
|
-
*
|
|
2134
|
+
* The characters to write; a newline starts a new line and a character outside plain ASCII
|
|
2135
|
+
* becomes a question mark
|
|
1892
2136
|
* @default Hello World
|
|
1893
2137
|
*/
|
|
1894
2138
|
this.text = "Hello World";
|
|
1895
2139
|
/**
|
|
1896
|
-
* Number of
|
|
2140
|
+
* Number of straight pieces used for curved strokes; more makes letters rounder
|
|
1897
2141
|
* @default 24
|
|
1898
2142
|
* @minimum 0
|
|
1899
2143
|
* @maximum Infinity
|
|
@@ -1901,7 +2145,7 @@ export var JSCAD;
|
|
|
1901
2145
|
*/
|
|
1902
2146
|
this.segments = 24;
|
|
1903
2147
|
/**
|
|
1904
|
-
* X
|
|
2148
|
+
* Where the text starts along X, in model units
|
|
1905
2149
|
* @default 0
|
|
1906
2150
|
* @minimum -Infinity
|
|
1907
2151
|
* @maximum Infinity
|
|
@@ -1909,7 +2153,7 @@ export var JSCAD;
|
|
|
1909
2153
|
*/
|
|
1910
2154
|
this.xOffset = 0;
|
|
1911
2155
|
/**
|
|
1912
|
-
*
|
|
2156
|
+
* Where the baseline of the first line sits along Y, in model units
|
|
1913
2157
|
* @default 0
|
|
1914
2158
|
* @minimum -Infinity
|
|
1915
2159
|
* @maximum Infinity
|
|
@@ -1917,7 +2161,7 @@ export var JSCAD;
|
|
|
1917
2161
|
*/
|
|
1918
2162
|
this.yOffset = 0;
|
|
1919
2163
|
/**
|
|
1920
|
-
* Height of the text
|
|
2164
|
+
* Height of a capital letter, in model units; the whole text scales with it
|
|
1921
2165
|
* @default 1
|
|
1922
2166
|
* @minimum 0
|
|
1923
2167
|
* @maximum Infinity
|
|
@@ -1925,7 +2169,8 @@ export var JSCAD;
|
|
|
1925
2169
|
*/
|
|
1926
2170
|
this.height = 1;
|
|
1927
2171
|
/**
|
|
1928
|
-
*
|
|
2172
|
+
* Step from one line down to the next as a multiple of the letter height; 1.4 leaves a 40
|
|
2173
|
+
* percent gap
|
|
1929
2174
|
* @default 1.4
|
|
1930
2175
|
* @minimum -Infinity
|
|
1931
2176
|
* @maximum Infinity
|
|
@@ -1933,7 +2178,8 @@ export var JSCAD;
|
|
|
1933
2178
|
*/
|
|
1934
2179
|
this.lineSpacing = 1.4;
|
|
1935
2180
|
/**
|
|
1936
|
-
*
|
|
2181
|
+
* Multiplies the step from one letter to the next; 1 is the font's own spacing and 2 spreads
|
|
2182
|
+
* letters twice as far apart
|
|
1937
2183
|
* @default 1
|
|
1938
2184
|
* @minimum -Infinity
|
|
1939
2185
|
* @maximum Infinity
|
|
@@ -1941,12 +2187,13 @@ export var JSCAD;
|
|
|
1941
2187
|
*/
|
|
1942
2188
|
this.letterSpacing = 1;
|
|
1943
2189
|
/**
|
|
1944
|
-
*
|
|
2190
|
+
* How the lines of a multi-line text line up: to the left, the center or the right
|
|
1945
2191
|
* @default center
|
|
1946
2192
|
*/
|
|
1947
2193
|
this.align = jscadTextAlignEnum.center;
|
|
1948
2194
|
/**
|
|
1949
|
-
*
|
|
2195
|
+
* Thickness the strokes will get later, in model units; the outlines are pulled in by half of
|
|
2196
|
+
* it so letters keep their size once thick
|
|
1950
2197
|
* @default 0
|
|
1951
2198
|
* @minimum -Infinity
|
|
1952
2199
|
* @maximum Infinity
|
|
@@ -1983,15 +2230,21 @@ export var JSCAD;
|
|
|
1983
2230
|
}
|
|
1984
2231
|
}
|
|
1985
2232
|
JSCAD.TextDto = TextDto;
|
|
2233
|
+
/**
|
|
2234
|
+
* Feeds `text.cylindricalText`: the text and font options of `TextDto` plus the size of the
|
|
2235
|
+
* cylinders every stroke is chained from.
|
|
2236
|
+
*/
|
|
1986
2237
|
class CylinderTextDto {
|
|
1987
2238
|
constructor(text, extrusionHeight, extrusionSize, segments, xOffset, yOffset, height, lineSpacing, letterSpacing, align, extrudeOffset) {
|
|
1988
2239
|
/**
|
|
1989
|
-
*
|
|
2240
|
+
* The characters to write; a newline starts a new line and a character outside plain ASCII
|
|
2241
|
+
* becomes a question mark
|
|
1990
2242
|
* @default Hello World
|
|
1991
2243
|
*/
|
|
1992
2244
|
this.text = "Hello World";
|
|
1993
2245
|
/**
|
|
1994
|
-
*
|
|
2246
|
+
* Length of the cylinders along Z, in model units; the strokes sit on the XY plane with half of
|
|
2247
|
+
* it on each side
|
|
1995
2248
|
* @default 0.5
|
|
1996
2249
|
* @minimum 0
|
|
1997
2250
|
* @maximum Infinity
|
|
@@ -1999,7 +2252,7 @@ export var JSCAD;
|
|
|
1999
2252
|
*/
|
|
2000
2253
|
this.extrusionHeight = 0.5;
|
|
2001
2254
|
/**
|
|
2002
|
-
* Radius of the
|
|
2255
|
+
* Radius of the cylinders, in model units, which is half the thickness of the strokes
|
|
2003
2256
|
* @default 0.1
|
|
2004
2257
|
* @minimum 0
|
|
2005
2258
|
* @maximum Infinity
|
|
@@ -2007,7 +2260,8 @@ export var JSCAD;
|
|
|
2007
2260
|
*/
|
|
2008
2261
|
this.extrusionSize = 0.1;
|
|
2009
2262
|
/**
|
|
2010
|
-
*
|
|
2263
|
+
* Number of flat sides around each cylinder and pieces in curved strokes; more makes the
|
|
2264
|
+
* letters rounder
|
|
2011
2265
|
* @default 24
|
|
2012
2266
|
* @minimum 0
|
|
2013
2267
|
* @maximum Infinity
|
|
@@ -2015,7 +2269,7 @@ export var JSCAD;
|
|
|
2015
2269
|
*/
|
|
2016
2270
|
this.segments = 24;
|
|
2017
2271
|
/**
|
|
2018
|
-
* X
|
|
2272
|
+
* Where the text starts along X before it is centered, in model units
|
|
2019
2273
|
* @default 0
|
|
2020
2274
|
* @minimum -Infinity
|
|
2021
2275
|
* @maximum Infinity
|
|
@@ -2023,7 +2277,7 @@ export var JSCAD;
|
|
|
2023
2277
|
*/
|
|
2024
2278
|
this.xOffset = 0;
|
|
2025
2279
|
/**
|
|
2026
|
-
*
|
|
2280
|
+
* Where the baseline of the first line sits along Y, in model units
|
|
2027
2281
|
* @default 0
|
|
2028
2282
|
* @minimum -Infinity
|
|
2029
2283
|
* @maximum Infinity
|
|
@@ -2031,7 +2285,7 @@ export var JSCAD;
|
|
|
2031
2285
|
*/
|
|
2032
2286
|
this.yOffset = 0;
|
|
2033
2287
|
/**
|
|
2034
|
-
* Height of the text
|
|
2288
|
+
* Height of a capital letter, in model units; the whole text scales with it
|
|
2035
2289
|
* @default 1
|
|
2036
2290
|
* @minimum 0
|
|
2037
2291
|
* @maximum Infinity
|
|
@@ -2039,7 +2293,8 @@ export var JSCAD;
|
|
|
2039
2293
|
*/
|
|
2040
2294
|
this.height = 1;
|
|
2041
2295
|
/**
|
|
2042
|
-
*
|
|
2296
|
+
* Step from one line down to the next as a multiple of the letter height; 1.4 leaves a 40
|
|
2297
|
+
* percent gap
|
|
2043
2298
|
* @default 1.4
|
|
2044
2299
|
* @minimum -Infinity
|
|
2045
2300
|
* @maximum Infinity
|
|
@@ -2047,7 +2302,8 @@ export var JSCAD;
|
|
|
2047
2302
|
*/
|
|
2048
2303
|
this.lineSpacing = 1.4;
|
|
2049
2304
|
/**
|
|
2050
|
-
*
|
|
2305
|
+
* Multiplies the step from one letter to the next; 1 is the font's own spacing and 2 spreads
|
|
2306
|
+
* letters twice as far apart
|
|
2051
2307
|
* @default 1
|
|
2052
2308
|
* @minimum -Infinity
|
|
2053
2309
|
* @maximum Infinity
|
|
@@ -2055,12 +2311,13 @@ export var JSCAD;
|
|
|
2055
2311
|
*/
|
|
2056
2312
|
this.letterSpacing = 1;
|
|
2057
2313
|
/**
|
|
2058
|
-
*
|
|
2314
|
+
* How the lines of a multi-line text line up: to the left, the center or the right
|
|
2059
2315
|
* @default center
|
|
2060
2316
|
*/
|
|
2061
2317
|
this.align = jscadTextAlignEnum.center;
|
|
2062
2318
|
/**
|
|
2063
|
-
*
|
|
2319
|
+
* Pulls the strokes inward by half this amount, in model units, so thick strokes keep the
|
|
2320
|
+
* intended letter size
|
|
2064
2321
|
* @default 0
|
|
2065
2322
|
* @minimum -Infinity
|
|
2066
2323
|
* @maximum Infinity
|
|
@@ -2103,15 +2360,20 @@ export var JSCAD;
|
|
|
2103
2360
|
}
|
|
2104
2361
|
}
|
|
2105
2362
|
JSCAD.CylinderTextDto = CylinderTextDto;
|
|
2363
|
+
/**
|
|
2364
|
+
* Feeds `text.sphericalText`: the text and font options of `TextDto` plus the size of the spheres
|
|
2365
|
+
* every stroke is chained from.
|
|
2366
|
+
*/
|
|
2106
2367
|
class SphereTextDto {
|
|
2107
2368
|
constructor(text, radius, segments, xOffset, yOffset, height, lineSpacing, letterSpacing, align, extrudeOffset) {
|
|
2108
2369
|
/**
|
|
2109
|
-
*
|
|
2370
|
+
* The characters to write; a newline starts a new line and a character outside plain ASCII
|
|
2371
|
+
* becomes a question mark
|
|
2110
2372
|
* @default Hello World
|
|
2111
2373
|
*/
|
|
2112
2374
|
this.text = "Hello World";
|
|
2113
2375
|
/**
|
|
2114
|
-
* Radius of the spheres
|
|
2376
|
+
* Radius of the spheres, in model units, which is half the thickness of the strokes
|
|
2115
2377
|
* @default 0.1
|
|
2116
2378
|
* @minimum 0
|
|
2117
2379
|
* @maximum Infinity
|
|
@@ -2119,7 +2381,8 @@ export var JSCAD;
|
|
|
2119
2381
|
*/
|
|
2120
2382
|
this.radius = 0.1;
|
|
2121
2383
|
/**
|
|
2122
|
-
*
|
|
2384
|
+
* Number of facets around each sphere and pieces in curved strokes; more makes the letters
|
|
2385
|
+
* rounder
|
|
2123
2386
|
* @default 24
|
|
2124
2387
|
* @minimum 0
|
|
2125
2388
|
* @maximum Infinity
|
|
@@ -2127,7 +2390,7 @@ export var JSCAD;
|
|
|
2127
2390
|
*/
|
|
2128
2391
|
this.segments = 24;
|
|
2129
2392
|
/**
|
|
2130
|
-
* X
|
|
2393
|
+
* Where the text starts along X before it is centered, in model units
|
|
2131
2394
|
* @default 0
|
|
2132
2395
|
* @minimum -Infinity
|
|
2133
2396
|
* @maximum Infinity
|
|
@@ -2135,7 +2398,7 @@ export var JSCAD;
|
|
|
2135
2398
|
*/
|
|
2136
2399
|
this.xOffset = 0;
|
|
2137
2400
|
/**
|
|
2138
|
-
*
|
|
2401
|
+
* Where the baseline of the first line sits along Y, in model units
|
|
2139
2402
|
* @default 0
|
|
2140
2403
|
* @minimum -Infinity
|
|
2141
2404
|
* @maximum Infinity
|
|
@@ -2143,7 +2406,7 @@ export var JSCAD;
|
|
|
2143
2406
|
*/
|
|
2144
2407
|
this.yOffset = 0;
|
|
2145
2408
|
/**
|
|
2146
|
-
* Height of the text
|
|
2409
|
+
* Height of a capital letter, in model units; the whole text scales with it
|
|
2147
2410
|
* @default 1
|
|
2148
2411
|
* @minimum 0
|
|
2149
2412
|
* @maximum Infinity
|
|
@@ -2151,7 +2414,8 @@ export var JSCAD;
|
|
|
2151
2414
|
*/
|
|
2152
2415
|
this.height = 1;
|
|
2153
2416
|
/**
|
|
2154
|
-
*
|
|
2417
|
+
* Step from one line down to the next as a multiple of the letter height; 1.4 leaves a 40
|
|
2418
|
+
* percent gap
|
|
2155
2419
|
* @default 1.4
|
|
2156
2420
|
* @minimum -Infinity
|
|
2157
2421
|
* @maximum Infinity
|
|
@@ -2159,7 +2423,8 @@ export var JSCAD;
|
|
|
2159
2423
|
*/
|
|
2160
2424
|
this.lineSpacing = 1.4;
|
|
2161
2425
|
/**
|
|
2162
|
-
*
|
|
2426
|
+
* Multiplies the step from one letter to the next; 1 is the font's own spacing and 2 spreads
|
|
2427
|
+
* letters twice as far apart
|
|
2163
2428
|
* @default 1
|
|
2164
2429
|
* @minimum -Infinity
|
|
2165
2430
|
* @maximum Infinity
|
|
@@ -2167,12 +2432,13 @@ export var JSCAD;
|
|
|
2167
2432
|
*/
|
|
2168
2433
|
this.letterSpacing = 1;
|
|
2169
2434
|
/**
|
|
2170
|
-
*
|
|
2435
|
+
* How the lines of a multi-line text line up: to the left, the center or the right
|
|
2171
2436
|
* @default center
|
|
2172
2437
|
*/
|
|
2173
2438
|
this.align = jscadTextAlignEnum.center;
|
|
2174
2439
|
/**
|
|
2175
|
-
*
|
|
2440
|
+
* Pulls the strokes inward by half this amount, in model units, so thick strokes keep the
|
|
2441
|
+
* intended letter size
|
|
2176
2442
|
* @default 0
|
|
2177
2443
|
* @minimum -Infinity
|
|
2178
2444
|
* @maximum Infinity
|
|
@@ -2212,6 +2478,10 @@ export var JSCAD;
|
|
|
2212
2478
|
}
|
|
2213
2479
|
}
|
|
2214
2480
|
JSCAD.SphereTextDto = SphereTextDto;
|
|
2481
|
+
/**
|
|
2482
|
+
* Feeds `shapes.fromPolygonPoints` with the faces of a solid, each as the list of points around it,
|
|
2483
|
+
* listed clockwise as seen from outside.
|
|
2484
|
+
*/
|
|
2215
2485
|
class FromPolygonPoints {
|
|
2216
2486
|
constructor(polygonPoints) {
|
|
2217
2487
|
if (polygonPoints !== undefined) {
|