1use kittycad_modeling_cmds_macros::define_modeling_cmd_enum;
2use schemars::JsonSchema;
3use serde::{Deserialize, Serialize};
4
5pub use self::each_cmd::*;
6use crate::{self as kittycad_modeling_cmds};
7
8define_modeling_cmd_enum! {
9 pub mod each_cmd {
10 use std::collections::HashSet;
11
12 use bon::Builder;
13 use crate::{self as kittycad_modeling_cmds};
14 use kittycad_modeling_cmds_macros::{ModelingCmdVariant};
15 use parse_display_derive::{Display, FromStr};
16 use schemars::JsonSchema;
17 use serde::{Deserialize, Serialize};
18 use uuid::Uuid;
19 use crate::shared::CameraViewState;
20 use crate::shared::MirrorAcross;
21
22 use crate::{
23 format::{OutputFormat2d, OutputFormat3d},
24 id::ModelingCmdId,
25 length_unit::LengthUnit,
26 shared::{
27 Angle,
28 RegionVersion,
29 BlendType,
30 BodyType,
31 EdgeCutVersion,
32 ComponentTransform,
33 RelativeTo,
34 CutType, CutTypeV2,
35 CutStrategy,
36 CameraMovement,
37 EdgeSpecifier,
38 EntityReference,
39 ExtrudedFaceInfo, ExtrudeMethod,
40 AnnotationOptions, AnnotationType, CameraDragInteractionType, Color, DistanceType, EntityType,
41 PathComponentConstraintBound, PathComponentConstraintType, PathSegment, PerspectiveCameraParameters,
42 Point2d, Point3d, ExtrudeReference, SceneSelectionType, SceneToolType, SurfaceEdgeReference, Opposite,
43 },
44 units,
45 };
46
47 fn default_animation_seconds() -> f64 {
49 0.4
50 }
51
52 fn mm() -> crate::units::UnitLength {
53 crate::units::UnitLength::Millimeters
54 }
55
56 #[derive(
58 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
59 )]
60 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
61 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
62 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
63 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
64 pub struct EngineUtilEvaluatePath {
65 pub path_json: String,
67
68 pub t: f64,
70 }
71
72 #[derive(
74 Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant,
75 Builder
76 )]
77 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
78 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
79 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
80 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
81 pub struct StartPath {}
82
83 #[derive(
91 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
92 )]
93 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
94 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
95 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
96 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
97 pub struct MovePathPen {
98 pub path: ModelingCmdId,
100 pub to: Point3d<LengthUnit>,
102 }
103
104 #[derive(
107 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
108 )]
109 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
110 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
111 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
112 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
113 pub struct ExtendPath {
114 pub path: ModelingCmdId,
116 pub segment: PathSegment,
119 #[serde(default, skip_serializing_if = "Option::is_none")]
121 pub label: Option<String>,
122 }
123
124 #[derive(
126 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
127 )]
128 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
129 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
130 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
131 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
132 pub struct Extrude {
133 pub target: ModelingCmdId,
136 pub distance: LengthUnit,
138 #[serde(default, skip_serializing_if = "Option::is_none")]
142 pub draft_angle: Option<Angle>,
143 #[serde(default)]
146 pub faces: Option<ExtrudedFaceInfo>,
147 #[serde(default)]
150 #[builder(default)]
151 pub opposite: Opposite<LengthUnit>,
152 #[builder(default)]
154 #[serde(default)]
155 pub extrude_method: ExtrudeMethod,
156 #[serde(default, skip_serializing_if = "Option::is_none")]
160 pub merge_coplanar_faces: Option<bool>,
161
162 #[serde(default)]
164 #[builder(default)]
165 pub body_type: BodyType,
166 }
167
168 #[derive(
170 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
171 )]
172 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
173 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
174 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
175 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
176 pub struct ExtrudeToReference {
177 pub target: ModelingCmdId,
180 pub reference: ExtrudeReference,
183 #[serde(default)]
186 pub faces: Option<ExtrudedFaceInfo>,
187 #[serde(default)]
189 #[builder(default)]
190 pub extrude_method: ExtrudeMethod,
191 #[serde(default)]
193 #[builder(default)]
194 pub body_type: BodyType,
195 }
196
197 fn default_twist_extrude_section_interval() -> Angle {
198 Angle::from_degrees(15.0)
199 }
200
201 #[derive(
203 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
204 )]
205 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
206 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
207 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
208 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
209 pub struct TwistExtrude {
210 pub target: ModelingCmdId,
213 pub distance: LengthUnit,
215 #[serde(default)]
218 pub faces: Option<ExtrudedFaceInfo>,
219 #[serde(default)]
222 #[builder(default)]
223 pub center_2d: Point2d<f64>,
224 pub total_rotation_angle: Angle,
226 #[serde(default = "default_twist_extrude_section_interval")]
228 #[builder(default = default_twist_extrude_section_interval())]
229 pub angle_step_size: Angle,
230 pub tolerance: LengthUnit,
232 #[serde(default)]
234 #[builder(default)]
235 pub body_type: BodyType,
236 }
237
238 #[derive(
240 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder
241 )]
242 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
243 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
244 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
245 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
246 pub struct Sweep {
247 pub target: ModelingCmdId,
250 pub trajectory: ModelingCmdId,
252 pub sectional: bool,
254 pub tolerance: LengthUnit,
256 #[serde(default)]
258 #[builder(default)]
259 pub body_type: BodyType,
260 #[serde(default)]
262 #[builder(default)]
263 pub relative_to: RelativeTo,
264 #[serde(default, skip_serializing_if = "Option::is_none")]
267 pub version: Option<u8>,
268 }
269
270 #[derive(
272 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
273 )]
274 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
275 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
276 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
277 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
278 pub struct Revolve {
279 pub target: ModelingCmdId,
282 pub origin: Point3d<LengthUnit>,
284 pub axis: Point3d<f64>,
286 pub axis_is_2d: bool,
288 pub angle: Angle,
290 pub tolerance: LengthUnit,
292 #[serde(default)]
295 #[builder(default)]
296 pub opposite: Opposite<Angle>,
297 #[serde(default)]
299 #[builder(default)]
300 pub body_type: BodyType,
301 }
302
303 #[derive(
305 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
306 )]
307 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
308 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
309 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
310 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
311 pub struct Solid3dShellFace {
312 pub object_id: Uuid,
314 pub face_ids: Vec<Uuid>,
316 pub shell_thickness: LengthUnit,
319 #[serde(default)]
321 #[builder(default)]
322 pub hollow: bool,
323 }
324
325 #[derive(
331 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
332 )]
333 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
334 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
335 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
336 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
337 pub struct Solid3dJoin {
338 pub object_id: Uuid,
340 }
341
342 #[derive(
344 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
345 )]
346 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
347 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
348 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
349 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
350 pub struct Solid3dMultiJoin {
351 pub object_ids: Vec<Uuid>,
353 pub tolerance: LengthUnit,
355 }
356
357
358 #[derive(
360 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
361 )]
362 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
363 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
364 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
365 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
366 pub struct SurfaceBlend {
367 #[schemars(length(min = 2, max = 2))]
369 pub surfaces: Vec<SurfaceEdgeReference>,
370 #[serde(default)]
372 #[builder(default)]
373 pub blend_type: BlendType,
374 }
375
376 #[derive(
378 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
379 )]
380 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
381 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
382 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
383 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
384 pub struct Solid3dGetEdgeUuid {
385 pub object_id: Uuid,
387
388 pub edge_index: u32,
390 }
391
392 #[derive(
394 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
395 )]
396 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
397 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
398 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
399 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
400 pub struct Solid3dGetFaceUuid {
401 pub object_id: Uuid,
403
404 pub face_index: u32,
406 }
407
408 #[derive(
410 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
411 )]
412 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
413 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
414 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
415 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
416 pub struct Solid3dGetBodyType {
417 pub object_id: Uuid,
419 }
420
421 #[derive(
423 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
424 )]
425 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
426 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
427 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
428 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
429 pub struct RevolveAboutEdge {
430 pub target: ModelingCmdId,
433 #[serde(default, skip_serializing_if = "Option::is_none")]
435 pub edge_id: Option<Uuid>,
436 #[serde(default, skip_serializing_if = "Option::is_none")]
439 pub edge_reference: Option<EdgeSpecifier>,
440 pub angle: Angle,
442 pub tolerance: LengthUnit,
444 #[serde(default)]
447 #[builder(default)]
448 pub opposite: Opposite<Angle>,
449 #[serde(default)]
451 #[builder(default)]
452 pub body_type: BodyType,
453 }
454
455 #[derive(
457 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
458 )]
459 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
460 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
461 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
462 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
463 pub struct Loft {
464 pub section_ids: Vec<Uuid>,
467 pub v_degree: std::num::NonZeroU32,
470 pub bez_approximate_rational: bool,
474 pub base_curve_index: Option<u32>,
476 pub tolerance: LengthUnit,
478 #[serde(default)]
480 #[builder(default)]
481 pub body_type: BodyType,
482 }
483
484
485 #[derive(
487 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
488 )]
489 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
490 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
491 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
492 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
493 pub struct ClosePath {
494 pub path_id: Uuid,
496 }
497
498 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
500 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
501 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
502 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
503 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
504 pub struct CameraDragStart {
505 pub interaction: CameraDragInteractionType,
507 pub window: Point2d,
509 }
510
511 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
513 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
514 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
515 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
516 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
517 pub struct CameraDragMove {
518 pub interaction: CameraDragInteractionType,
520 pub window: Point2d,
522 pub sequence: Option<u32>,
527 }
528
529 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
531 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
532 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
533 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
534 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
535 pub struct CameraDragEnd {
536 pub interaction: CameraDragInteractionType,
538 pub window: Point2d,
540 }
541
542 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
544 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
545 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
546 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
547 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
548 pub struct DefaultCameraGetSettings {}
549
550 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
552 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
553 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
554 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
555 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
556 pub struct DefaultCameraGetView {}
557
558 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
560 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
561 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
562 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
563 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
564 pub struct DefaultCameraSetView {
565 pub view: CameraViewState,
567 }
568
569 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
571 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
572 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
573 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
574 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
575 pub struct DefaultCameraLookAt {
576 pub vantage: Point3d,
578 pub center: Point3d,
580 pub up: Point3d,
582 pub sequence: Option<u32>,
587 }
588
589 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
591 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
592 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
593 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
594 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
595 pub struct DefaultCameraPerspectiveSettings {
596 pub vantage: Point3d,
598 pub center: Point3d,
600 pub up: Point3d,
602 pub fov_y: Option<f32>,
604 pub z_near: Option<f32>,
606 pub z_far: Option<f32>,
608 pub sequence: Option<u32>,
613 }
614
615 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
617 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
618 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
619 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
620 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
621 pub struct DefaultCameraZoom {
622 pub magnitude: f32,
626 }
627
628 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
630 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
631 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
632 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
633 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
634 pub struct Export2d {
635 pub entity_ids: Vec<Uuid>,
637 pub format: OutputFormat2d,
639 }
640
641 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
643 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
644 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
645 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
646 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
647 pub struct Export3d {
648 #[builder(default)]
650 pub entity_ids: Vec<Uuid>,
651 pub format: OutputFormat3d,
653 }
654
655 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
657 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
658 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
659 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
660 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
661 pub struct Export {
662 #[builder(default)]
664 pub entity_ids: Vec<Uuid>,
665 pub format: OutputFormat3d,
667 }
668
669 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
671 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
672 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
673 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
674 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
675 pub struct EntityGetParentId {
676 pub entity_id: Uuid,
678 }
679
680 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
682 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
683 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
684 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
685 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
686 pub struct EntityGetNumChildren {
687 pub entity_id: Uuid,
689 }
690
691 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
693 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
694 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
695 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
696 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
697 pub struct EntityGetChildUuid {
698 pub entity_id: Uuid,
700 pub child_index: u32,
702 }
703
704 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
706 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
707 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
708 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
709 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
710 pub struct EntityGetIndex {
711 pub entity_id: Uuid,
713 }
714
715 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
717 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
718 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
719 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
720 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
721 pub struct EntityGetPrimitiveIndex {
722 pub entity_id: Uuid,
724 }
725
726 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
729 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
730 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
731 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
732 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
733 pub struct EntityDeleteChildren {
734 pub entity_id: Uuid,
736 pub child_entity_ids: HashSet<Uuid>,
738 }
739
740 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
742 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
743 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
744 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
745 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
746 pub struct EntityGetAllChildUuids {
747 pub entity_id: Uuid,
749 }
750
751 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
753 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
754 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
755 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
756 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
757 pub struct EntityGetSketchPaths {
758 pub entity_id: Uuid,
760 }
761
762 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
764 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
765 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
766 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
767 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
768 pub struct EntityGetDistance {
769 pub entity_id1: Uuid,
771 pub entity_id2: Uuid,
773 pub distance_type: DistanceType,
775 }
776
777 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
780 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
781 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
782 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
783 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
784 pub struct EntityClone {
785 pub entity_id: Uuid,
787 }
788
789 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
792 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
793 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
794 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
795 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
796 pub struct EntityLinearPatternTransform {
797 pub entity_id: Uuid,
799 #[serde(default)]
803 #[builder(default)]
804 pub transform: Vec<crate::shared::Transform>,
805 #[serde(default)]
809 #[builder(default)]
810 pub transforms: Vec<Vec<crate::shared::Transform>>,
811 }
812
813 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
815 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
816 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
817 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
818 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
819 pub struct EntityLinearPattern {
820 pub entity_id: Uuid,
822 pub axis: Point3d<f64>,
825 pub num_repetitions: u32,
827 pub spacing: LengthUnit,
829 }
830 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
832 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
833 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
834 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
835 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
836 pub struct EntityCircularPattern {
837 pub entity_id: Uuid,
839 pub axis: Point3d<f64>,
842 pub center: Point3d<LengthUnit>,
845 pub num_repetitions: u32,
847 pub arc_degrees: f64,
849 pub rotate_duplicates: bool,
851 }
852
853 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
855 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
856 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
857 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
858 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
859 pub struct EntityMakeHelix {
860 pub cylinder_id: Uuid,
862 pub revolutions: f64,
864 #[serde(default)]
866 #[builder(default)]
867 pub start_angle: Angle,
868 pub is_clockwise: bool,
870 pub length: Option<LengthUnit>,
872 }
873
874 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
876 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
877 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
878 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
879 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
880 pub struct EntityMakeHelixFromParams {
881 pub radius: LengthUnit,
883 pub length: LengthUnit,
885 pub revolutions: f64,
887 #[serde(default)]
889 #[builder(default)]
890 pub start_angle: Angle,
891 pub is_clockwise: bool,
893 pub center: Point3d<LengthUnit>,
895 pub axis: Point3d<f64>,
897 }
898
899 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
901 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
902 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
903 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
904 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
905 pub struct EntityMakeHelixFromEdge {
906 pub radius: LengthUnit,
908 pub length: Option<LengthUnit>,
910 pub revolutions: f64,
912 #[serde(default)]
914 #[builder(default)]
915 pub start_angle: Angle,
916 pub is_clockwise: bool,
918 #[serde(default, skip_serializing_if = "Option::is_none")]
921 pub edge_id: Option<Uuid>,
922 #[serde(default, skip_serializing_if = "Option::is_none")]
925 pub edge_reference: Option<EdgeSpecifier>,
926 }
927
928 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
930 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
931 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
932 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
933 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
934 pub struct EntityMirrorAcross {
935 pub ids: Vec<Uuid>,
937 pub across: MirrorAcross,
939 }
940
941
942 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
945 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
946 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
947 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
948 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
949 pub struct EntityMirror {
950 pub ids: Vec<Uuid>,
952 pub axis: Point3d<f64>,
954 pub point: Point3d<LengthUnit>,
956 }
957
958 #[derive(
961 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
962 )]
963 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
964 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
965 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
966 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
967 pub struct EntityMirrorAcrossEdge {
968 pub ids: Vec<Uuid>,
970 #[serde(default, skip_serializing_if = "Option::is_none")]
973 pub edge_id: Option<Uuid>,
974 #[serde(default, skip_serializing_if = "Option::is_none")]
977 pub edge_reference: Option<EdgeSpecifier>,
978 }
979
980 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
983 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
984 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
985 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
986 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
987 pub struct SelectWithPoint {
988 pub selected_at_window: Point2d,
990 pub selection_type: SceneSelectionType,
992 }
993
994 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
998 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
999 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1000 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1001 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1002 pub struct QueryEntityTypeWithPoint {
1003 pub selected_at_window: Point2d,
1005 pub selection_type: SceneSelectionType,
1007 }
1008
1009 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1013 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1014 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1015 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1016 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1017 pub struct QueryEntityType {
1018 pub entity_id: Uuid,
1020 }
1021
1022 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1024 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1025 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1026 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1027 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1028 pub struct SelectAdd {
1029 pub entities: Vec<Uuid>,
1031 }
1032
1033 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1035 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1036 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1037 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1038 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1039 pub struct SelectRemove {
1040 pub entities: Vec<Uuid>,
1042 }
1043
1044 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1046 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1047 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1048 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1049 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1050 pub struct SceneClearAll {}
1051
1052 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1054 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1055 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1056 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1057 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1058 pub struct SelectReplace {
1059 pub entities: Vec<Uuid>,
1061 }
1062
1063 #[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1066 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1067 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1068 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1069 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1070 pub struct HighlightSetEntity {
1071 pub selected_at_window: Point2d,
1073 pub sequence: Option<u32>,
1078 }
1079
1080 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1082 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1083 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1084 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1085 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1086 pub struct HighlightSetEntities {
1087 pub entities: Vec<Uuid>,
1089 }
1090
1091 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1093 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1094 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1095 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1096 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1097 pub struct NewAnnotation {
1098 pub options: AnnotationOptions,
1100 pub clobber: bool,
1102 pub annotation_type: AnnotationType,
1104 }
1105
1106 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1108 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1109 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1110 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1111 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1112 pub struct UpdateAnnotation {
1113 pub annotation_id: Uuid,
1115 pub options: AnnotationOptions,
1118 }
1119
1120 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1122 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1123 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1124 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1125 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1126 pub struct EdgeLinesVisible {
1127 pub hidden: bool,
1129 }
1130
1131 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1133 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1134 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1135 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1136 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1137 pub struct ObjectVisible {
1138 pub object_id: Uuid,
1140 pub hidden: bool,
1142 }
1143
1144 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1146 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1147 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1148 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1149 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1150 pub struct ObjectBringToFront {
1151 pub object_id: Uuid,
1153 }
1154
1155 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1157 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1158 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1159 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1160 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1161 pub struct ObjectSetMaterialParamsPbr {
1162 pub object_id: Uuid,
1164 pub color: Color,
1166 pub metalness: f32,
1168 pub roughness: f32,
1170 pub ambient_occlusion: f32,
1172 #[serde(default, skip_serializing_if = "Option::is_none")]
1174 pub backface_color: Option<Color>,
1175 }
1176
1177 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1179 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1180 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1181 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1182 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1183 pub struct ObjectSetName {
1184 pub object_id: Uuid,
1186 #[serde(default, skip_serializing_if = "String::is_empty")]
1188 pub name: String,
1189 }
1190
1191 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1193 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1194 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1195 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1196 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1197 pub struct GetEntityType {
1198 pub entity_id: Uuid,
1200 }
1201
1202 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1204 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1205 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1206 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1207 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1208 pub struct Solid3dGetAllEdgeFaces {
1209 pub object_id: Uuid,
1211 pub edge_id: Uuid,
1213 }
1214
1215 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1217 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1218 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1219 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1220 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1221 pub struct Solid3dFlip {
1222 pub object_id: Uuid,
1224 }
1225
1226 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1229 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1230 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1231 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1232 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1233 pub struct Solid3dFlipFace {
1234 pub object_id: Uuid,
1236 pub face_id: Uuid,
1238 }
1239
1240 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1242 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1243 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1244 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1245 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1246 pub struct Solid2dAddHole {
1247 pub object_id: Uuid,
1249 pub hole_id: Uuid,
1251 }
1252
1253 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1255 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1256 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1257 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1258 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1259 pub struct Solid3dGetAllOppositeEdges {
1260 pub object_id: Uuid,
1262 pub edge_id: Uuid,
1264 pub along_vector: Option<Point3d<f64>>,
1266 }
1267
1268 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1270 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1271 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1272 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1273 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1274 pub struct Solid3dGetOppositeEdge {
1275 pub object_id: Uuid,
1277 pub edge_id: Uuid,
1279 pub face_id: Uuid,
1281 }
1282
1283 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1285 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1286 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1287 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1288 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1289 pub struct Solid3dGetNextAdjacentEdge {
1290 pub object_id: Uuid,
1292 pub edge_id: Uuid,
1294 pub face_id: Uuid,
1296 }
1297
1298 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1300 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1301 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1302 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1303 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1304 pub struct Solid3dGetPrevAdjacentEdge {
1305 pub object_id: Uuid,
1307 pub edge_id: Uuid,
1309 pub face_id: Uuid,
1311 }
1312
1313 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1315 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1316 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1317 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1318 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1319 pub struct Solid3dGetCommonEdge {
1320 pub object_id: Uuid,
1322 pub face_ids: [Uuid; 2]
1324 }
1325
1326 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1328 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1329 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1330 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1331 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1332 pub struct Solid3dFilletEdge {
1333 pub object_id: Uuid,
1335 #[serde(default)]
1337 pub edge_id: Option<Uuid>,
1338 #[serde(default)]
1340 #[builder(default)]
1341 pub edge_ids: Vec<Uuid>,
1342 #[serde(default, skip_serializing_if = "Vec::is_empty")]
1344 #[builder(default)]
1345 pub edges_references: Vec<EdgeSpecifier>,
1346 pub radius: LengthUnit,
1348 pub tolerance: LengthUnit,
1350 #[serde(default)]
1352 #[builder(default)]
1353 pub cut_type: CutType,
1354 #[serde(default)]
1356 #[builder(default)]
1357 pub strategy: CutStrategy,
1358 #[serde(default)]
1366 #[builder(default)]
1367 pub extra_face_ids: Vec<Uuid>,
1368 #[serde(default, skip_serializing_if = "super::is_false")]
1370 #[builder(default)]
1371 pub use_legacy: bool,
1372 #[serde(default, skip_serializing_if = "EdgeCutVersion::is_default")]
1374 #[builder(default)]
1375 pub version: EdgeCutVersion,
1376 }
1377
1378 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1380 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1381 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1382 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1383 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1384 pub struct Solid3dCutEdgeReferences {
1385 pub object_id: Uuid,
1387 #[serde(default)]
1389 #[builder(default)]
1390 pub edges_references: Vec<EdgeSpecifier>,
1391 pub cut_type: CutTypeV2,
1393 pub tolerance: LengthUnit,
1396 #[serde(default)]
1398 #[builder(default)]
1399 pub strategy: CutStrategy,
1400 #[serde(default)]
1408 #[builder(default)]
1409 pub extra_face_ids: Vec<Uuid>,
1410 #[serde(default, skip_serializing_if = "super::is_false")]
1412 #[builder(default)]
1413 pub use_legacy: bool,
1414 #[serde(default, skip_serializing_if = "EdgeCutVersion::is_default")]
1416 #[builder(default)]
1417 pub version: EdgeCutVersion,
1418 }
1419
1420 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1422 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1423 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1424 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1425 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1426 pub struct Solid3dCutEdges {
1427 pub object_id: Uuid,
1429 #[serde(default)]
1431 #[builder(default)]
1432 pub edge_ids: Vec<Uuid>,
1433 pub cut_type: CutTypeV2,
1435 pub tolerance: LengthUnit,
1438 #[serde(default)]
1440 #[builder(default)]
1441 pub strategy: CutStrategy,
1442 #[serde(default)]
1450 #[builder(default)]
1451 pub extra_face_ids: Vec<Uuid>,
1452 #[serde(default, skip_serializing_if = "super::is_false")]
1454 #[builder(default)]
1455 pub use_legacy: bool,
1456 #[serde(default, skip_serializing_if = "EdgeCutVersion::is_default")]
1458 #[builder(default)]
1459 pub version: EdgeCutVersion,
1460 }
1461
1462 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1464 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1465 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1466 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1467 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1468 pub struct FaceIsPlanar {
1469 pub object_id: Uuid,
1471 }
1472
1473 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1475 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1476 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1477 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1478 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1479 pub struct FaceGetPosition {
1480 pub object_id: Uuid,
1482
1483 pub uv: Point2d<f64>,
1485 }
1486
1487 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1489 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1490 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1491 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1492 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1493 pub struct FaceGetCenter {
1494 pub object_id: Uuid,
1496 }
1497
1498 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1500 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1501 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1502 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1503 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1504 pub struct FaceGetGradient {
1505 pub object_id: Uuid,
1507
1508 pub uv: Point2d<f64>,
1510 }
1511
1512 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1514 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1515 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1516 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1517 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1518 pub struct SendObject {
1519 pub object_id: Uuid,
1521 pub front: bool,
1523 }
1524 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1526 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1527 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1528 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1529 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1530 pub struct EntitySetOpacity {
1531 pub entity_id: Uuid,
1533 pub opacity: f32,
1537 }
1538
1539 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1541 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1542 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1543 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1544 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1545 pub struct EntityFade {
1546 pub entity_id: Uuid,
1548 pub fade_in: bool,
1550 #[serde(default = "default_animation_seconds")]
1552 #[builder(default = default_animation_seconds())]
1553 pub duration_seconds: f64,
1554 }
1555
1556 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1558 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1559 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1560 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1561 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1562 pub struct MakePlane {
1563 pub origin: Point3d<LengthUnit>,
1565 pub x_axis: Point3d<f64>,
1567 pub y_axis: Point3d<f64>,
1569 pub size: LengthUnit,
1573 pub clobber: bool,
1575 pub hide: Option<bool>,
1577 }
1578
1579 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1581 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1582 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1583 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1584 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1585 pub struct PlaneSetColor {
1586 pub plane_id: Uuid,
1588 pub color: Color,
1590 }
1591
1592 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1594 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1595 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1596 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1597 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1598 pub struct SetTool {
1599 pub tool: SceneToolType,
1601 }
1602
1603 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1605 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1606 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1607 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1608 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1609 pub struct MouseMove {
1610 pub window: Point2d,
1612 pub sequence: Option<u32>,
1617 }
1618
1619 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1622 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1623 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1624 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1625 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1626 pub struct MouseClick {
1627 pub window: Point2d,
1629 }
1630
1631 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1635 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1636 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1637 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1638 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1639 pub struct SketchModeDisable {}
1640
1641 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1643 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1644 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1645 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1646 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1647 pub struct GetSketchModePlane {}
1648
1649 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1651 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1652 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1653 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1654 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1655 pub struct CurveSetConstraint {
1656 pub object_id: Uuid,
1658 pub constraint_bound: PathComponentConstraintBound,
1660 pub constraint_type: PathComponentConstraintType,
1662 }
1663
1664 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1666 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1667 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1668 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1669 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1670 pub struct EnableSketchMode {
1671 pub entity_id: Uuid,
1673 pub ortho: bool,
1676 pub animated: bool,
1678 pub adjust_camera: bool,
1680 pub planar_normal: Option<Point3d<f64>>,
1683 }
1684
1685 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1689 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1690 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1691 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1692 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1693 pub struct EnableDryRun {}
1694
1695 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1699 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1700 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1701 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1702 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1703 pub struct DisableDryRun {}
1704
1705 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1707 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1708 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1709 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1710 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1711 pub struct SetBackgroundColor {
1712 pub color: Color,
1714 }
1715
1716 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1718 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1719 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1720 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1721 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1722 pub struct SetCurrentToolProperties {
1723 pub color: Option<Color>,
1725 }
1726
1727 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1729 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1730 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1731 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1732 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1733 pub struct SetDefaultSystemProperties {
1734 #[serde(default)]
1736 pub color: Option<Color>,
1737 #[serde(default)]
1739 pub backface_color: Option<Color>,
1740 #[serde(default)]
1742 pub highlight_color: Option<Color>,
1743 #[serde(default)]
1745 pub selection_color: Option<Color>,
1746 }
1747
1748 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1750 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1751 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1752 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1753 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1754 pub struct CurveGetType {
1755 pub curve_id: Uuid,
1757 }
1758
1759 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1761 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1762 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1763 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1764 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1765 pub struct CurveGetControlPoints {
1766 pub curve_id: Uuid,
1768 }
1769
1770 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1772 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1773 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1774 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1775 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1776 pub struct ProjectEntityToPlane {
1777 #[serde(default, skip_serializing_if = "Option::is_none")]
1779 pub entity_id: Option<Uuid>,
1780 #[serde(default, skip_serializing_if = "Option::is_none")]
1782 pub entity_reference: Option<EntityReference>,
1783 pub plane_id: Uuid,
1785 pub use_plane_coords: bool,
1788 }
1789
1790 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1792 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1793 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1794 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1795 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1796 pub struct ProjectPointsToPlane {
1797 pub plane_id: Uuid,
1799 pub points: Vec<Point3d<f64>>,
1801 pub use_plane_coords: bool,
1804 }
1805
1806 #[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, JsonSchema, FromStr, Display)]
1808 #[serde(rename_all = "snake_case")]
1809 #[display(style = "snake_case")]
1810 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1811 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1812 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1813 #[cfg_attr(feature = "python", pyo3::pyclass(from_py_object), pyo3_stub_gen::derive::gen_stub_pyclass_enum)]
1814 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1815 pub enum ImageFormat {
1816 Png,
1818 Jpeg,
1820 }
1821
1822 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1824 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1825 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1826 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1827 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1828 pub struct TakeSnapshot {
1829 pub format: ImageFormat,
1831 }
1832
1833 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1835 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1836 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1837 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1838 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1839 pub struct MakeAxesGizmo {
1840 pub gizmo_mode: bool,
1843 pub clobber: bool,
1845 }
1846
1847 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1849 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1850 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1851 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1852 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1853 pub struct PathGetInfo {
1854 pub path_id: Uuid,
1856 }
1857
1858 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1860 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1861 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1862 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1863 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1864 pub struct PathGetCurveUuidsForVertices {
1865 pub path_id: Uuid,
1867
1868 pub vertex_ids: Vec<Uuid>,
1870 }
1871
1872 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1874 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1875 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1876 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1877 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1878 pub struct PathGetCurveUuid {
1879 pub path_id: Uuid,
1881
1882 pub index: u32,
1884 }
1885
1886 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1888 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1889 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1890 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1891 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1892 pub struct PathGetVertexUuids {
1893 pub path_id: Uuid,
1895 }
1896
1897 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1899 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1900 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1901 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1902 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1903 pub struct PathGetSketchTargetUuid {
1904 pub path_id: Uuid,
1906 }
1907
1908 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1910 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1911 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1912 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1913 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1914 pub struct HandleMouseDragStart {
1915 pub window: Point2d,
1917 }
1918
1919 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1921 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1922 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1923 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1924 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1925 pub struct HandleMouseDragMove {
1926 pub window: Point2d,
1928 pub sequence: Option<u32>,
1933 }
1934
1935 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1937 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1938 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1939 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1940 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1941 pub struct HandleMouseDragEnd {
1942 pub window: Point2d,
1944 }
1945
1946 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1948 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1949 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1950 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1951 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1952 pub struct RemoveSceneObjects {
1953 pub object_ids: HashSet<Uuid>,
1955 }
1956
1957 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1960 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1961 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1962 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1963 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1964 pub struct PlaneIntersectAndProject {
1965 pub plane_id: Uuid,
1967 pub window: Point2d,
1969 }
1970
1971 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1973 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1974 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1975 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1976 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1977 pub struct CurveGetEndPoints {
1978 pub curve_id: Uuid,
1980 }
1981
1982 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1984 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1985 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1986 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1987 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1988 pub struct ReconfigureStream {
1989 pub width: u32,
1991 pub height: u32,
1993 pub fps: u32,
1995 #[serde(default)]
1997 pub bitrate: Option<u32>,
1998 }
1999
2000 #[derive(Debug, Eq, PartialEq, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2002 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2003 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2004 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2005 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2006 pub struct ImportFiles {
2007 pub files: Vec<super::ImportFile>,
2009 pub format: crate::format::InputFormat3d,
2011 }
2012
2013 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2019 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2020 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2021 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2022 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2023 pub struct SetSceneUnits {
2024 pub unit: units::UnitLength,
2026 }
2027
2028 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2030 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2031 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2032 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2033 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2034 pub struct Mass {
2035 #[builder(default)]
2038 pub entity_ids: Vec<Uuid>,
2039 pub material_density: f64,
2041 pub material_density_unit: units::UnitDensity,
2043 pub output_unit: units::UnitMass,
2045 }
2046
2047 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2049 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2050 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2051 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2052 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2053 pub struct Density {
2054 #[builder(default)]
2057 pub entity_ids: Vec<Uuid>,
2058 pub material_mass: f64,
2060 pub material_mass_unit: units::UnitMass,
2062 pub output_unit: units::UnitDensity,
2064 }
2065
2066 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2068 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2069 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2070 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2071 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2072 pub struct Volume {
2073 #[builder(default)]
2076 pub entity_ids: Vec<Uuid>,
2077 pub output_unit: units::UnitVolume,
2079 }
2080
2081 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2083 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2084 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2085 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2086 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2087 pub struct CenterOfMass {
2088 #[builder(default)]
2091 pub entity_ids: Vec<Uuid>,
2092 pub output_unit: units::UnitLength,
2094 }
2095
2096 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2098 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2099 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2100 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2101 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2102 pub struct SurfaceArea {
2103 #[builder(default)]
2106 pub entity_ids: Vec<Uuid>,
2107 pub output_unit: units::UnitArea,
2109 }
2110
2111 #[derive(
2113 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
2114 Builder
2115 )]
2116 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2117 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2118 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2119 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2120 pub struct DefaultCameraFocusOn {
2121 pub uuid: Uuid,
2123 }
2124 #[derive(
2126 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
2127 Builder
2128 )]
2129 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2130 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2131 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2132 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2133 pub struct SetSelectionType {
2134 pub selection_type: SceneSelectionType,
2136 }
2137
2138 #[derive(
2140 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
2141 Builder
2142 )]
2143 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2144 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2145 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2146 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2147 pub struct SetSelectionFilter {
2148 pub filter: Vec<EntityType>,
2151 }
2152
2153 #[derive(
2155 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
2156 Builder
2157 )]
2158 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2159 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2160 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2161 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2162 pub struct SceneGetEntityIds {
2163 pub filter: Vec<EntityType>,
2165 pub skip: u32,
2168 #[schemars(range(min = 1, max = 1000))]
2173 pub take: u32,
2174 }
2175
2176 #[derive(
2178 Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
2179 Builder
2180 )]
2181 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2182 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2183 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2184 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2185 pub struct DefaultCameraSetOrthographic {}
2186
2187 #[derive(
2189 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
2190 Builder
2191 )]
2192 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2193 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2194 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2195 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2196 pub struct DefaultCameraSetPerspective {
2197 pub parameters: Option<PerspectiveCameraParameters>,
2199 }
2200
2201 #[derive(
2204 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder
2205 )]
2206 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2207 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2208 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2209 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2210 pub struct DefaultCameraCenterToSelection {
2211 #[serde(default)]
2214 #[builder(default)]
2215 pub camera_movement: CameraMovement,
2216 }
2217
2218 #[derive(
2220 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder
2221 )]
2222 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2223 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2224 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2225 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2226 pub struct DefaultCameraCenterToScene {
2227 #[serde(default)]
2230 #[builder(default)]
2231 pub camera_movement: CameraMovement,
2232 }
2233
2234 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2236 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2237 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2238 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2239 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2240 pub struct ZoomToFit {
2241 #[serde(default)]
2243 #[builder(default)]
2244 pub object_ids: Vec<Uuid>,
2245 #[serde(default)]
2250 #[builder(default)]
2251 pub padding: f32,
2252 #[serde(default)]
2254 #[builder(default)]
2255 pub animated: bool,
2256 }
2257
2258 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2260 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2261 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2262 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2263 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2264 pub struct OrientToFace {
2265 pub face_id: Uuid,
2267 #[serde(default)]
2272 #[builder(default)]
2273 pub padding: f32,
2274 #[serde(default)]
2276 #[builder(default)]
2277 pub animated: bool,
2278 }
2279
2280 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2282 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2283 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2284 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2285 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2286 pub struct ViewIsometric {
2287 #[serde(default)]
2292 #[builder(default)]
2293 pub padding: f32,
2294 }
2295
2296 #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
2298 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2299 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2300 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2301 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2302 pub struct Solid3dGetExtrusionFaceInfo {
2303 pub object_id: Uuid,
2305 pub edge_id: Uuid,
2307 }
2308
2309 #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
2311 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2312 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2313 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2314 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2315 pub struct Solid3dGetAdjacencyInfo {
2316 pub object_id: Uuid,
2318 pub edge_id: Uuid,
2320 }
2321
2322
2323 #[derive(Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
2325 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2326 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2327 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2328 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2329 pub struct SelectClear {}
2330
2331 #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
2334 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2335 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2336 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2337 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2338 pub struct SelectEntity {
2339 pub entities: Vec<EntityReference>,
2341 }
2342
2343 #[derive(Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
2345 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2346 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2347 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2348 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2349 pub struct SelectGet {}
2350
2351 #[derive(
2353 Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
2354 Builder
2355 )]
2356 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2357 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2358 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2359 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2360 pub struct GetNumObjects {}
2361
2362 #[derive(
2364 Clone, Debug, Deserialize, PartialEq, JsonSchema, Serialize, ModelingCmdVariant,
2365 Builder
2366 )]
2367 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2368 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2369 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2370 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2371 pub struct SetObjectTransform
2372 {
2373 pub object_id: Uuid,
2375 pub transforms: Vec<ComponentTransform>,
2377 }
2378
2379 #[derive(
2382 Clone, Debug, Deserialize, PartialEq, JsonSchema, Serialize, ModelingCmdVariant,
2383 Builder
2384 )]
2385 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2386 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2387 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2388 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2389 pub struct BooleanUnion
2390 {
2391 pub solid_ids: Vec<Uuid>,
2394 #[serde(default)]
2396 #[builder(default)]
2397 pub separate_bodies: bool,
2398 #[serde(default, skip_serializing_if = "super::is_false")]
2400 #[builder(default)]
2401 pub use_legacy: bool,
2402 pub tolerance: LengthUnit,
2404 }
2405
2406 #[derive(
2409 Clone, Debug, Deserialize, PartialEq, JsonSchema, Serialize, ModelingCmdVariant,
2410 Builder
2411 )]
2412 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2413 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2414 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2415 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2416 pub struct BooleanIntersection
2417 {
2418 pub solid_ids: Vec<Uuid>,
2420 #[serde(default)]
2422 #[builder(default)]
2423 pub separate_bodies: bool,
2424 #[serde(default, skip_serializing_if = "super::is_false")]
2426 #[builder(default)]
2427 pub use_legacy: bool,
2428 pub tolerance: LengthUnit,
2430 }
2431
2432 #[derive(
2436 Clone, Debug, Deserialize, PartialEq, JsonSchema, Serialize, ModelingCmdVariant,
2437 Builder
2438 )]
2439 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2440 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2441 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2442 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2443 pub struct BooleanSubtract
2444 {
2445 pub target_ids: Vec<Uuid>,
2447 pub tool_ids: Vec<Uuid>,
2449 #[serde(default)]
2451 #[builder(default)]
2452 pub separate_bodies: bool,
2453 #[serde(default, skip_serializing_if = "super::is_false")]
2455 #[builder(default)]
2456 pub use_legacy: bool,
2457 pub tolerance: LengthUnit,
2459 }
2460
2461 #[derive(
2463 Clone, Debug, Deserialize, PartialEq, JsonSchema, Serialize, ModelingCmdVariant,
2464 Builder
2465 )]
2466 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2467 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2468 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2469 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2470 pub struct BooleanImprint
2471 {
2472 #[serde(alias = "target_ids")]
2474 pub body_ids: Vec<Uuid>,
2475 #[serde(default)]
2478 pub tool_ids: Option<Vec<Uuid>>,
2479 #[serde(default)]
2481 #[builder(default)]
2482 pub separate_bodies: bool,
2483 #[serde(default, skip_serializing_if = "super::is_false")]
2485 #[builder(default)]
2486 pub use_legacy: bool,
2487 #[serde(default)]
2489 #[builder(default)]
2490 pub keep_tools: bool,
2491 pub tolerance: LengthUnit,
2493 }
2494
2495 #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
2498 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2499 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2500 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2501 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2502 pub struct MakeOffsetPath {
2503 pub object_id: Uuid,
2505 #[serde(default)]
2510 pub face_id: Option<Uuid>,
2511 pub offset: LengthUnit,
2513 }
2514
2515 #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
2517 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2518 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2519 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2520 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2521 pub struct AddHoleFromOffset {
2522 pub object_id: Uuid,
2524 pub offset: LengthUnit,
2526 }
2527
2528 #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
2530 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2531 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2532 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2533 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2534 pub struct SetGridReferencePlane {
2535 pub grid_id: Uuid,
2537 pub reference_id: Uuid,
2540 }
2541
2542 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2544 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2545 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2546 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2547 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2548 pub struct SetGridScale {
2549 pub value: f32,
2551 pub units: units::UnitLength,
2553 }
2554
2555 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2558 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2559 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2560 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2561 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2562 pub struct SetGridAutoScale {
2563 }
2564
2565 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2568 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2569 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2570 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2571 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2572 pub struct SetOrderIndependentTransparency {
2573 pub enabled: Option<bool>,
2576 }
2577
2578 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2582 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2583 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2584 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2585 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2586 pub struct CreateRegion {
2587 pub object_id: Uuid,
2589 pub segment: Uuid,
2591 pub intersection_segment: Uuid,
2594 #[serde(default = "super::negative_one")]
2598 #[builder(default = super::negative_one())]
2599 pub intersection_index: i32,
2600 #[serde(default)]
2603 #[builder(default)]
2604 pub curve_clockwise: bool,
2605 #[serde(default, skip_serializing_if = "RegionVersion::is_zero")]
2607 #[builder(default)]
2608 pub version: RegionVersion,
2609 }
2610
2611 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2615 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2616 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2617 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2618 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2619 pub struct CreateRegionFromQueryPoint {
2620 pub object_id: Uuid,
2622
2623 pub query_point: Point2d<LengthUnit>,
2626 #[serde(default, skip_serializing_if = "RegionVersion::is_zero")]
2628 #[builder(default)]
2629 pub version: RegionVersion,
2630 }
2631
2632 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2634 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2635 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2636 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2637 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2638 pub struct RegionGetQueryPoint {
2639 pub region_id: Uuid,
2641 }
2642
2643 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2646 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2647 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2648 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2649 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2650 pub struct SelectRegionFromPoint {
2651 pub selected_at_window: Point2d,
2653 }
2654
2655 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2657 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2658 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2659 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2660 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2661 pub struct BoundingBox {
2662 #[builder(default)]
2665 pub entity_ids: Vec<Uuid>,
2666 #[builder(default = mm())]
2668 #[serde(default = "mm")]
2669 pub output_unit: units::UnitLength,
2670 }
2671
2672 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2674 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2675 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2676 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2677 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2678 pub struct OffsetSurface {
2679 pub surface_id: Uuid,
2681 pub distance: LengthUnit,
2683 pub flip: bool,
2685 }
2686
2687 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2689 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2690 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2691 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2692 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2693 pub struct ClosestEdge {
2694 #[serde(default)]
2697 pub object_id: Option<Uuid>,
2698 pub closest_to: Point3d<f64>,
2701 }
2702 }
2703
2704
2705}
2706
2707pub(crate) fn is_false(b: &bool) -> bool {
2708 !b
2709}
2710
2711pub(crate) fn negative_one() -> i32 {
2712 -1
2713}
2714
2715impl ModelingCmd {
2716 pub fn is_safe_to_batch(&self) -> bool {
2718 use ModelingCmd::*;
2719 matches!(
2720 self,
2721 MovePathPen(_)
2722 | ExtendPath(_)
2723 | Extrude(_)
2724 | Revolve(_)
2725 | Solid3dFilletEdge(_)
2726 | ClosePath(_)
2727 | UpdateAnnotation(_)
2728 | ObjectVisible(_)
2729 | ObjectBringToFront(_)
2730 | Solid2dAddHole(_)
2731 | SendObject(_)
2732 | EntitySetOpacity(_)
2733 | PlaneSetColor(_)
2734 | SetTool(_)
2735 )
2736 }
2737}
2738
2739#[derive(Clone, Serialize, Deserialize, JsonSchema, Eq, PartialEq, bon::Builder)]
2743#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2744#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2745#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2746#[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2747pub struct ImportFile {
2748 pub path: String,
2750 #[serde(
2752 serialize_with = "serde_bytes::serialize",
2753 deserialize_with = "serde_bytes::deserialize"
2754 )]
2755 pub data: Vec<u8>,
2756}
2757
2758impl std::fmt::Debug for ImportFile {
2759 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2760 f.debug_struct("ImportFile")
2761 .field("path", &self.path)
2762 .field("data", &"<redacted>")
2763 .finish()
2764 }
2765}