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 fn default_animation_seconds() -> f64 {
53 0.4
54 }
55
56 fn mm() -> crate::units::UnitLength {
57 crate::units::UnitLength::Millimeters
58 }
59
60 #[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 pub path_json: String,
71
72 pub t: f64,
74 }
75
76 #[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 #[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 pub path: ModelingCmdId,
104 pub to: Point3d<LengthUnit>,
106 }
107
108 #[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 pub path: ModelingCmdId,
120 pub segment: PathSegment,
123 #[serde(default, skip_serializing_if = "Option::is_none")]
125 pub label: Option<String>,
126 }
127
128 #[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 #[serde(default, skip_serializing_if = "Option::is_none")]
140 pub target: Option<ModelingCmdId>,
141 #[serde(default, skip_serializing_if = "Option::is_none")]
143 pub target_reference: Option<EdgeSpecifier>,
144 pub distance: LengthUnit,
148 #[serde(default, skip_serializing_if = "Option::is_none")]
151 pub direction: Option<DirectionType>,
152 #[serde(default, skip_serializing_if = "Option::is_none")]
154 pub direction_reference: Option<EdgeSpecifier>,
155 #[serde(default, skip_serializing_if = "Option::is_none")]
159 pub draft_angle: Option<Angle>,
160 #[serde(default)]
163 pub faces: Option<ExtrudedFaceInfo>,
164 #[serde(default)]
167 #[builder(default)]
168 pub opposite: Opposite<LengthUnit>,
169 #[builder(default)]
171 #[serde(default)]
172 pub extrude_method: ExtrudeMethod,
173 #[serde(default, skip_serializing_if = "Option::is_none")]
177 pub merge_coplanar_faces: Option<bool>,
178
179 #[serde(default)]
181 #[builder(default)]
182 pub body_type: BodyType,
183 }
184
185 #[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 #[serde(default, skip_serializing_if = "Option::is_none")]
199 pub target: Option<ModelingCmdId>,
200 #[serde(default, skip_serializing_if = "Option::is_none")]
203 pub target_reference: Option<EdgeSpecifier>,
204 pub reference: ExtrudeReference,
207 #[serde(default)]
210 pub faces: Option<ExtrudedFaceInfo>,
211 #[serde(default)]
213 #[builder(default)]
214 pub extrude_method: ExtrudeMethod,
215 #[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 #[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 pub target: ModelingCmdId,
237 pub distance: LengthUnit,
239 #[serde(default)]
242 pub faces: Option<ExtrudedFaceInfo>,
243 #[serde(default)]
246 #[builder(default)]
247 pub center_2d: Point2d<f64>,
248 pub total_rotation_angle: Angle,
250 #[serde(default = "default_twist_extrude_section_interval")]
252 #[builder(default = default_twist_extrude_section_interval())]
253 pub angle_step_size: Angle,
254 pub tolerance: LengthUnit,
256 #[serde(default)]
258 #[builder(default)]
259 pub body_type: BodyType,
260 }
261
262 #[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 pub target: ModelingCmdId,
274 pub trajectory: ModelingCmdId,
276 pub sectional: bool,
278 pub tolerance: LengthUnit,
280 #[serde(default)]
282 #[builder(default)]
283 pub body_type: BodyType,
284 #[serde(default)]
287 pub relative_to: Option<RelativeTo>,
288 #[serde(default, skip_serializing_if = "Option::is_none")]
291 pub version: Option<u8>,
292 #[serde(default, skip_serializing_if = "Option::is_none")]
297 pub translate_profile_to_path: Option<bool>,
298 #[serde(default, skip_serializing_if = "Option::is_none")]
303 pub orient_profile_perpendicular: Option<bool>,
304 #[serde(default, skip_serializing_if = "Option::is_none")]
309 pub projected_axis: Option<DirectionType>,
310 }
311
312 #[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 pub target: ModelingCmdId,
324 pub origin: Point3d<LengthUnit>,
326 pub axis: Point3d<f64>,
328 pub axis_is_2d: bool,
330 pub angle: Angle,
332 pub tolerance: LengthUnit,
334 #[serde(default)]
337 #[builder(default)]
338 pub opposite: Opposite<Angle>,
339 #[serde(default)]
341 #[builder(default)]
342 pub body_type: BodyType,
343 }
344
345 #[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 pub object_id: Uuid,
356 pub face_ids: Vec<Uuid>,
358 pub shell_thickness: LengthUnit,
361 #[serde(default)]
363 #[builder(default)]
364 pub hollow: bool,
365 }
366
367 #[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 pub object_id: Uuid,
382 }
383
384 #[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 pub object_ids: Vec<Uuid>,
395 pub tolerance: LengthUnit,
397 }
398
399
400 #[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 #[schemars(length(min = 2, max = 2))]
411 pub surfaces: Vec<SurfaceEdgeReference>,
412 #[serde(default)]
414 #[builder(default)]
415 pub blend_type: BlendType,
416 }
417
418 #[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 pub object_id: Uuid,
429
430 pub edge_index: u32,
432 }
433
434 #[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 pub object_id: Uuid,
445
446 pub face_index: u32,
448 }
449
450 #[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 pub object_id: Uuid,
461 }
462
463 #[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 pub target: ModelingCmdId,
475 #[serde(default, skip_serializing_if = "Option::is_none")]
477 pub edge_id: Option<Uuid>,
478 #[serde(default, skip_serializing_if = "Option::is_none")]
481 pub edge_reference: Option<EdgeSpecifier>,
482 pub angle: Angle,
484 pub tolerance: LengthUnit,
486 #[serde(default)]
489 #[builder(default)]
490 pub opposite: Opposite<Angle>,
491 #[serde(default)]
493 #[builder(default)]
494 pub body_type: BodyType,
495 }
496
497 #[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 pub section_ids: Vec<Uuid>,
509 pub v_degree: std::num::NonZeroU32,
512 pub bez_approximate_rational: bool,
516 pub base_curve_index: Option<u32>,
518 pub tolerance: LengthUnit,
520 #[serde(default)]
522 #[builder(default)]
523 pub body_type: BodyType,
524 }
525
526
527 #[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 pub path_id: Uuid,
538 }
539
540 #[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 pub interaction: CameraDragInteractionType,
549 pub window: Point2d,
551 }
552
553 #[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 pub interaction: CameraDragInteractionType,
562 pub window: Point2d,
564 pub sequence: Option<u32>,
569 }
570
571 #[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 pub interaction: CameraDragInteractionType,
580 pub window: Point2d,
582 }
583
584 #[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 #[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 #[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 pub view: CameraViewState,
609 }
610
611 #[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 pub vantage: Point3d,
620 pub center: Point3d,
622 pub up: Point3d,
624 pub sequence: Option<u32>,
629 }
630
631 #[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 pub vantage: Point3d,
640 pub center: Point3d,
642 pub up: Point3d,
644 pub fov_y: Option<f32>,
646 pub z_near: Option<f32>,
648 pub z_far: Option<f32>,
650 pub sequence: Option<u32>,
655 }
656
657 #[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 pub magnitude: f32,
668 }
669
670 #[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 pub entity_ids: Vec<Uuid>,
679 pub format: OutputFormat2d,
681 }
682
683 #[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 #[builder(default)]
694 pub entity_ids: Vec<Uuid>,
695 pub format: OutputFormat3d,
697 #[serde(default, skip_serializing_if = "Option::is_none")]
699 pub kcl_source: Option<KclProject>,
700 #[serde(default, skip_serializing_if = "Option::is_none")]
702 pub compression: Option<crate::shared::CompressionType>,
703 }
704
705 #[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 #[builder(default)]
716 pub entity_ids: Vec<Uuid>,
717 pub format: OutputFormat3d,
719 #[serde(default, skip_serializing_if = "Option::is_none")]
721 pub kcl_source: Option<KclProject>,
722 }
723
724 #[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 pub entity_id: Uuid,
733 }
734
735 #[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 pub entity_id: Uuid,
744 }
745
746 #[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 pub entity_id: Uuid,
755 pub child_index: u32,
757 }
758
759 #[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 pub entity_id: Uuid,
768 }
769
770 #[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 pub entity_id: Uuid,
779 }
780
781 #[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 pub entity_id: Uuid,
791 pub child_entity_ids: HashSet<Uuid>,
793 }
794
795 #[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 pub entity_id: Uuid,
804 }
805
806 #[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 pub entity_id: Uuid,
815 }
816
817 #[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 pub entity_id1: Uuid,
826 pub entity_id2: Uuid,
828 pub distance_type: DistanceType,
830 }
831
832 #[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 pub edge_id: Uuid,
841 }
842
843 #[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 pub entity_id: Uuid,
853 }
854
855 #[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 pub entity_id: Uuid,
865 #[serde(default)]
869 #[builder(default)]
870 pub transform: Vec<crate::shared::Transform>,
871 #[serde(default)]
875 #[builder(default)]
876 pub transforms: Vec<Vec<crate::shared::Transform>>,
877 }
878
879 #[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 pub entity_id: Uuid,
888 pub axis: Point3d<f64>,
891 pub num_repetitions: u32,
893 pub spacing: LengthUnit,
895 }
896 #[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 pub entity_id: Uuid,
905 pub axis: Point3d<f64>,
908 pub center: Point3d<LengthUnit>,
911 pub num_repetitions: u32,
913 pub arc_degrees: f64,
915 pub rotate_duplicates: bool,
917 }
918
919 #[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 pub cylinder_id: Uuid,
928 pub revolutions: f64,
930 #[serde(default)]
932 #[builder(default)]
933 pub start_angle: Angle,
934 pub is_clockwise: bool,
936 pub length: Option<LengthUnit>,
938 }
939
940 #[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 pub radius: LengthUnit,
949 pub length: LengthUnit,
951 pub revolutions: f64,
953 #[serde(default)]
955 #[builder(default)]
956 pub start_angle: Angle,
957 pub is_clockwise: bool,
959 pub center: Point3d<LengthUnit>,
961 pub axis: Point3d<f64>,
963 }
964
965 #[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 pub radius: LengthUnit,
974 pub length: Option<LengthUnit>,
976 pub revolutions: f64,
978 #[serde(default)]
980 #[builder(default)]
981 pub start_angle: Angle,
982 pub is_clockwise: bool,
984 #[serde(default, skip_serializing_if = "Option::is_none")]
987 pub edge_id: Option<Uuid>,
988 #[serde(default, skip_serializing_if = "Option::is_none")]
991 pub edge_reference: Option<EdgeSpecifier>,
992 }
993
994 #[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 pub ids: Vec<Uuid>,
1003 pub across: MirrorAcross,
1005 }
1006
1007
1008 #[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 pub ids: Vec<Uuid>,
1018 pub axis: Point3d<f64>,
1020 pub point: Point3d<LengthUnit>,
1022 }
1023
1024 #[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 pub ids: Vec<Uuid>,
1036 #[serde(default, skip_serializing_if = "Option::is_none")]
1039 pub edge_id: Option<Uuid>,
1040 #[serde(default, skip_serializing_if = "Option::is_none")]
1043 pub edge_reference: Option<EdgeSpecifier>,
1044 }
1045
1046 #[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 pub selected_at_window: Point2d,
1056 pub selection_type: SceneSelectionType,
1058 }
1059
1060 #[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 pub selected_at_window: Point2d,
1071 pub selection_type: SceneSelectionType,
1073 }
1074
1075 #[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 pub entity_id: Uuid,
1086 }
1087
1088 #[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 pub entities: Vec<Uuid>,
1097 }
1098
1099 #[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 pub entities: Vec<Uuid>,
1108 }
1109
1110 #[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 #[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 pub entities: Vec<Uuid>,
1127 }
1128
1129 #[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 pub selected_at_window: Point2d,
1139 pub sequence: Option<u32>,
1144 }
1145
1146 #[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 pub entities: Vec<Uuid>,
1155 }
1156
1157 #[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 pub options: AnnotationOptions,
1166 pub clobber: bool,
1168 pub annotation_type: AnnotationType,
1170 }
1171
1172 #[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 pub annotation_id: Uuid,
1181 pub options: AnnotationOptions,
1184 }
1185
1186 #[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 pub hidden: bool,
1195 }
1196
1197 #[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 pub object_id: Uuid,
1206 pub hidden: bool,
1208 }
1209
1210 #[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 pub object_ids: Vec<Uuid>,
1221 }
1222
1223 #[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 pub object_id: Uuid,
1232 }
1233
1234 #[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 pub object_id: Uuid,
1243 pub color: Color,
1245 pub metalness: f32,
1247 pub roughness: f32,
1249 pub ambient_occlusion: f32,
1251 #[serde(default, skip_serializing_if = "Option::is_none")]
1253 pub backface_color: Option<Color>,
1254 }
1255
1256 #[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 pub object_id: Uuid,
1265 #[serde(default, skip_serializing_if = "String::is_empty")]
1267 pub name: String,
1268 }
1269
1270 #[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 pub entity_id: Uuid,
1279 }
1280
1281 #[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 pub object_id: Uuid,
1290 pub edge_id: Uuid,
1292 }
1293
1294 #[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 pub object_id: Uuid,
1303 }
1304
1305 #[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 pub object_id: Uuid,
1315 pub face_id: Uuid,
1317 }
1318
1319 #[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 pub object_id: Uuid,
1328 pub hole_id: Uuid,
1330 }
1331
1332 #[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 pub object_id: Uuid,
1341 pub edge_id: Uuid,
1343 pub along_vector: Option<Point3d<f64>>,
1345 }
1346
1347 #[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 pub object_id: Uuid,
1356 pub edge_id: Uuid,
1358 pub face_id: Uuid,
1360 }
1361
1362 #[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 pub object_id: Uuid,
1371 pub edge_id: Uuid,
1373 pub face_id: Uuid,
1375 }
1376
1377 #[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 pub object_id: Uuid,
1386 pub edge_id: Uuid,
1388 pub face_id: Uuid,
1390 }
1391
1392 #[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 pub object_id: Uuid,
1401 pub face_ids: [Uuid; 2]
1403 }
1404
1405 #[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 pub object_id: Uuid,
1414 #[serde(default)]
1416 pub edge_id: Option<Uuid>,
1417 #[serde(default)]
1419 #[builder(default)]
1420 pub edge_ids: Vec<Uuid>,
1421 #[serde(default, skip_serializing_if = "Vec::is_empty")]
1423 #[builder(default)]
1424 pub edges_references: Vec<EdgeSpecifier>,
1425 pub radius: LengthUnit,
1427 pub tolerance: LengthUnit,
1429 #[serde(default)]
1431 #[builder(default)]
1432 pub cut_type: CutType,
1433 #[serde(default)]
1435 #[builder(default)]
1436 pub strategy: CutStrategy,
1437 #[serde(default)]
1445 #[builder(default)]
1446 pub extra_face_ids: Vec<Uuid>,
1447 #[serde(default, skip_serializing_if = "super::is_false")]
1449 #[builder(default)]
1450 pub use_legacy: bool,
1451 #[serde(default, skip_serializing_if = "EdgeCutVersion::is_default")]
1453 #[builder(default)]
1454 pub version: EdgeCutVersion,
1455 }
1456
1457 #[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 pub object_id: Uuid,
1466 #[serde(default)]
1468 #[builder(default)]
1469 pub edges_references: Vec<EdgeSpecifier>,
1470 pub cut_type: CutTypeV2,
1472 pub tolerance: LengthUnit,
1475 #[serde(default)]
1477 #[builder(default)]
1478 pub strategy: CutStrategy,
1479 #[serde(default)]
1487 #[builder(default)]
1488 pub extra_face_ids: Vec<Uuid>,
1489 #[serde(default, skip_serializing_if = "super::is_false")]
1491 #[builder(default)]
1492 pub use_legacy: bool,
1493 #[serde(default, skip_serializing_if = "EdgeCutVersion::is_default")]
1495 #[builder(default)]
1496 pub version: EdgeCutVersion,
1497 #[serde(default, skip_serializing_if = "super::is_false")]
1499 #[builder(default)]
1500 pub tangent_chain: bool,
1501 }
1502
1503 #[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 pub object_id: Uuid,
1512 #[serde(default)]
1514 #[builder(default)]
1515 pub edge_ids: Vec<Uuid>,
1516 pub cut_type: CutTypeV2,
1518 pub tolerance: LengthUnit,
1521 #[serde(default)]
1523 #[builder(default)]
1524 pub strategy: CutStrategy,
1525 #[serde(default)]
1533 #[builder(default)]
1534 pub extra_face_ids: Vec<Uuid>,
1535 #[serde(default, skip_serializing_if = "super::is_false")]
1537 #[builder(default)]
1538 pub use_legacy: bool,
1539 #[serde(default, skip_serializing_if = "EdgeCutVersion::is_default")]
1541 #[builder(default)]
1542 pub version: EdgeCutVersion,
1543 #[serde(default, skip_serializing_if = "super::is_false")]
1545 #[builder(default)]
1546 pub tangent_chain: bool,
1547 }
1548
1549 #[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 pub object_id: Uuid,
1558 }
1559
1560 #[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 pub object_id: Uuid,
1569
1570 pub uv: Point2d<f64>,
1572 }
1573
1574 #[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 pub object_id: Uuid,
1583 }
1584
1585 #[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 pub object_id: Uuid,
1594
1595 pub uv: Point2d<f64>,
1597 }
1598
1599 #[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 pub object_id: Uuid,
1608 pub front: bool,
1610 }
1611 #[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 pub entity_id: Uuid,
1620 pub opacity: f32,
1624 }
1625
1626 #[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 pub entity_id: Uuid,
1635 pub fade_in: bool,
1637 #[serde(default = "default_animation_seconds")]
1639 #[builder(default = default_animation_seconds())]
1640 pub duration_seconds: f64,
1641 }
1642
1643 #[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 pub origin: Point3d<LengthUnit>,
1652 pub x_axis: Point3d<f64>,
1654 pub y_axis: Point3d<f64>,
1656 pub size: LengthUnit,
1660 pub clobber: bool,
1662 pub hide: Option<bool>,
1664 }
1665
1666 #[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 pub plane_id: Uuid,
1675 pub color: Color,
1677 }
1678
1679 #[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 pub tool: SceneToolType,
1688 }
1689
1690 #[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 pub window: Point2d,
1699 pub sequence: Option<u32>,
1704 }
1705
1706 #[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 pub window: Point2d,
1716 }
1717
1718 #[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 #[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 #[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 pub object_id: Uuid,
1745 pub constraint_bound: PathComponentConstraintBound,
1747 pub constraint_type: PathComponentConstraintType,
1749 }
1750
1751 #[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 pub entity_id: Uuid,
1760 pub ortho: bool,
1763 pub animated: bool,
1765 pub adjust_camera: bool,
1767 pub planar_normal: Option<Point3d<f64>>,
1770 }
1771
1772 #[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 pub color: Color,
1781 }
1782
1783 #[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 pub color: Option<Color>,
1792 }
1793
1794 #[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 #[serde(default)]
1803 pub tolerance: Option<Tolerance>,
1804 #[serde(default)]
1806 pub color: Option<Color>,
1807 #[serde(default)]
1809 pub backface_color: Option<Color>,
1810 #[serde(default)]
1812 pub highlight_color: Option<Color>,
1813 #[serde(default)]
1815 pub selection_color: Option<Color>,
1816 #[serde(default)]
1818 pub edge_3d_color: Option<Color>,
1819 }
1820
1821 #[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 pub curve_id: Uuid,
1830 }
1831
1832 #[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 pub curve_id: Uuid,
1841 }
1842
1843 #[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 #[serde(default, skip_serializing_if = "Option::is_none")]
1852 pub entity_id: Option<Uuid>,
1853 #[serde(default, skip_serializing_if = "Option::is_none")]
1855 pub entity_reference: Option<EntityReference>,
1856 pub plane_id: Uuid,
1858 pub use_plane_coords: bool,
1861 }
1862
1863 #[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 pub plane_id: Uuid,
1872 pub points: Vec<Point3d<f64>>,
1874 pub use_plane_coords: bool,
1877 }
1878
1879 #[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 pub object_id: Uuid,
1894 pub frame: PlanarFrame,
1896 #[serde(default, skip_serializing_if = "Option::is_none")]
1898 pub hidden_lines: Option<ProjectionHiddenLineMode>,
1899 #[serde(default, skip_serializing_if = "Option::is_none")]
1901 #[schemars(range(min = 2))]
1902 pub resolution: Option<u32>,
1903 #[serde(default, skip_serializing_if = "Option::is_none")]
1905 pub tolerance: Option<f64>,
1906 }
1907
1908 #[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,
1920 Jpeg,
1922 }
1923
1924 #[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 pub format: ImageFormat,
1933 }
1934
1935 #[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 pub gizmo_mode: bool,
1945 pub clobber: bool,
1947 }
1948
1949 #[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 pub path_id: Uuid,
1958 }
1959
1960 #[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 pub path_id: Uuid,
1969
1970 pub vertex_ids: Vec<Uuid>,
1972 }
1973
1974 #[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 pub path_id: Uuid,
1983
1984 pub index: u32,
1986 }
1987
1988 #[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 pub path_id: Uuid,
1997 }
1998
1999 #[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 pub path_id: Uuid,
2008 }
2009
2010 #[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 pub window: Point2d,
2019 }
2020
2021 #[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 pub window: Point2d,
2030 pub sequence: Option<u32>,
2035 }
2036
2037 #[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 pub window: Point2d,
2046 }
2047
2048 #[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 pub object_ids: HashSet<Uuid>,
2057 }
2058
2059 #[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 pub plane_id: Uuid,
2069 pub window: Point2d,
2071 }
2072
2073 #[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 pub curve_id: Uuid,
2082 }
2083
2084 #[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 pub width: u32,
2093 pub height: u32,
2095 pub fps: u32,
2097 #[serde(default)]
2099 pub bitrate: Option<u32>,
2100 }
2101
2102 #[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 pub files: Vec<super::ImportFile>,
2117 pub format: crate::format::InputFormat3d,
2119 }
2120
2121 #[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 pub unit: units::UnitLength,
2134 }
2135
2136 #[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 #[builder(default)]
2146 pub entity_ids: Vec<Uuid>,
2147 pub material_density: f64,
2149 pub material_density_unit: units::UnitDensity,
2151 pub output_unit: units::UnitMass,
2153 }
2154
2155 #[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 #[builder(default)]
2165 pub entity_ids: Vec<Uuid>,
2166 pub material_mass: f64,
2168 pub material_mass_unit: units::UnitMass,
2170 pub output_unit: units::UnitDensity,
2172 }
2173
2174 #[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 #[builder(default)]
2184 pub entity_ids: Vec<Uuid>,
2185 pub output_unit: units::UnitVolume,
2187 }
2188
2189 #[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 #[builder(default)]
2199 pub entity_ids: Vec<Uuid>,
2200 pub output_unit: units::UnitLength,
2202 }
2203
2204 #[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 #[builder(default)]
2214 pub entity_ids: Vec<Uuid>,
2215 pub output_unit: units::UnitArea,
2217 }
2218
2219 #[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 #[builder(default)]
2231 pub entity_ids: Vec<Uuid>,
2232 pub material_density: f64,
2234 pub material_density_unit: units::UnitDensity,
2236 pub material_mass: f64,
2238 pub material_mass_unit: units::UnitMass,
2240 pub mass_output_unit: units::UnitMass,
2242 pub density_output_unit: units::UnitDensity,
2244 pub volume_output_unit: units::UnitVolume,
2246 pub center_of_mass_output_unit: units::UnitLength,
2248 pub surface_area_output_unit: units::UnitArea,
2250 pub bounding_box_output_unit: units::UnitLength,
2252 }
2253
2254 #[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 pub uuid: Uuid,
2266 }
2267 #[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 pub selection_type: SceneSelectionType,
2279 }
2280
2281 #[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 pub filter: Vec<EntityType>,
2294 }
2295
2296 #[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 pub filter: Vec<EntityType>,
2308 pub skip: u32,
2311 #[schemars(range(min = 1, max = 1000))]
2316 pub take: u32,
2317 }
2318
2319 #[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 #[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 pub parameters: Option<PerspectiveCameraParameters>,
2342 }
2343
2344 #[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 #[serde(default)]
2357 #[builder(default)]
2358 pub camera_movement: CameraMovement,
2359 }
2360
2361 #[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 #[serde(default)]
2373 #[builder(default)]
2374 pub camera_movement: CameraMovement,
2375 }
2376
2377 #[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 #[serde(default)]
2386 #[builder(default)]
2387 pub object_ids: Vec<Uuid>,
2388 #[serde(default)]
2393 #[builder(default)]
2394 pub padding: f32,
2395 #[serde(default)]
2397 #[builder(default)]
2398 pub animated: bool,
2399 }
2400
2401 #[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 pub face_id: Uuid,
2410 #[serde(default)]
2415 #[builder(default)]
2416 pub padding: f32,
2417 #[serde(default)]
2419 #[builder(default)]
2420 pub animated: bool,
2421 }
2422
2423 #[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 #[serde(default)]
2435 #[builder(default)]
2436 pub padding: f32,
2437 }
2438
2439 #[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 pub object_id: Uuid,
2448 #[serde(default, skip_serializing_if = "Option::is_none")]
2450 pub edge_id: Option<Uuid>,
2451 }
2452
2453 #[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 pub object_id: Uuid,
2462 #[serde(default, skip_serializing_if = "Option::is_none")]
2464 pub edge_id: Option<Uuid>,
2465 }
2466
2467
2468 #[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 #[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 pub entities: Vec<EntityReference>,
2486 }
2487
2488 #[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 #[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 #[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 pub object_id: Uuid,
2520 pub transforms: Vec<ComponentTransform>,
2522 }
2523
2524 #[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 pub solid_ids: Vec<Uuid>,
2553 #[serde(default)]
2555 #[builder(default)]
2556 pub separate_bodies: bool,
2557 #[serde(default, skip_serializing_if = "super::is_false")]
2559 #[builder(default)]
2560 pub use_legacy: bool,
2561 pub tolerance: LengthUnit,
2563 }
2564
2565 #[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 pub solid_ids: Vec<Uuid>,
2579 #[serde(default)]
2581 #[builder(default)]
2582 pub separate_bodies: bool,
2583 #[serde(default, skip_serializing_if = "super::is_false")]
2585 #[builder(default)]
2586 pub use_legacy: bool,
2587 pub tolerance: LengthUnit,
2589 }
2590
2591 #[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 pub target_ids: Vec<Uuid>,
2623 pub tool_ids: Vec<Uuid>,
2625 #[serde(default)]
2627 #[builder(default)]
2628 pub separate_bodies: bool,
2629 #[serde(default, skip_serializing_if = "super::is_false")]
2631 #[builder(default)]
2632 pub use_legacy: bool,
2633 pub tolerance: LengthUnit,
2635 }
2636
2637 #[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 #[serde(alias = "target_ids")]
2650 pub body_ids: Vec<Uuid>,
2651 #[serde(default)]
2654 pub tool_ids: Option<Vec<Uuid>>,
2655 #[serde(default)]
2657 #[builder(default)]
2658 pub separate_bodies: bool,
2659 #[serde(default, skip_serializing_if = "super::is_false")]
2661 #[builder(default)]
2662 pub use_legacy: bool,
2663 #[serde(default)]
2665 #[builder(default)]
2666 pub keep_tools: bool,
2667 pub tolerance: LengthUnit,
2669 }
2670
2671 #[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 pub object_id: Uuid,
2681 #[serde(default)]
2686 pub face_id: Option<Uuid>,
2687 pub offset: LengthUnit,
2689 }
2690
2691 #[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 pub object_id: Uuid,
2700 pub offset: LengthUnit,
2702 }
2703
2704 #[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 pub grid_id: Uuid,
2713 pub reference_id: Uuid,
2716 }
2717
2718 #[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 pub value: f32,
2727 pub units: units::UnitLength,
2729 }
2730
2731 #[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 #[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 pub enabled: Option<bool>,
2752 }
2753
2754 #[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 pub object_id: Uuid,
2765 pub segment: Uuid,
2767 pub intersection_segment: Uuid,
2770 #[serde(default = "super::negative_one")]
2774 #[builder(default = super::negative_one())]
2775 pub intersection_index: i32,
2776 #[serde(default)]
2779 #[builder(default)]
2780 pub curve_clockwise: bool,
2781 #[serde(default, skip_serializing_if = "RegionVersion::is_zero")]
2783 #[builder(default)]
2784 pub version: RegionVersion,
2785 }
2786
2787 #[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 pub graphics_enabled: bool,
2797 }
2798
2799 #[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 pub curve_ids: Vec<Uuid>,
2811 pub tolerance: LengthUnit,
2813 }
2814
2815 #[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 pub region_id: Uuid,
2824 }
2825
2826 #[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 pub object_id: Uuid,
2837
2838 pub query_point: Point2d<LengthUnit>,
2841 #[serde(default, skip_serializing_if = "RegionVersion::is_zero")]
2843 #[builder(default)]
2844 pub version: RegionVersion,
2845 }
2846
2847 #[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 pub region_id: Uuid,
2856 }
2857
2858 #[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 pub selected_at_window: Point2d,
2868 }
2869
2870 #[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 #[builder(default)]
2880 pub entity_ids: Vec<Uuid>,
2881 #[builder(default = mm())]
2883 #[serde(default = "mm")]
2884 pub output_unit: units::UnitLength,
2885 }
2886
2887 #[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 pub surface_id: Uuid,
2896 pub distance: LengthUnit,
2898 pub flip: bool,
2900 }
2901
2902 #[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 pub enable_render: bool,
2918 }
2919
2920 #[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 #[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 #[serde(default)]
2940 pub object_id: Option<Uuid>,
2941 pub closest_to: Point3d<f64>,
2944 }
2945
2946 #[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 pub path_id: ModelingCmdId,
2955 }
2956
2957 #[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 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 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#[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 pub path: String,
3011 #[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 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}