kittycad-modeling-cmds 0.2.191

Commands in the KittyCAD Modeling API
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
use kittycad_modeling_cmds_macros::define_modeling_cmd_enum;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};

pub use self::each_cmd::*;
use crate::{self as kittycad_modeling_cmds};

define_modeling_cmd_enum! {
    pub mod each_cmd {
        use std::collections::HashSet;

        use bon::Builder;
        use crate::{self as kittycad_modeling_cmds};
        use kittycad_modeling_cmds_macros::{ModelingCmdVariant};
        use parse_display_derive::{Display, FromStr};
        use schemars::JsonSchema;
        use serde::{Deserialize, Serialize};
        use uuid::Uuid;
        use crate::shared::CameraViewState;
        use crate::shared::MirrorAcross;

        use crate::{
            format::{OutputFormat2d, OutputFormat3d},
            id::ModelingCmdId,
            length_unit::LengthUnit,
            shared::{
                Angle,
                RegionVersion,
                BlendType,
                BodyType,
                ComponentTransform,
                RelativeTo,
                CutType, CutTypeV2,
                CutStrategy,
                CameraMovement,
                ExtrudedFaceInfo, ExtrudeMethod,
                AnnotationOptions, AnnotationType, CameraDragInteractionType, Color, DistanceType, EntityType,
                PathComponentConstraintBound, PathComponentConstraintType, PathSegment, PerspectiveCameraParameters,
                Point2d, Point3d, ExtrudeReference, SceneSelectionType, SceneToolType, SurfaceEdgeReference, Opposite,
            },
            units,
        };

        /// Mike says this usually looks nice.
        fn default_animation_seconds() -> f64 {
            0.4
        }

        fn mm() -> crate::units::UnitLength {
            crate::units::UnitLength::Millimeters
        }

        /// Evaluates the position of a path in one shot (engine utility for kcl executor)
        #[derive(
            Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
        )]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct EngineUtilEvaluatePath {
            /// The path in json form (the serialized result of the kcl Sketch/Path object
            pub path_json: String,

            /// The evaluation parameter (path curve parameter in the normalized domain [0, 1])
            pub t: f64,
        }

        /// Start a new path.
        #[derive(
            Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant,
            Builder
        )]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct StartPath {}

        /// Move the path's "pen".
        /// If you're in sketch mode, these coordinates are in the local coordinate system,
        /// not the world's coordinate system.
        /// For example, say you're sketching on the plane {x: (1,0,0), y: (0,1,0), origin: (0, 0, 50)}.
        /// In other words, the plane 50 units above the default XY plane. Then, moving the pen
        /// to (1, 1, 0) with this command uses local coordinates. So, it would move the pen to
        /// (1, 1, 50) in global coordinates.
        #[derive(
            Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
        )]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct MovePathPen {
            /// The ID of the command which created the path.
            pub path: ModelingCmdId,
            /// Where the path's pen should be.
            pub to: Point3d<LengthUnit>,
        }

        /// Extend a path by adding a new segment which starts at the path's "pen".
        /// If no "pen" location has been set before (via `MovePen`), then the pen is at the origin.
        #[derive(
            Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
        )]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct ExtendPath {
            /// The ID of the command which created the path.
            pub path: ModelingCmdId,
            /// Segment to append to the path.
            /// This segment will implicitly begin at the current "pen" location.
            pub segment: PathSegment,
            /// Optional label to associate with the new path segment.
            #[serde(default, skip_serializing_if = "Option::is_none")]
            pub label: Option<String>,
        }

        /// Command for extruding a solid 2d.
        #[derive(
            Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
        )]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct Extrude {
            /// Which sketch to extrude.
            /// Must be a closed 2D solid.
            pub target: ModelingCmdId,
            /// How far off the plane to extrude
            pub distance: LengthUnit,
            /// Which IDs should the new faces have?
            /// If this isn't given, the engine will generate IDs.
            #[serde(default)]
            pub faces: Option<ExtrudedFaceInfo>,
            /// Should the extrusion also extrude in the opposite direction?
            /// If so, this specifies its distance.
            #[serde(default)]
            #[builder(default)]
            pub opposite: Opposite<LengthUnit>,
            /// Should the extrusion create a new object or be part of the existing object.
            #[builder(default)]
            #[serde(default)]
            pub extrude_method: ExtrudeMethod,
            /// Only used if the extrusion is created from a face and extrude_method = Merge
            /// If true, coplanar faces will be merged and seams will be hidden.
            /// Otherwise, seams between the extrusion and original body will be shown.
            #[serde(default, skip_serializing_if = "Option::is_none")]
            pub merge_coplanar_faces: Option<bool>,

            /// Should this extrude create a solid body or a surface?
            #[serde(default)]
            #[builder(default)]
            pub body_type: BodyType,
        }

        /// Command for extruding a solid 2d to a reference geometry.
        #[derive(
            Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
        )]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct ExtrudeToReference {
            /// Which sketch to extrude.
            /// Must be a closed 2D solid.
            pub target: ModelingCmdId,
            /// Reference to extrude to.
            /// Extrusion occurs along the target's normal until it is as close to the reference as possible.
            pub reference: ExtrudeReference,
            /// Which IDs should the new faces have?
            /// If this isn't given, the engine will generate IDs.
            #[serde(default)]
            pub faces: Option<ExtrudedFaceInfo>,
            /// Should the extrusion create a new object or be part of the existing object.
            #[serde(default)]
            #[builder(default)]
            pub extrude_method: ExtrudeMethod,
            /// Should this extrude create a solid body or a surface?
            #[serde(default)]
            #[builder(default)]
            pub body_type: BodyType,
        }

        fn default_twist_extrude_section_interval() -> Angle {
            Angle::from_degrees(15.0)
        }

        /// Command for twist extruding a solid 2d.
        #[derive(
            Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
        )]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct TwistExtrude {
            /// Which sketch to extrude.
            /// Must be a closed 2D solid.
            pub target: ModelingCmdId,
            /// How far off the plane to extrude
            pub distance: LengthUnit,
            /// Which IDs should the new faces have?
            /// If this isn't given, the engine will generate IDs.
            #[serde(default)]
            pub faces: Option<ExtrudedFaceInfo>,
            /// Center to twist about (relative to plane's origin)
            /// Defaults to `[0, 0]` i.e. the plane's origin
            #[serde(default)]
            #[builder(default)]
            pub center_2d: Point2d<f64>,
            /// Total rotation of the section
            pub total_rotation_angle: Angle,
            /// Angle step interval (converted to whole number degrees and bounded between 4° and 90°)
            #[serde(default = "default_twist_extrude_section_interval")]
            #[builder(default = default_twist_extrude_section_interval())]
            pub angle_step_size: Angle,
            /// The twisted surface loft tolerance
            pub tolerance: LengthUnit,
            /// Should this extrude create a solid body or a surface?
            #[serde(default)]
            #[builder(default)]
            pub body_type: BodyType,
        }

        /// Extrude the object along a path.
        #[derive(
            Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder
        )]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct Sweep {
            /// Which sketch to sweep.
            /// Must be a closed 2D solid.
            pub target: ModelingCmdId,
            /// Path along which to sweep.
            pub trajectory: ModelingCmdId,
            /// If true, the sweep will be broken up into sub-sweeps (extrusions, revolves, sweeps) based on the trajectory path components.
            pub sectional: bool,
            /// The maximum acceptable surface gap computed between the revolution surface joints. Must be positive (i.e. greater than zero).
            pub tolerance: LengthUnit,
            /// Should this sweep create a solid body or a surface?
            #[serde(default)]
            #[builder(default)]
            pub body_type: BodyType,
            /// What is this sweep relative to?
            #[serde(default)]
            #[builder(default)]
            pub relative_to: RelativeTo,
            /// What version of the sweeping algorithm to use. If None, or zero, the engine's
            /// default algorithm will be used
            #[serde(default, skip_serializing_if = "Option::is_none")]
            pub version: Option<u8>,
        }

        /// Command for revolving a solid 2d.
        #[derive(
            Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
        )]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct Revolve {
            /// Which sketch to revolve.
            /// Must be a closed 2D solid.
            pub target: ModelingCmdId,
            /// The origin of the extrusion axis
            pub origin: Point3d<LengthUnit>,
            /// The axis of the extrusion (taken from the origin)
            pub axis: Point3d<f64>,
            /// If true, the axis is interpreted within the 2D space of the solid 2D's plane
            pub axis_is_2d: bool,
            /// The signed angle of revolution (in degrees, must be <= 360 in either direction)
            pub angle: Angle,
            /// The maximum acceptable surface gap computed between the revolution surface joints. Must be positive (i.e. greater than zero).
            pub tolerance: LengthUnit,
            /// Should the revolution also revolve in the opposite direction along the given axis?
            /// If so, this specifies its angle.
            #[serde(default)]
            #[builder(default)]
            pub opposite: Opposite<Angle>,
            /// Should this extrude create a solid body or a surface?
            #[serde(default)]
            #[builder(default)]
            pub body_type: BodyType,
        }

        /// Command for shelling a solid3d face
        #[derive(
            Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
        )]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct Solid3dShellFace {
            /// Which Solid3D is being shelled.
            pub object_id: Uuid,
            /// Which faces to remove, leaving only the shell.
            pub face_ids: Vec<Uuid>,
            /// How thick the shell should be.
            /// Smaller values mean a thinner shell.
            pub shell_thickness: LengthUnit,
            /// If true, the Solid3D is made hollow instead of removing the selected faces
            #[serde(default)]
            #[builder(default)]
            pub hollow: bool,
        }

        /// Command for joining a Surface (non-manifold) body back to a Solid.
        /// All of the surfaces should already be contained within the body mated topologically.
        /// This operation should be the final step after a sequence of Solid modeling commands such as
        /// BooleanImprint, EntityDeleteChildren, Solid3dFlipFace
        /// If successful, the new body type will become "Solid".
        #[derive(
            Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
        )]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct Solid3dJoin {
            /// Which Solid3D is being joined.
            pub object_id: Uuid,
        }

        /// Command for joining multiple Surfaces (non-manifold) to a Solid.
        #[derive(
            Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
        )]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct Solid3dMultiJoin {
            /// Which bodies are being joined.
            pub object_ids: Vec<Uuid>,
            /// The maximum acceptable surface gap computed between the joints. Must be positive (i.e. greater than zero).
            pub tolerance: LengthUnit,
        }


        /// Command for creating a blend between the edge of two given surfaces
        #[derive(
            Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
        )]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct SurfaceBlend {
            /// The two surfaces that the blend will span between
            #[schemars(length(min = 2, max = 2))]
            pub surfaces: Vec<SurfaceEdgeReference>,
            /// The type of blend to use.
            #[serde(default)]
            #[builder(default)]
            pub blend_type: BlendType,
        }

        /// What is the UUID of this body's n-th edge?
        #[derive(
            Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
        )]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct Solid3dGetEdgeUuid {
            /// The Solid3D parent who owns the edge
            pub object_id: Uuid,

            /// The primitive index of the edge being queried.
            pub edge_index: u32,
        }

        /// What is the UUID of this body's n-th face?
        #[derive(
            Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
        )]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct Solid3dGetFaceUuid {
            /// The Solid3D parent who owns the face
            pub object_id: Uuid,

            /// The primitive index of the face being queried.
            pub face_index: u32,
        }

        /// Retrieves the body type.
        #[derive(
            Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
        )]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct Solid3dGetBodyType {
            /// The Solid3D whose body type is being queried.
            pub object_id: Uuid,
        }

        /// Command for revolving a solid 2d about a brep edge
        #[derive(
            Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
        )]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct RevolveAboutEdge {
            /// Which sketch to revolve.
            /// Must be a closed 2D solid.
            pub target: ModelingCmdId,
            /// The edge to use as the axis of revolution, must be linear and lie in the plane of the solid
            pub edge_id: Uuid,
            /// The signed angle of revolution (in degrees, must be <= 360 in either direction)
            pub angle: Angle,
            /// The maximum acceptable surface gap computed between the revolution surface joints. Must be positive (i.e. greater than zero).
            pub tolerance: LengthUnit,
            /// Should the revolution also revolve in the opposite direction along the given axis?
            /// If so, this specifies its angle.
            #[serde(default)]
            #[builder(default)]
            pub opposite: Opposite<Angle>,
            /// Should this extrude create a solid body or a surface?
            #[serde(default)]
            #[builder(default)]
            pub body_type: BodyType,
        }

        /// Command for lofting sections to create a solid
        #[derive(
            Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
        )]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct Loft {
            /// The closed section curves to create a lofted solid from.
            /// Currently, these must be Solid2Ds
            pub section_ids: Vec<Uuid>,
            /// Degree of the interpolation. Must be greater than zero.
            /// For example, use 2 for quadratic, or 3 for cubic interpolation in the V direction.
            pub v_degree: std::num::NonZeroU32,
            /// Attempt to approximate rational curves (such as arcs) using a bezier.
            /// This will remove banding around interpolations between arcs and non-arcs.  It may produce errors in other scenarios
            /// Over time, this field won't be necessary.
            pub bez_approximate_rational: bool,
            /// This can be set to override the automatically determined topological base curve, which is usually the first section encountered.
            pub base_curve_index: Option<u32>,
            /// Tolerance
            pub tolerance: LengthUnit,
            /// Should this loft create a solid body or a surface?
            #[serde(default)]
            #[builder(default)]
            pub body_type: BodyType,
        }


        /// Closes a path, converting it to a 2D solid.
        #[derive(
            Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
        )]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct ClosePath {
            /// Which path to close.
            pub path_id: Uuid,
        }

        /// Camera drag started.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct CameraDragStart {
            /// The type of camera drag interaction.
            pub interaction: CameraDragInteractionType,
            /// The initial mouse position.
            pub window: Point2d,
        }

        /// Camera drag continued.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct CameraDragMove {
            /// The type of camera drag interaction.
            pub interaction: CameraDragInteractionType,
            /// The current mouse position.
            pub window: Point2d,
            /// Logical timestamp. The client should increment this
            /// with every event in the current mouse drag. That way, if the
            /// events are being sent over an unordered channel, the API
            /// can ignore the older events.
            pub sequence: Option<u32>,
        }

        /// Camera drag ended
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct CameraDragEnd {
            /// The type of camera drag interaction.
            pub interaction: CameraDragInteractionType,
            /// The final mouse position.
            pub window: Point2d,
        }

        /// Gets the default camera's camera settings
        #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct DefaultCameraGetSettings {}

        /// Gets the default camera's view state
        #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct DefaultCameraGetView {}

        /// Sets the default camera's view state
        #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct DefaultCameraSetView {
            /// Camera view state
            pub view: CameraViewState,
        }

        /// Change what the default camera is looking at.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct DefaultCameraLookAt {
            /// Where the camera is positioned
            pub vantage: Point3d,
            /// What the camera is looking at. Center of the camera's field of vision
            pub center: Point3d,
            /// Which way is "up", from the camera's point of view.
            pub up: Point3d,
            /// Logical timestamp. The client should increment this
            /// with every event in the current mouse drag. That way, if the
            /// events are being sent over an unordered channel, the API
            /// can ignore the older events.
            pub sequence: Option<u32>,
        }

        /// Change what the default camera is looking at.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct DefaultCameraPerspectiveSettings {
            /// Where the camera is positioned
            pub vantage: Point3d,
            /// What the camera is looking at. Center of the camera's field of vision
            pub center: Point3d,
            /// Which way is "up", from the camera's point of view.
            pub up: Point3d,
            /// The field of view angle in the y direction, in degrees.
            pub fov_y: Option<f32>,
            /// The distance to the near clipping plane.
            pub z_near: Option<f32>,
            /// The distance to the far clipping plane.
            pub z_far: Option<f32>,
            /// Logical timestamp. The client should increment this
            /// with every event in the current mouse drag. That way, if the
            /// events are being sent over an unordered channel, the API
            /// can ignore the older events.
            pub sequence: Option<u32>,
        }

        /// Adjust zoom of the default camera.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct DefaultCameraZoom {
            /// Move the camera forward along the vector it's looking at,
            /// by this magnitudedefaultCameraZoom.
            /// Basically, how much should the camera move forward by.
            pub magnitude: f32,
        }

        /// Export a sketch to a file.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct Export2d {
            /// IDs of the entities to be exported.
            pub entity_ids: Vec<Uuid>,
            /// The file format to export to.
            pub format: OutputFormat2d,
        }

        /// Export the scene to a file.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct Export3d {
            /// IDs of the entities to be exported. If this is empty, then all entities are exported.
            #[builder(default)]
            pub entity_ids: Vec<Uuid>,
            /// The file format to export to.
            pub format: OutputFormat3d,
        }

        /// Export the scene to a file.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct Export {
            /// IDs of the entities to be exported. If this is empty, then all entities are exported.
            #[builder(default)]
            pub entity_ids: Vec<Uuid>,
            /// The file format to export to.
            pub format: OutputFormat3d,
        }

        /// What is this entity's parent?
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct EntityGetParentId {
            /// ID of the entity being queried.
            pub entity_id: Uuid,
        }

        /// How many children does the entity have?
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct EntityGetNumChildren {
            /// ID of the entity being queried.
            pub entity_id: Uuid,
        }

        /// What is the UUID of this entity's n-th child?
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct EntityGetChildUuid {
            /// ID of the entity being queried.
            pub entity_id: Uuid,
            /// Index into the entity's list of children.
            pub child_index: u32,
        }

        /// What is this entity's child index within its parent
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct EntityGetIndex {
            /// ID of the entity being queried.
            pub entity_id: Uuid,
        }

        /// What is this edge or face entity's primitive index within its parent body's edges or faces array respectively
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct EntityGetPrimitiveIndex {
            /// ID of the entity being queried.
            pub entity_id: Uuid,
        }

        /// Attempts to delete children entity from an entity.
        /// Note that this API may change the body type of certain entities from Solid to Surface.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct EntityDeleteChildren {
            /// ID of the entity being modified
            pub entity_id: Uuid,
            /// ID of the entity's child being deleted
            pub child_entity_ids: HashSet<Uuid>,
        }

        /// What are all UUIDs of this entity's children?
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct EntityGetAllChildUuids {
            /// ID of the entity being queried.
            pub entity_id: Uuid,
        }

        /// What are all UUIDs of all the paths sketched on top of this entity?
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct EntityGetSketchPaths {
            /// ID of the entity being queried.
            pub entity_id: Uuid,
        }

        /// What is the distance between these two entities?
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct EntityGetDistance {
            /// ID of the first entity being queried.
            pub entity_id1: Uuid,
            /// ID of the second entity being queried.
            pub entity_id2: Uuid,
            /// Type of distance to be measured.
            pub distance_type: DistanceType,
        }

        /// Create a pattern using this entity by specifying the transform for each desired repetition.
        /// Transformations are performed in the following order (first applied to last applied): scale, rotate, translate.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct EntityClone {
            /// ID of the entity being cloned.
            pub entity_id: Uuid,
        }

        /// Create a pattern using this entity by specifying the transform for each desired repetition.
        /// Transformations are performed in the following order (first applied to last applied): scale, rotate, translate.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct EntityLinearPatternTransform {
            /// ID of the entity being copied.
            pub entity_id: Uuid,
            /// How to transform each repeated solid.
            /// The 0th transform will create the first copy of the entity.
            /// The total number of (optional) repetitions equals the size of this list.
            #[serde(default)]
            #[builder(default)]
            pub transform: Vec<crate::shared::Transform>,
            /// Alternatively, you could set this key instead.
            /// If you want to use multiple transforms per item.
            /// If this is non-empty then the `transform` key must be empty, and vice-versa.
            #[serde(default)]
            #[builder(default)]
            pub transforms: Vec<Vec<crate::shared::Transform>>,
        }

        /// Create a linear pattern using this entity.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct EntityLinearPattern {
            /// ID of the entity being copied.
            pub entity_id: Uuid,
            /// Axis along which to make the copies.
            /// For Solid2d patterns, the z component is ignored.
            pub axis: Point3d<f64>,
            /// Number of repetitions to make.
            pub num_repetitions: u32,
            /// Spacing between repetitions.
            pub spacing: LengthUnit,
        }
        /// Create a circular pattern using this entity.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct EntityCircularPattern {
            /// ID of the entity being copied.
            pub entity_id: Uuid,
            /// Axis around which to make the copies.
            /// For Solid2d patterns, this is ignored.
            pub axis: Point3d<f64>,
            /// Point around which to make the copies.
            /// For Solid2d patterns, the z component is ignored.
            pub center: Point3d<LengthUnit>,
            /// Number of repetitions to make.
            pub num_repetitions: u32,
            /// Arc angle (in degrees) to place repetitions along.
            pub arc_degrees: f64,
            /// Whether or not to rotate the objects as they are copied.
            pub rotate_duplicates: bool,
        }

        /// Create a helix using the input cylinder and other specified parameters.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct EntityMakeHelix {
            /// ID of the cylinder.
            pub cylinder_id: Uuid,
            /// Number of revolutions.
            pub revolutions: f64,
            /// Start angle.
            #[serde(default)]
            #[builder(default)]
            pub start_angle: Angle,
            /// Is the helix rotation clockwise?
            pub is_clockwise: bool,
            /// Length of the helix. If None, the length of the cylinder will be used instead.
            pub length: Option<LengthUnit>,
        }

        /// Create a helix using the specified parameters.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct EntityMakeHelixFromParams {
            /// Radius of the helix.
            pub radius: LengthUnit,
            /// Length of the helix.
            pub length: LengthUnit,
            /// Number of revolutions.
            pub revolutions: f64,
            /// Start angle.
            #[serde(default)]
            #[builder(default)]
            pub start_angle: Angle,
            /// Is the helix rotation clockwise?
            pub is_clockwise: bool,
            /// Center of the helix at the base of the helix.
            pub center: Point3d<LengthUnit>,
            /// Axis of the helix. The helix will be created around and in the direction of this axis.
            pub axis: Point3d<f64>,
        }

        /// Create a helix using the specified parameters.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct EntityMakeHelixFromEdge {
            /// Radius of the helix.
            pub radius: LengthUnit,
            /// Length of the helix. If None, the length of the edge will be used instead.
            pub length: Option<LengthUnit>,
            /// Number of revolutions.
            pub revolutions: f64,
            /// Start angle.
            #[serde(default)]
            #[builder(default)]
            pub start_angle: Angle,
            /// Is the helix rotation clockwise?
            pub is_clockwise: bool,
            /// Edge about which to make the helix.
            pub edge_id: Uuid,
        }

        /// Mirror the input entities over the specified axis, edge, or plane.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct EntityMirrorAcross {
            /// ID of the mirror entities.
            pub ids: Vec<Uuid>,
            /// What to mirror across
            pub across: MirrorAcross,
        }


        /// Mirror the input entities over the specified axis.
        /// Deprecated; please use `EntityMirrorAcross`
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct EntityMirror {
            /// ID of the mirror entities.
            pub ids: Vec<Uuid>,
            /// Axis to use as mirror.
            pub axis: Point3d<f64>,
            /// Point through which the mirror axis passes.
            pub point: Point3d<LengthUnit>,
        }

        /// Mirror the input entities over the specified edge.
        /// Deprecated; please use `EntityMirrorAcross`
        #[derive(
            Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
        )]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct EntityMirrorAcrossEdge {
            /// ID of the mirror entities.
            pub ids: Vec<Uuid>,
            /// The edge to use as the mirror axis, must be linear and lie in the plane of the solid
            pub edge_id: Uuid,
        }

        /// Modifies the selection by simulating a "mouse click" at the given x,y window coordinate
        /// Returns ID of whatever was selected.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct SelectWithPoint {
            /// Where in the window was selected
            pub selected_at_window: Point2d,
            /// What entity was selected?
            pub selection_type: SceneSelectionType,
        }

        /// Adds one or more entities (by UUID) to the selection.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct SelectAdd {
            /// Which entities to select
            pub entities: Vec<Uuid>,
        }

        /// Removes one or more entities (by UUID) from the selection.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct SelectRemove {
            /// Which entities to unselect
            pub entities: Vec<Uuid>,
        }

        /// Removes all of the Objects in the scene
        #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct SceneClearAll {}

        /// Replaces current selection with these entities (by UUID).
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct SelectReplace {
            /// Which entities to select
            pub entities: Vec<Uuid>,
        }

        /// Changes the current highlighted entity to whichever one is at the given window coordinate.
        /// If there's no entity at this location, clears the highlight.
        #[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct HighlightSetEntity {
            /// Coordinates of the window being clicked
            pub selected_at_window: Point2d,
            /// Logical timestamp. The client should increment this
            /// with every event in the current mouse drag. That way, if the
            /// events are being sent over an unordered channel, the API
            /// can ignore the older events.
            pub sequence: Option<u32>,
        }

        /// Changes the current highlighted entity to these entities.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct HighlightSetEntities {
            /// Highlight these entities.
            pub entities: Vec<Uuid>,
        }

        /// Create a new annotation
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct NewAnnotation {
            /// What should the annotation contain?
            pub options: AnnotationOptions,
            /// If true, any existing drawables within the obj will be replaced (the object will be reset)
            pub clobber: bool,
            /// What type of annotation to create.
            pub annotation_type: AnnotationType,
        }

        /// Update an annotation
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct UpdateAnnotation {
            /// Which annotation to update
            pub annotation_id: Uuid,
            /// If any of these fields are set, they will overwrite the previous options for the
            /// annotation.
            pub options: AnnotationOptions,
        }

        /// Changes visibility of scene-wide edge lines on brep solids
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct EdgeLinesVisible {
            /// Whether or not the edge lines should be hidden.
            pub hidden: bool,
        }

        /// Hide or show an object
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct ObjectVisible {
            /// Which object to change
            pub object_id: Uuid,
            /// Whether or not the object should be hidden.
            pub hidden: bool,
        }

        /// Bring an object to the front of the scene
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct ObjectBringToFront {
            /// Which object to change
            pub object_id: Uuid,
        }

        /// Set the material properties of an object
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct ObjectSetMaterialParamsPbr {
            /// Which object to change
            pub object_id: Uuid,
            /// Color of the new material
            pub color: Color,
            /// Metalness of the new material
            pub metalness: f32,
            /// Roughness of the new material
            pub roughness: f32,
            /// Ambient Occlusion of the new material
            pub ambient_occlusion: f32,
            /// Color of the backface
            #[serde(default, skip_serializing_if = "Option::is_none")]
            pub backface_color: Option<Color>,
        }
        /// What type of entity is this?
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct GetEntityType {
            /// ID of the entity being queried.
            pub entity_id: Uuid,
        }

        /// Gets all faces which use the given edge.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct Solid3dGetAllEdgeFaces {
            /// Which object is being queried.
            pub object_id: Uuid,
            /// Which edge you want the faces of.
            pub edge_id: Uuid,
        }

        /// Flips (reverses) a brep that is "inside-out".
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct Solid3dFlip {
            /// Which object is being flipped.
            pub object_id: Uuid,
        }

        /// Flips (reverses) a face.  If the solid3d body type is "Solid",
        /// then body type will become non-manifold ("Surface").
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct Solid3dFlipFace {
            /// Which object is being queried.
            pub object_id: Uuid,
            /// Which face you want to flip.
            pub face_id: Uuid,
        }

        /// Add a hole to a Solid2d object before extruding it.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct Solid2dAddHole {
            /// Which object to add the hole to.
            pub object_id: Uuid,
            /// The id of the path to use as the inner profile (hole).
            pub hole_id: Uuid,
        }

        /// Gets all edges which are opposite the given edge, across all possible faces.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct Solid3dGetAllOppositeEdges {
            /// Which object is being queried.
            pub object_id: Uuid,
            /// Which edge you want the opposites of.
            pub edge_id: Uuid,
            /// If given, only faces parallel to this vector will be considered.
            pub along_vector: Option<Point3d<f64>>,
        }

        /// Gets the edge opposite the given edge, along the given face.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct Solid3dGetOppositeEdge {
            /// Which object is being queried.
            pub object_id: Uuid,
            /// Which edge you want the opposite of.
            pub edge_id: Uuid,
            /// Which face is used to figure out the opposite edge?
            pub face_id: Uuid,
        }

        /// Gets the next adjacent edge for the given edge, along the given face.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct Solid3dGetNextAdjacentEdge {
            /// Which object is being queried.
            pub object_id: Uuid,
            /// Which edge you want the opposite of.
            pub edge_id: Uuid,
            /// Which face is used to figure out the opposite edge?
            pub face_id: Uuid,
        }

        /// Gets the previous adjacent edge for the given edge, along the given face.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct Solid3dGetPrevAdjacentEdge {
            /// Which object is being queried.
            pub object_id: Uuid,
            /// Which edge you want the opposite of.
            pub edge_id: Uuid,
            /// Which face is used to figure out the opposite edge?
            pub face_id: Uuid,
        }

        /// Gets the shared edge between these two faces if it exists
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct Solid3dGetCommonEdge {
            /// Which object is being queried.
            pub object_id: Uuid,
            /// The faces being queried
            pub face_ids: [Uuid; 2]
        }

        /// Fillets the given edge with the specified radius.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct Solid3dFilletEdge {
            /// Which object is being filletted.
            pub object_id: Uuid,
            /// Which edge you want to fillet.
            #[serde(default)]
            pub edge_id: Option<Uuid>,
            /// Which edges you want to fillet.
            #[serde(default)]
            #[builder(default)]
            pub edge_ids: Vec<Uuid>,
            /// The radius of the fillet. Measured in length (using the same units that the current sketch uses). Must be positive (i.e. greater than zero).
            pub radius: LengthUnit,
            /// The maximum acceptable surface gap computed between the filleted surfaces. Must be positive (i.e. greater than zero).
            pub tolerance: LengthUnit,
            /// How to apply the cut.
            #[serde(default)]
            #[builder(default)]
            pub cut_type: CutType,
            /// Which cutting algorithm to use.
            #[serde(default)]
            #[builder(default)]
            pub strategy: CutStrategy,
            /// What IDs should the resulting faces have?
            /// If you've only passed one edge ID, its ID will
            /// be the command ID used to send this command, and this
            /// field should be empty.
            /// If you've passed `n` IDs (to fillet `n` edges), then
            /// this should be length `n-1`, and the first edge will use
            /// the command ID used to send this command.
            #[serde(default)]
            #[builder(default)]
            pub extra_face_ids: Vec<Uuid>,
            /// If true, use the legacy CSG algorithm.
            #[serde(default, skip_serializing_if = "super::is_false")]
            #[builder(default)]
            pub use_legacy: bool,
        }

        /// Cut the list of given edges with the given cut parameters.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct Solid3dCutEdges {
            /// Which object is being cut.
            pub object_id: Uuid,
            /// Which edges you want to cut.
            #[serde(default)]
            #[builder(default)]
            pub edge_ids: Vec<Uuid>,
            /// The cut type and information required to perform the cut.
            pub cut_type: CutTypeV2,
            /// The maximum acceptable surface gap computed between the cut surfaces. Must be
            /// positive (i.e. greater than zero).
            pub tolerance: LengthUnit,
            /// Which cutting algorithm to use.
            #[serde(default)]
            #[builder(default)]
            pub strategy: CutStrategy,
            /// What IDs should the resulting faces have?
            /// If you've only passed one edge ID, its ID will
            /// be the command ID used to send this command, and this
            /// field should be empty.
            /// If you've passed `n` IDs (to cut `n` edges), then
            /// this should be length `n-1`, and the first edge will use
            /// the command ID used to send this command.
            #[serde(default)]
            #[builder(default)]
            pub extra_face_ids: Vec<Uuid>,
            /// If true, use the legacy CSG algorithm.
            #[serde(default, skip_serializing_if = "super::is_false")]
            #[builder(default)]
            pub use_legacy: bool,
        }

        /// Determines whether a brep face is planar and returns its surface-local planar axes if so
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct FaceIsPlanar {
            /// Which face is being queried.
            pub object_id: Uuid,
        }

        /// Determines a position on a brep face evaluated by parameters u,v
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct FaceGetPosition {
            /// Which face is being queried.
            pub object_id: Uuid,

            /// The 2D parameter-space u,v position to evaluate the surface at
            pub uv: Point2d<f64>,
        }

        ///Obtains the surface "center of mass"
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct FaceGetCenter {
            /// Which face is being queried.
            pub object_id: Uuid,
        }

        /// Determines the gradient (dFdu, dFdv) + normal vector on a brep face evaluated by parameters u,v
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct FaceGetGradient {
            /// Which face is being queried.
            pub object_id: Uuid,

            /// The 2D parameter-space u,v position to evaluate the surface at
            pub uv: Point2d<f64>,
        }

        /// Send object to front or back.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct SendObject {
            /// Which object is being changed.
            pub object_id: Uuid,
            /// Bring to front = true, send to back = false.
            pub front: bool,
        }
        /// Set opacity of the entity.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct EntitySetOpacity {
            /// Which entity is being changed.
            pub entity_id: Uuid,
            /// How transparent should it be?
            /// 0 or lower is totally transparent.
            /// 1 or greater is totally opaque.
            pub opacity: f32,
        }

        /// Fade entity in or out.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct EntityFade {
            /// Which entity is being changed.
            pub entity_id: Uuid,
            /// Fade in = true, fade out = false.
            pub fade_in: bool,
            /// How many seconds the animation should take.
            #[serde(default = "default_animation_seconds")]
            #[builder(default = default_animation_seconds())]
            pub duration_seconds: f64,
        }

        /// Make a new plane
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct MakePlane {
            /// Origin of the plane
            pub origin: Point3d<LengthUnit>,
            /// What should the plane's X axis be?
            pub x_axis: Point3d<f64>,
            /// What should the plane's Y axis be?
            pub y_axis: Point3d<f64>,
            /// What should the plane's span/extent?
            /// When rendered visually, this is both the
            /// width and height along X and Y axis respectively.
            pub size: LengthUnit,
            /// If true, any existing drawables within the obj will be replaced (the object will be reset)
            pub clobber: bool,
            /// If true, the plane will be created but hidden initially.
            pub hide: Option<bool>,
        }

        /// Set the color of a plane.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct PlaneSetColor {
            /// Which plane is being changed.
            pub plane_id: Uuid,
            /// What color it should be.
            pub color: Color,
        }

        /// Set the current tool.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct SetTool {
            /// What tool should be active.
            pub tool: SceneToolType,
        }

        /// Send a mouse move event
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct MouseMove {
            /// Where the mouse is
            pub window: Point2d,
            /// Logical timestamp. The client should increment this
            /// with every event in the current mouse drag. That way, if the
            /// events are being sent over an unordered channel, the API
            /// can ignore the older events.
            pub sequence: Option<u32>,
        }

        /// Send a mouse click event
        /// Updates modified/selected entities.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct MouseClick {
            /// Where the mouse is
            pub window: Point2d,
        }

        /// Disable sketch mode.
        /// If you are sketching on a face, be sure to not disable sketch mode until you have extruded.
        /// Otherwise, your object will not be fused with the face.
        #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct SketchModeDisable {}

        /// Get the plane for sketch mode.
        #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct GetSketchModePlane {}

        /// Get the plane for sketch mode.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct CurveSetConstraint {
            /// Which curve to constrain.
            pub object_id: Uuid,
            /// Which constraint to apply.
            pub constraint_bound: PathComponentConstraintBound,
            /// What part of the curve should be constrained.
            pub constraint_type: PathComponentConstraintType,
        }

        /// Sketch on some entity (e.g. a plane, a face).
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct EnableSketchMode {
            /// Which entity to sketch on.
            pub entity_id: Uuid,
            /// Should the camera use orthographic projection?
            /// In other words, should an object's size in the rendered image stay constant regardless of its distance from the camera.
            pub ortho: bool,
            /// Should we animate or snap for the camera transition?
            pub animated: bool,
            /// Should the camera move at all?
            pub adjust_camera: bool,
            /// If provided, ensures that the normal of the sketch plane must be aligned with this supplied normal
            /// (otherwise the camera position will be used to infer the normal to point towards the viewer)
            pub planar_normal: Option<Point3d<f64>>,
        }

        /// Sets whether or not changes to the scene or its objects will be done as a "dry run"
        /// In a dry run, successful commands won't actually change the model.
        /// This is useful for catching errors before actually making the change.
        #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct EnableDryRun {}

        /// Sets whether or not changes to the scene or its objects will be done as a "dry run"
        /// In a dry run, successful commands won't actually change the model.
        /// This is useful for catching errors before actually making the change.
        #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct DisableDryRun {}

        /// Set the background color of the scene.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct SetBackgroundColor {
            /// The color to set the background to.
            pub color: Color,
        }

        /// Set the properties of the tool lines for the scene.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct SetCurrentToolProperties {
            /// The color to set the tool line to.
            pub color: Option<Color>,
        }

        /// Set the default system properties used when a specific property isn't set.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct SetDefaultSystemProperties {
            /// The default system color.
            #[serde(default)]
            pub color: Option<Color>,
            /// The default color to use for all backfaces
            #[serde(default)]
            pub backface_color: Option<Color>,
            /// The default color to use for highlight
            #[serde(default)]
            pub highlight_color: Option<Color>,
            /// The default color to use for selection
            #[serde(default)]
            pub selection_color: Option<Color>,
        }

        /// Get type of the given curve.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct CurveGetType {
            /// Which curve to query.
            pub curve_id: Uuid,
        }

        /// Get control points of the given curve.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct CurveGetControlPoints {
            /// Which curve to query.
            pub curve_id: Uuid,
        }

        /// Project an entity on to a plane.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct ProjectEntityToPlane {
            /// Which entity to project (vertex or edge).
            pub entity_id: Uuid,
            /// Which plane to project entity_id onto.
            pub plane_id: Uuid,
            /// If true: the projected points are returned in the plane_id's coordinate system,
            /// else: the projected points are returned in the world coordinate system.
            pub use_plane_coords: bool,
        }

        /// Project a list of points on to a plane.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct ProjectPointsToPlane {
            /// The id of the plane used for the projection.
            pub plane_id: Uuid,
            /// The list of points that will be projected.
            pub points: Vec<Point3d<f64>>,
            /// If true: the projected points are returned in the plane_id's coordinate sysetm.
            /// else: the projected points are returned in the world coordinate system.
            pub use_plane_coords: bool,
        }

        /// Enum containing the variety of image formats snapshots may be exported to.
        #[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, JsonSchema, FromStr, Display)]
        #[serde(rename_all = "snake_case")]
        #[display(style = "snake_case")]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(feature = "python", pyo3::pyclass, pyo3_stub_gen::derive::gen_stub_pyclass_enum)]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub enum ImageFormat {
            /// .png format
            Png,
            /// .jpeg format
            Jpeg,
        }

        /// Take a snapshot of the current view.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct TakeSnapshot {
            /// What image format to return.
            pub format: ImageFormat,
        }

        /// Add a gizmo showing the axes.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct MakeAxesGizmo {
            /// If true, axes gizmo will be placed in the corner of the screen.
            /// If false, it will be placed at the origin of the scene.
            pub gizmo_mode: bool,
            /// If true, any existing drawables within the obj will be replaced (the object will be reset)
            pub clobber: bool,
        }

        /// Query the given path.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct PathGetInfo {
            /// Which path to query
            pub path_id: Uuid,
        }

        /// Obtain curve ids for vertex ids
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct PathGetCurveUuidsForVertices {
            /// Which path to query
            pub path_id: Uuid,

            /// IDs of the vertices for which to obtain curve ids from
            pub vertex_ids: Vec<Uuid>,
        }

        /// Obtain curve id by index
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct PathGetCurveUuid {
            /// Which path to query
            pub path_id: Uuid,

            /// IDs of the vertices for which to obtain curve ids from
            pub index: u32,
        }

        /// Obtain vertex ids for a path
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct PathGetVertexUuids {
            /// Which path to query
            pub path_id: Uuid,
        }

        /// Obtain the sketch target id (if the path was drawn in sketchmode) for a path
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct PathGetSketchTargetUuid {
            /// Which path to query
            pub path_id: Uuid,
        }

        /// Start dragging the mouse.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct HandleMouseDragStart {
            /// The mouse position.
            pub window: Point2d,
        }

        /// Continue dragging the mouse.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct HandleMouseDragMove {
            /// The mouse position.
            pub window: Point2d,
            /// Logical timestamp. The client should increment this
            /// with every event in the current mouse drag. That way, if the
            /// events are being sent over an unordered channel, the API
            /// can ignore the older events.
            pub sequence: Option<u32>,
        }

        /// Stop dragging the mouse.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct HandleMouseDragEnd {
            /// The mouse position.
            pub window: Point2d,
        }

        /// Remove scene objects.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct RemoveSceneObjects {
            /// Objects to remove.
            pub object_ids: HashSet<Uuid>,
        }

        /// Utility method. Performs both a ray cast and projection to plane-local coordinates.
        /// Returns the plane coordinates for the given window coordinates.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct PlaneIntersectAndProject {
            /// The plane you're intersecting against.
            pub plane_id: Uuid,
            /// Window coordinates where the ray cast should be aimed.
            pub window: Point2d,
        }

        /// Find the start and end of a curve.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct CurveGetEndPoints {
            /// ID of the curve being queried.
            pub curve_id: Uuid,
        }

        /// Reconfigure the stream.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct ReconfigureStream {
            /// Width of the stream.
            pub width: u32,
            /// Height of the stream.
            pub height: u32,
            /// Frames per second.
            pub fps: u32,
            /// Video feed's constant bitrate (CBR)
            #[serde(default)]
            pub bitrate: Option<u32>,
        }

        /// Import files to the current model.
        #[derive(Debug, Eq, PartialEq, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct ImportFiles {
            /// Files to import.
            pub files: Vec<super::ImportFile>,
            /// Input file format.
            pub format: crate::format::InputFormat3d,
        }

        /// Set the units of the scene.
        /// For all following commands, the units will be interpreted as the given units.
        /// Any previously executed commands will not be affected or have their units changed.
        /// They will remain in the units they were originally executed in.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct SetSceneUnits {
            /// Which units the scene uses.
            pub unit: units::UnitLength,
        }

        /// Get the mass of entities in the scene or the default scene.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct Mass {
            /// IDs of the entities to get the mass of. If this is empty, then the default scene is included in
            /// the mass.
            #[builder(default)]
            pub entity_ids: Vec<Uuid>,
            /// The material density.
            pub material_density: f64,
            /// The material density unit.
            pub material_density_unit: units::UnitDensity,
            /// The output unit for the mass.
            pub output_unit: units::UnitMass,
        }

        /// Get the density of entities in the scene or the default scene.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct Density {
            /// IDs of the entities to get the density of. If this is empty, then the default scene is included in
            /// the density.
            #[builder(default)]
            pub entity_ids: Vec<Uuid>,
            /// The material mass.
            pub material_mass: f64,
            /// The material mass unit.
            pub material_mass_unit: units::UnitMass,
            /// The output unit for the density.
            pub output_unit: units::UnitDensity,
        }

        /// Get the volume of entities in the scene or the default scene.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct Volume {
            /// IDs of the entities to get the volume of. If this is empty, then the default scene is included in
            /// the volume.
            #[builder(default)]
            pub entity_ids: Vec<Uuid>,
            /// The output unit for the volume.
            pub output_unit: units::UnitVolume,
        }

        /// Get the center of mass of entities in the scene or the default scene.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct CenterOfMass {
            /// IDs of the entities to get the center of mass of. If this is empty, then the default scene is included in
            /// the center of mass.
            #[builder(default)]
            pub entity_ids: Vec<Uuid>,
            /// The output unit for the center of mass.
            pub output_unit: units::UnitLength,
        }

        /// Get the surface area of entities in the scene or the default scene.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct SurfaceArea {
            /// IDs of the entities to get the surface area of. If this is empty, then the default scene is included in
            /// the surface area.
            #[builder(default)]
            pub entity_ids: Vec<Uuid>,
            /// The output unit for the surface area.
            pub output_unit: units::UnitArea,
        }

        /// Focus the default camera upon an object in the scene.
        #[derive(
            Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
            Builder
        )]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct DefaultCameraFocusOn {
            /// UUID of object to focus on.
            pub uuid: Uuid,
        }
        /// When you select some entity with the current tool, what should happen to the entity?
        #[derive(
            Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
            Builder
        )]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct SetSelectionType {
            /// What type of selection should occur when you select something?
            pub selection_type: SceneSelectionType,
        }

        /// What kind of entities can be selected?
        #[derive(
            Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
            Builder
        )]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct SetSelectionFilter {
            /// If vector is empty, clear all filters.
            /// If vector is non-empty, only the given entity types will be selectable.
            pub filter: Vec<EntityType>,
        }

        /// Get the ids of a given entity type.
        #[derive(
            Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
            Builder
        )]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct SceneGetEntityIds {
            /// The entity types to be queried.
            pub filter: Vec<EntityType>,
            /// Skip the first n returned ids. If multiple filters are provided, this skip will
            /// apply to each filter individually.
            pub skip: u32,
            /// Take n ids after any ids skipped. This value must be greater than zero and not
            /// exceed 1000. If multiple filters are provided, this take will apply to each filter
            /// individually. If there are fewer than `take` items of the provided filter type then the
            /// returned list's length will be the smaller value.
            #[schemars(range(min = 1, max = 1000))]
            pub take: u32,
        }

        /// Use orthographic projection.
        #[derive(
            Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
            Builder
        )]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct DefaultCameraSetOrthographic {}

        /// Use perspective projection.
        #[derive(
            Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
            Builder
        )]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct DefaultCameraSetPerspective {
            /// If this is not given, use the same parameters as last time the perspective camera was used.
            pub parameters: Option<PerspectiveCameraParameters>,
        }

        ///Updates the camera to center to the center of the current selection
        ///(or the origin if nothing is selected)
        #[derive(
            Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder
        )]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct DefaultCameraCenterToSelection {
            /// Dictates whether or not the camera position should be adjusted during this operation
            /// If no movement is requested, the camera will orbit around the new center from its current position
            #[serde(default)]
            #[builder(default)]
            pub camera_movement: CameraMovement,
        }

        ///Updates the camera to center to the center of the current scene's bounds
        #[derive(
            Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder
        )]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct DefaultCameraCenterToScene {
            /// Dictates whether or not the camera position should be adjusted during this operation
            /// If no movement is requested, the camera will orbit around the new center from its current position
            #[serde(default)]
            #[builder(default)]
            pub camera_movement: CameraMovement,
        }

        /// Fit the view to the specified object(s).
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct ZoomToFit {
            /// Which objects to fit camera to; if empty, fit to all non-default objects. Defaults to empty vector.
            #[serde(default)]
            #[builder(default)]
            pub object_ids: Vec<Uuid>,
            /// How much to pad the view frame by, as a fraction of the object(s) bounding box size.
            /// Negative padding will crop the view of the object proportionally.
            /// e.g. padding = 0.2 means the view will span 120% of the object(s) bounding box,
            /// and padding = -0.2 means the view will span 80% of the object(s) bounding box.
            #[serde(default)]
            #[builder(default)]
            pub padding: f32,
            /// Whether or not to animate the camera movement.
            #[serde(default)]
            #[builder(default)]
            pub animated: bool,
        }

        /// Looks along the normal of the specified face (if it is planar!), and fits the view to it.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct OrientToFace {
            /// Which face to orient camera to. If the face is not planar, no action will occur.
            pub face_id: Uuid,
            /// How much to pad the view frame by, as a fraction of the face bounding box size.
            /// Negative padding will crop the view of the face proportionally.
            /// e.g. padding = 0.2 means the view will span 120% of the face bounding box,
            /// and padding = -0.2 means the view will span 80% of the face bounding box.
            #[serde(default)]
            #[builder(default)]
            pub padding: f32,
            /// Whether or not to animate the camera movement. (Animation is currently not supported.)
            #[serde(default)]
            #[builder(default)]
            pub animated: bool,
        }

        /// Fit the view to the scene with an isometric view.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct ViewIsometric {
            /// How much to pad the view frame by, as a fraction of the object(s) bounding box size.
            /// Negative padding will crop the view of the object proportionally.
            /// e.g. padding = 0.2 means the view will span 120% of the object(s) bounding box,
            /// and padding = -0.2 means the view will span 80% of the object(s) bounding box.
            #[serde(default)]
            #[builder(default)]
            pub padding: f32,
        }

        /// Get a concise description of all of an extrusion's faces.
        #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct Solid3dGetExtrusionFaceInfo {
            /// The Solid3d object whose extrusion is being queried.
            pub object_id: Uuid,
            /// Any edge that lies on the extrusion base path.
            pub edge_id: Uuid,
        }

        /// Get a concise description of all of solids edges.
        #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct Solid3dGetAdjacencyInfo {
            /// The Solid3d object whose info is being queried.
            pub object_id: Uuid,
            /// Any edge that lies on the extrusion base path.
            pub edge_id: Uuid,
        }


        /// Clear the selection
        #[derive(Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct SelectClear {}

        /// Find all IDs of selected entities
        #[derive(Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct SelectGet {}

        /// Get the number of objects in the scene
        #[derive(
            Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
            Builder
        )]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct GetNumObjects {}

        ///Set the transform of an object.
        #[derive(
            Clone, Debug, Deserialize, PartialEq, JsonSchema, Serialize, ModelingCmdVariant,
            Builder
        )]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct SetObjectTransform
        {
            /// Id of the object whose transform is to be set.
            pub object_id: Uuid,
            /// List of transforms to be applied to the object.
            pub transforms: Vec<ComponentTransform>,
        }

        /// Create a new solid from combining other smaller solids.
        /// In other words, every part of the input solids will be included in the output solid.
        #[derive(
            Clone, Debug, Deserialize, PartialEq, JsonSchema, Serialize, ModelingCmdVariant,
            Builder
        )]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct BooleanUnion
        {
            /// Which solids to union together.
            /// Cannot be empty.
            pub solid_ids: Vec<Uuid>,
            /// If true, non-contiguous bodies in the result will be returned as separate objects
            #[serde(default)]
            #[builder(default)]
            pub separate_bodies: bool,
            /// If true, use the legacy CSG algorithm.
            #[serde(default, skip_serializing_if = "super::is_false")]
            #[builder(default)]
            pub use_legacy: bool,
            /// The maximum acceptable surface gap computed between the joined solids. Must be positive (i.e. greater than zero).
            pub tolerance: LengthUnit,
        }

        /// Create a new solid from intersecting several other solids.
        /// In other words, the part of the input solids where they all overlap will be the output solid.
        #[derive(
            Clone, Debug, Deserialize, PartialEq, JsonSchema, Serialize, ModelingCmdVariant,
            Builder
        )]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct BooleanIntersection
        {
            /// Which solids to intersect together
            pub solid_ids: Vec<Uuid>,
            /// If true, non-contiguous bodies in the result will be returned as separate objects
            #[serde(default)]
            #[builder(default)]
            pub separate_bodies: bool,
            /// If true, use the legacy CSG algorithm.
            #[serde(default, skip_serializing_if = "super::is_false")]
            #[builder(default)]
            pub use_legacy: bool,
            /// The maximum acceptable surface gap computed between the joined solids. Must be positive (i.e. greater than zero).
            pub tolerance: LengthUnit,
        }

        /// Create a new solid from subtracting several other solids.
        /// The 'target' is what will be cut from.
        /// The 'tool' is what will be cut out from 'target'.
        #[derive(
            Clone, Debug, Deserialize, PartialEq, JsonSchema, Serialize, ModelingCmdVariant,
            Builder
        )]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct BooleanSubtract
        {
            /// Geometry to cut out from.
            pub target_ids: Vec<Uuid>,
            /// Will be cut out from the 'target'.
            pub tool_ids: Vec<Uuid>,
            /// If true, non-contiguous bodies in the result will be returned as separate objects
            #[serde(default)]
            #[builder(default)]
            pub separate_bodies: bool,
            /// If true, use the legacy CSG algorithm.
            #[serde(default, skip_serializing_if = "super::is_false")]
            #[builder(default)]
            pub use_legacy: bool,
            /// The maximum acceptable surface gap computed between the target and the solids cut out from it. Must be positive (i.e. greater than zero).
            pub tolerance: LengthUnit,
        }

        /// Create a new non-manifold body by intersecting all the input bodies, cutting and splitting all the faces at the intersection boundaries.
        #[derive(
            Clone, Debug, Deserialize, PartialEq, JsonSchema, Serialize, ModelingCmdVariant,
            Builder
        )]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct BooleanImprint
        {
            /// Which target input bodies to intersect. Inputs with non-solid body types are permitted
            #[serde(alias = "target_ids")]
            pub body_ids: Vec<Uuid>,
            ///If provided, only these bodies will be used to intersect with the target bodies in body_ids,
            ///Otherwise, all bodies in body_ids will be intersected with themselves.
            #[serde(default)]
            pub tool_ids: Option<Vec<Uuid>>,
            /// If true, target bodies will be separated into multiple objects at their intersection boundaries.
            #[serde(default)]
            #[builder(default)]
            pub separate_bodies: bool,
            /// If true, use the legacy CSG algorithm.
            #[serde(default, skip_serializing_if = "super::is_false")]
            #[builder(default)]
            pub use_legacy: bool,
            /// If true, the provided tool bodies will not be modified
            #[serde(default)]
            #[builder(default)]
            pub keep_tools: bool,
            /// The maximum acceptable surface gap between the intersected bodies. Must be positive (i.e. greater than zero).
            pub tolerance: LengthUnit,
        }

        /// Make a new path by offsetting an object by a given distance.
        /// The new path's ID will be the ID of this command.
        #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct MakeOffsetPath {
            /// The object that will be offset (can be a path, sketch, or a solid)
            pub object_id: Uuid,
            /// If the object is a solid, this is the ID of the face to base the offset on.
            /// If given, and `object_id` refers to a solid, then this face on the solid will be offset.
            /// If given but `object_id` doesn't refer to a solid, responds with an error.
            /// If not given, then `object_id` itself will be offset directly.
            #[serde(default)]
            pub face_id: Option<Uuid>,
            /// The distance to offset the path (positive for outset, negative for inset)
            pub offset: LengthUnit,
        }

        /// Add a hole to a closed path by offsetting it a uniform distance inward.
        #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct AddHoleFromOffset {
            /// The closed path to add a hole to.
            pub object_id: Uuid,
            /// The distance to offset the path (positive for outset, negative for inset)
            pub offset: LengthUnit,
        }

        /// Align the grid with a plane or a planar face.
        #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct SetGridReferencePlane {
            /// The grid to be moved.
            pub grid_id: Uuid,
            /// The plane or face that the grid will be aligned to.
            /// If a face, it must be planar to succeed.
            pub reference_id: Uuid,
        }

        /// Set the scale of the grid lines in the video feed.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct SetGridScale {
            /// Distance between grid lines represents this much distance.
            pub value: f32,
            /// Which units the `value` field uses.
            pub units: units::UnitLength,
        }

        /// Set the grid lines to auto scale. The grid will get larger the further you zoom out,
        /// and smaller the more you zoom in.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct SetGridAutoScale {
        }

        /// Render transparent surfaces more accurately, but this might make rendering slower.
        /// Because it can interfere with runtime performance, it defaults to false.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct SetOrderIndependentTransparency {
            /// Enables or disables OIT.
            /// If not given, toggles it.
            pub enabled: Option<bool>,
        }

        /// Create a region bounded by the intersection of various paths.
        /// The region should have an ID taken from the ID of the
        /// 'CreateRegion' modeling command.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct CreateRegion {
            /// Which sketch object to create the region from.
            pub object_id: Uuid,
            /// First segment to follow to find the region.
            pub segment: Uuid,
            /// Second segment to follow to find the region.
            /// Intersects the first segment.
            pub intersection_segment: Uuid,
            /// At which intersection between `segment` and `intersection_segment`
            /// should we stop following the `segment` and start following `intersection_segment`?
            /// Defaults to -1, which means the last intersection.
            #[serde(default = "super::negative_one")]
            #[builder(default = super::negative_one())]
            pub intersection_index: i32,
            /// By default, curve counterclockwise at intersections.
            /// If this is true, instead curve clockwise.
            #[serde(default)]
            #[builder(default)]
            pub curve_clockwise: bool,
            /// Which version of the Region endpoint to call.
            #[serde(default)]
            #[builder(default)]
            version: RegionVersion,
        }

        /// Create a region with a query point.
        /// The region should have an ID taken from the ID of the
        /// 'CreateRegionFromQueryPoint' modeling command.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct CreateRegionFromQueryPoint {
            /// Which sketch object to create the region from.
            pub object_id: Uuid,

            /// The query point (in the same coordinates as the sketch itself)
            /// if a possible sketch region contains this point, then that region will be created
            pub query_point: Point2d<LengthUnit>,
            /// Which version of the Region endpoint to call.
            #[serde(default)]
            #[builder(default)]
            version: RegionVersion,
        }

        /// Finds a suitable point inside the region for calling such that CreateRegionFromQueryPoint will generate an identical region.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct RegionGetQueryPoint {
            /// Which region to search within
            pub region_id: Uuid,
        }

        /// The user clicked on a point in the window,
        /// returns the region the user clicked on, if any.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct SelectRegionFromPoint {
            /// Where in the window was selected
            pub selected_at_window: Point2d,
        }

        /// Get the smallest box that could contain the given parts.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct BoundingBox {
            /// IDs of the entities to be included in the box.
            /// If this is empty, then all entities are included (the entire scene).
            #[builder(default)]
            pub entity_ids: Vec<Uuid>,
            /// The output unit for the box's dimensions. Defaults to millimeters.
            #[builder(default = mm())]
            #[serde(default = "mm")]
            pub output_unit: units::UnitLength,
        }

        ///Offset a surface by a given distance.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct OffsetSurface {
            /// The surface to offset.
            pub surface_id: Uuid,
            /// The distance to offset the surface by.
            pub distance: LengthUnit,
            /// Flip the newly created face.
            pub flip: bool,
        }

        /// Returns the closest edge to this point.
        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
        pub struct ClosestEdge {
            /// The body whose edges are being queried.
            /// If not given, will search all bodies in the scene.
            #[serde(default)]
            pub object_id: Option<Uuid>,
            /// Find the edge closest to this point.
            /// Assumed to be in absolute coordinates, relative to global (scene) origin.
            pub closest_to: Point3d<f64>,
        }
    }


}

