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