Skip to main content

kittycad_modeling_cmds/
def_enum.rs

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