pub(crate) fn is_false(b: &bool) -> bool {
    !b
}

pub(crate) fn negative_one() -> i32 {
    -1
}

impl ModelingCmd {
    /// Is this command safe to run in an engine batch?
    pub fn is_safe_to_batch(&self) -> bool {
        use ModelingCmd::*;
        matches!(
            self,
            MovePathPen(_)
                | ExtendPath(_)
                | Extrude(_)
                | Revolve(_)
                | Solid3dFilletEdge(_)
                | ClosePath(_)
                | UpdateAnnotation(_)
                | ObjectVisible(_)
                | ObjectBringToFront(_)
                | Solid2dAddHole(_)
                | SendObject(_)
                | EntitySetOpacity(_)
                | PlaneSetColor(_)
                | SetTool(_)
        )
    }
}

/// File to import into the current model.
/// If you are sending binary data for a file, be sure to send the WebSocketRequest as
/// binary/bson, not text/json.
#[derive(Clone, Serialize, Deserialize, JsonSchema, Eq, PartialEq, bon::Builder)]
#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
#[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
pub struct ImportFile {
    /// The file's full path, including file extension.
    pub path: String,
    /// The raw bytes of the file
    #[serde(
        serialize_with = "serde_bytes::serialize",
        deserialize_with = "serde_bytes::deserialize"
    )]
    pub data: Vec<u8>,
}

impl std::fmt::Debug for ImportFile {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        f.debug_struct("ImportFile")
            .field("path", &self.path)
            .field("data", &"<redacted>")
            .finish()
    }
}