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