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 crate::{self as kittycad_modeling_cmds};
13 use kittycad_modeling_cmds_macros::{ModelingCmdVariant};
14 use parse_display_derive::{Display, FromStr};
15 use schemars::JsonSchema;
16 use serde::{Deserialize, Serialize};
17 use uuid::Uuid;
18 use crate::shared::CameraViewState;
19
20 use crate::{
21 format::{OutputFormat2d, OutputFormat3d},
22 id::ModelingCmdId,
23 length_unit::LengthUnit,
24 shared::{
25 Angle,
26 ComponentTransform,
27 RelativeTo,
28 CutType, CutTypeV2,
29 CutStrategy,
30 CameraMovement,
31 ExtrudedFaceInfo, ExtrudeMethod,
32 AnnotationOptions, AnnotationType, CameraDragInteractionType, Color, DistanceType, EntityType,
33 PathComponentConstraintBound, PathComponentConstraintType, PathSegment, PerspectiveCameraParameters,
34 Point2d, Point3d, ExtrudeReference, SceneSelectionType, SceneToolType, Opposite,
35 },
36 units,
37 };
38
39 fn default_animation_seconds() -> f64 {
41 0.4
42 }
43
44 fn default_uuid_vector() -> Vec<Uuid> {
46 Vec::new()
47 }
48
49 #[derive(
51 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant,
52 )]
53 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
54 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
55 pub struct EngineUtilEvaluatePath {
56 pub path_json: String,
58
59 pub t: f64,
61 }
62
63 #[derive(
65 Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant,
66 )]
67 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
68 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
69 pub struct StartPath {}
70
71 #[derive(
79 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant,
80 )]
81 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
82 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
83 pub struct MovePathPen {
84 pub path: ModelingCmdId,
86 pub to: Point3d<LengthUnit>,
88 }
89
90 #[derive(
93 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant,
94 )]
95 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
96 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
97 pub struct ExtendPath {
98 pub path: ModelingCmdId,
100 pub segment: PathSegment,
103 #[serde(default, skip_serializing_if = "Option::is_none")]
105 pub label: Option<String>,
106 }
107
108 #[derive(
110 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant,
111 )]
112 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
113 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
114 pub struct Extrude {
115 pub target: ModelingCmdId,
118 pub distance: LengthUnit,
120 #[serde(default)]
123 pub faces: Option<ExtrudedFaceInfo>,
124 #[serde(default)]
127 pub opposite: Opposite<LengthUnit>,
128 #[serde(default)]
130 pub extrude_method: ExtrudeMethod,
131 }
132
133 #[derive(
135 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant,
136 )]
137 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
138 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
139 pub struct ExtrudeToReference {
140 pub target: ModelingCmdId,
143 pub reference: ExtrudeReference,
146 #[serde(default)]
149 pub faces: Option<ExtrudedFaceInfo>,
150 #[serde(default)]
152 pub extrude_method: ExtrudeMethod,
153 }
154
155 fn default_twist_extrude_section_interval() -> Angle {
156 Angle::from_degrees(15.0)
157 }
158
159 #[derive(
161 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant,
162 )]
163 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
164 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
165 pub struct TwistExtrude {
166 pub target: ModelingCmdId,
169 pub distance: LengthUnit,
171 #[serde(default)]
174 pub faces: Option<ExtrudedFaceInfo>,
175 #[serde(default)]
177 pub center_2d: Point2d<f64>,
178 pub total_rotation_angle: Angle,
180 #[serde(default = "default_twist_extrude_section_interval")]
182 pub angle_step_size: Angle,
183 pub tolerance: LengthUnit,
185 }
186
187 #[derive(
189 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
190 )]
191 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
192 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
193 pub struct Sweep {
194 pub target: ModelingCmdId,
197 pub trajectory: ModelingCmdId,
199 pub sectional: bool,
201 pub tolerance: LengthUnit,
203 #[serde(default)]
205 pub relative_to: RelativeTo,
206 }
207
208 #[derive(
210 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant,
211 )]
212 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
213 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
214 pub struct Revolve {
215 pub target: ModelingCmdId,
218 pub origin: Point3d<LengthUnit>,
220 pub axis: Point3d<f64>,
222 pub axis_is_2d: bool,
224 pub angle: Angle,
226 pub tolerance: LengthUnit,
228 #[serde(default)]
231 pub opposite: Opposite<Angle>,
232 }
233
234 #[derive(
236 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant,
237 )]
238 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
239 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
240 pub struct Solid3dShellFace {
241 pub object_id: Uuid,
243 pub face_ids: Vec<Uuid>,
245 pub shell_thickness: LengthUnit,
248 #[serde(default)]
250 pub hollow: bool,
251 }
252
253 #[derive(
255 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant,
256 )]
257 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
258 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
259 pub struct RevolveAboutEdge {
260 pub target: ModelingCmdId,
263 pub edge_id: Uuid,
265 pub angle: Angle,
267 pub tolerance: LengthUnit,
269 #[serde(default)]
272 pub opposite: Opposite<Angle>,
273 }
274
275 #[derive(
277 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant
278 )]
279 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
280 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
281 pub struct Loft {
282 pub section_ids: Vec<Uuid>,
285 pub v_degree: std::num::NonZeroU32,
288 pub bez_approximate_rational: bool,
292 pub base_curve_index: Option<u32>,
294 pub tolerance: LengthUnit,
296 }
297
298
299 #[derive(
301 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant,
302 )]
303 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
304 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
305 pub struct ClosePath {
306 pub path_id: Uuid,
308 }
309
310 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
312 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
313 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
314 pub struct CameraDragStart {
315 pub interaction: CameraDragInteractionType,
317 pub window: Point2d,
319 }
320
321 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
323 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
324 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
325 pub struct CameraDragMove {
326 pub interaction: CameraDragInteractionType,
328 pub window: Point2d,
330 pub sequence: Option<u32>,
335 }
336
337 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
339 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
340 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
341 pub struct CameraDragEnd {
342 pub interaction: CameraDragInteractionType,
344 pub window: Point2d,
346 }
347
348 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
350 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
351 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
352 pub struct DefaultCameraGetSettings {}
353
354 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
356 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
357 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
358 pub struct DefaultCameraGetView {}
359
360 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
362 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
363 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
364 pub struct DefaultCameraSetView {
365 pub view: CameraViewState,
367 }
368
369 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
371 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
372 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
373 pub struct DefaultCameraLookAt {
374 pub vantage: Point3d,
376 pub center: Point3d,
378 pub up: Point3d,
380 pub sequence: Option<u32>,
385 }
386
387 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
389 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
390 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
391 pub struct DefaultCameraPerspectiveSettings {
392 pub vantage: Point3d,
394 pub center: Point3d,
396 pub up: Point3d,
398 pub fov_y: Option<f32>,
400 pub z_near: Option<f32>,
402 pub z_far: Option<f32>,
404 pub sequence: Option<u32>,
409 }
410
411 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
413 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
414 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
415 pub struct DefaultCameraZoom {
416 pub magnitude: f32,
420 }
421
422 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
424 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
425 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
426 pub struct Export2d {
427 pub entity_ids: Vec<Uuid>,
429 pub format: OutputFormat2d,
431 }
432
433 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
435 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
436 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
437 pub struct Export3d {
438 pub entity_ids: Vec<Uuid>,
440 pub format: OutputFormat3d,
442 }
443
444 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
446 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
447 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
448 pub struct Export {
449 pub entity_ids: Vec<Uuid>,
451 pub format: OutputFormat3d,
453 }
454
455 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
457 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
458 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
459 pub struct EntityGetParentId {
460 pub entity_id: Uuid,
462 }
463
464 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
466 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
467 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
468 pub struct EntityGetNumChildren {
469 pub entity_id: Uuid,
471 }
472
473 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
475 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
476 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
477 pub struct EntityGetChildUuid {
478 pub entity_id: Uuid,
480 pub child_index: u32,
482 }
483
484 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
486 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
487 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
488 pub struct EntityGetAllChildUuids {
489 pub entity_id: Uuid,
491 }
492
493 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
495 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
496 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
497 pub struct EntityGetSketchPaths {
498 pub entity_id: Uuid,
500 }
501
502 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
504 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
505 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
506 pub struct EntityGetDistance {
507 pub entity_id1: Uuid,
509 pub entity_id2: Uuid,
511 pub distance_type: DistanceType,
513 }
514
515 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
518 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
519 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
520 pub struct EntityClone {
521 pub entity_id: Uuid,
523 }
524
525 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
528 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
529 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
530 pub struct EntityLinearPatternTransform {
531 pub entity_id: Uuid,
533 #[serde(default)]
537 pub transform: Vec<crate::shared::Transform>,
538 #[serde(default)]
542 pub transforms: Vec<Vec<crate::shared::Transform>>,
543 }
544
545 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
547 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
548 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
549 pub struct EntityLinearPattern {
550 pub entity_id: Uuid,
552 pub axis: Point3d<f64>,
555 pub num_repetitions: u32,
557 pub spacing: LengthUnit,
559 }
560 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
562 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
563 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
564 pub struct EntityCircularPattern {
565 pub entity_id: Uuid,
567 pub axis: Point3d<f64>,
570 pub center: Point3d<LengthUnit>,
573 pub num_repetitions: u32,
575 pub arc_degrees: f64,
577 pub rotate_duplicates: bool,
579 }
580
581 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
583 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
584 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
585 pub struct EntityMakeHelix {
586 pub cylinder_id: Uuid,
588 pub revolutions: f64,
590 #[serde(default)]
592 pub start_angle: Angle,
593 pub is_clockwise: bool,
595 pub length: Option<LengthUnit>,
597 }
598
599 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
601 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
602 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
603 pub struct EntityMakeHelixFromParams {
604 pub radius: LengthUnit,
606 pub length: LengthUnit,
608 pub revolutions: f64,
610 #[serde(default)]
612 pub start_angle: Angle,
613 pub is_clockwise: bool,
615 pub center: Point3d<LengthUnit>,
617 pub axis: Point3d<f64>,
619 }
620
621 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
623 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
624 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
625 pub struct EntityMakeHelixFromEdge {
626 pub radius: LengthUnit,
628 pub length: Option<LengthUnit>,
630 pub revolutions: f64,
632 #[serde(default)]
634 pub start_angle: Angle,
635 pub is_clockwise: bool,
637 pub edge_id: Uuid,
639 }
640
641 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
643 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
644 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
645 pub struct EntityMirror {
646 pub ids: Vec<Uuid>,
648 pub axis: Point3d<f64>,
650 pub point: Point3d<LengthUnit>,
652 }
653
654 #[derive(
656 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant,
657 )]
658 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
659 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
660 pub struct EntityMirrorAcrossEdge {
661 pub ids: Vec<Uuid>,
663 pub edge_id: Uuid,
665 }
666
667 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
670 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
671 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
672 pub struct SelectWithPoint {
673 pub selected_at_window: Point2d,
675 pub selection_type: SceneSelectionType,
677 }
678
679 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
681 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
682 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
683 pub struct SelectAdd {
684 pub entities: Vec<Uuid>,
686 }
687
688 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
690 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
691 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
692 pub struct SelectRemove {
693 pub entities: Vec<Uuid>,
695 }
696
697 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
699 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
700 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
701 pub struct SceneClearAll {}
702
703 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
705 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
706 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
707 pub struct SelectReplace {
708 pub entities: Vec<Uuid>,
710 }
711
712 #[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
715 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
716 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
717 pub struct HighlightSetEntity {
718 pub selected_at_window: Point2d,
720 pub sequence: Option<u32>,
725 }
726
727 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
729 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
730 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
731 pub struct HighlightSetEntities {
732 pub entities: Vec<Uuid>,
734 }
735
736 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
738 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
739 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
740 pub struct NewAnnotation {
741 pub options: AnnotationOptions,
743 pub clobber: bool,
745 pub annotation_type: AnnotationType,
747 }
748
749 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
751 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
752 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
753 pub struct UpdateAnnotation {
754 pub annotation_id: Uuid,
756 pub options: AnnotationOptions,
759 }
760
761 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
763 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
764 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
765 pub struct EdgeLinesVisible {
766 pub hidden: bool,
768 }
769
770 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
772 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
773 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
774 pub struct ObjectVisible {
775 pub object_id: Uuid,
777 pub hidden: bool,
779 }
780
781 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
783 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
784 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
785 pub struct ObjectBringToFront {
786 pub object_id: Uuid,
788 }
789
790 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
792 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
793 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
794 pub struct ObjectSetMaterialParamsPbr {
795 pub object_id: Uuid,
797 pub color: Color,
799 pub metalness: f32,
801 pub roughness: f32,
803 pub ambient_occlusion: f32,
805 #[serde(default, skip_serializing_if = "Option::is_none")]
807 pub backface_color: Option<Color>,
808 }
809 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
811 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
812 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
813 pub struct GetEntityType {
814 pub entity_id: Uuid,
816 }
817
818 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
820 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
821 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
822 pub struct Solid3dGetAllEdgeFaces {
823 pub object_id: Uuid,
825 pub edge_id: Uuid,
827 }
828
829 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
831 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
832 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
833 pub struct Solid2dAddHole {
834 pub object_id: Uuid,
836 pub hole_id: Uuid,
838 }
839
840 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
842 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
843 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
844 pub struct Solid3dGetAllOppositeEdges {
845 pub object_id: Uuid,
847 pub edge_id: Uuid,
849 pub along_vector: Option<Point3d<f64>>,
851 }
852
853 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
855 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
856 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
857 pub struct Solid3dGetOppositeEdge {
858 pub object_id: Uuid,
860 pub edge_id: Uuid,
862 pub face_id: Uuid,
864 }
865
866 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
868 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
869 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
870 pub struct Solid3dGetNextAdjacentEdge {
871 pub object_id: Uuid,
873 pub edge_id: Uuid,
875 pub face_id: Uuid,
877 }
878
879 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
881 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
882 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
883 pub struct Solid3dGetPrevAdjacentEdge {
884 pub object_id: Uuid,
886 pub edge_id: Uuid,
888 pub face_id: Uuid,
890 }
891
892 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
894 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
895 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
896 pub struct Solid3dGetCommonEdge {
897 pub object_id: Uuid,
899 pub face_ids: [Uuid; 2]
901 }
902
903 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
905 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
906 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
907 pub struct Solid3dFilletEdge {
908 pub object_id: Uuid,
910 #[serde(default)]
912 pub edge_id: Option<Uuid>,
913 #[serde(default)]
915 pub edge_ids: Vec<Uuid>,
916 pub radius: LengthUnit,
918 pub tolerance: LengthUnit,
920 #[serde(default)]
922 pub cut_type: CutType,
923 #[serde(default)]
925 pub strategy: CutStrategy,
926 #[serde(default)]
934 pub extra_face_ids: Vec<Uuid>,
935 }
936
937 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
939 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
940 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
941 pub struct Solid3dCutEdges {
942 pub object_id: Uuid,
944 #[serde(default)]
946 pub edge_ids: Vec<Uuid>,
947 pub cut_type: CutTypeV2,
949 pub tolerance: LengthUnit,
952 #[serde(default)]
954 pub strategy: CutStrategy,
955 #[serde(default)]
963 pub extra_face_ids: Vec<Uuid>,
964 }
965
966 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
968 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
969 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
970 pub struct FaceIsPlanar {
971 pub object_id: Uuid,
973 }
974
975 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
977 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
978 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
979 pub struct FaceGetPosition {
980 pub object_id: Uuid,
982
983 pub uv: Point2d<f64>,
985 }
986
987 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
989 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
990 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
991 pub struct FaceGetCenter {
992 pub object_id: Uuid,
994 }
995
996 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
998 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
999 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1000 pub struct FaceGetGradient {
1001 pub object_id: Uuid,
1003
1004 pub uv: Point2d<f64>,
1006 }
1007
1008 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1010 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1011 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1012 pub struct SendObject {
1013 pub object_id: Uuid,
1015 pub front: bool,
1017 }
1018 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1020 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1021 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1022 pub struct EntitySetOpacity {
1023 pub entity_id: Uuid,
1025 pub opacity: f32,
1029 }
1030
1031 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1033 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1034 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1035 pub struct EntityFade {
1036 pub entity_id: Uuid,
1038 pub fade_in: bool,
1040 #[serde(default = "default_animation_seconds")]
1042 pub duration_seconds: f64,
1043 }
1044
1045 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1047 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1048 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1049 pub struct MakePlane {
1050 pub origin: Point3d<LengthUnit>,
1052 pub x_axis: Point3d<f64>,
1054 pub y_axis: Point3d<f64>,
1056 pub size: LengthUnit,
1060 pub clobber: bool,
1062 pub hide: Option<bool>,
1064 }
1065
1066 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1068 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1069 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1070 pub struct PlaneSetColor {
1071 pub plane_id: Uuid,
1073 pub color: Color,
1075 }
1076
1077 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1079 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1080 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1081 pub struct SetTool {
1082 pub tool: SceneToolType,
1084 }
1085
1086 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1088 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1089 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1090 pub struct MouseMove {
1091 pub window: Point2d,
1093 pub sequence: Option<u32>,
1098 }
1099
1100 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1103 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1104 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1105 pub struct MouseClick {
1106 pub window: Point2d,
1108 }
1109
1110 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1114 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1115 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1116 pub struct SketchModeDisable {}
1117
1118 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1120 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1121 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1122 pub struct GetSketchModePlane {}
1123
1124 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1126 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1127 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1128 pub struct CurveSetConstraint {
1129 pub object_id: Uuid,
1131 pub constraint_bound: PathComponentConstraintBound,
1133 pub constraint_type: PathComponentConstraintType,
1135 }
1136
1137 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1139 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1140 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1141 pub struct EnableSketchMode {
1142 pub entity_id: Uuid,
1144 pub ortho: bool,
1147 pub animated: bool,
1149 pub adjust_camera: bool,
1151 pub planar_normal: Option<Point3d<f64>>,
1154 }
1155
1156 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1160 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1161 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1162 pub struct EnableDryRun {}
1163
1164 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1168 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1169 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1170 pub struct DisableDryRun {}
1171
1172 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1174 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1175 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1176 pub struct SetBackgroundColor {
1177 pub color: Color,
1179 }
1180
1181 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1183 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1184 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1185 pub struct SetCurrentToolProperties {
1186 pub color: Option<Color>,
1188 }
1189
1190 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1192 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1193 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1194 pub struct SetDefaultSystemProperties {
1195 pub color: Option<Color>,
1197 }
1198
1199 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1201 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1202 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1203 pub struct CurveGetType {
1204 pub curve_id: Uuid,
1206 }
1207
1208 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1210 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1211 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1212 pub struct CurveGetControlPoints {
1213 pub curve_id: Uuid,
1215 }
1216
1217 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1219 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1220 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1221 pub struct ProjectEntityToPlane {
1222 pub entity_id: Uuid,
1224 pub plane_id: Uuid,
1226 pub use_plane_coords: bool,
1229 }
1230
1231 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1233 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1234 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1235 pub struct ProjectPointsToPlane {
1236 pub plane_id: Uuid,
1238 pub points: Vec<Point3d<f64>>,
1240 pub use_plane_coords: bool,
1243 }
1244
1245 #[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, JsonSchema, FromStr, Display)]
1247 #[serde(rename_all = "snake_case")]
1248 #[display(style = "snake_case")]
1249 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1250 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1251 #[cfg_attr(feature = "python", pyo3::pyclass, pyo3_stub_gen::derive::gen_stub_pyclass_enum)]
1252 pub enum ImageFormat {
1253 Png,
1255 Jpeg,
1257 }
1258
1259 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1261 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1262 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1263 pub struct TakeSnapshot {
1264 pub format: ImageFormat,
1266 }
1267
1268 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1270 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1271 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1272 pub struct MakeAxesGizmo {
1273 pub gizmo_mode: bool,
1276 pub clobber: bool,
1278 }
1279
1280 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1282 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1283 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1284 pub struct PathGetInfo {
1285 pub path_id: Uuid,
1287 }
1288
1289 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1291 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1292 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1293 pub struct PathGetCurveUuidsForVertices {
1294 pub path_id: Uuid,
1296
1297 pub vertex_ids: Vec<Uuid>,
1299 }
1300
1301 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1303 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1304 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1305 pub struct PathGetCurveUuid {
1306 pub path_id: Uuid,
1308
1309 pub index: u32,
1311 }
1312
1313 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1315 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1316 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1317 pub struct PathGetVertexUuids {
1318 pub path_id: Uuid,
1320 }
1321
1322 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1324 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1325 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1326 pub struct PathGetSketchTargetUuid {
1327 pub path_id: Uuid,
1329 }
1330
1331 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1333 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1334 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1335 pub struct HandleMouseDragStart {
1336 pub window: Point2d,
1338 }
1339
1340 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1342 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1343 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1344 pub struct HandleMouseDragMove {
1345 pub window: Point2d,
1347 pub sequence: Option<u32>,
1352 }
1353
1354 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1356 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1357 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1358 pub struct HandleMouseDragEnd {
1359 pub window: Point2d,
1361 }
1362
1363 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1365 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1366 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1367 pub struct RemoveSceneObjects {
1368 pub object_ids: HashSet<Uuid>,
1370 }
1371
1372 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1375 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1376 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1377 pub struct PlaneIntersectAndProject {
1378 pub plane_id: Uuid,
1380 pub window: Point2d,
1382 }
1383
1384 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1386 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1387 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1388 pub struct CurveGetEndPoints {
1389 pub curve_id: Uuid,
1391 }
1392
1393 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1395 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1396 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1397 pub struct ReconfigureStream {
1398 pub width: u32,
1400 pub height: u32,
1402 pub fps: u32,
1404 #[serde(default)]
1406 pub bitrate: Option<u32>,
1407 }
1408
1409 #[derive(Debug, Eq, PartialEq, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1411 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1412 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1413 pub struct ImportFiles {
1414 pub files: Vec<super::ImportFile>,
1416 pub format: crate::format::InputFormat3d,
1418 }
1419
1420 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1425 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1426 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1427 pub struct SetSceneUnits {
1428 pub unit: units::UnitLength,
1430 }
1431
1432 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1434 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1435 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1436 pub struct Mass {
1437 pub entity_ids: Vec<Uuid>,
1440 pub material_density: f64,
1442 pub material_density_unit: units::UnitDensity,
1444 pub output_unit: units::UnitMass,
1446 }
1447
1448 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1450 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1451 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1452 pub struct Density {
1453 pub entity_ids: Vec<Uuid>,
1456 pub material_mass: f64,
1458 pub material_mass_unit: units::UnitMass,
1460 pub output_unit: units::UnitDensity,
1462 }
1463
1464 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1466 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1467 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1468 pub struct Volume {
1469 pub entity_ids: Vec<Uuid>,
1472 pub output_unit: units::UnitVolume,
1474 }
1475
1476 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1478 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1479 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1480 pub struct CenterOfMass {
1481 pub entity_ids: Vec<Uuid>,
1484 pub output_unit: units::UnitLength,
1486 }
1487
1488 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1490 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1491 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1492 pub struct SurfaceArea {
1493 pub entity_ids: Vec<Uuid>,
1496 pub output_unit: units::UnitArea,
1498 }
1499
1500 #[derive(
1502 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
1503 )]
1504 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1505 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1506 pub struct DefaultCameraFocusOn {
1507 pub uuid: Uuid,
1509 }
1510 #[derive(
1512 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
1513 )]
1514 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1515 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1516 pub struct SetSelectionType {
1517 pub selection_type: SceneSelectionType,
1519 }
1520
1521 #[derive(
1523 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
1524 )]
1525 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1526 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1527 pub struct SetSelectionFilter {
1528 pub filter: Vec<EntityType>,
1531 }
1532
1533 #[derive(
1535 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
1536 )]
1537 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1538 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1539 pub struct SceneGetEntityIds {
1540 pub filter: Vec<EntityType>,
1542 pub skip: u32,
1545 #[schemars(range(min = 1, max = 1000))]
1550 pub take: u32,
1551 }
1552
1553 #[derive(
1555 Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
1556 )]
1557 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1558 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1559 pub struct DefaultCameraSetOrthographic {}
1560
1561 #[derive(
1563 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
1564 )]
1565 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1566 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1567 pub struct DefaultCameraSetPerspective {
1568 pub parameters: Option<PerspectiveCameraParameters>,
1570 }
1571
1572 #[derive(
1575 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
1576 )]
1577 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1578 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1579 pub struct DefaultCameraCenterToSelection {
1580 #[serde(default)]
1583 pub camera_movement: CameraMovement,
1584 }
1585
1586 #[derive(
1588 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
1589 )]
1590 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1591 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1592 pub struct DefaultCameraCenterToScene {
1593 #[serde(default)]
1596 pub camera_movement: CameraMovement,
1597 }
1598
1599 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1601 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1602 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1603 pub struct ZoomToFit {
1604 #[serde(default = "default_uuid_vector")]
1606 pub object_ids: Vec<Uuid>,
1607 #[serde(default)]
1612 pub padding: f32,
1613 #[serde(default)]
1615 pub animated: bool,
1616 }
1617
1618 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1620 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1621 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1622 pub struct OrientToFace {
1623 pub face_id: Uuid,
1625 #[serde(default)]
1630 pub padding: f32,
1631 #[serde(default)]
1633 pub animated: bool,
1634 }
1635
1636 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1638 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1639 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1640 pub struct ViewIsometric {
1641 #[serde(default = "f32::default")]
1646 pub padding: f32,
1647 }
1648
1649 #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant)]
1651 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1652 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1653 pub struct Solid3dGetExtrusionFaceInfo {
1654 pub object_id: Uuid,
1656 pub edge_id: Uuid,
1658 }
1659
1660 #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant)]
1662 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1663 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1664 pub struct Solid3dGetAdjacencyInfo {
1665 pub object_id: Uuid,
1667 pub edge_id: Uuid,
1669 }
1670
1671
1672 #[derive(Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant)]
1674 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1675 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1676 pub struct SelectClear {}
1677
1678 #[derive(Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant)]
1680 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1681 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1682 pub struct SelectGet {}
1683
1684 #[derive(
1686 Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
1687 )]
1688 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1689 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1690 pub struct GetNumObjects {}
1691
1692 #[derive(
1694 Clone, Debug, Deserialize, PartialEq, JsonSchema, Serialize, ModelingCmdVariant,
1695 )]
1696 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1697 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1698 pub struct SetObjectTransform
1699 {
1700 pub object_id: Uuid,
1702 pub transforms: Vec<ComponentTransform>,
1704 }
1705
1706 #[derive(
1709 Clone, Debug, Deserialize, PartialEq, JsonSchema, Serialize, ModelingCmdVariant,
1710 )]
1711 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1712 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1713 pub struct BooleanUnion
1714 {
1715 pub solid_ids: Vec<Uuid>,
1718 pub tolerance: LengthUnit,
1720 }
1721
1722 #[derive(
1725 Clone, Debug, Deserialize, PartialEq, JsonSchema, Serialize, ModelingCmdVariant,
1726 )]
1727 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1728 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1729 pub struct BooleanIntersection
1730 {
1731 pub solid_ids: Vec<Uuid>,
1733 pub tolerance: LengthUnit,
1735 }
1736
1737 #[derive(
1741 Clone, Debug, Deserialize, PartialEq, JsonSchema, Serialize, ModelingCmdVariant,
1742 )]
1743 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1744 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1745 pub struct BooleanSubtract
1746 {
1747 pub target_ids: Vec<Uuid>,
1749 pub tool_ids: Vec<Uuid>,
1751 pub tolerance: LengthUnit,
1753 }
1754
1755 #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant)]
1758 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1759 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1760 pub struct MakeOffsetPath {
1761 pub object_id: Uuid,
1763 #[serde(default)]
1768 pub face_id: Option<Uuid>,
1769 pub offset: LengthUnit,
1771 }
1772
1773 #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant)]
1775 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1776 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1777 pub struct AddHoleFromOffset {
1778 pub object_id: Uuid,
1780 pub offset: LengthUnit,
1782 }
1783
1784 #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant)]
1786 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1787 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1788 pub struct SetGridReferencePlane {
1789 pub grid_id: Uuid,
1791 pub reference_id: Uuid,
1794 }
1795
1796 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1798 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1799 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1800 pub struct SetGridScale {
1801 pub value: f32,
1803 pub units: units::UnitLength,
1805 }
1806
1807 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1810 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1811 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1812 pub struct SetGridAutoScale {
1813 }
1814
1815 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1818 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1819 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1820 pub struct SetOrderIndependentTransparency {
1821 pub enabled: Option<bool>,
1824 }
1825 }
1826}
1827
1828impl ModelingCmd {
1829 pub fn is_safe_to_batch(&self) -> bool {
1831 use ModelingCmd::*;
1832 matches!(
1833 self,
1834 MovePathPen(_)
1835 | ExtendPath(_)
1836 | Extrude(_)
1837 | Revolve(_)
1838 | Solid3dFilletEdge(_)
1839 | ClosePath(_)
1840 | UpdateAnnotation(_)
1841 | ObjectVisible(_)
1842 | ObjectBringToFront(_)
1843 | Solid2dAddHole(_)
1844 | SendObject(_)
1845 | EntitySetOpacity(_)
1846 | PlaneSetColor(_)
1847 | SetTool(_)
1848 )
1849 }
1850}
1851
1852#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, Eq, PartialEq)]
1856#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1857#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1858pub struct ImportFile {
1859 pub path: String,
1861 #[serde(
1863 serialize_with = "serde_bytes::serialize",
1864 deserialize_with = "serde_bytes::deserialize"
1865 )]
1866 pub data: Vec<u8>,
1867}