Skip to main content

kittycad_modeling_cmds/
def_enum.rs

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