Skip to main content

kittycad_modeling_cmds/
def_enum.rs

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                ComponentTransform,
32                RelativeTo,
33                CutType, CutTypeV2,
34                CutStrategy,
35                CameraMovement,
36                EdgeSpecifier,
37                EntityReference,
38                ExtrudedFaceInfo, ExtrudeMethod,
39                AnnotationOptions, AnnotationType, CameraDragInteractionType, Color, DistanceType, EntityType,
40                PathComponentConstraintBound, PathComponentConstraintType, PathSegment, PerspectiveCameraParameters,
41                Point2d, Point3d, ExtrudeReference, SceneSelectionType, SceneToolType, SurfaceEdgeReference, Opposite,
42            },
43            units,
44        };
45
46        /// Mike says this usually looks nice.
47        fn default_animation_seconds() -> f64 {
48            0.4
49        }
50
51        fn mm() -> crate::units::UnitLength {
52            crate::units::UnitLength::Millimeters
53        }
54
55        /// Evaluates the position of a path in one shot (engine utility for kcl executor)
56        #[derive(
57            Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
58        )]
59        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
60        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
61        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
62        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
63        pub struct EngineUtilEvaluatePath {
64            /// The path in json form (the serialized result of the kcl Sketch/Path object
65            pub path_json: String,
66
67            /// The evaluation parameter (path curve parameter in the normalized domain [0, 1])
68            pub t: f64,
69        }
70
71        /// Start a new path.
72        #[derive(
73            Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant,
74            Builder
75        )]
76        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
77        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
78        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
79        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
80        pub struct StartPath {}
81
82        /// Move the path's "pen".
83        /// If you're in sketch mode, these coordinates are in the local coordinate system,
84        /// not the world's coordinate system.
85        /// For example, say you're sketching on the plane {x: (1,0,0), y: (0,1,0), origin: (0, 0, 50)}.
86        /// In other words, the plane 50 units above the default XY plane. Then, moving the pen
87        /// to (1, 1, 0) with this command uses local coordinates. So, it would move the pen to
88        /// (1, 1, 50) in global coordinates.
89        #[derive(
90            Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
91        )]
92        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
93        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
94        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
95        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
96        pub struct MovePathPen {
97            /// The ID of the command which created the path.
98            pub path: ModelingCmdId,
99            /// Where the path's pen should be.
100            pub to: Point3d<LengthUnit>,
101        }
102
103        /// Extend a path by adding a new segment which starts at the path's "pen".
104        /// If no "pen" location has been set before (via `MovePen`), then the pen is at the origin.
105        #[derive(
106            Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
107        )]
108        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
109        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
110        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
111        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
112        pub struct ExtendPath {
113            /// The ID of the command which created the path.
114            pub path: ModelingCmdId,
115            /// Segment to append to the path.
116            /// This segment will implicitly begin at the current "pen" location.
117            pub segment: PathSegment,
118            /// Optional label to associate with the new path segment.
119            #[serde(default, skip_serializing_if = "Option::is_none")]
120            pub label: Option<String>,
121        }
122
123        /// Command for extruding a solid 2d.
124        #[derive(
125            Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
126        )]
127        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
128        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
129        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
130        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
131        pub struct Extrude {
132            /// Which sketch to extrude.
133            /// Must be a closed 2D solid.
134            pub target: ModelingCmdId,
135            /// How far off the plane to extrude
136            pub distance: LengthUnit,
137            /// What draft angle should be used in this extrusion?
138            /// Negative values indicate an outward draft,
139            /// while positive values indicate an inward draft
140            #[serde(default, skip_serializing_if = "Option::is_none")]
141            pub draft_angle: Option<Angle>,
142            /// Which IDs should the new faces have?
143            /// If this isn't given, the engine will generate IDs.
144            #[serde(default)]
145            pub faces: Option<ExtrudedFaceInfo>,
146            /// Should the extrusion also extrude in the opposite direction?
147            /// If so, this specifies its distance.
148            #[serde(default)]
149            #[builder(default)]
150            pub opposite: Opposite<LengthUnit>,
151            /// Should the extrusion create a new object or be part of the existing object.
152            #[builder(default)]
153            #[serde(default)]
154            pub extrude_method: ExtrudeMethod,
155            /// Only used if the extrusion is created from a face and extrude_method = Merge
156            /// If true, coplanar faces will be merged and seams will be hidden.
157            /// Otherwise, seams between the extrusion and original body will be shown.
158            #[serde(default, skip_serializing_if = "Option::is_none")]
159            pub merge_coplanar_faces: Option<bool>,
160
161            /// Should this extrude create a solid body or a surface?
162            #[serde(default)]
163            #[builder(default)]
164            pub body_type: BodyType,
165        }
166
167        /// Command for extruding a solid 2d to a reference geometry.
168        #[derive(
169            Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
170        )]
171        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
172        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
173        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
174        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
175        pub struct ExtrudeToReference {
176            /// Which sketch to extrude.
177            /// Must be a closed 2D solid.
178            pub target: ModelingCmdId,
179            /// Reference to extrude to.
180            /// Extrusion occurs along the target's normal until it is as close to the reference as possible.
181            pub reference: ExtrudeReference,
182            /// Which IDs should the new faces have?
183            /// If this isn't given, the engine will generate IDs.
184            #[serde(default)]
185            pub faces: Option<ExtrudedFaceInfo>,
186            /// Should the extrusion create a new object or be part of the existing object.
187            #[serde(default)]
188            #[builder(default)]
189            pub extrude_method: ExtrudeMethod,
190            /// Should this extrude create a solid body or a surface?
191            #[serde(default)]
192            #[builder(default)]
193            pub body_type: BodyType,
194        }
195
196        fn default_twist_extrude_section_interval() -> Angle {
197            Angle::from_degrees(15.0)
198        }
199
200        /// Command for twist extruding a solid 2d.
201        #[derive(
202            Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
203        )]
204        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
205        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
206        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
207        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
208        pub struct TwistExtrude {
209            /// Which sketch to extrude.
210            /// Must be a closed 2D solid.
211            pub target: ModelingCmdId,
212            /// How far off the plane to extrude
213            pub distance: LengthUnit,
214            /// Which IDs should the new faces have?
215            /// If this isn't given, the engine will generate IDs.
216            #[serde(default)]
217            pub faces: Option<ExtrudedFaceInfo>,
218            /// Center to twist about (relative to plane's origin)
219            /// Defaults to `[0, 0]` i.e. the plane's origin
220            #[serde(default)]
221            #[builder(default)]
222            pub center_2d: Point2d<f64>,
223            /// Total rotation of the section
224            pub total_rotation_angle: Angle,
225            /// Angle step interval (converted to whole number degrees and bounded between 4° and 90°)
226            #[serde(default = "default_twist_extrude_section_interval")]
227            #[builder(default = default_twist_extrude_section_interval())]
228            pub angle_step_size: Angle,
229            /// The twisted surface loft tolerance
230            pub tolerance: LengthUnit,
231            /// Should this extrude create a solid body or a surface?
232            #[serde(default)]
233            #[builder(default)]
234            pub body_type: BodyType,
235        }
236
237        /// Extrude the object along a path.
238        #[derive(
239            Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder
240        )]
241        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
242        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
243        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
244        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
245        pub struct Sweep {
246            /// Which sketch to sweep.
247            /// Must be a closed 2D solid.
248            pub target: ModelingCmdId,
249            /// Path along which to sweep.
250            pub trajectory: ModelingCmdId,
251            /// If true, the sweep will be broken up into sub-sweeps (extrusions, revolves, sweeps) based on the trajectory path components.
252            pub sectional: bool,
253            /// The maximum acceptable surface gap computed between the revolution surface joints. Must be positive (i.e. greater than zero).
254            pub tolerance: LengthUnit,
255            /// Should this sweep create a solid body or a surface?
256            #[serde(default)]
257            #[builder(default)]
258            pub body_type: BodyType,
259            /// What is this sweep relative to?
260            #[serde(default)]
261            #[builder(default)]
262            pub relative_to: RelativeTo,
263            /// What version of the sweeping algorithm to use. If None, or zero, the engine's
264            /// default algorithm will be used
265            #[serde(default, skip_serializing_if = "Option::is_none")]
266            pub version: Option<u8>,
267        }
268
269        /// Command for revolving a solid 2d.
270        #[derive(
271            Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
272        )]
273        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
274        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
275        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
276        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
277        pub struct Revolve {
278            /// Which sketch to revolve.
279            /// Must be a closed 2D solid.
280            pub target: ModelingCmdId,
281            /// The origin of the extrusion axis
282            pub origin: Point3d<LengthUnit>,
283            /// The axis of the extrusion (taken from the origin)
284            pub axis: Point3d<f64>,
285            /// If true, the axis is interpreted within the 2D space of the solid 2D's plane
286            pub axis_is_2d: bool,
287            /// The signed angle of revolution (in degrees, must be <= 360 in either direction)
288            pub angle: Angle,
289            /// The maximum acceptable surface gap computed between the revolution surface joints. Must be positive (i.e. greater than zero).
290            pub tolerance: LengthUnit,
291            /// Should the revolution also revolve in the opposite direction along the given axis?
292            /// If so, this specifies its angle.
293            #[serde(default)]
294            #[builder(default)]
295            pub opposite: Opposite<Angle>,
296            /// Should this extrude create a solid body or a surface?
297            #[serde(default)]
298            #[builder(default)]
299            pub body_type: BodyType,
300        }
301
302        /// Command for shelling a solid3d face
303        #[derive(
304            Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
305        )]
306        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
307        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
308        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
309        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
310        pub struct Solid3dShellFace {
311            /// Which Solid3D is being shelled.
312            pub object_id: Uuid,
313            /// Which faces to remove, leaving only the shell.
314            pub face_ids: Vec<Uuid>,
315            /// How thick the shell should be.
316            /// Smaller values mean a thinner shell.
317            pub shell_thickness: LengthUnit,
318            /// If true, the Solid3D is made hollow instead of removing the selected faces
319            #[serde(default)]
320            #[builder(default)]
321            pub hollow: bool,
322        }
323
324        /// Command for joining a Surface (non-manifold) body back to a Solid.
325        /// All of the surfaces should already be contained within the body mated topologically.
326        /// This operation should be the final step after a sequence of Solid modeling commands such as
327        /// BooleanImprint, EntityDeleteChildren, Solid3dFlipFace
328        /// If successful, the new body type will become "Solid".
329        #[derive(
330            Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
331        )]
332        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
333        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
334        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
335        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
336        pub struct Solid3dJoin {
337            /// Which Solid3D is being joined.
338            pub object_id: Uuid,
339        }
340
341        /// Command for joining multiple Surfaces (non-manifold) to a Solid.
342        #[derive(
343            Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
344        )]
345        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
346        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
347        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
348        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
349        pub struct Solid3dMultiJoin {
350            /// Which bodies are being joined.
351            pub object_ids: Vec<Uuid>,
352            /// The maximum acceptable surface gap computed between the joints. Must be positive (i.e. greater than zero).
353            pub tolerance: LengthUnit,
354        }
355
356
357        /// Command for creating a blend between the edge of two given surfaces
358        #[derive(
359            Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
360        )]
361        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
362        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
363        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
364        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
365        pub struct SurfaceBlend {
366            /// The two surfaces that the blend will span between
367            #[schemars(length(min = 2, max = 2))]
368            pub surfaces: Vec<SurfaceEdgeReference>,
369            /// The type of blend to use.
370            #[serde(default)]
371            #[builder(default)]
372            pub blend_type: BlendType,
373        }
374
375        /// What is the UUID of this body's n-th edge?
376        #[derive(
377            Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
378        )]
379        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
380        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
381        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
382        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
383        pub struct Solid3dGetEdgeUuid {
384            /// The Solid3D parent who owns the edge
385            pub object_id: Uuid,
386
387            /// The primitive index of the edge being queried.
388            pub edge_index: u32,
389        }
390
391        /// What is the UUID of this body's n-th face?
392        #[derive(
393            Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
394        )]
395        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
396        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
397        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
398        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
399        pub struct Solid3dGetFaceUuid {
400            /// The Solid3D parent who owns the face
401            pub object_id: Uuid,
402
403            /// The primitive index of the face being queried.
404            pub face_index: u32,
405        }
406
407        /// Retrieves the body type.
408        #[derive(
409            Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
410        )]
411        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
412        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
413        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
414        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
415        pub struct Solid3dGetBodyType {
416            /// The Solid3D whose body type is being queried.
417            pub object_id: Uuid,
418        }
419
420        /// Command for revolving a solid 2d about a brep edge
421        #[derive(
422            Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
423        )]
424        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
425        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
426        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
427        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
428        pub struct RevolveAboutEdge {
429            /// Which sketch to revolve.
430            /// Must be a closed 2D solid.
431            pub target: ModelingCmdId,
432            /// The edge to use as the axis of revolution, must be linear and lie in the plane of the solid
433            #[serde(default, skip_serializing_if = "Option::is_none")]
434            pub edge_id: Option<Uuid>,
435            /// Edge reference to use as the axis of revolution (new API).
436            /// If both `edge_id` and `edge_reference` are provided, `edge_reference` takes precedence.
437            #[serde(default, skip_serializing_if = "Option::is_none")]
438            pub edge_reference: Option<EdgeSpecifier>,
439            /// The signed angle of revolution (in degrees, must be <= 360 in either direction)
440            pub angle: Angle,
441            /// The maximum acceptable surface gap computed between the revolution surface joints. Must be positive (i.e. greater than zero).
442            pub tolerance: LengthUnit,
443            /// Should the revolution also revolve in the opposite direction along the given axis?
444            /// If so, this specifies its angle.
445            #[serde(default)]
446            #[builder(default)]
447            pub opposite: Opposite<Angle>,
448            /// Should this extrude create a solid body or a surface?
449            #[serde(default)]
450            #[builder(default)]
451            pub body_type: BodyType,
452        }
453
454        /// Command for lofting sections to create a solid
455        #[derive(
456            Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
457        )]
458        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
459        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
460        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
461        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
462        pub struct Loft {
463            /// The closed section curves to create a lofted solid from.
464            /// Currently, these must be Solid2Ds
465            pub section_ids: Vec<Uuid>,
466            /// Degree of the interpolation. Must be greater than zero.
467            /// For example, use 2 for quadratic, or 3 for cubic interpolation in the V direction.
468            pub v_degree: std::num::NonZeroU32,
469            /// Attempt to approximate rational curves (such as arcs) using a bezier.
470            /// This will remove banding around interpolations between arcs and non-arcs.  It may produce errors in other scenarios
471            /// Over time, this field won't be necessary.
472            pub bez_approximate_rational: bool,
473            /// This can be set to override the automatically determined topological base curve, which is usually the first section encountered.
474            pub base_curve_index: Option<u32>,
475            /// Tolerance
476            pub tolerance: LengthUnit,
477            /// Should this loft create a solid body or a surface?
478            #[serde(default)]
479            #[builder(default)]
480            pub body_type: BodyType,
481        }
482
483
484        /// Closes a path, converting it to a 2D solid.
485        #[derive(
486            Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
487        )]
488        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
489        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
490        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
491        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
492        pub struct ClosePath {
493            /// Which path to close.
494            pub path_id: Uuid,
495        }
496
497        /// Camera drag started.
498        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
499        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
500        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
501        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
502        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
503        pub struct CameraDragStart {
504            /// The type of camera drag interaction.
505            pub interaction: CameraDragInteractionType,
506            /// The initial mouse position.
507            pub window: Point2d,
508        }
509
510        /// Camera drag continued.
511        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
512        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
513        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
514        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
515        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
516        pub struct CameraDragMove {
517            /// The type of camera drag interaction.
518            pub interaction: CameraDragInteractionType,
519            /// The current mouse position.
520            pub window: Point2d,
521            /// Logical timestamp. The client should increment this
522            /// with every event in the current mouse drag. That way, if the
523            /// events are being sent over an unordered channel, the API
524            /// can ignore the older events.
525            pub sequence: Option<u32>,
526        }
527
528        /// Camera drag ended
529        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
530        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
531        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
532        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
533        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
534        pub struct CameraDragEnd {
535            /// The type of camera drag interaction.
536            pub interaction: CameraDragInteractionType,
537            /// The final mouse position.
538            pub window: Point2d,
539        }
540
541        /// Gets the default camera's camera settings
542        #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
543        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
544        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
545        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
546        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
547        pub struct DefaultCameraGetSettings {}
548
549        /// Gets the default camera's view state
550        #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
551        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
552        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
553        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
554        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
555        pub struct DefaultCameraGetView {}
556
557        /// Sets the default camera's view state
558        #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
559        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
560        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
561        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
562        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
563        pub struct DefaultCameraSetView {
564            /// Camera view state
565            pub view: CameraViewState,
566        }
567
568        /// Change what the default camera is looking at.
569        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
570        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
571        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
572        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
573        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
574        pub struct DefaultCameraLookAt {
575            /// Where the camera is positioned
576            pub vantage: Point3d,
577            /// What the camera is looking at. Center of the camera's field of vision
578            pub center: Point3d,
579            /// Which way is "up", from the camera's point of view.
580            pub up: Point3d,
581            /// Logical timestamp. The client should increment this
582            /// with every event in the current mouse drag. That way, if the
583            /// events are being sent over an unordered channel, the API
584            /// can ignore the older events.
585            pub sequence: Option<u32>,
586        }
587
588        /// Change what the default camera is looking at.
589        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
590        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
591        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
592        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
593        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
594        pub struct DefaultCameraPerspectiveSettings {
595            /// Where the camera is positioned
596            pub vantage: Point3d,
597            /// What the camera is looking at. Center of the camera's field of vision
598            pub center: Point3d,
599            /// Which way is "up", from the camera's point of view.
600            pub up: Point3d,
601            /// The field of view angle in the y direction, in degrees.
602            pub fov_y: Option<f32>,
603            /// The distance to the near clipping plane.
604            pub z_near: Option<f32>,
605            /// The distance to the far clipping plane.
606            pub z_far: Option<f32>,
607            /// Logical timestamp. The client should increment this
608            /// with every event in the current mouse drag. That way, if the
609            /// events are being sent over an unordered channel, the API
610            /// can ignore the older events.
611            pub sequence: Option<u32>,
612        }
613
614        /// Adjust zoom of the default camera.
615        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
616        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
617        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
618        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
619        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
620        pub struct DefaultCameraZoom {
621            /// Move the camera forward along the vector it's looking at,
622            /// by this magnitudedefaultCameraZoom.
623            /// Basically, how much should the camera move forward by.
624            pub magnitude: f32,
625        }
626
627        /// Export a sketch to a file.
628        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
629        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
630        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
631        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
632        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
633        pub struct Export2d {
634            /// IDs of the entities to be exported.
635            pub entity_ids: Vec<Uuid>,
636            /// The file format to export to.
637            pub format: OutputFormat2d,
638        }
639
640        /// Export the scene to a file.
641        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
642        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
643        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
644        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
645        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
646        pub struct Export3d {
647            /// IDs of the entities to be exported. If this is empty, then all entities are exported.
648            #[builder(default)]
649            pub entity_ids: Vec<Uuid>,
650            /// The file format to export to.
651            pub format: OutputFormat3d,
652        }
653
654        /// Export the scene to a file.
655        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
656        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
657        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
658        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
659        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
660        pub struct Export {
661            /// IDs of the entities to be exported. If this is empty, then all entities are exported.
662            #[builder(default)]
663            pub entity_ids: Vec<Uuid>,
664            /// The file format to export to.
665            pub format: OutputFormat3d,
666        }
667
668        /// What is this entity's parent?
669        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
670        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
671        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
672        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
673        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
674        pub struct EntityGetParentId {
675            /// ID of the entity being queried.
676            pub entity_id: Uuid,
677        }
678
679        /// How many children does the entity have?
680        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
681        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
682        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
683        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
684        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
685        pub struct EntityGetNumChildren {
686            /// ID of the entity being queried.
687            pub entity_id: Uuid,
688        }
689
690        /// What is the UUID of this entity's n-th child?
691        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
692        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
693        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
694        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
695        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
696        pub struct EntityGetChildUuid {
697            /// ID of the entity being queried.
698            pub entity_id: Uuid,
699            /// Index into the entity's list of children.
700            pub child_index: u32,
701        }
702
703        /// What is this entity's child index within its parent
704        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
705        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
706        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
707        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
708        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
709        pub struct EntityGetIndex {
710            /// ID of the entity being queried.
711            pub entity_id: Uuid,
712        }
713
714        /// What is this edge or face entity's primitive index within its parent body's edges or faces array respectively
715        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
716        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
717        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
718        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
719        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
720        pub struct EntityGetPrimitiveIndex {
721            /// ID of the entity being queried.
722            pub entity_id: Uuid,
723        }
724
725        /// Attempts to delete children entity from an entity.
726        /// Note that this API may change the body type of certain entities from Solid to Surface.
727        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
728        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
729        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
730        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
731        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
732        pub struct EntityDeleteChildren {
733            /// ID of the entity being modified
734            pub entity_id: Uuid,
735            /// ID of the entity's child being deleted
736            pub child_entity_ids: HashSet<Uuid>,
737        }
738
739        /// What are all UUIDs of this entity's children?
740        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
741        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
742        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
743        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
744        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
745        pub struct EntityGetAllChildUuids {
746            /// ID of the entity being queried.
747            pub entity_id: Uuid,
748        }
749
750        /// What are all UUIDs of all the paths sketched on top of this entity?
751        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
752        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
753        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
754        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
755        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
756        pub struct EntityGetSketchPaths {
757            /// ID of the entity being queried.
758            pub entity_id: Uuid,
759        }
760
761        /// What is the distance between these two entities?
762        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
763        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
764        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
765        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
766        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
767        pub struct EntityGetDistance {
768            /// ID of the first entity being queried.
769            pub entity_id1: Uuid,
770            /// ID of the second entity being queried.
771            pub entity_id2: Uuid,
772            /// Type of distance to be measured.
773            pub distance_type: DistanceType,
774        }
775
776        /// Create a pattern using this entity by specifying the transform for each desired repetition.
777        /// Transformations are performed in the following order (first applied to last applied): scale, rotate, translate.
778        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
779        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
780        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
781        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
782        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
783        pub struct EntityClone {
784            /// ID of the entity being cloned.
785            pub entity_id: Uuid,
786        }
787
788        /// Create a pattern using this entity by specifying the transform for each desired repetition.
789        /// Transformations are performed in the following order (first applied to last applied): scale, rotate, translate.
790        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
791        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
792        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
793        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
794        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
795        pub struct EntityLinearPatternTransform {
796            /// ID of the entity being copied.
797            pub entity_id: Uuid,
798            /// How to transform each repeated solid.
799            /// The 0th transform will create the first copy of the entity.
800            /// The total number of (optional) repetitions equals the size of this list.
801            #[serde(default)]
802            #[builder(default)]
803            pub transform: Vec<crate::shared::Transform>,
804            /// Alternatively, you could set this key instead.
805            /// If you want to use multiple transforms per item.
806            /// If this is non-empty then the `transform` key must be empty, and vice-versa.
807            #[serde(default)]
808            #[builder(default)]
809            pub transforms: Vec<Vec<crate::shared::Transform>>,
810        }
811
812        /// Create a linear pattern using this entity.
813        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
814        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
815        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
816        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
817        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
818        pub struct EntityLinearPattern {
819            /// ID of the entity being copied.
820            pub entity_id: Uuid,
821            /// Axis along which to make the copies.
822            /// For Solid2d patterns, the z component is ignored.
823            pub axis: Point3d<f64>,
824            /// Number of repetitions to make.
825            pub num_repetitions: u32,
826            /// Spacing between repetitions.
827            pub spacing: LengthUnit,
828        }
829        /// Create a circular pattern using this entity.
830        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
831        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
832        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
833        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
834        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
835        pub struct EntityCircularPattern {
836            /// ID of the entity being copied.
837            pub entity_id: Uuid,
838            /// Axis around which to make the copies.
839            /// For Solid2d patterns, this is ignored.
840            pub axis: Point3d<f64>,
841            /// Point around which to make the copies.
842            /// For Solid2d patterns, the z component is ignored.
843            pub center: Point3d<LengthUnit>,
844            /// Number of repetitions to make.
845            pub num_repetitions: u32,
846            /// Arc angle (in degrees) to place repetitions along.
847            pub arc_degrees: f64,
848            /// Whether or not to rotate the objects as they are copied.
849            pub rotate_duplicates: bool,
850        }
851
852        /// Create a helix using the input cylinder and other specified parameters.
853        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
854        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
855        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
856        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
857        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
858        pub struct EntityMakeHelix {
859            /// ID of the cylinder.
860            pub cylinder_id: Uuid,
861            /// Number of revolutions.
862            pub revolutions: f64,
863            /// Start angle.
864            #[serde(default)]
865            #[builder(default)]
866            pub start_angle: Angle,
867            /// Is the helix rotation clockwise?
868            pub is_clockwise: bool,
869            /// Length of the helix. If None, the length of the cylinder will be used instead.
870            pub length: Option<LengthUnit>,
871        }
872
873        /// Create a helix using the specified parameters.
874        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
875        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
876        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
877        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
878        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
879        pub struct EntityMakeHelixFromParams {
880            /// Radius of the helix.
881            pub radius: LengthUnit,
882            /// Length of the helix.
883            pub length: LengthUnit,
884            /// Number of revolutions.
885            pub revolutions: f64,
886            /// Start angle.
887            #[serde(default)]
888            #[builder(default)]
889            pub start_angle: Angle,
890            /// Is the helix rotation clockwise?
891            pub is_clockwise: bool,
892            /// Center of the helix at the base of the helix.
893            pub center: Point3d<LengthUnit>,
894            /// Axis of the helix. The helix will be created around and in the direction of this axis.
895            pub axis: Point3d<f64>,
896        }
897
898        /// Create a helix using the specified parameters.
899        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
900        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
901        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
902        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
903        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
904        pub struct EntityMakeHelixFromEdge {
905            /// Radius of the helix.
906            pub radius: LengthUnit,
907            /// Length of the helix. If None, the length of the edge will be used instead.
908            pub length: Option<LengthUnit>,
909            /// Number of revolutions.
910            pub revolutions: f64,
911            /// Start angle.
912            #[serde(default)]
913            #[builder(default)]
914            pub start_angle: Angle,
915            /// Is the helix rotation clockwise?
916            pub is_clockwise: bool,
917            /// Edge ID about which to make the helix (legacy API, for backwards compatibility).
918            /// If both `edge_id` and `edge_reference` are provided, `edge_reference` takes precedence.
919            #[serde(default, skip_serializing_if = "Option::is_none")]
920            pub edge_id: Option<Uuid>,
921            /// Edge reference about which to make the helix (new API).
922            /// If both `edge_id` and `edge_reference` are provided, `edge_reference` takes precedence.
923            #[serde(default, skip_serializing_if = "Option::is_none")]
924            pub edge_reference: Option<EdgeSpecifier>,
925        }
926
927        /// Mirror the input entities over the specified axis, edge, or plane.
928        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
929        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
930        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
931        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
932        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
933        pub struct EntityMirrorAcross {
934            /// ID of the mirror entities.
935            pub ids: Vec<Uuid>,
936            /// What to mirror across
937            pub across: MirrorAcross,
938        }
939
940
941        /// Mirror the input entities over the specified axis.
942        /// Deprecated; please use `EntityMirrorAcross`
943        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
944        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
945        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
946        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
947        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
948        pub struct EntityMirror {
949            /// ID of the mirror entities.
950            pub ids: Vec<Uuid>,
951            /// Axis to use as mirror.
952            pub axis: Point3d<f64>,
953            /// Point through which the mirror axis passes.
954            pub point: Point3d<LengthUnit>,
955        }
956
957        /// Mirror the input entities over the specified edge.
958        /// Deprecated; please use `EntityMirrorAcross`
959        #[derive(
960            Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
961        )]
962        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
963        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
964        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
965        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
966        pub struct EntityMirrorAcrossEdge {
967            /// ID of the mirror entities.
968            pub ids: Vec<Uuid>,
969            /// The edge to use as the mirror axis (legacy API). Must be linear and lie in the plane of the solid.
970            /// If both `edge_id` and `edge_reference` are provided, `edge_reference` takes precedence.
971            #[serde(default, skip_serializing_if = "Option::is_none")]
972            pub edge_id: Option<Uuid>,
973            /// Edge reference to use as the mirror axis (new API).
974            /// If both `edge_id` and `edge_reference` are provided, `edge_reference` takes precedence.
975            #[serde(default, skip_serializing_if = "Option::is_none")]
976            pub edge_reference: Option<EdgeSpecifier>,
977        }
978
979        /// Modifies the selection by simulating a "mouse click" at the given x,y window coordinate
980        /// Returns ID of whatever was selected.
981        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
982        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
983        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
984        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
985        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
986        pub struct SelectWithPoint {
987            /// Where in the window was selected
988            pub selected_at_window: Point2d,
989            /// What entity was selected?
990            pub selection_type: SceneSelectionType,
991        }
992
993        /// Query the type of entity that was selected. E.g. if a face is selected the face id is
994        /// returned, if an edge/vertex is selected then the face ids that uniquely define the edge/vertex are
995        /// returned (typically two).
996        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
997        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
998        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
999        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1000        pub struct QueryEntityTypeWithPoint {
1001            /// Where in the window was selected
1002            pub selected_at_window: Point2d,
1003            /// What entity was selected?
1004            pub selection_type: SceneSelectionType,
1005        }
1006
1007        /// Query the type of entity given its id. E.g. if a face is selected the face id is
1008        /// returned, if an edge/vertex is selected then the face ids that uniquely define the edge/vertex are
1009        /// returned (typically two).
1010        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1011        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1012        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1013        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1014        pub struct QueryEntityType {
1015            /// The entity id to query
1016            pub entity_id: Uuid,
1017        }
1018
1019        /// Adds one or more entities (by UUID) to the selection.
1020        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1021        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1022        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1023        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1024        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1025        pub struct SelectAdd {
1026            /// Which entities to select
1027            pub entities: Vec<Uuid>,
1028        }
1029
1030        /// Removes one or more entities (by UUID) from the selection.
1031        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1032        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1033        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1034        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1035        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1036        pub struct SelectRemove {
1037            /// Which entities to unselect
1038            pub entities: Vec<Uuid>,
1039        }
1040
1041        /// Removes all of the Objects in the scene
1042        #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1043        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1044        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1045        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1046        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1047        pub struct SceneClearAll {}
1048
1049        /// Replaces current selection with these entities (by UUID).
1050        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1051        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1052        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1053        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1054        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1055        pub struct SelectReplace {
1056            /// Which entities to select
1057            pub entities: Vec<Uuid>,
1058        }
1059
1060        /// Changes the current highlighted entity to whichever one is at the given window coordinate.
1061        /// If there's no entity at this location, clears the highlight.
1062        #[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1063        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1064        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1065        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1066        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1067        pub struct HighlightSetEntity {
1068            /// Coordinates of the window being clicked
1069            pub selected_at_window: Point2d,
1070            /// Logical timestamp. The client should increment this
1071            /// with every event in the current mouse drag. That way, if the
1072            /// events are being sent over an unordered channel, the API
1073            /// can ignore the older events.
1074            pub sequence: Option<u32>,
1075        }
1076
1077        /// Changes the current highlighted entity to these entities.
1078        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1079        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1080        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1081        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1082        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1083        pub struct HighlightSetEntities {
1084            /// Highlight these entities.
1085            pub entities: Vec<Uuid>,
1086        }
1087
1088        /// Create a new annotation
1089        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1090        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1091        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1092        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1093        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1094        pub struct NewAnnotation {
1095            /// What should the annotation contain?
1096            pub options: AnnotationOptions,
1097            /// If true, any existing drawables within the obj will be replaced (the object will be reset)
1098            pub clobber: bool,
1099            /// What type of annotation to create.
1100            pub annotation_type: AnnotationType,
1101        }
1102
1103        /// Update an annotation
1104        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1105        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1106        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1107        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1108        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1109        pub struct UpdateAnnotation {
1110            /// Which annotation to update
1111            pub annotation_id: Uuid,
1112            /// If any of these fields are set, they will overwrite the previous options for the
1113            /// annotation.
1114            pub options: AnnotationOptions,
1115        }
1116
1117        /// Changes visibility of scene-wide edge lines on brep solids
1118        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1119        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1120        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1121        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1122        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1123        pub struct EdgeLinesVisible {
1124            /// Whether or not the edge lines should be hidden.
1125            pub hidden: bool,
1126        }
1127
1128        /// Hide or show an object
1129        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1130        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1131        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1132        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1133        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1134        pub struct ObjectVisible {
1135            /// Which object to change
1136            pub object_id: Uuid,
1137            /// Whether or not the object should be hidden.
1138            pub hidden: bool,
1139        }
1140
1141        /// Bring an object to the front of the scene
1142        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1143        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1144        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1145        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1146        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1147        pub struct ObjectBringToFront {
1148            /// Which object to change
1149            pub object_id: Uuid,
1150        }
1151
1152        /// Set the material properties of an object
1153        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1154        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1155        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1156        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1157        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1158        pub struct ObjectSetMaterialParamsPbr {
1159            /// Which object to change
1160            pub object_id: Uuid,
1161            /// Color of the new material
1162            pub color: Color,
1163            /// Metalness of the new material
1164            pub metalness: f32,
1165            /// Roughness of the new material
1166            pub roughness: f32,
1167            /// Ambient Occlusion of the new material
1168            pub ambient_occlusion: f32,
1169            /// Color of the backface
1170            #[serde(default, skip_serializing_if = "Option::is_none")]
1171            pub backface_color: Option<Color>,
1172        }
1173
1174        /// Set the name of an object
1175        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1176        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1177        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1178        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1179        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1180        pub struct ObjectSetName {
1181            /// Which object to change
1182            pub object_id: Uuid,
1183            /// Name of the object. Using a zero-length name unsets the name.
1184            #[serde(default, skip_serializing_if = "String::is_empty")]
1185            pub name: String,
1186        }
1187
1188        /// What type of entity is this?
1189        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1190        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1191        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1192        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1193        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1194        pub struct GetEntityType {
1195            /// ID of the entity being queried.
1196            pub entity_id: Uuid,
1197        }
1198
1199        /// Gets all faces which use the given edge.
1200        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1201        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1202        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1203        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1204        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1205        pub struct Solid3dGetAllEdgeFaces {
1206            /// Which object is being queried.
1207            pub object_id: Uuid,
1208            /// Which edge you want the faces of.
1209            pub edge_id: Uuid,
1210        }
1211
1212        /// Flips (reverses) a brep that is "inside-out".
1213        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1214        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1215        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1216        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1217        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1218        pub struct Solid3dFlip {
1219            /// Which object is being flipped.
1220            pub object_id: Uuid,
1221        }
1222
1223        /// Flips (reverses) a face.  If the solid3d body type is "Solid",
1224        /// then body type will become non-manifold ("Surface").
1225        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1226        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1227        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1228        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1229        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1230        pub struct Solid3dFlipFace {
1231            /// Which object is being queried.
1232            pub object_id: Uuid,
1233            /// Which face you want to flip.
1234            pub face_id: Uuid,
1235        }
1236
1237        /// Add a hole to a Solid2d object before extruding it.
1238        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1239        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1240        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1241        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1242        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1243        pub struct Solid2dAddHole {
1244            /// Which object to add the hole to.
1245            pub object_id: Uuid,
1246            /// The id of the path to use as the inner profile (hole).
1247            pub hole_id: Uuid,
1248        }
1249
1250        /// Gets all edges which are opposite the given edge, across all possible faces.
1251        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1252        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1253        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1254        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1255        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1256        pub struct Solid3dGetAllOppositeEdges {
1257            /// Which object is being queried.
1258            pub object_id: Uuid,
1259            /// Which edge you want the opposites of.
1260            pub edge_id: Uuid,
1261            /// If given, only faces parallel to this vector will be considered.
1262            pub along_vector: Option<Point3d<f64>>,
1263        }
1264
1265        /// Gets the edge opposite the given edge, along the given face.
1266        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1267        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1268        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1269        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1270        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1271        pub struct Solid3dGetOppositeEdge {
1272            /// Which object is being queried.
1273            pub object_id: Uuid,
1274            /// Which edge you want the opposite of.
1275            pub edge_id: Uuid,
1276            /// Which face is used to figure out the opposite edge?
1277            pub face_id: Uuid,
1278        }
1279
1280        /// Gets the next adjacent edge for the given edge, along the given face.
1281        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1282        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1283        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1284        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1285        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1286        pub struct Solid3dGetNextAdjacentEdge {
1287            /// Which object is being queried.
1288            pub object_id: Uuid,
1289            /// Which edge you want the opposite of.
1290            pub edge_id: Uuid,
1291            /// Which face is used to figure out the opposite edge?
1292            pub face_id: Uuid,
1293        }
1294
1295        /// Gets the previous adjacent edge for the given edge, along the given face.
1296        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1297        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1298        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1299        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1300        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1301        pub struct Solid3dGetPrevAdjacentEdge {
1302            /// Which object is being queried.
1303            pub object_id: Uuid,
1304            /// Which edge you want the opposite of.
1305            pub edge_id: Uuid,
1306            /// Which face is used to figure out the opposite edge?
1307            pub face_id: Uuid,
1308        }
1309
1310        /// Gets the shared edge between these two faces if it exists
1311        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1312        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1313        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1314        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1315        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1316        pub struct Solid3dGetCommonEdge {
1317            /// Which object is being queried.
1318            pub object_id: Uuid,
1319            /// The faces being queried
1320            pub face_ids: [Uuid; 2]
1321        }
1322
1323        /// Fillets the given edge with the specified radius.
1324        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1325        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1326        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1327        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1328        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1329        pub struct Solid3dFilletEdge {
1330            /// Which object is being filletted.
1331            pub object_id: Uuid,
1332            /// Which edge you want to fillet.
1333            #[serde(default)]
1334            pub edge_id: Option<Uuid>,
1335            /// Which edges you want to fillet.
1336            #[serde(default)]
1337            #[builder(default)]
1338            pub edge_ids: Vec<Uuid>,
1339            /// A struct containing the information required to reference an edge.
1340            #[serde(default, skip_serializing_if = "Vec::is_empty")]
1341            #[builder(default)]
1342            pub edges_references: Vec<EdgeSpecifier>,
1343            /// 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).
1344            pub radius: LengthUnit,
1345            /// The maximum acceptable surface gap computed between the filleted surfaces. Must be positive (i.e. greater than zero).
1346            pub tolerance: LengthUnit,
1347            /// How to apply the cut.
1348            #[serde(default)]
1349            #[builder(default)]
1350            pub cut_type: CutType,
1351            /// Which cutting algorithm to use.
1352            #[serde(default)]
1353            #[builder(default)]
1354            pub strategy: CutStrategy,
1355            /// What IDs should the resulting faces have?
1356            /// If you've only passed one edge ID, its ID will
1357            /// be the command ID used to send this command, and this
1358            /// field should be empty.
1359            /// If you've passed `n` IDs (to fillet `n` edges), then
1360            /// this should be length `n-1`, and the first edge will use
1361            /// the command ID used to send this command.
1362            #[serde(default)]
1363            #[builder(default)]
1364            pub extra_face_ids: Vec<Uuid>,
1365            /// If true, use the legacy CSG algorithm.
1366            #[serde(default, skip_serializing_if = "super::is_false")]
1367            #[builder(default)]
1368            pub use_legacy: bool,
1369        }
1370
1371        /// Cut the list of edge references with the given cut parameters
1372        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1373        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1374        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1375        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1376        pub struct Solid3dCutEdgeReferences {
1377            /// Which object is being cut.
1378            pub object_id: Uuid,
1379            /// A struct containing the information required to reference an edge.
1380            #[serde(default)]
1381            #[builder(default)]
1382            pub edges_references: Vec<EdgeSpecifier>,
1383            /// The cut type and information required to perform the cut.
1384            pub cut_type: CutTypeV2,
1385            /// The maximum acceptable surface gap computed between the cut surfaces. Must be
1386            /// positive (i.e. greater than zero).
1387            pub tolerance: LengthUnit,
1388            /// Which cutting algorithm to use.
1389            #[serde(default)]
1390            #[builder(default)]
1391            pub strategy: CutStrategy,
1392            /// What IDs should the resulting faces have?
1393            /// If you've only passed one edge ID, its ID will
1394            /// be the command ID used to send this command, and this
1395            /// field should be empty.
1396            /// If you've passed `n` IDs (to cut `n` edges), then
1397            /// this should be length `n-1`, and the first edge will use
1398            /// the command ID used to send this command.
1399            #[serde(default)]
1400            #[builder(default)]
1401            pub extra_face_ids: Vec<Uuid>,
1402            /// If true, use the legacy CSG algorithm.
1403            #[serde(default, skip_serializing_if = "super::is_false")]
1404            #[builder(default)]
1405            pub use_legacy: bool,
1406        }
1407
1408        /// Cut the list of given edges with the given cut parameters.
1409        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1410        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1411        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1412        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1413        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1414        pub struct Solid3dCutEdges {
1415            /// Which object is being cut.
1416            pub object_id: Uuid,
1417            /// Which edges you want to cut.
1418            #[serde(default)]
1419            #[builder(default)]
1420            pub edge_ids: Vec<Uuid>,
1421            /// The cut type and information required to perform the cut.
1422            pub cut_type: CutTypeV2,
1423            /// The maximum acceptable surface gap computed between the cut surfaces. Must be
1424            /// positive (i.e. greater than zero).
1425            pub tolerance: LengthUnit,
1426            /// Which cutting algorithm to use.
1427            #[serde(default)]
1428            #[builder(default)]
1429            pub strategy: CutStrategy,
1430            /// What IDs should the resulting faces have?
1431            /// If you've only passed one edge ID, its ID will
1432            /// be the command ID used to send this command, and this
1433            /// field should be empty.
1434            /// If you've passed `n` IDs (to cut `n` edges), then
1435            /// this should be length `n-1`, and the first edge will use
1436            /// the command ID used to send this command.
1437            #[serde(default)]
1438            #[builder(default)]
1439            pub extra_face_ids: Vec<Uuid>,
1440            /// If true, use the legacy CSG algorithm.
1441            #[serde(default, skip_serializing_if = "super::is_false")]
1442            #[builder(default)]
1443            pub use_legacy: bool,
1444        }
1445
1446        /// Determines whether a brep face is planar and returns its surface-local planar axes if so
1447        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1448        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1449        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1450        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1451        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1452        pub struct FaceIsPlanar {
1453            /// Which face is being queried.
1454            pub object_id: Uuid,
1455        }
1456
1457        /// Determines a position on a brep face evaluated by parameters u,v
1458        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1459        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1460        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1461        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1462        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1463        pub struct FaceGetPosition {
1464            /// Which face is being queried.
1465            pub object_id: Uuid,
1466
1467            /// The 2D parameter-space u,v position to evaluate the surface at
1468            pub uv: Point2d<f64>,
1469        }
1470
1471        ///Obtains the surface "center of mass"
1472        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1473        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1474        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1475        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1476        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1477        pub struct FaceGetCenter {
1478            /// Which face is being queried.
1479            pub object_id: Uuid,
1480        }
1481
1482        /// Determines the gradient (dFdu, dFdv) + normal vector on a brep face evaluated by parameters u,v
1483        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1484        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1485        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1486        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1487        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1488        pub struct FaceGetGradient {
1489            /// Which face is being queried.
1490            pub object_id: Uuid,
1491
1492            /// The 2D parameter-space u,v position to evaluate the surface at
1493            pub uv: Point2d<f64>,
1494        }
1495
1496        /// Send object to front or back.
1497        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1498        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1499        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1500        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1501        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1502        pub struct SendObject {
1503            /// Which object is being changed.
1504            pub object_id: Uuid,
1505            /// Bring to front = true, send to back = false.
1506            pub front: bool,
1507        }
1508        /// Set opacity of the entity.
1509        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1510        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1511        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1512        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1513        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1514        pub struct EntitySetOpacity {
1515            /// Which entity is being changed.
1516            pub entity_id: Uuid,
1517            /// How transparent should it be?
1518            /// 0 or lower is totally transparent.
1519            /// 1 or greater is totally opaque.
1520            pub opacity: f32,
1521        }
1522
1523        /// Fade entity in or out.
1524        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1525        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1526        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1527        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1528        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1529        pub struct EntityFade {
1530            /// Which entity is being changed.
1531            pub entity_id: Uuid,
1532            /// Fade in = true, fade out = false.
1533            pub fade_in: bool,
1534            /// How many seconds the animation should take.
1535            #[serde(default = "default_animation_seconds")]
1536            #[builder(default = default_animation_seconds())]
1537            pub duration_seconds: f64,
1538        }
1539
1540        /// Make a new plane
1541        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1542        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1543        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1544        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1545        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1546        pub struct MakePlane {
1547            /// Origin of the plane
1548            pub origin: Point3d<LengthUnit>,
1549            /// What should the plane's X axis be?
1550            pub x_axis: Point3d<f64>,
1551            /// What should the plane's Y axis be?
1552            pub y_axis: Point3d<f64>,
1553            /// What should the plane's span/extent?
1554            /// When rendered visually, this is both the
1555            /// width and height along X and Y axis respectively.
1556            pub size: LengthUnit,
1557            /// If true, any existing drawables within the obj will be replaced (the object will be reset)
1558            pub clobber: bool,
1559            /// If true, the plane will be created but hidden initially.
1560            pub hide: Option<bool>,
1561        }
1562
1563        /// Set the color of a plane.
1564        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1565        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1566        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1567        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1568        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1569        pub struct PlaneSetColor {
1570            /// Which plane is being changed.
1571            pub plane_id: Uuid,
1572            /// What color it should be.
1573            pub color: Color,
1574        }
1575
1576        /// Set the current tool.
1577        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1578        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1579        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1580        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1581        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1582        pub struct SetTool {
1583            /// What tool should be active.
1584            pub tool: SceneToolType,
1585        }
1586
1587        /// Send a mouse move event
1588        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1589        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1590        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1591        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1592        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1593        pub struct MouseMove {
1594            /// Where the mouse is
1595            pub window: Point2d,
1596            /// Logical timestamp. The client should increment this
1597            /// with every event in the current mouse drag. That way, if the
1598            /// events are being sent over an unordered channel, the API
1599            /// can ignore the older events.
1600            pub sequence: Option<u32>,
1601        }
1602
1603        /// Send a mouse click event
1604        /// Updates modified/selected entities.
1605        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1606        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1607        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1608        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1609        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1610        pub struct MouseClick {
1611            /// Where the mouse is
1612            pub window: Point2d,
1613        }
1614
1615        /// Disable sketch mode.
1616        /// If you are sketching on a face, be sure to not disable sketch mode until you have extruded.
1617        /// Otherwise, your object will not be fused with the face.
1618        #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1619        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1620        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1621        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1622        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1623        pub struct SketchModeDisable {}
1624
1625        /// Get the plane for sketch mode.
1626        #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1627        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1628        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1629        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1630        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1631        pub struct GetSketchModePlane {}
1632
1633        /// Get the plane for sketch mode.
1634        #[derive(Debug, Clone, 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 CurveSetConstraint {
1640            /// Which curve to constrain.
1641            pub object_id: Uuid,
1642            /// Which constraint to apply.
1643            pub constraint_bound: PathComponentConstraintBound,
1644            /// What part of the curve should be constrained.
1645            pub constraint_type: PathComponentConstraintType,
1646        }
1647
1648        /// Sketch on some entity (e.g. a plane, a face).
1649        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1650        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1651        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1652        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1653        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1654        pub struct EnableSketchMode {
1655            /// Which entity to sketch on.
1656            pub entity_id: Uuid,
1657            /// Should the camera use orthographic projection?
1658            /// In other words, should an object's size in the rendered image stay constant regardless of its distance from the camera.
1659            pub ortho: bool,
1660            /// Should we animate or snap for the camera transition?
1661            pub animated: bool,
1662            /// Should the camera move at all?
1663            pub adjust_camera: bool,
1664            /// If provided, ensures that the normal of the sketch plane must be aligned with this supplied normal
1665            /// (otherwise the camera position will be used to infer the normal to point towards the viewer)
1666            pub planar_normal: Option<Point3d<f64>>,
1667        }
1668
1669        /// Sets whether or not changes to the scene or its objects will be done as a "dry run"
1670        /// In a dry run, successful commands won't actually change the model.
1671        /// This is useful for catching errors before actually making the change.
1672        #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1673        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1674        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1675        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1676        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1677        pub struct EnableDryRun {}
1678
1679        /// Sets whether or not changes to the scene or its objects will be done as a "dry run"
1680        /// In a dry run, successful commands won't actually change the model.
1681        /// This is useful for catching errors before actually making the change.
1682        #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1683        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1684        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1685        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1686        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1687        pub struct DisableDryRun {}
1688
1689        /// Set the background color of the scene.
1690        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1691        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1692        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1693        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1694        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1695        pub struct SetBackgroundColor {
1696            /// The color to set the background to.
1697            pub color: Color,
1698        }
1699
1700        /// Set the properties of the tool lines for the scene.
1701        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1702        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1703        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1704        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1705        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1706        pub struct SetCurrentToolProperties {
1707            /// The color to set the tool line to.
1708            pub color: Option<Color>,
1709        }
1710
1711        /// Set the default system properties used when a specific property isn't set.
1712        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1713        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1714        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1715        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1716        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1717        pub struct SetDefaultSystemProperties {
1718            /// The default system color.
1719            #[serde(default)]
1720            pub color: Option<Color>,
1721            /// The default color to use for all backfaces
1722            #[serde(default)]
1723            pub backface_color: Option<Color>,
1724            /// The default color to use for highlight
1725            #[serde(default)]
1726            pub highlight_color: Option<Color>,
1727            /// The default color to use for selection
1728            #[serde(default)]
1729            pub selection_color: Option<Color>,
1730        }
1731
1732        /// Get type of the given curve.
1733        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1734        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1735        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1736        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1737        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1738        pub struct CurveGetType {
1739            /// Which curve to query.
1740            pub curve_id: Uuid,
1741        }
1742
1743        /// Get control points of the given curve.
1744        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1745        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1746        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1747        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1748        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1749        pub struct CurveGetControlPoints {
1750            /// Which curve to query.
1751            pub curve_id: Uuid,
1752        }
1753
1754        /// Project an entity on to a plane.
1755        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1756        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1757        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1758        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1759        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1760        pub struct ProjectEntityToPlane {
1761            /// Which entity to project (vertex or edge). Legacy; if both `entity_id` and `entity_reference` are provided, `entity_reference` takes precedence.
1762            #[serde(default, skip_serializing_if = "Option::is_none")]
1763            pub entity_id: Option<Uuid>,
1764            /// Entity reference (e.g. edge by side_faces, vertex, face) to project. If both `entity_id` and `entity_reference` are provided, `entity_reference` takes precedence.
1765            #[serde(default, skip_serializing_if = "Option::is_none")]
1766            pub entity_reference: Option<EntityReference>,
1767            /// Which plane to project the entity onto.
1768            pub plane_id: Uuid,
1769            /// If true: the projected points are returned in the plane_id's coordinate system,
1770            /// else: the projected points are returned in the world coordinate system.
1771            pub use_plane_coords: bool,
1772        }
1773
1774        /// Project a list of points on to a plane.
1775        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1776        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1777        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1778        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1779        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1780        pub struct ProjectPointsToPlane {
1781            /// The id of the plane used for the projection.
1782            pub plane_id: Uuid,
1783            /// The list of points that will be projected.
1784            pub points: Vec<Point3d<f64>>,
1785            /// If true: the projected points are returned in the plane_id's coordinate sysetm.
1786            /// else: the projected points are returned in the world coordinate system.
1787            pub use_plane_coords: bool,
1788        }
1789
1790        /// Enum containing the variety of image formats snapshots may be exported to.
1791        #[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, JsonSchema, FromStr, Display)]
1792        #[serde(rename_all = "snake_case")]
1793        #[display(style = "snake_case")]
1794        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1795        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1796        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1797        #[cfg_attr(feature = "python", pyo3::pyclass(from_py_object), pyo3_stub_gen::derive::gen_stub_pyclass_enum)]
1798        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1799        pub enum ImageFormat {
1800            /// .png format
1801            Png,
1802            /// .jpeg format
1803            Jpeg,
1804        }
1805
1806        /// Take a snapshot of the current view.
1807        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1808        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1809        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1810        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1811        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1812        pub struct TakeSnapshot {
1813            /// What image format to return.
1814            pub format: ImageFormat,
1815        }
1816
1817        /// Add a gizmo showing the axes.
1818        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1819        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1820        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1821        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1822        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1823        pub struct MakeAxesGizmo {
1824            /// If true, axes gizmo will be placed in the corner of the screen.
1825            /// If false, it will be placed at the origin of the scene.
1826            pub gizmo_mode: bool,
1827            /// If true, any existing drawables within the obj will be replaced (the object will be reset)
1828            pub clobber: bool,
1829        }
1830
1831        /// Query the given path.
1832        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1833        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1834        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1835        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1836        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1837        pub struct PathGetInfo {
1838            /// Which path to query
1839            pub path_id: Uuid,
1840        }
1841
1842        /// Obtain curve ids for vertex ids
1843        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1844        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1845        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1846        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1847        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1848        pub struct PathGetCurveUuidsForVertices {
1849            /// Which path to query
1850            pub path_id: Uuid,
1851
1852            /// IDs of the vertices for which to obtain curve ids from
1853            pub vertex_ids: Vec<Uuid>,
1854        }
1855
1856        /// Obtain curve id by index
1857        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1858        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1859        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1860        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1861        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1862        pub struct PathGetCurveUuid {
1863            /// Which path to query
1864            pub path_id: Uuid,
1865
1866            /// IDs of the vertices for which to obtain curve ids from
1867            pub index: u32,
1868        }
1869
1870        /// Obtain vertex ids for a path
1871        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1872        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1873        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1874        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1875        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1876        pub struct PathGetVertexUuids {
1877            /// Which path to query
1878            pub path_id: Uuid,
1879        }
1880
1881        /// Obtain the sketch target id (if the path was drawn in sketchmode) for a path
1882        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1883        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1884        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1885        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1886        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1887        pub struct PathGetSketchTargetUuid {
1888            /// Which path to query
1889            pub path_id: Uuid,
1890        }
1891
1892        /// Start dragging the mouse.
1893        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1894        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1895        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1896        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1897        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1898        pub struct HandleMouseDragStart {
1899            /// The mouse position.
1900            pub window: Point2d,
1901        }
1902
1903        /// Continue dragging the mouse.
1904        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1905        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1906        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1907        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1908        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1909        pub struct HandleMouseDragMove {
1910            /// The mouse position.
1911            pub window: Point2d,
1912            /// Logical timestamp. The client should increment this
1913            /// with every event in the current mouse drag. That way, if the
1914            /// events are being sent over an unordered channel, the API
1915            /// can ignore the older events.
1916            pub sequence: Option<u32>,
1917        }
1918
1919        /// Stop dragging the mouse.
1920        #[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 HandleMouseDragEnd {
1926            /// The mouse position.
1927            pub window: Point2d,
1928        }
1929
1930        /// Remove scene objects.
1931        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1932        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1933        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1934        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1935        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1936        pub struct RemoveSceneObjects {
1937            /// Objects to remove.
1938            pub object_ids: HashSet<Uuid>,
1939        }
1940
1941        /// Utility method. Performs both a ray cast and projection to plane-local coordinates.
1942        /// Returns the plane coordinates for the given window coordinates.
1943        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1944        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1945        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1946        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1947        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1948        pub struct PlaneIntersectAndProject {
1949            /// The plane you're intersecting against.
1950            pub plane_id: Uuid,
1951            /// Window coordinates where the ray cast should be aimed.
1952            pub window: Point2d,
1953        }
1954
1955        /// Find the start and end of a curve.
1956        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1957        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1958        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1959        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1960        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1961        pub struct CurveGetEndPoints {
1962            /// ID of the curve being queried.
1963            pub curve_id: Uuid,
1964        }
1965
1966        /// Reconfigure the stream.
1967        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1968        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1969        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1970        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1971        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1972        pub struct ReconfigureStream {
1973            /// Width of the stream.
1974            pub width: u32,
1975            /// Height of the stream.
1976            pub height: u32,
1977            /// Frames per second.
1978            pub fps: u32,
1979            /// Video feed's constant bitrate (CBR)
1980            #[serde(default)]
1981            pub bitrate: Option<u32>,
1982        }
1983
1984        /// Import files to the current model.
1985        #[derive(Debug, Eq, PartialEq, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1986        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1987        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1988        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1989        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1990        pub struct ImportFiles {
1991            /// Files to import.
1992            pub files: Vec<super::ImportFile>,
1993            /// Input file format.
1994            pub format: crate::format::InputFormat3d,
1995        }
1996
1997        /// Set the units of the scene.
1998        /// For all following commands, the units will be interpreted as the given units.
1999        /// Any previously executed commands will not be affected or have their units changed.
2000        /// They will remain in the units they were originally executed in.
2001        #[derive(Debug, Clone, PartialEq, 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 SetSceneUnits {
2007            /// Which units the scene uses.
2008            pub unit: units::UnitLength,
2009        }
2010
2011        /// Get the mass of entities in the scene or the default scene.
2012        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2013        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2014        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2015        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2016        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2017        pub struct Mass {
2018            /// IDs of the entities to get the mass of. If this is empty, then the default scene is included in
2019            /// the mass.
2020            #[builder(default)]
2021            pub entity_ids: Vec<Uuid>,
2022            /// The material density.
2023            pub material_density: f64,
2024            /// The material density unit.
2025            pub material_density_unit: units::UnitDensity,
2026            /// The output unit for the mass.
2027            pub output_unit: units::UnitMass,
2028        }
2029
2030        /// Get the density of entities in the scene or the default scene.
2031        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2032        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2033        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2034        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2035        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2036        pub struct Density {
2037            /// IDs of the entities to get the density of. If this is empty, then the default scene is included in
2038            /// the density.
2039            #[builder(default)]
2040            pub entity_ids: Vec<Uuid>,
2041            /// The material mass.
2042            pub material_mass: f64,
2043            /// The material mass unit.
2044            pub material_mass_unit: units::UnitMass,
2045            /// The output unit for the density.
2046            pub output_unit: units::UnitDensity,
2047        }
2048
2049        /// Get the volume of entities in the scene or the default scene.
2050        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2051        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2052        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2053        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2054        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2055        pub struct Volume {
2056            /// IDs of the entities to get the volume of. If this is empty, then the default scene is included in
2057            /// the volume.
2058            #[builder(default)]
2059            pub entity_ids: Vec<Uuid>,
2060            /// The output unit for the volume.
2061            pub output_unit: units::UnitVolume,
2062        }
2063
2064        /// Get the center of mass of entities in the scene or the default scene.
2065        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2066        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2067        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2068        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2069        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2070        pub struct CenterOfMass {
2071            /// IDs of the entities to get the center of mass of. If this is empty, then the default scene is included in
2072            /// the center of mass.
2073            #[builder(default)]
2074            pub entity_ids: Vec<Uuid>,
2075            /// The output unit for the center of mass.
2076            pub output_unit: units::UnitLength,
2077        }
2078
2079        /// Get the surface area of entities in the scene or the default scene.
2080        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2081        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2082        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2083        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2084        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2085        pub struct SurfaceArea {
2086            /// IDs of the entities to get the surface area of. If this is empty, then the default scene is included in
2087            /// the surface area.
2088            #[builder(default)]
2089            pub entity_ids: Vec<Uuid>,
2090            /// The output unit for the surface area.
2091            pub output_unit: units::UnitArea,
2092        }
2093
2094        /// Focus the default camera upon an object in the scene.
2095        #[derive(
2096            Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
2097            Builder
2098        )]
2099        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2100        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2101        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2102        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2103        pub struct DefaultCameraFocusOn {
2104            /// UUID of object to focus on.
2105            pub uuid: Uuid,
2106        }
2107        /// When you select some entity with the current tool, what should happen to the entity?
2108        #[derive(
2109            Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
2110            Builder
2111        )]
2112        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2113        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2114        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2115        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2116        pub struct SetSelectionType {
2117            /// What type of selection should occur when you select something?
2118            pub selection_type: SceneSelectionType,
2119        }
2120
2121        /// What kind of entities can be selected?
2122        #[derive(
2123            Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
2124            Builder
2125        )]
2126        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2127        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2128        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2129        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2130        pub struct SetSelectionFilter {
2131            /// If vector is empty, clear all filters.
2132            /// If vector is non-empty, only the given entity types will be selectable.
2133            pub filter: Vec<EntityType>,
2134        }
2135
2136        /// Get the ids of a given entity type.
2137        #[derive(
2138            Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
2139            Builder
2140        )]
2141        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2142        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2143        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2144        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2145        pub struct SceneGetEntityIds {
2146            /// The entity types to be queried.
2147            pub filter: Vec<EntityType>,
2148            /// Skip the first n returned ids. If multiple filters are provided, this skip will
2149            /// apply to each filter individually.
2150            pub skip: u32,
2151            /// Take n ids after any ids skipped. This value must be greater than zero and not
2152            /// exceed 1000. If multiple filters are provided, this take will apply to each filter
2153            /// individually. If there are fewer than `take` items of the provided filter type then the
2154            /// returned list's length will be the smaller value.
2155            #[schemars(range(min = 1, max = 1000))]
2156            pub take: u32,
2157        }
2158
2159        /// Use orthographic projection.
2160        #[derive(
2161            Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
2162            Builder
2163        )]
2164        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2165        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2166        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2167        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2168        pub struct DefaultCameraSetOrthographic {}
2169
2170        /// Use perspective projection.
2171        #[derive(
2172            Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
2173            Builder
2174        )]
2175        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2176        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2177        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2178        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2179        pub struct DefaultCameraSetPerspective {
2180            /// If this is not given, use the same parameters as last time the perspective camera was used.
2181            pub parameters: Option<PerspectiveCameraParameters>,
2182        }
2183
2184        ///Updates the camera to center to the center of the current selection
2185        ///(or the origin if nothing is selected)
2186        #[derive(
2187            Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder
2188        )]
2189        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2190        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2191        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2192        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2193        pub struct DefaultCameraCenterToSelection {
2194            /// Dictates whether or not the camera position should be adjusted during this operation
2195            /// If no movement is requested, the camera will orbit around the new center from its current position
2196            #[serde(default)]
2197            #[builder(default)]
2198            pub camera_movement: CameraMovement,
2199        }
2200
2201        ///Updates the camera to center to the center of the current scene's bounds
2202        #[derive(
2203            Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder
2204        )]
2205        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2206        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2207        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2208        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2209        pub struct DefaultCameraCenterToScene {
2210            /// Dictates whether or not the camera position should be adjusted during this operation
2211            /// If no movement is requested, the camera will orbit around the new center from its current position
2212            #[serde(default)]
2213            #[builder(default)]
2214            pub camera_movement: CameraMovement,
2215        }
2216
2217        /// Fit the view to the specified object(s).
2218        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2219        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2220        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2221        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2222        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2223        pub struct ZoomToFit {
2224            /// Which objects to fit camera to; if empty, fit to all non-default objects. Defaults to empty vector.
2225            #[serde(default)]
2226            #[builder(default)]
2227            pub object_ids: Vec<Uuid>,
2228            /// How much to pad the view frame by, as a fraction of the object(s) bounding box size.
2229            /// Negative padding will crop the view of the object proportionally.
2230            /// e.g. padding = 0.2 means the view will span 120% of the object(s) bounding box,
2231            /// and padding = -0.2 means the view will span 80% of the object(s) bounding box.
2232            #[serde(default)]
2233            #[builder(default)]
2234            pub padding: f32,
2235            /// Whether or not to animate the camera movement.
2236            #[serde(default)]
2237            #[builder(default)]
2238            pub animated: bool,
2239        }
2240
2241        /// Looks along the normal of the specified face (if it is planar!), and fits the view to it.
2242        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2243        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2244        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2245        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2246        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2247        pub struct OrientToFace {
2248            /// Which face to orient camera to. If the face is not planar, no action will occur.
2249            pub face_id: Uuid,
2250            /// How much to pad the view frame by, as a fraction of the face bounding box size.
2251            /// Negative padding will crop the view of the face proportionally.
2252            /// e.g. padding = 0.2 means the view will span 120% of the face bounding box,
2253            /// and padding = -0.2 means the view will span 80% of the face bounding box.
2254            #[serde(default)]
2255            #[builder(default)]
2256            pub padding: f32,
2257            /// Whether or not to animate the camera movement. (Animation is currently not supported.)
2258            #[serde(default)]
2259            #[builder(default)]
2260            pub animated: bool,
2261        }
2262
2263        /// Fit the view to the scene with an isometric view.
2264        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2265        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2266        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2267        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2268        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2269        pub struct ViewIsometric {
2270            /// How much to pad the view frame by, as a fraction of the object(s) bounding box size.
2271            /// Negative padding will crop the view of the object proportionally.
2272            /// e.g. padding = 0.2 means the view will span 120% of the object(s) bounding box,
2273            /// and padding = -0.2 means the view will span 80% of the object(s) bounding box.
2274            #[serde(default)]
2275            #[builder(default)]
2276            pub padding: f32,
2277        }
2278
2279        /// Get a concise description of all of an extrusion's faces.
2280        #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
2281        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2282        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2283        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2284        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2285        pub struct Solid3dGetExtrusionFaceInfo {
2286            /// The Solid3d object whose extrusion is being queried.
2287            pub object_id: Uuid,
2288            /// Any edge that lies on the extrusion base path.
2289            pub edge_id: Uuid,
2290        }
2291
2292        /// Get a concise description of all of solids edges.
2293        #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
2294        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2295        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2296        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2297        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2298        pub struct Solid3dGetAdjacencyInfo {
2299            /// The Solid3d object whose info is being queried.
2300            pub object_id: Uuid,
2301            /// Any edge that lies on the extrusion base path.
2302            pub edge_id: Uuid,
2303        }
2304
2305
2306        /// Clear the selection
2307        #[derive(Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
2308        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2309        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2310        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2311        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2312        pub struct SelectClear {}
2313
2314        /// Set the selection to exactly these entities (replaces previous selection).
2315        /// Empty array clears the selection.
2316        #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
2317        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2318        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2319        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2320        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2321        pub struct SelectEntity {
2322            /// Which entities to select (face-based references for edges/vertices, face_id for faces)
2323            pub entities: Vec<EntityReference>,
2324        }
2325
2326        /// Find all IDs of selected entities
2327        #[derive(Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
2328        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2329        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2330        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2331        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2332        pub struct SelectGet {}
2333
2334        /// Get the number of objects in the scene
2335        #[derive(
2336            Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
2337            Builder
2338        )]
2339        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2340        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2341        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2342        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2343        pub struct GetNumObjects {}
2344
2345        ///Set the transform of an object.
2346        #[derive(
2347            Clone, Debug, Deserialize, PartialEq, JsonSchema, Serialize, ModelingCmdVariant,
2348            Builder
2349        )]
2350        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2351        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2352        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2353        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2354        pub struct SetObjectTransform
2355        {
2356            /// Id of the object whose transform is to be set.
2357            pub object_id: Uuid,
2358            /// List of transforms to be applied to the object.
2359            pub transforms: Vec<ComponentTransform>,
2360        }
2361
2362        /// Create a new solid from combining other smaller solids.
2363        /// In other words, every part of the input solids will be included in the output solid.
2364        #[derive(
2365            Clone, Debug, Deserialize, PartialEq, JsonSchema, Serialize, ModelingCmdVariant,
2366            Builder
2367        )]
2368        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2369        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2370        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2371        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2372        pub struct BooleanUnion
2373        {
2374            /// Which solids to union together.
2375            /// Cannot be empty.
2376            pub solid_ids: Vec<Uuid>,
2377            /// If true, non-contiguous bodies in the result will be returned as separate objects
2378            #[serde(default)]
2379            #[builder(default)]
2380            pub separate_bodies: bool,
2381            /// If true, use the legacy CSG algorithm.
2382            #[serde(default, skip_serializing_if = "super::is_false")]
2383            #[builder(default)]
2384            pub use_legacy: bool,
2385            /// The maximum acceptable surface gap computed between the joined solids. Must be positive (i.e. greater than zero).
2386            pub tolerance: LengthUnit,
2387        }
2388
2389        /// Create a new solid from intersecting several other solids.
2390        /// In other words, the part of the input solids where they all overlap will be the output solid.
2391        #[derive(
2392            Clone, Debug, Deserialize, PartialEq, JsonSchema, Serialize, ModelingCmdVariant,
2393            Builder
2394        )]
2395        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2396        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2397        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2398        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2399        pub struct BooleanIntersection
2400        {
2401            /// Which solids to intersect together
2402            pub solid_ids: Vec<Uuid>,
2403            /// If true, non-contiguous bodies in the result will be returned as separate objects
2404            #[serde(default)]
2405            #[builder(default)]
2406            pub separate_bodies: bool,
2407            /// If true, use the legacy CSG algorithm.
2408            #[serde(default, skip_serializing_if = "super::is_false")]
2409            #[builder(default)]
2410            pub use_legacy: bool,
2411            /// The maximum acceptable surface gap computed between the joined solids. Must be positive (i.e. greater than zero).
2412            pub tolerance: LengthUnit,
2413        }
2414
2415        /// Create a new solid from subtracting several other solids.
2416        /// The 'target' is what will be cut from.
2417        /// The 'tool' is what will be cut out from 'target'.
2418        #[derive(
2419            Clone, Debug, Deserialize, PartialEq, JsonSchema, Serialize, ModelingCmdVariant,
2420            Builder
2421        )]
2422        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2423        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2424        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2425        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2426        pub struct BooleanSubtract
2427        {
2428            /// Geometry to cut out from.
2429            pub target_ids: Vec<Uuid>,
2430            /// Will be cut out from the 'target'.
2431            pub tool_ids: Vec<Uuid>,
2432            /// If true, non-contiguous bodies in the result will be returned as separate objects
2433            #[serde(default)]
2434            #[builder(default)]
2435            pub separate_bodies: bool,
2436            /// If true, use the legacy CSG algorithm.
2437            #[serde(default, skip_serializing_if = "super::is_false")]
2438            #[builder(default)]
2439            pub use_legacy: bool,
2440            /// The maximum acceptable surface gap computed between the target and the solids cut out from it. Must be positive (i.e. greater than zero).
2441            pub tolerance: LengthUnit,
2442        }
2443
2444        /// Create a new non-manifold body by intersecting all the input bodies, cutting and splitting all the faces at the intersection boundaries.
2445        #[derive(
2446            Clone, Debug, Deserialize, PartialEq, JsonSchema, Serialize, ModelingCmdVariant,
2447            Builder
2448        )]
2449        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2450        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2451        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2452        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2453        pub struct BooleanImprint
2454        {
2455            /// Which target input bodies to intersect. Inputs with non-solid body types are permitted
2456            #[serde(alias = "target_ids")]
2457            pub body_ids: Vec<Uuid>,
2458            ///If provided, only these bodies will be used to intersect with the target bodies in body_ids,
2459            ///Otherwise, all bodies in body_ids will be intersected with themselves.
2460            #[serde(default)]
2461            pub tool_ids: Option<Vec<Uuid>>,
2462            /// If true, target bodies will be separated into multiple objects at their intersection boundaries.
2463            #[serde(default)]
2464            #[builder(default)]
2465            pub separate_bodies: bool,
2466            /// If true, use the legacy CSG algorithm.
2467            #[serde(default, skip_serializing_if = "super::is_false")]
2468            #[builder(default)]
2469            pub use_legacy: bool,
2470            /// If true, the provided tool bodies will not be modified
2471            #[serde(default)]
2472            #[builder(default)]
2473            pub keep_tools: bool,
2474            /// The maximum acceptable surface gap between the intersected bodies. Must be positive (i.e. greater than zero).
2475            pub tolerance: LengthUnit,
2476        }
2477
2478        /// Make a new path by offsetting an object by a given distance.
2479        /// The new path's ID will be the ID of this command.
2480        #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
2481        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2482        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2483        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2484        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2485        pub struct MakeOffsetPath {
2486            /// The object that will be offset (can be a path, sketch, or a solid)
2487            pub object_id: Uuid,
2488            /// If the object is a solid, this is the ID of the face to base the offset on.
2489            /// If given, and `object_id` refers to a solid, then this face on the solid will be offset.
2490            /// If given but `object_id` doesn't refer to a solid, responds with an error.
2491            /// If not given, then `object_id` itself will be offset directly.
2492            #[serde(default)]
2493            pub face_id: Option<Uuid>,
2494            /// The distance to offset the path (positive for outset, negative for inset)
2495            pub offset: LengthUnit,
2496        }
2497
2498        /// Add a hole to a closed path by offsetting it a uniform distance inward.
2499        #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
2500        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2501        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2502        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2503        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2504        pub struct AddHoleFromOffset {
2505            /// The closed path to add a hole to.
2506            pub object_id: Uuid,
2507            /// The distance to offset the path (positive for outset, negative for inset)
2508            pub offset: LengthUnit,
2509        }
2510
2511        /// Align the grid with a plane or a planar face.
2512        #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
2513        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2514        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2515        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2516        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2517        pub struct SetGridReferencePlane {
2518            /// The grid to be moved.
2519            pub grid_id: Uuid,
2520            /// The plane or face that the grid will be aligned to.
2521            /// If a face, it must be planar to succeed.
2522            pub reference_id: Uuid,
2523        }
2524
2525        /// Set the scale of the grid lines in the video feed.
2526        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2527        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2528        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2529        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2530        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2531        pub struct SetGridScale {
2532            /// Distance between grid lines represents this much distance.
2533            pub value: f32,
2534            /// Which units the `value` field uses.
2535            pub units: units::UnitLength,
2536        }
2537
2538        /// Set the grid lines to auto scale. The grid will get larger the further you zoom out,
2539        /// and smaller the more you zoom in.
2540        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2541        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2542        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2543        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2544        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2545        pub struct SetGridAutoScale {
2546        }
2547
2548        /// Render transparent surfaces more accurately, but this might make rendering slower.
2549        /// Because it can interfere with runtime performance, it defaults to false.
2550        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2551        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2552        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2553        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2554        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2555        pub struct SetOrderIndependentTransparency {
2556            /// Enables or disables OIT.
2557            /// If not given, toggles it.
2558            pub enabled: Option<bool>,
2559        }
2560
2561        /// Create a region bounded by the intersection of various paths.
2562        /// The region should have an ID taken from the ID of the
2563        /// 'CreateRegion' modeling command.
2564        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2565        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2566        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2567        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2568        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2569        pub struct CreateRegion {
2570            /// Which sketch object to create the region from.
2571            pub object_id: Uuid,
2572            /// First segment to follow to find the region.
2573            pub segment: Uuid,
2574            /// Second segment to follow to find the region.
2575            /// Intersects the first segment.
2576            pub intersection_segment: Uuid,
2577            /// At which intersection between `segment` and `intersection_segment`
2578            /// should we stop following the `segment` and start following `intersection_segment`?
2579            /// Defaults to -1, which means the last intersection.
2580            #[serde(default = "super::negative_one")]
2581            #[builder(default = super::negative_one())]
2582            pub intersection_index: i32,
2583            /// By default, curve counterclockwise at intersections.
2584            /// If this is true, instead curve clockwise.
2585            #[serde(default)]
2586            #[builder(default)]
2587            pub curve_clockwise: bool,
2588            /// Which version of the Region endpoint to call.
2589            #[serde(default, skip_serializing_if = "RegionVersion::is_zero")]
2590            #[builder(default)]
2591            pub version: RegionVersion,
2592        }
2593
2594        /// Create a region with a query point.
2595        /// The region should have an ID taken from the ID of the
2596        /// 'CreateRegionFromQueryPoint' modeling command.
2597        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2598        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2599        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2600        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2601        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2602        pub struct CreateRegionFromQueryPoint {
2603            /// Which sketch object to create the region from.
2604            pub object_id: Uuid,
2605
2606            /// The query point (in the same coordinates as the sketch itself)
2607            /// if a possible sketch region contains this point, then that region will be created
2608            pub query_point: Point2d<LengthUnit>,
2609            /// Which version of the Region endpoint to call.
2610            #[serde(default, skip_serializing_if = "RegionVersion::is_zero")]
2611            #[builder(default)]
2612            pub version: RegionVersion,
2613        }
2614
2615        /// Finds a suitable point inside the region for calling such that CreateRegionFromQueryPoint will generate an identical region.
2616        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2617        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2618        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2619        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2620        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2621        pub struct RegionGetQueryPoint {
2622            /// Which region to search within
2623            pub region_id: Uuid,
2624        }
2625
2626        /// The user clicked on a point in the window,
2627        /// returns the region the user clicked on, if any.
2628        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2629        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2630        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2631        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2632        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2633        pub struct SelectRegionFromPoint {
2634            /// Where in the window was selected
2635            pub selected_at_window: Point2d,
2636        }
2637
2638        /// Get the smallest box that could contain the given parts.
2639        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2640        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2641        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2642        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2643        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2644        pub struct BoundingBox {
2645            /// IDs of the entities to be included in the box.
2646            /// If this is empty, then all entities are included (the entire scene).
2647            #[builder(default)]
2648            pub entity_ids: Vec<Uuid>,
2649            /// The output unit for the box's dimensions. Defaults to millimeters.
2650            #[builder(default = mm())]
2651            #[serde(default = "mm")]
2652            pub output_unit: units::UnitLength,
2653        }
2654
2655        ///Offset a surface by a given distance.
2656        #[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 OffsetSurface {
2662            /// The surface to offset.
2663            pub surface_id: Uuid,
2664            /// The distance to offset the surface by.
2665            pub distance: LengthUnit,
2666            /// Flip the newly created face.
2667            pub flip: bool,
2668        }
2669
2670        /// Returns the closest edge to this point.
2671        #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2672        #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2673        #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2674        #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2675        #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2676        pub struct ClosestEdge {
2677            /// The body whose edges are being queried.
2678            /// If not given, will search all bodies in the scene.
2679            #[serde(default)]
2680            pub object_id: Option<Uuid>,
2681            /// Find the edge closest to this point.
2682            /// Assumed to be in absolute coordinates, relative to global (scene) origin.
2683            pub closest_to: Point3d<f64>,
2684        }
2685    }
2686
2687
2688}
2689
2690pub(crate) fn is_false(b: &bool) -> bool {
2691    !b
2692}
2693
2694pub(crate) fn negative_one() -> i32 {
2695    -1
2696}
2697
2698impl ModelingCmd {
2699    /// Is this command safe to run in an engine batch?
2700    pub fn is_safe_to_batch(&self) -> bool {
2701        use ModelingCmd::*;
2702        matches!(
2703            self,
2704            MovePathPen(_)
2705                | ExtendPath(_)
2706                | Extrude(_)
2707                | Revolve(_)
2708                | Solid3dFilletEdge(_)
2709                | ClosePath(_)
2710                | UpdateAnnotation(_)
2711                | ObjectVisible(_)
2712                | ObjectBringToFront(_)
2713                | Solid2dAddHole(_)
2714                | SendObject(_)
2715                | EntitySetOpacity(_)
2716                | PlaneSetColor(_)
2717                | SetTool(_)
2718        )
2719    }
2720}
2721
2722/// File to import into the current model.
2723/// If you are sending binary data for a file, be sure to send the WebSocketRequest as
2724/// binary/bson, not text/json.
2725#[derive(Clone, Serialize, Deserialize, JsonSchema, Eq, PartialEq, bon::Builder)]
2726#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2727#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2728#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2729#[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2730pub struct ImportFile {
2731    /// The file's full path, including file extension.
2732    pub path: String,
2733    /// The raw bytes of the file
2734    #[serde(
2735        serialize_with = "serde_bytes::serialize",
2736        deserialize_with = "serde_bytes::deserialize"
2737    )]
2738    pub data: Vec<u8>,
2739}
2740
2741impl std::fmt::Debug for ImportFile {
2742    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2743        f.debug_struct("ImportFile")
2744            .field("path", &self.path)
2745            .field("data", &"<redacted>")
2746            .finish()
2747    }
2748}