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