@bitbybit-dev/jscad 1.3.2 → 1.4.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/README.md +1 -1
- package/lib/api/dto-registry.d.ts +8 -0
- package/lib/api/dto-registry.js +139 -0
- package/lib/api/inputs/jscad-inputs.d.ts +332 -432
- package/lib/api/inputs/jscad-inputs.js +251 -301
- package/lib/api/jscad-service.js +8 -5
- package/lib/api/resolved-inputs/index.d.ts +80 -0
- package/lib/api/resolved-inputs/index.js +1 -0
- package/lib/api/services/jscad-colors.js +5 -2
- package/lib/api/services/jscad-expansions.d.ts +1 -1
- package/lib/api/services/jscad-expansions.js +11 -8
- package/lib/api/services/jscad-extrusions.js +18 -12
- package/lib/api/services/jscad-path.js +16 -11
- package/lib/api/services/jscad-polygon.d.ts +4 -4
- package/lib/api/services/jscad-polygon.js +28 -20
- package/lib/api/services/jscad-shapes.js +94 -73
- package/lib/api/services/jscad-text.js +20 -15
- package/lib/api/validation/index.d.ts +11 -0
- package/lib/api/validation/index.js +17 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +3 -0
- package/package.json +2 -2
|
@@ -24,7 +24,7 @@ export var JSCAD;
|
|
|
24
24
|
/**
|
|
25
25
|
* Whether the last point joins back to the first; the JSCAD methods decide closure on their own
|
|
26
26
|
* and ignore this flag
|
|
27
|
-
* @
|
|
27
|
+
* @default false
|
|
28
28
|
*/
|
|
29
29
|
this.isClosed = false;
|
|
30
30
|
if (points !== undefined) {
|
|
@@ -479,14 +479,13 @@ export var JSCAD;
|
|
|
479
479
|
}
|
|
480
480
|
JSCAD.MinkowskiSumDto = MinkowskiSumDto;
|
|
481
481
|
/**
|
|
482
|
-
* Feeds `expansions.
|
|
483
|
-
*
|
|
482
|
+
* Feeds `expansions.offset`: the 2D shape or path, the signed distance to build its outline at and
|
|
483
|
+
* how the corners are shaped, kept sharp unless `corners` says otherwise.
|
|
484
484
|
*/
|
|
485
485
|
class ExpansionDto {
|
|
486
486
|
constructor(geometry, delta, corners, segments) {
|
|
487
487
|
/**
|
|
488
488
|
* How far the boundary moves, in model units: positive grows the geometry, negative shrinks it
|
|
489
|
-
* (a solid accepts positive only)
|
|
490
489
|
* @default 0.1
|
|
491
490
|
* @minimum -Infinity
|
|
492
491
|
* @maximum Infinity
|
|
@@ -495,7 +494,7 @@ export var JSCAD;
|
|
|
495
494
|
this.delta = 0.1;
|
|
496
495
|
/**
|
|
497
496
|
* How a convex corner is shaped: `edge` keeps it sharp, `chamfer` cuts it flat, `round` curves
|
|
498
|
-
* it
|
|
497
|
+
* it with `segments` pieces
|
|
499
498
|
* @default edge
|
|
500
499
|
*/
|
|
501
500
|
this.corners = solidCornerTypeEnum.edge;
|
|
@@ -523,6 +522,51 @@ export var JSCAD;
|
|
|
523
522
|
}
|
|
524
523
|
}
|
|
525
524
|
JSCAD.ExpansionDto = ExpansionDto;
|
|
525
|
+
/**
|
|
526
|
+
* Feeds `expansions.expand`: the geometry, the signed distance to move its boundary by and how the
|
|
527
|
+
* corners are shaped, rounded unless `corners` says otherwise.
|
|
528
|
+
*/
|
|
529
|
+
class ExpandDto {
|
|
530
|
+
constructor(geometry, delta, corners, segments) {
|
|
531
|
+
/**
|
|
532
|
+
* How far the boundary moves, in model units: positive grows the geometry, negative shrinks it;
|
|
533
|
+
* a solid or a path accepts a positive value only
|
|
534
|
+
* @default 0.1
|
|
535
|
+
* @minimum -Infinity
|
|
536
|
+
* @maximum Infinity
|
|
537
|
+
* @step 0.1
|
|
538
|
+
*/
|
|
539
|
+
this.delta = 0.1;
|
|
540
|
+
/**
|
|
541
|
+
* How a convex corner is shaped: `round` curves it with `segments` pieces, `chamfer` cuts it
|
|
542
|
+
* flat, `edge` keeps it sharp; a solid accepts `round` only
|
|
543
|
+
* @default round
|
|
544
|
+
*/
|
|
545
|
+
this.corners = solidCornerTypeEnum.round;
|
|
546
|
+
/**
|
|
547
|
+
* Number of straight pieces a `round` corner is made of over a full circle; more makes it
|
|
548
|
+
* smoother, and a solid needs at least 4
|
|
549
|
+
* @default 24
|
|
550
|
+
* @minimum 0
|
|
551
|
+
* @maximum Infinity
|
|
552
|
+
* @step 1
|
|
553
|
+
*/
|
|
554
|
+
this.segments = 24;
|
|
555
|
+
if (geometry !== undefined) {
|
|
556
|
+
this.geometry = geometry;
|
|
557
|
+
}
|
|
558
|
+
if (delta !== undefined) {
|
|
559
|
+
this.delta = delta;
|
|
560
|
+
}
|
|
561
|
+
if (corners !== undefined) {
|
|
562
|
+
this.corners = corners;
|
|
563
|
+
}
|
|
564
|
+
if (segments !== undefined) {
|
|
565
|
+
this.segments = segments;
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
JSCAD.ExpandDto = ExpandDto;
|
|
526
570
|
/**
|
|
527
571
|
* Feeds `extrusions.extrudeLinear`: the flat shape, how far it rises along Z and the optional twist
|
|
528
572
|
* applied on the way up.
|
|
@@ -550,7 +594,7 @@ export var JSCAD;
|
|
|
550
594
|
* Number of slices the twist is built from, at least 1; more makes a smoother twist and a
|
|
551
595
|
* heavier mesh
|
|
552
596
|
* @default 15
|
|
553
|
-
* @minimum
|
|
597
|
+
* @minimum 1
|
|
554
598
|
* @maximum Infinity
|
|
555
599
|
* @step 1
|
|
556
600
|
*/
|
|
@@ -594,28 +638,40 @@ export var JSCAD;
|
|
|
594
638
|
}
|
|
595
639
|
JSCAD.SolidDto = SolidDto;
|
|
596
640
|
/**
|
|
597
|
-
*
|
|
598
|
-
*
|
|
641
|
+
* The wall a rectangular extrusion builds, shared by `ExtrudeRectangularDto` and
|
|
642
|
+
* `ExtrudeRectangularPointsDto`: how thick and how tall.
|
|
599
643
|
*/
|
|
600
|
-
class
|
|
601
|
-
constructor(
|
|
644
|
+
class ExtrudeRectangularSharedDto {
|
|
645
|
+
constructor() {
|
|
602
646
|
/**
|
|
603
647
|
* How tall the wall is along Z, in model units, standing on the XY plane
|
|
604
648
|
* @default 1
|
|
605
649
|
* @minimum 0
|
|
650
|
+
* @exclusiveMinimum true
|
|
606
651
|
* @maximum Infinity
|
|
607
652
|
* @step 0.1
|
|
608
653
|
*/
|
|
609
654
|
this.height = 1;
|
|
610
655
|
/**
|
|
611
|
-
* How far the wall reaches to each side of the
|
|
612
|
-
*
|
|
656
|
+
* How far the wall reaches to each side of the path, in model units, so the wall is twice this
|
|
657
|
+
* thick
|
|
613
658
|
* @default 1
|
|
614
659
|
* @minimum 0
|
|
660
|
+
* @exclusiveMinimum true
|
|
615
661
|
* @maximum Infinity
|
|
616
662
|
* @step 0.1
|
|
617
663
|
*/
|
|
618
664
|
this.size = 1;
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
JSCAD.ExtrudeRectangularSharedDto = ExtrudeRectangularSharedDto;
|
|
668
|
+
/**
|
|
669
|
+
* Feeds `extrusions.extrudeRectangular`: the outline to build a wall along, the wall's height along
|
|
670
|
+
* Z and its half thickness.
|
|
671
|
+
*/
|
|
672
|
+
class ExtrudeRectangularDto extends ExtrudeRectangularSharedDto {
|
|
673
|
+
constructor(geometry, height, size) {
|
|
674
|
+
super();
|
|
619
675
|
if (geometry !== undefined) {
|
|
620
676
|
this.geometry = geometry;
|
|
621
677
|
}
|
|
@@ -632,25 +688,9 @@ export var JSCAD;
|
|
|
632
688
|
* Feeds `extrusions.extrudeRectangularPoints`: the points of the line to build a wall along, the
|
|
633
689
|
* wall's height along Z and its half thickness.
|
|
634
690
|
*/
|
|
635
|
-
class ExtrudeRectangularPointsDto {
|
|
691
|
+
class ExtrudeRectangularPointsDto extends ExtrudeRectangularSharedDto {
|
|
636
692
|
constructor(points, height, size) {
|
|
637
|
-
|
|
638
|
-
* How tall the wall is along Z, in model units, standing on the XY plane
|
|
639
|
-
* @default 1
|
|
640
|
-
* @minimum 0
|
|
641
|
-
* @maximum Infinity
|
|
642
|
-
* @step 0.1
|
|
643
|
-
*/
|
|
644
|
-
this.height = 1;
|
|
645
|
-
/**
|
|
646
|
-
* How far the wall reaches to each side of the line, in model units, so the wall is twice this
|
|
647
|
-
* thick
|
|
648
|
-
* @default 1
|
|
649
|
-
* @minimum 0
|
|
650
|
-
* @maximum Infinity
|
|
651
|
-
* @step 0.1
|
|
652
|
-
*/
|
|
653
|
-
this.size = 1;
|
|
693
|
+
super();
|
|
654
694
|
if (points !== undefined) {
|
|
655
695
|
this.points = points;
|
|
656
696
|
}
|
|
@@ -689,7 +729,7 @@ export var JSCAD;
|
|
|
689
729
|
* Number of steps in a full turn; a partial angle uses proportionally fewer. Fewer than 3
|
|
690
730
|
* throws an error
|
|
691
731
|
* @default 24
|
|
692
|
-
* @minimum
|
|
732
|
+
* @minimum 3
|
|
693
733
|
* @maximum Infinity
|
|
694
734
|
* @step 1
|
|
695
735
|
*/
|
|
@@ -872,7 +912,7 @@ export var JSCAD;
|
|
|
872
912
|
/**
|
|
873
913
|
* Number of straight pieces for a full ellipse; the arc gets its proportional share
|
|
874
914
|
* @default 24
|
|
875
|
-
* @minimum
|
|
915
|
+
* @minimum 4
|
|
876
916
|
* @maximum Infinity
|
|
877
917
|
* @step 1
|
|
878
918
|
*/
|
|
@@ -881,7 +921,7 @@ export var JSCAD;
|
|
|
881
921
|
* Half width of the ellipse along its own X axis, in model units; scaled up when too small to
|
|
882
922
|
* reach the end point
|
|
883
923
|
* @default 1
|
|
884
|
-
* @minimum
|
|
924
|
+
* @minimum 0
|
|
885
925
|
* @maximum Infinity
|
|
886
926
|
* @step 0.1
|
|
887
927
|
*/
|
|
@@ -890,7 +930,7 @@ export var JSCAD;
|
|
|
890
930
|
* Half height of the ellipse along its own Y axis, in model units; equal to `radiusX` for a
|
|
891
931
|
* circular arc
|
|
892
932
|
* @default 1
|
|
893
|
-
* @minimum
|
|
933
|
+
* @minimum 0
|
|
894
934
|
* @maximum Infinity
|
|
895
935
|
* @step 0.1
|
|
896
936
|
*/
|
|
@@ -936,7 +976,7 @@ export var JSCAD;
|
|
|
936
976
|
/**
|
|
937
977
|
* Distance from the center to the rim, in model units
|
|
938
978
|
* @default 1
|
|
939
|
-
* @minimum
|
|
979
|
+
* @minimum 0
|
|
940
980
|
* @maximum Infinity
|
|
941
981
|
* @step 0.1
|
|
942
982
|
*/
|
|
@@ -944,7 +984,7 @@ export var JSCAD;
|
|
|
944
984
|
/**
|
|
945
985
|
* Number of straight sides around the circle; more makes it rounder
|
|
946
986
|
* @default 24
|
|
947
|
-
* @minimum
|
|
987
|
+
* @minimum 3
|
|
948
988
|
* @maximum Infinity
|
|
949
989
|
* @step 1
|
|
950
990
|
*/
|
|
@@ -980,7 +1020,7 @@ export var JSCAD;
|
|
|
980
1020
|
/**
|
|
981
1021
|
* Number of straight sides around the ellipse; more makes it rounder
|
|
982
1022
|
* @default 24
|
|
983
|
-
* @minimum
|
|
1023
|
+
* @minimum 3
|
|
984
1024
|
* @maximum Infinity
|
|
985
1025
|
* @step 1
|
|
986
1026
|
*/
|
|
@@ -1011,7 +1051,7 @@ export var JSCAD;
|
|
|
1011
1051
|
/**
|
|
1012
1052
|
* Length of each side, in model units
|
|
1013
1053
|
* @default 1
|
|
1014
|
-
* @minimum
|
|
1054
|
+
* @minimum 0
|
|
1015
1055
|
* @maximum Infinity
|
|
1016
1056
|
* @step 0.1
|
|
1017
1057
|
*/
|
|
@@ -1039,7 +1079,7 @@ export var JSCAD;
|
|
|
1039
1079
|
/**
|
|
1040
1080
|
* Full size along X, in model units
|
|
1041
1081
|
* @default 1
|
|
1042
|
-
* @minimum
|
|
1082
|
+
* @minimum 0
|
|
1043
1083
|
* @maximum Infinity
|
|
1044
1084
|
* @step 0.1
|
|
1045
1085
|
*/
|
|
@@ -1047,7 +1087,7 @@ export var JSCAD;
|
|
|
1047
1087
|
/**
|
|
1048
1088
|
* Full size along Y, in model units
|
|
1049
1089
|
* @default 1
|
|
1050
|
-
* @minimum
|
|
1090
|
+
* @minimum 0
|
|
1051
1091
|
* @maximum Infinity
|
|
1052
1092
|
* @step 0.1
|
|
1053
1093
|
*/
|
|
@@ -1080,7 +1120,7 @@ export var JSCAD;
|
|
|
1080
1120
|
* Radius of each rounded corner, in model units; it must be less than half of the smaller side
|
|
1081
1121
|
* or an error is thrown
|
|
1082
1122
|
* @default 0.2
|
|
1083
|
-
* @minimum
|
|
1123
|
+
* @minimum 0
|
|
1084
1124
|
* @maximum Infinity
|
|
1085
1125
|
* @step 0.1
|
|
1086
1126
|
*/
|
|
@@ -1089,7 +1129,7 @@ export var JSCAD;
|
|
|
1089
1129
|
* Number of straight pieces a full circle of rounding is made of, so each corner gets a
|
|
1090
1130
|
* quarter; more makes it smoother
|
|
1091
1131
|
* @default 24
|
|
1092
|
-
* @minimum
|
|
1132
|
+
* @minimum 4
|
|
1093
1133
|
* @maximum Infinity
|
|
1094
1134
|
* @step 1
|
|
1095
1135
|
*/
|
|
@@ -1097,7 +1137,7 @@ export var JSCAD;
|
|
|
1097
1137
|
/**
|
|
1098
1138
|
* Full size along X, in model units
|
|
1099
1139
|
* @default 1
|
|
1100
|
-
* @minimum
|
|
1140
|
+
* @minimum 0
|
|
1101
1141
|
* @maximum Infinity
|
|
1102
1142
|
* @step 0.1
|
|
1103
1143
|
*/
|
|
@@ -1105,7 +1145,7 @@ export var JSCAD;
|
|
|
1105
1145
|
/**
|
|
1106
1146
|
* Full size along Y, in model units
|
|
1107
1147
|
* @default 1
|
|
1108
|
-
* @minimum
|
|
1148
|
+
* @minimum 0
|
|
1109
1149
|
* @maximum Infinity
|
|
1110
1150
|
* @step 0.1
|
|
1111
1151
|
*/
|
|
@@ -1142,7 +1182,7 @@ export var JSCAD;
|
|
|
1142
1182
|
/**
|
|
1143
1183
|
* Number of tips; the star has as many notches between them
|
|
1144
1184
|
* @default 10
|
|
1145
|
-
* @minimum
|
|
1185
|
+
* @minimum 2
|
|
1146
1186
|
* @maximum Infinity
|
|
1147
1187
|
* @step 1
|
|
1148
1188
|
*/
|
|
@@ -1160,6 +1200,7 @@ export var JSCAD;
|
|
|
1160
1200
|
* Distance from the center to each tip, in model units
|
|
1161
1201
|
* @default 2
|
|
1162
1202
|
* @minimum 0
|
|
1203
|
+
* @exclusiveMinimum true
|
|
1163
1204
|
* @maximum Infinity
|
|
1164
1205
|
* @step 0.1
|
|
1165
1206
|
*/
|
|
@@ -1175,7 +1216,7 @@ export var JSCAD;
|
|
|
1175
1216
|
/**
|
|
1176
1217
|
* Direction of the first tip, in degrees counter-clockwise from the X axis
|
|
1177
1218
|
* @default 0
|
|
1178
|
-
* @minimum
|
|
1219
|
+
* @minimum 0
|
|
1179
1220
|
* @maximum Infinity
|
|
1180
1221
|
* @step 1
|
|
1181
1222
|
*/
|
|
@@ -1215,7 +1256,7 @@ export var JSCAD;
|
|
|
1215
1256
|
/**
|
|
1216
1257
|
* Length of every edge, in model units
|
|
1217
1258
|
* @default 1
|
|
1218
|
-
* @minimum
|
|
1259
|
+
* @minimum 0
|
|
1219
1260
|
* @maximum Infinity
|
|
1220
1261
|
* @step 0.1
|
|
1221
1262
|
*/
|
|
@@ -1253,16 +1294,10 @@ export var JSCAD;
|
|
|
1253
1294
|
}
|
|
1254
1295
|
JSCAD.CubeCentersDto = CubeCentersDto;
|
|
1255
1296
|
/**
|
|
1256
|
-
*
|
|
1257
|
-
* sizes along X, Y and Z.
|
|
1297
|
+
* The size of a box, shared by `CuboidDto` and `CuboidCentersDto`.
|
|
1258
1298
|
*/
|
|
1259
|
-
class
|
|
1260
|
-
constructor(
|
|
1261
|
-
/**
|
|
1262
|
-
* The point the box is centered on, so half of each size lies on each side of it
|
|
1263
|
-
* @default [0, 0, 0]
|
|
1264
|
-
*/
|
|
1265
|
-
this.center = [0, 0, 0];
|
|
1299
|
+
class CuboidSharedDto {
|
|
1300
|
+
constructor() {
|
|
1266
1301
|
/**
|
|
1267
1302
|
* Full size along X, in model units
|
|
1268
1303
|
* @default 1
|
|
@@ -1287,6 +1322,21 @@ export var JSCAD;
|
|
|
1287
1322
|
* @step 0.1
|
|
1288
1323
|
*/
|
|
1289
1324
|
this.height = 1;
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
JSCAD.CuboidSharedDto = CuboidSharedDto;
|
|
1328
|
+
/**
|
|
1329
|
+
* Feeds `shapes.cuboid`: a box with faces parallel to the axes, given by its center point and its
|
|
1330
|
+
* sizes along X, Y and Z.
|
|
1331
|
+
*/
|
|
1332
|
+
class CuboidDto extends CuboidSharedDto {
|
|
1333
|
+
constructor(center, width, length, height) {
|
|
1334
|
+
super();
|
|
1335
|
+
/**
|
|
1336
|
+
* The point the box is centered on, so half of each size lies on each side of it
|
|
1337
|
+
* @default [0, 0, 0]
|
|
1338
|
+
*/
|
|
1339
|
+
this.center = [0, 0, 0];
|
|
1290
1340
|
if (center !== undefined) {
|
|
1291
1341
|
this.center = center;
|
|
1292
1342
|
}
|
|
@@ -1306,32 +1356,9 @@ export var JSCAD;
|
|
|
1306
1356
|
* Feeds `shapes.cuboidsOnCenterPoints`: one box of the same sizes on every center point, coming
|
|
1307
1357
|
* back in the same order.
|
|
1308
1358
|
*/
|
|
1309
|
-
class CuboidCentersDto {
|
|
1359
|
+
class CuboidCentersDto extends CuboidSharedDto {
|
|
1310
1360
|
constructor(centers, width, length, height) {
|
|
1311
|
-
|
|
1312
|
-
* Full size of every box along X, in model units
|
|
1313
|
-
* @default 1
|
|
1314
|
-
* @minimum 0
|
|
1315
|
-
* @maximum Infinity
|
|
1316
|
-
* @step 0.1
|
|
1317
|
-
*/
|
|
1318
|
-
this.width = 1;
|
|
1319
|
-
/**
|
|
1320
|
-
* Full size of every box along Z, in model units
|
|
1321
|
-
* @default 1
|
|
1322
|
-
* @minimum 0
|
|
1323
|
-
* @maximum Infinity
|
|
1324
|
-
* @step 0.1
|
|
1325
|
-
*/
|
|
1326
|
-
this.length = 1;
|
|
1327
|
-
/**
|
|
1328
|
-
* Full size of every box along Y, in model units
|
|
1329
|
-
* @default 1
|
|
1330
|
-
* @minimum 0
|
|
1331
|
-
* @maximum Infinity
|
|
1332
|
-
* @step 0.1
|
|
1333
|
-
*/
|
|
1334
|
-
this.height = 1;
|
|
1361
|
+
super();
|
|
1335
1362
|
if (centers !== undefined) {
|
|
1336
1363
|
this.centers = centers;
|
|
1337
1364
|
}
|
|
@@ -1348,16 +1375,11 @@ export var JSCAD;
|
|
|
1348
1375
|
}
|
|
1349
1376
|
JSCAD.CuboidCentersDto = CuboidCentersDto;
|
|
1350
1377
|
/**
|
|
1351
|
-
*
|
|
1352
|
-
*
|
|
1378
|
+
* The size and rounding of a rounded box, shared by `RoundedCuboidDto` and
|
|
1379
|
+
* `RoundedCuboidCentersDto`.
|
|
1353
1380
|
*/
|
|
1354
|
-
class
|
|
1355
|
-
constructor(
|
|
1356
|
-
/**
|
|
1357
|
-
* The point the box is centered on, so half of each size lies on each side of it
|
|
1358
|
-
* @default [0, 0, 0]
|
|
1359
|
-
*/
|
|
1360
|
-
this.center = [0, 0, 0];
|
|
1381
|
+
class RoundedCuboidSharedDto {
|
|
1382
|
+
constructor() {
|
|
1361
1383
|
/**
|
|
1362
1384
|
* Radius of the rounding on every edge, in model units; it must be less than half of the
|
|
1363
1385
|
* smallest side or an error is thrown
|
|
@@ -1394,11 +1416,26 @@ export var JSCAD;
|
|
|
1394
1416
|
/**
|
|
1395
1417
|
* Number of straight pieces a full circle of rounding is made of; more makes the edges smoother
|
|
1396
1418
|
* @default 24
|
|
1397
|
-
* @minimum
|
|
1419
|
+
* @minimum 4
|
|
1398
1420
|
* @maximum Infinity
|
|
1399
1421
|
* @step 1
|
|
1400
1422
|
*/
|
|
1401
1423
|
this.segments = 24;
|
|
1424
|
+
}
|
|
1425
|
+
}
|
|
1426
|
+
JSCAD.RoundedCuboidSharedDto = RoundedCuboidSharedDto;
|
|
1427
|
+
/**
|
|
1428
|
+
* Feeds `shapes.roundedCuboid`: a box with every edge and corner rounded, given by its center, its
|
|
1429
|
+
* sizes along X, Y and Z, the rounding radius and how finely the rounding is faceted.
|
|
1430
|
+
*/
|
|
1431
|
+
class RoundedCuboidDto extends RoundedCuboidSharedDto {
|
|
1432
|
+
constructor(center, roundRadius, width, length, height, segments) {
|
|
1433
|
+
super();
|
|
1434
|
+
/**
|
|
1435
|
+
* The point the box is centered on, so half of each size lies on each side of it
|
|
1436
|
+
* @default [0, 0, 0]
|
|
1437
|
+
*/
|
|
1438
|
+
this.center = [0, 0, 0];
|
|
1402
1439
|
if (center !== undefined) {
|
|
1403
1440
|
this.center = center;
|
|
1404
1441
|
}
|
|
@@ -1424,49 +1461,9 @@ export var JSCAD;
|
|
|
1424
1461
|
* Feeds `shapes.roundedCuboidsOnCenterPoints`: one rounded box of the same sizes and rounding on
|
|
1425
1462
|
* every center point, coming back in the same order.
|
|
1426
1463
|
*/
|
|
1427
|
-
class RoundedCuboidCentersDto {
|
|
1464
|
+
class RoundedCuboidCentersDto extends RoundedCuboidSharedDto {
|
|
1428
1465
|
constructor(centers, roundRadius, width, length, height, segments) {
|
|
1429
|
-
|
|
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
|
|
1432
|
-
* @default 0.1
|
|
1433
|
-
* @minimum 0
|
|
1434
|
-
* @maximum Infinity
|
|
1435
|
-
* @step 0.1
|
|
1436
|
-
*/
|
|
1437
|
-
this.roundRadius = 0.1;
|
|
1438
|
-
/**
|
|
1439
|
-
* Full size of every box along X, in model units, rounding included
|
|
1440
|
-
* @default 1
|
|
1441
|
-
* @minimum 0
|
|
1442
|
-
* @maximum Infinity
|
|
1443
|
-
* @step 0.1
|
|
1444
|
-
*/
|
|
1445
|
-
this.width = 1;
|
|
1446
|
-
/**
|
|
1447
|
-
* Full size of every box along Z, in model units, rounding included
|
|
1448
|
-
* @default 1
|
|
1449
|
-
* @minimum 0
|
|
1450
|
-
* @maximum Infinity
|
|
1451
|
-
* @step 0.1
|
|
1452
|
-
*/
|
|
1453
|
-
this.length = 1;
|
|
1454
|
-
/**
|
|
1455
|
-
* Full size of every box along Y, in model units, rounding included
|
|
1456
|
-
* @default 1
|
|
1457
|
-
* @minimum 0
|
|
1458
|
-
* @maximum Infinity
|
|
1459
|
-
* @step 0.1
|
|
1460
|
-
*/
|
|
1461
|
-
this.height = 1;
|
|
1462
|
-
/**
|
|
1463
|
-
* Number of straight pieces a full circle of rounding is made of; more makes the edges smoother
|
|
1464
|
-
* @default 24
|
|
1465
|
-
* @minimum 0
|
|
1466
|
-
* @maximum Infinity
|
|
1467
|
-
* @step 1
|
|
1468
|
-
*/
|
|
1469
|
-
this.segments = 24;
|
|
1466
|
+
super();
|
|
1470
1467
|
if (centers !== undefined) {
|
|
1471
1468
|
this.centers = centers;
|
|
1472
1469
|
}
|
|
@@ -1503,6 +1500,7 @@ export var JSCAD;
|
|
|
1503
1500
|
* Full length along Z, in model units
|
|
1504
1501
|
* @default 1
|
|
1505
1502
|
* @minimum 0
|
|
1503
|
+
* @exclusiveMinimum true
|
|
1506
1504
|
* @maximum Infinity
|
|
1507
1505
|
* @step 0.1
|
|
1508
1506
|
*/
|
|
@@ -1520,7 +1518,7 @@ export var JSCAD;
|
|
|
1520
1518
|
/**
|
|
1521
1519
|
* Number of flat sides around the cylinder; more makes it rounder
|
|
1522
1520
|
* @default 24
|
|
1523
|
-
* @minimum
|
|
1521
|
+
* @minimum 4
|
|
1524
1522
|
* @maximum Infinity
|
|
1525
1523
|
* @step 1
|
|
1526
1524
|
*/
|
|
@@ -1553,6 +1551,7 @@ export var JSCAD;
|
|
|
1553
1551
|
* Full length of every cylinder along Z, in model units
|
|
1554
1552
|
* @default 1
|
|
1555
1553
|
* @minimum 0
|
|
1554
|
+
* @exclusiveMinimum true
|
|
1556
1555
|
* @maximum Infinity
|
|
1557
1556
|
* @step 0.1
|
|
1558
1557
|
*/
|
|
@@ -1571,7 +1570,7 @@ export var JSCAD;
|
|
|
1571
1570
|
/**
|
|
1572
1571
|
* Number of flat sides around each cylinder; more makes them rounder
|
|
1573
1572
|
* @default 24
|
|
1574
|
-
* @minimum
|
|
1573
|
+
* @minimum 4
|
|
1575
1574
|
* @maximum Infinity
|
|
1576
1575
|
* @step 1
|
|
1577
1576
|
*/
|
|
@@ -1595,16 +1594,10 @@ export var JSCAD;
|
|
|
1595
1594
|
}
|
|
1596
1595
|
JSCAD.CylidnerCentersEllipticDto = CylidnerCentersEllipticDto;
|
|
1597
1596
|
/**
|
|
1598
|
-
*
|
|
1599
|
-
* axis, its height, its radius and how many flat sides approximate it.
|
|
1597
|
+
* The size and smoothness of a cylinder, shared by `CylidnerDto` and `CylidnerCentersDto`.
|
|
1600
1598
|
*/
|
|
1601
|
-
class
|
|
1602
|
-
constructor(
|
|
1603
|
-
/**
|
|
1604
|
-
* The point halfway up the axis; half the height lies above it along Z and half below
|
|
1605
|
-
* @default [0, 0, 0]
|
|
1606
|
-
*/
|
|
1607
|
-
this.center = [0, 0, 0];
|
|
1599
|
+
class CylinderSharedDto {
|
|
1600
|
+
constructor() {
|
|
1608
1601
|
/**
|
|
1609
1602
|
* Full length along Z, in model units
|
|
1610
1603
|
* @default 1
|
|
@@ -1624,11 +1617,26 @@ export var JSCAD;
|
|
|
1624
1617
|
/**
|
|
1625
1618
|
* Number of flat sides around the cylinder; more makes it rounder
|
|
1626
1619
|
* @default 24
|
|
1627
|
-
* @minimum
|
|
1620
|
+
* @minimum 4
|
|
1628
1621
|
* @maximum Infinity
|
|
1629
1622
|
* @step 1
|
|
1630
1623
|
*/
|
|
1631
1624
|
this.segments = 24;
|
|
1625
|
+
}
|
|
1626
|
+
}
|
|
1627
|
+
JSCAD.CylinderSharedDto = CylinderSharedDto;
|
|
1628
|
+
/**
|
|
1629
|
+
* Feeds `shapes.cylinder`: a round cylinder standing along Z, given by the point halfway up its
|
|
1630
|
+
* axis, its height, its radius and how many flat sides approximate it.
|
|
1631
|
+
*/
|
|
1632
|
+
class CylidnerDto extends CylinderSharedDto {
|
|
1633
|
+
constructor(center, height, radius, segments) {
|
|
1634
|
+
super();
|
|
1635
|
+
/**
|
|
1636
|
+
* The point halfway up the axis; half the height lies above it along Z and half below
|
|
1637
|
+
* @default [0, 0, 0]
|
|
1638
|
+
*/
|
|
1639
|
+
this.center = [0, 0, 0];
|
|
1632
1640
|
if (center !== undefined) {
|
|
1633
1641
|
this.center = center;
|
|
1634
1642
|
}
|
|
@@ -1645,17 +1653,11 @@ export var JSCAD;
|
|
|
1645
1653
|
}
|
|
1646
1654
|
JSCAD.CylidnerDto = CylidnerDto;
|
|
1647
1655
|
/**
|
|
1648
|
-
*
|
|
1649
|
-
*
|
|
1650
|
-
* faceted.
|
|
1656
|
+
* The size, rounding and smoothness of a rounded cylinder, shared by `RoundedCylidnerDto` and
|
|
1657
|
+
* `RoundedCylidnerCentersDto`.
|
|
1651
1658
|
*/
|
|
1652
|
-
class
|
|
1653
|
-
constructor(
|
|
1654
|
-
/**
|
|
1655
|
-
* The point halfway up the axis; half the height lies above it along Z and half below
|
|
1656
|
-
* @default [0, 0, 0]
|
|
1657
|
-
*/
|
|
1658
|
-
this.center = [0, 0, 0];
|
|
1659
|
+
class RoundedCylinderSharedDto {
|
|
1660
|
+
constructor() {
|
|
1659
1661
|
/**
|
|
1660
1662
|
* Radius of the rounding on both rims, in model units; the height must be more than twice it or
|
|
1661
1663
|
* an error is thrown
|
|
@@ -1684,11 +1686,27 @@ export var JSCAD;
|
|
|
1684
1686
|
/**
|
|
1685
1687
|
* Number of flat sides around the cylinder and pieces in the rounding; more makes it smoother
|
|
1686
1688
|
* @default 24
|
|
1687
|
-
* @minimum
|
|
1689
|
+
* @minimum 4
|
|
1688
1690
|
* @maximum Infinity
|
|
1689
1691
|
* @step 1
|
|
1690
1692
|
*/
|
|
1691
1693
|
this.segments = 24;
|
|
1694
|
+
}
|
|
1695
|
+
}
|
|
1696
|
+
JSCAD.RoundedCylinderSharedDto = RoundedCylinderSharedDto;
|
|
1697
|
+
/**
|
|
1698
|
+
* Feeds `shapes.roundedCylinder`: a cylinder standing along Z whose two rims are rounded, given by
|
|
1699
|
+
* the point halfway up its axis, the rounding radius, its height and radius and how finely it is
|
|
1700
|
+
* faceted.
|
|
1701
|
+
*/
|
|
1702
|
+
class RoundedCylidnerDto extends RoundedCylinderSharedDto {
|
|
1703
|
+
constructor(center, roundRadius, height, radius, segments) {
|
|
1704
|
+
super();
|
|
1705
|
+
/**
|
|
1706
|
+
* The point halfway up the axis; half the height lies above it along Z and half below
|
|
1707
|
+
* @default [0, 0, 0]
|
|
1708
|
+
*/
|
|
1709
|
+
this.center = [0, 0, 0];
|
|
1692
1710
|
if (center !== undefined) {
|
|
1693
1711
|
this.center = center;
|
|
1694
1712
|
}
|
|
@@ -1708,16 +1726,10 @@ export var JSCAD;
|
|
|
1708
1726
|
}
|
|
1709
1727
|
JSCAD.RoundedCylidnerDto = RoundedCylidnerDto;
|
|
1710
1728
|
/**
|
|
1711
|
-
*
|
|
1712
|
-
* its three radii and how finely it is faceted.
|
|
1729
|
+
* The size and smoothness of an ellipsoid, shared by `EllipsoidDto` and `EllipsoidCentersDto`.
|
|
1713
1730
|
*/
|
|
1714
|
-
class
|
|
1715
|
-
constructor(
|
|
1716
|
-
/**
|
|
1717
|
-
* The point the ellipsoid is centered on
|
|
1718
|
-
* @default [0, 0, 0]
|
|
1719
|
-
*/
|
|
1720
|
-
this.center = [0, 0, 0];
|
|
1731
|
+
class EllipsoidSharedDto {
|
|
1732
|
+
constructor() {
|
|
1721
1733
|
/**
|
|
1722
1734
|
* The half sizes along X, Y and Z, in model units, as `[x, y, z]`; equal values make a sphere
|
|
1723
1735
|
* @default [1, 2, 3]
|
|
@@ -1726,11 +1738,26 @@ export var JSCAD;
|
|
|
1726
1738
|
/**
|
|
1727
1739
|
* Number of facets around the ellipsoid; more makes it smoother
|
|
1728
1740
|
* @default 24
|
|
1729
|
-
* @minimum
|
|
1741
|
+
* @minimum 4
|
|
1730
1742
|
* @maximum Infinity
|
|
1731
1743
|
* @step 1
|
|
1732
1744
|
*/
|
|
1733
1745
|
this.segments = 24;
|
|
1746
|
+
}
|
|
1747
|
+
}
|
|
1748
|
+
JSCAD.EllipsoidSharedDto = EllipsoidSharedDto;
|
|
1749
|
+
/**
|
|
1750
|
+
* Feeds `shapes.ellipsoid`: a sphere stretched separately along X, Y and Z, given by its center,
|
|
1751
|
+
* its three radii and how finely it is faceted.
|
|
1752
|
+
*/
|
|
1753
|
+
class EllipsoidDto extends EllipsoidSharedDto {
|
|
1754
|
+
constructor(center, radius, segments) {
|
|
1755
|
+
super();
|
|
1756
|
+
/**
|
|
1757
|
+
* The point the ellipsoid is centered on
|
|
1758
|
+
* @default [0, 0, 0]
|
|
1759
|
+
*/
|
|
1760
|
+
this.center = [0, 0, 0];
|
|
1734
1761
|
if (center !== undefined) {
|
|
1735
1762
|
this.center = center;
|
|
1736
1763
|
}
|
|
@@ -1747,21 +1774,9 @@ export var JSCAD;
|
|
|
1747
1774
|
* Feeds `shapes.ellipsoidsOnCenterPoints`: one ellipsoid of the same radii on every center point,
|
|
1748
1775
|
* coming back in the same order.
|
|
1749
1776
|
*/
|
|
1750
|
-
class EllipsoidCentersDto {
|
|
1777
|
+
class EllipsoidCentersDto extends EllipsoidSharedDto {
|
|
1751
1778
|
constructor(centers, radius, segments) {
|
|
1752
|
-
|
|
1753
|
-
* The half sizes of every ellipsoid along X, Y and Z, in model units, as `[x, y, z]`
|
|
1754
|
-
* @default [1, 2, 3]
|
|
1755
|
-
*/
|
|
1756
|
-
this.radius = [1, 2, 3];
|
|
1757
|
-
/**
|
|
1758
|
-
* Number of facets around each ellipsoid; more makes them smoother
|
|
1759
|
-
* @default 24
|
|
1760
|
-
* @minimum 0
|
|
1761
|
-
* @maximum Infinity
|
|
1762
|
-
* @step 1
|
|
1763
|
-
*/
|
|
1764
|
-
this.segments = 24;
|
|
1779
|
+
super();
|
|
1765
1780
|
if (centers !== undefined) {
|
|
1766
1781
|
this.centers = centers;
|
|
1767
1782
|
}
|
|
@@ -1775,16 +1790,11 @@ export var JSCAD;
|
|
|
1775
1790
|
}
|
|
1776
1791
|
JSCAD.EllipsoidCentersDto = EllipsoidCentersDto;
|
|
1777
1792
|
/**
|
|
1778
|
-
*
|
|
1779
|
-
*
|
|
1793
|
+
* The size and subdivision of a geodesic sphere, shared by `GeodesicSphereDto` and
|
|
1794
|
+
* `GeodesicSphereCentersDto`.
|
|
1780
1795
|
*/
|
|
1781
|
-
class
|
|
1782
|
-
constructor(
|
|
1783
|
-
/**
|
|
1784
|
-
* The point the sphere is centered on
|
|
1785
|
-
* @default [0, 0, 0]
|
|
1786
|
-
*/
|
|
1787
|
-
this.center = [0, 0, 0];
|
|
1796
|
+
class GeodesicSphereSharedDto {
|
|
1797
|
+
constructor() {
|
|
1788
1798
|
/**
|
|
1789
1799
|
* Distance from the center to the surface, in model units
|
|
1790
1800
|
* @default 1
|
|
@@ -1797,11 +1807,26 @@ export var JSCAD;
|
|
|
1797
1807
|
* How finely each of the twenty starting faces is subdivided; used in whole multiples of 6, at
|
|
1798
1808
|
* least 6, and higher is rounder
|
|
1799
1809
|
* @default 12
|
|
1800
|
-
* @minimum
|
|
1810
|
+
* @minimum 6
|
|
1801
1811
|
* @maximum Infinity
|
|
1802
1812
|
* @step 1
|
|
1803
1813
|
*/
|
|
1804
1814
|
this.frequency = 12;
|
|
1815
|
+
}
|
|
1816
|
+
}
|
|
1817
|
+
JSCAD.GeodesicSphereSharedDto = GeodesicSphereSharedDto;
|
|
1818
|
+
/**
|
|
1819
|
+
* Feeds `shapes.geodesicSphere`: a sphere made of evenly sized triangles, given by its center, its
|
|
1820
|
+
* radius and how finely the twenty starting faces are subdivided.
|
|
1821
|
+
*/
|
|
1822
|
+
class GeodesicSphereDto extends GeodesicSphereSharedDto {
|
|
1823
|
+
constructor(center, radius, frequency) {
|
|
1824
|
+
super();
|
|
1825
|
+
/**
|
|
1826
|
+
* The point the sphere is centered on
|
|
1827
|
+
* @default [0, 0, 0]
|
|
1828
|
+
*/
|
|
1829
|
+
this.center = [0, 0, 0];
|
|
1805
1830
|
if (center !== undefined) {
|
|
1806
1831
|
this.center = center;
|
|
1807
1832
|
}
|
|
@@ -1818,25 +1843,9 @@ export var JSCAD;
|
|
|
1818
1843
|
* Feeds `shapes.geodesicSpheresOnCenterPoints`: one geodesic sphere of the same radius on every
|
|
1819
1844
|
* center point, coming back in the same order.
|
|
1820
1845
|
*/
|
|
1821
|
-
class GeodesicSphereCentersDto {
|
|
1846
|
+
class GeodesicSphereCentersDto extends GeodesicSphereSharedDto {
|
|
1822
1847
|
constructor(centers, radius, frequency) {
|
|
1823
|
-
|
|
1824
|
-
* Distance from each center to its surface, in model units
|
|
1825
|
-
* @default 1
|
|
1826
|
-
* @minimum 0
|
|
1827
|
-
* @maximum Infinity
|
|
1828
|
-
* @step 0.1
|
|
1829
|
-
*/
|
|
1830
|
-
this.radius = 1;
|
|
1831
|
-
/**
|
|
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
|
|
1834
|
-
* @default 12
|
|
1835
|
-
* @minimum 0
|
|
1836
|
-
* @maximum Infinity
|
|
1837
|
-
* @step 0.1
|
|
1838
|
-
*/
|
|
1839
|
-
this.frequency = 12;
|
|
1848
|
+
super();
|
|
1840
1849
|
if (centers !== undefined) {
|
|
1841
1850
|
this.centers = centers;
|
|
1842
1851
|
}
|
|
@@ -1853,32 +1862,9 @@ export var JSCAD;
|
|
|
1853
1862
|
* Feeds `shapes.cylindersOnCenterPoints`: one round cylinder of the same size standing along Z on
|
|
1854
1863
|
* every center point, coming back in the same order.
|
|
1855
1864
|
*/
|
|
1856
|
-
class CylidnerCentersDto {
|
|
1865
|
+
class CylidnerCentersDto extends CylinderSharedDto {
|
|
1857
1866
|
constructor(centers, height, radius, segments) {
|
|
1858
|
-
|
|
1859
|
-
* Full length of every cylinder along Z, in model units
|
|
1860
|
-
* @default 1
|
|
1861
|
-
* @minimum 0
|
|
1862
|
-
* @maximum Infinity
|
|
1863
|
-
* @step 0.1
|
|
1864
|
-
*/
|
|
1865
|
-
this.height = 1;
|
|
1866
|
-
/**
|
|
1867
|
-
* Distance from the axis to the side of every cylinder, in model units
|
|
1868
|
-
* @default 1
|
|
1869
|
-
* @minimum 0
|
|
1870
|
-
* @maximum Infinity
|
|
1871
|
-
* @step 0.1
|
|
1872
|
-
*/
|
|
1873
|
-
this.radius = 1;
|
|
1874
|
-
/**
|
|
1875
|
-
* Number of flat sides around each cylinder; more makes them rounder
|
|
1876
|
-
* @default 24
|
|
1877
|
-
* @minimum 0
|
|
1878
|
-
* @maximum Infinity
|
|
1879
|
-
* @step 1
|
|
1880
|
-
*/
|
|
1881
|
-
this.segments = 24;
|
|
1867
|
+
super();
|
|
1882
1868
|
if (centers !== undefined) {
|
|
1883
1869
|
this.centers = centers;
|
|
1884
1870
|
}
|
|
@@ -1898,42 +1884,9 @@ export var JSCAD;
|
|
|
1898
1884
|
* Feeds `shapes.roundedCylindersOnCenterPoints`: one rounded cylinder of the same size on every
|
|
1899
1885
|
* center point, coming back in the same order.
|
|
1900
1886
|
*/
|
|
1901
|
-
class RoundedCylidnerCentersDto {
|
|
1887
|
+
class RoundedCylidnerCentersDto extends RoundedCylinderSharedDto {
|
|
1902
1888
|
constructor(centers, roundRadius, height, radius, segments) {
|
|
1903
|
-
|
|
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
|
|
1906
|
-
* @default 0.1
|
|
1907
|
-
* @minimum 0
|
|
1908
|
-
* @maximum Infinity
|
|
1909
|
-
* @step 0.1
|
|
1910
|
-
*/
|
|
1911
|
-
this.roundRadius = 0.1;
|
|
1912
|
-
/**
|
|
1913
|
-
* Full length of every cylinder along Z, in model units, rounding included
|
|
1914
|
-
* @default 1
|
|
1915
|
-
* @minimum 0
|
|
1916
|
-
* @maximum Infinity
|
|
1917
|
-
* @step 0.1
|
|
1918
|
-
*/
|
|
1919
|
-
this.height = 1;
|
|
1920
|
-
/**
|
|
1921
|
-
* Distance from the axis to the side of every cylinder, in model units
|
|
1922
|
-
* @default 1
|
|
1923
|
-
* @minimum 0
|
|
1924
|
-
* @maximum Infinity
|
|
1925
|
-
* @step 0.1
|
|
1926
|
-
*/
|
|
1927
|
-
this.radius = 1;
|
|
1928
|
-
/**
|
|
1929
|
-
* Number of flat sides around each cylinder and pieces in the rounding; more makes them
|
|
1930
|
-
* smoother
|
|
1931
|
-
* @default 24
|
|
1932
|
-
* @minimum 0
|
|
1933
|
-
* @maximum Infinity
|
|
1934
|
-
* @step 1
|
|
1935
|
-
*/
|
|
1936
|
-
this.segments = 24;
|
|
1889
|
+
super();
|
|
1937
1890
|
if (centers !== undefined) {
|
|
1938
1891
|
this.centers = centers;
|
|
1939
1892
|
}
|
|
@@ -1953,16 +1906,10 @@ export var JSCAD;
|
|
|
1953
1906
|
}
|
|
1954
1907
|
JSCAD.RoundedCylidnerCentersDto = RoundedCylidnerCentersDto;
|
|
1955
1908
|
/**
|
|
1956
|
-
*
|
|
1957
|
-
* approximate it.
|
|
1909
|
+
* The size and smoothness of a sphere, shared by `SphereDto` and `SphereCentersDto`.
|
|
1958
1910
|
*/
|
|
1959
|
-
class
|
|
1960
|
-
constructor(
|
|
1961
|
-
/**
|
|
1962
|
-
* The point the sphere is centered on
|
|
1963
|
-
* @default [0, 0, 0]
|
|
1964
|
-
*/
|
|
1965
|
-
this.center = [0, 0, 0];
|
|
1911
|
+
class SphereSharedDto {
|
|
1912
|
+
constructor() {
|
|
1966
1913
|
/**
|
|
1967
1914
|
* Distance from the center to the surface, in model units
|
|
1968
1915
|
* @default 1
|
|
@@ -1974,11 +1921,26 @@ export var JSCAD;
|
|
|
1974
1921
|
/**
|
|
1975
1922
|
* Number of facets around the sphere; more makes it rounder
|
|
1976
1923
|
* @default 24
|
|
1977
|
-
* @minimum
|
|
1924
|
+
* @minimum 4
|
|
1978
1925
|
* @maximum Infinity
|
|
1979
1926
|
* @step 1
|
|
1980
1927
|
*/
|
|
1981
1928
|
this.segments = 24;
|
|
1929
|
+
}
|
|
1930
|
+
}
|
|
1931
|
+
JSCAD.SphereSharedDto = SphereSharedDto;
|
|
1932
|
+
/**
|
|
1933
|
+
* Feeds `shapes.sphere`: a sphere given by its center point, its radius and how many facets
|
|
1934
|
+
* approximate it.
|
|
1935
|
+
*/
|
|
1936
|
+
class SphereDto extends SphereSharedDto {
|
|
1937
|
+
constructor(center, radius, segments) {
|
|
1938
|
+
super();
|
|
1939
|
+
/**
|
|
1940
|
+
* The point the sphere is centered on
|
|
1941
|
+
* @default [0, 0, 0]
|
|
1942
|
+
*/
|
|
1943
|
+
this.center = [0, 0, 0];
|
|
1982
1944
|
if (center !== undefined) {
|
|
1983
1945
|
this.center = center;
|
|
1984
1946
|
}
|
|
@@ -1995,24 +1957,9 @@ export var JSCAD;
|
|
|
1995
1957
|
* Feeds `shapes.spheresOnCenterPoints`: one sphere of the same radius on every center point, coming
|
|
1996
1958
|
* back in the same order.
|
|
1997
1959
|
*/
|
|
1998
|
-
class SphereCentersDto {
|
|
1960
|
+
class SphereCentersDto extends SphereSharedDto {
|
|
1999
1961
|
constructor(centers, radius, segments) {
|
|
2000
|
-
|
|
2001
|
-
* Distance from each center to its surface, in model units
|
|
2002
|
-
* @default 1
|
|
2003
|
-
* @minimum 0
|
|
2004
|
-
* @maximum Infinity
|
|
2005
|
-
* @step 0.1
|
|
2006
|
-
*/
|
|
2007
|
-
this.radius = 1;
|
|
2008
|
-
/**
|
|
2009
|
-
* Number of facets around each sphere; more makes them rounder
|
|
2010
|
-
* @default 24
|
|
2011
|
-
* @minimum 0
|
|
2012
|
-
* @maximum Infinity
|
|
2013
|
-
* @step 1
|
|
2014
|
-
*/
|
|
2015
|
-
this.segments = 24;
|
|
1962
|
+
super();
|
|
2016
1963
|
if (centers !== undefined) {
|
|
2017
1964
|
this.centers = centers;
|
|
2018
1965
|
}
|
|
@@ -2041,6 +1988,7 @@ export var JSCAD;
|
|
|
2041
1988
|
* Radius of the tube itself, in model units; it must be less than `outerRadius`
|
|
2042
1989
|
* @default 1
|
|
2043
1990
|
* @minimum 0
|
|
1991
|
+
* @exclusiveMinimum true
|
|
2044
1992
|
* @maximum Infinity
|
|
2045
1993
|
* @step 0.1
|
|
2046
1994
|
*/
|
|
@@ -2050,6 +1998,7 @@ export var JSCAD;
|
|
|
2050
1998
|
* twice the sum of both radii
|
|
2051
1999
|
* @default 2
|
|
2052
2000
|
* @minimum 0
|
|
2001
|
+
* @exclusiveMinimum true
|
|
2053
2002
|
* @maximum Infinity
|
|
2054
2003
|
* @step 0.1
|
|
2055
2004
|
*/
|
|
@@ -2057,7 +2006,7 @@ export var JSCAD;
|
|
|
2057
2006
|
/**
|
|
2058
2007
|
* Number of flat pieces around the tube's cross-section; more makes the tube rounder
|
|
2059
2008
|
* @default 24
|
|
2060
|
-
* @minimum
|
|
2009
|
+
* @minimum 3
|
|
2061
2010
|
* @maximum Infinity
|
|
2062
2011
|
* @step 1
|
|
2063
2012
|
*/
|
|
@@ -2065,7 +2014,7 @@ export var JSCAD;
|
|
|
2065
2014
|
/**
|
|
2066
2015
|
* Number of flat pieces around the ring; more makes the ring rounder
|
|
2067
2016
|
* @default 24
|
|
2068
|
-
* @minimum
|
|
2017
|
+
* @minimum 3
|
|
2069
2018
|
* @maximum Infinity
|
|
2070
2019
|
* @step 1
|
|
2071
2020
|
*/
|
|
@@ -2083,7 +2032,8 @@ export var JSCAD;
|
|
|
2083
2032
|
* How far the tube is swept around the ring, in degrees; 360 closes the ring and less leaves it
|
|
2084
2033
|
* open
|
|
2085
2034
|
* @default 360
|
|
2086
|
-
* @minimum
|
|
2035
|
+
* @minimum 0
|
|
2036
|
+
* @exclusiveMinimum true
|
|
2087
2037
|
* @maximum Infinity
|
|
2088
2038
|
* @step 1
|
|
2089
2039
|
*/
|
|
@@ -2091,7 +2041,7 @@ export var JSCAD;
|
|
|
2091
2041
|
/**
|
|
2092
2042
|
* Where the sweep around the ring starts, in degrees from the X axis
|
|
2093
2043
|
* @default 0
|
|
2094
|
-
* @minimum
|
|
2044
|
+
* @minimum 0
|
|
2095
2045
|
* @maximum Infinity
|
|
2096
2046
|
* @step 1
|
|
2097
2047
|
*/
|
|
@@ -2263,7 +2213,7 @@ export var JSCAD;
|
|
|
2263
2213
|
* Number of flat sides around each cylinder and pieces in curved strokes; more makes the
|
|
2264
2214
|
* letters rounder
|
|
2265
2215
|
* @default 24
|
|
2266
|
-
* @minimum
|
|
2216
|
+
* @minimum 4
|
|
2267
2217
|
* @maximum Infinity
|
|
2268
2218
|
* @step 1
|
|
2269
2219
|
*/
|
|
@@ -2384,7 +2334,7 @@ export var JSCAD;
|
|
|
2384
2334
|
* Number of facets around each sphere and pieces in curved strokes; more makes the letters
|
|
2385
2335
|
* rounder
|
|
2386
2336
|
* @default 24
|
|
2387
|
-
* @minimum
|
|
2337
|
+
* @minimum 4
|
|
2388
2338
|
* @maximum Infinity
|
|
2389
2339
|
* @step 1
|
|
2390
2340
|
*/
|