1use kittycad_modeling_cmds_macros::define_modeling_cmd_enum;
2use schemars::JsonSchema;
3use serde::{Deserialize, Serialize};
4
5pub use self::each_cmd::*;
6use crate::{self as kittycad_modeling_cmds};
7
8define_modeling_cmd_enum! {
9 pub mod each_cmd {
10 use std::collections::HashSet;
11
12 use bon::Builder;
13 use crate::{self as kittycad_modeling_cmds};
14 use kittycad_modeling_cmds_macros::{ModelingCmdVariant};
15 use parse_display_derive::{Display, FromStr};
16 use schemars::JsonSchema;
17 use serde::{Deserialize, Serialize};
18 use uuid::Uuid;
19 use crate::shared::CameraViewState;
20
21 use crate::{
22 format::{OutputFormat2d, OutputFormat3d},
23 id::ModelingCmdId,
24 length_unit::LengthUnit,
25 shared::{
26 Angle,
27 BodyType,
28 ComponentTransform,
29 RelativeTo,
30 CutType, CutTypeV2,
31 CutStrategy,
32 CameraMovement,
33 ExtrudedFaceInfo, ExtrudeMethod,
34 AnnotationOptions, AnnotationType, CameraDragInteractionType, Color, DistanceType, EntityType,
35 PathComponentConstraintBound, PathComponentConstraintType, PathSegment, PerspectiveCameraParameters,
36 Point2d, Point3d, ExtrudeReference, SceneSelectionType, SceneToolType, Opposite,
37 },
38 units,
39 };
40
41 fn default_animation_seconds() -> f64 {
43 0.4
44 }
45
46 #[derive(
48 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
49 )]
50 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
51 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
52 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
53 pub struct EngineUtilEvaluatePath {
54 pub path_json: String,
56
57 pub t: f64,
59 }
60
61 #[derive(
63 Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant,
64 Builder
65 )]
66 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
67 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
68 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
69 pub struct StartPath {}
70
71 #[derive(
79 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
80 )]
81 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
82 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
83 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
84 pub struct MovePathPen {
85 pub path: ModelingCmdId,
87 pub to: Point3d<LengthUnit>,
89 }
90
91 #[derive(
94 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
95 )]
96 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
97 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
98 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
99 pub struct ExtendPath {
100 pub path: ModelingCmdId,
102 pub segment: PathSegment,
105 #[serde(default, skip_serializing_if = "Option::is_none")]
107 pub label: Option<String>,
108 }
109
110 #[derive(
112 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
113 )]
114 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
115 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
116 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
117 pub struct Extrude {
118 pub target: ModelingCmdId,
121 pub distance: LengthUnit,
123 #[serde(default)]
126 pub faces: Option<ExtrudedFaceInfo>,
127 #[serde(default)]
130 #[builder(default)]
131 pub opposite: Opposite<LengthUnit>,
132 #[builder(default)]
134 #[serde(default)]
135 pub extrude_method: ExtrudeMethod,
136 #[serde(default, skip_serializing_if = "Option::is_none")]
140 pub merge_coplanar_faces: Option<bool>,
141
142 #[serde(default)]
144 #[builder(default)]
145 pub body_type: BodyType,
146 }
147
148 #[derive(
150 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
151 )]
152 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
153 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
154 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
155 pub struct ExtrudeToReference {
156 pub target: ModelingCmdId,
159 pub reference: ExtrudeReference,
162 #[serde(default)]
165 pub faces: Option<ExtrudedFaceInfo>,
166 #[serde(default)]
168 #[builder(default)]
169 pub extrude_method: ExtrudeMethod,
170 #[serde(default)]
172 #[builder(default)]
173 pub body_type: BodyType,
174 }
175
176 fn default_twist_extrude_section_interval() -> Angle {
177 Angle::from_degrees(15.0)
178 }
179
180 #[derive(
182 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
183 )]
184 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
185 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
186 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
187 pub struct TwistExtrude {
188 pub target: ModelingCmdId,
191 pub distance: LengthUnit,
193 #[serde(default)]
196 pub faces: Option<ExtrudedFaceInfo>,
197 #[serde(default)]
199 #[builder(default)]
200 pub center_2d: Point2d<f64>,
201 pub total_rotation_angle: Angle,
203 #[serde(default = "default_twist_extrude_section_interval")]
205 pub angle_step_size: Angle,
206 pub tolerance: LengthUnit,
208 #[serde(default)]
210 #[builder(default)]
211 pub body_type: BodyType,
212 }
213
214 #[derive(
216 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder
217 )]
218 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
219 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
220 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
221 pub struct Sweep {
222 pub target: ModelingCmdId,
225 pub trajectory: ModelingCmdId,
227 pub sectional: bool,
229 pub tolerance: LengthUnit,
231 #[serde(default)]
233 #[builder(default)]
234 pub relative_to: RelativeTo,
235 }
236
237 #[derive(
239 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
240 )]
241 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
242 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
243 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
244 pub struct Revolve {
245 pub target: ModelingCmdId,
248 pub origin: Point3d<LengthUnit>,
250 pub axis: Point3d<f64>,
252 pub axis_is_2d: bool,
254 pub angle: Angle,
256 pub tolerance: LengthUnit,
258 #[serde(default)]
261 #[builder(default)]
262 pub opposite: Opposite<Angle>,
263 #[serde(default)]
265 #[builder(default)]
266 pub body_type: BodyType,
267 }
268
269 #[derive(
271 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
272 )]
273 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
274 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
275 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
276 pub struct Solid3dShellFace {
277 pub object_id: Uuid,
279 pub face_ids: Vec<Uuid>,
281 pub shell_thickness: LengthUnit,
284 #[serde(default)]
286 #[builder(default)]
287 pub hollow: bool,
288 }
289
290 #[derive(
296 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
297 )]
298 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
299 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
300 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
301 pub struct Solid3dJoin {
302 pub object_id: Uuid,
304 }
305
306 #[derive(
308 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
309 )]
310 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
311 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
312 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
313 pub struct Solid3dGetEdgeUuid {
314 pub object_id: Uuid,
316
317 pub edge_index: u32,
319 }
320
321 #[derive(
323 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
324 )]
325 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
326 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
327 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
328 pub struct Solid3dGetFaceUuid {
329 pub object_id: Uuid,
331
332 pub face_index: u32,
334 }
335
336 #[derive(
338 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
339 )]
340 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
341 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
342 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
343 pub struct Solid3dGetBodyType {
344 pub object_id: Uuid,
346 }
347
348 #[derive(
350 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
351 )]
352 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
353 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
354 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
355 pub struct RevolveAboutEdge {
356 pub target: ModelingCmdId,
359 pub edge_id: Uuid,
361 pub angle: Angle,
363 pub tolerance: LengthUnit,
365 #[serde(default)]
368 #[builder(default)]
369 pub opposite: Opposite<Angle>,
370 #[serde(default)]
372 #[builder(default)]
373 pub body_type: BodyType,
374 }
375
376 #[derive(
378 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
379 )]
380 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
381 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
382 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
383 pub struct Loft {
384 pub section_ids: Vec<Uuid>,
387 pub v_degree: std::num::NonZeroU32,
390 pub bez_approximate_rational: bool,
394 pub base_curve_index: Option<u32>,
396 pub tolerance: LengthUnit,
398 #[serde(default)]
400 #[builder(default)]
401 pub body_type: BodyType,
402 }
403
404
405 #[derive(
407 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
408 )]
409 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
410 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
411 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
412 pub struct ClosePath {
413 pub path_id: Uuid,
415 }
416
417 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
419 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
420 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
421 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
422 pub struct CameraDragStart {
423 pub interaction: CameraDragInteractionType,
425 pub window: Point2d,
427 }
428
429 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
431 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
432 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
433 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
434 pub struct CameraDragMove {
435 pub interaction: CameraDragInteractionType,
437 pub window: Point2d,
439 pub sequence: Option<u32>,
444 }
445
446 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
448 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
449 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
450 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
451 pub struct CameraDragEnd {
452 pub interaction: CameraDragInteractionType,
454 pub window: Point2d,
456 }
457
458 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
460 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
461 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
462 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
463 pub struct DefaultCameraGetSettings {}
464
465 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
467 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
468 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
469 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
470 pub struct DefaultCameraGetView {}
471
472 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
474 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
475 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
476 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
477 pub struct DefaultCameraSetView {
478 pub view: CameraViewState,
480 }
481
482 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
484 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
485 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
486 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
487 pub struct DefaultCameraLookAt {
488 pub vantage: Point3d,
490 pub center: Point3d,
492 pub up: Point3d,
494 pub sequence: Option<u32>,
499 }
500
501 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
503 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
504 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
505 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
506 pub struct DefaultCameraPerspectiveSettings {
507 pub vantage: Point3d,
509 pub center: Point3d,
511 pub up: Point3d,
513 pub fov_y: Option<f32>,
515 pub z_near: Option<f32>,
517 pub z_far: Option<f32>,
519 pub sequence: Option<u32>,
524 }
525
526 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
528 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
529 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
530 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
531 pub struct DefaultCameraZoom {
532 pub magnitude: f32,
536 }
537
538 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
540 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
541 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
542 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
543 pub struct Export2d {
544 pub entity_ids: Vec<Uuid>,
546 pub format: OutputFormat2d,
548 }
549
550 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
552 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
553 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
554 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
555 pub struct Export3d {
556 pub entity_ids: Vec<Uuid>,
558 pub format: OutputFormat3d,
560 }
561
562 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
564 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
565 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
566 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
567 pub struct Export {
568 pub entity_ids: Vec<Uuid>,
570 pub format: OutputFormat3d,
572 }
573
574 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
576 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
577 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
578 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
579 pub struct EntityGetParentId {
580 pub entity_id: Uuid,
582 }
583
584 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
586 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
587 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
588 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
589 pub struct EntityGetNumChildren {
590 pub entity_id: Uuid,
592 }
593
594 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
596 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
597 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
598 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
599 pub struct EntityGetChildUuid {
600 pub entity_id: Uuid,
602 pub child_index: u32,
604 }
605
606 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
608 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
609 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
610 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
611 pub struct EntityGetIndex {
612 pub entity_id: Uuid,
614 }
615
616 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
618 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
619 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
620 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
621 pub struct EntityGetPrimitiveIndex {
622 pub entity_id: Uuid,
624 }
625
626 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
629 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
630 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
631 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
632 pub struct EntityDeleteChildren {
633 pub entity_id: Uuid,
635 pub child_entity_ids: HashSet<Uuid>,
637 }
638
639 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
641 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
642 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
643 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
644 pub struct EntityGetAllChildUuids {
645 pub entity_id: Uuid,
647 }
648
649 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
651 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
652 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
653 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
654 pub struct EntityGetSketchPaths {
655 pub entity_id: Uuid,
657 }
658
659 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
661 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
662 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
663 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
664 pub struct EntityGetDistance {
665 pub entity_id1: Uuid,
667 pub entity_id2: Uuid,
669 pub distance_type: DistanceType,
671 }
672
673 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
676 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
677 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
678 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
679 pub struct EntityClone {
680 pub entity_id: Uuid,
682 }
683
684 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
687 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
688 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
689 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
690 pub struct EntityLinearPatternTransform {
691 pub entity_id: Uuid,
693 #[serde(default)]
697 #[builder(default)]
698 pub transform: Vec<crate::shared::Transform>,
699 #[serde(default)]
703 #[builder(default)]
704 pub transforms: Vec<Vec<crate::shared::Transform>>,
705 }
706
707 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
709 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
710 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
711 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
712 pub struct EntityLinearPattern {
713 pub entity_id: Uuid,
715 pub axis: Point3d<f64>,
718 pub num_repetitions: u32,
720 pub spacing: LengthUnit,
722 }
723 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
725 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
726 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
727 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
728 pub struct EntityCircularPattern {
729 pub entity_id: Uuid,
731 pub axis: Point3d<f64>,
734 pub center: Point3d<LengthUnit>,
737 pub num_repetitions: u32,
739 pub arc_degrees: f64,
741 pub rotate_duplicates: bool,
743 }
744
745 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
747 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
748 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
749 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
750 pub struct EntityMakeHelix {
751 pub cylinder_id: Uuid,
753 pub revolutions: f64,
755 #[serde(default)]
757 #[builder(default)]
758 pub start_angle: Angle,
759 pub is_clockwise: bool,
761 pub length: Option<LengthUnit>,
763 }
764
765 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
767 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
768 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
769 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
770 pub struct EntityMakeHelixFromParams {
771 pub radius: LengthUnit,
773 pub length: LengthUnit,
775 pub revolutions: f64,
777 #[serde(default)]
779 #[builder(default)]
780 pub start_angle: Angle,
781 pub is_clockwise: bool,
783 pub center: Point3d<LengthUnit>,
785 pub axis: Point3d<f64>,
787 }
788
789 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
791 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
792 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
793 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
794 pub struct EntityMakeHelixFromEdge {
795 pub radius: LengthUnit,
797 pub length: Option<LengthUnit>,
799 pub revolutions: f64,
801 #[serde(default)]
803 #[builder(default)]
804 pub start_angle: Angle,
805 pub is_clockwise: bool,
807 pub edge_id: Uuid,
809 }
810
811 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
813 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
814 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
815 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
816 pub struct EntityMirror {
817 pub ids: Vec<Uuid>,
819 pub axis: Point3d<f64>,
821 pub point: Point3d<LengthUnit>,
823 }
824
825 #[derive(
827 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
828 )]
829 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
830 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
831 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
832 pub struct EntityMirrorAcrossEdge {
833 pub ids: Vec<Uuid>,
835 pub edge_id: Uuid,
837 }
838
839 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
842 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
843 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
844 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
845 pub struct SelectWithPoint {
846 pub selected_at_window: Point2d,
848 pub selection_type: SceneSelectionType,
850 }
851
852 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
854 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
855 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
856 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
857 pub struct SelectAdd {
858 pub entities: Vec<Uuid>,
860 }
861
862 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
864 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
865 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
866 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
867 pub struct SelectRemove {
868 pub entities: Vec<Uuid>,
870 }
871
872 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
874 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
875 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
876 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
877 pub struct SceneClearAll {}
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 = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
883 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
884 pub struct SelectReplace {
885 pub entities: Vec<Uuid>,
887 }
888
889 #[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
892 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
893 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
894 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
895 pub struct HighlightSetEntity {
896 pub selected_at_window: Point2d,
898 pub sequence: Option<u32>,
903 }
904
905 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
907 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
908 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
909 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
910 pub struct HighlightSetEntities {
911 pub entities: Vec<Uuid>,
913 }
914
915 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
917 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
918 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
919 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
920 pub struct NewAnnotation {
921 pub options: AnnotationOptions,
923 pub clobber: bool,
925 pub annotation_type: AnnotationType,
927 }
928
929 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
931 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
932 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
933 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
934 pub struct UpdateAnnotation {
935 pub annotation_id: Uuid,
937 pub options: AnnotationOptions,
940 }
941
942 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
944 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
945 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
946 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
947 pub struct EdgeLinesVisible {
948 pub hidden: bool,
950 }
951
952 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
954 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
955 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
956 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
957 pub struct ObjectVisible {
958 pub object_id: Uuid,
960 pub hidden: bool,
962 }
963
964 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
966 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
967 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
968 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
969 pub struct ObjectBringToFront {
970 pub object_id: Uuid,
972 }
973
974 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
976 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
977 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
978 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
979 pub struct ObjectSetMaterialParamsPbr {
980 pub object_id: Uuid,
982 pub color: Color,
984 pub metalness: f32,
986 pub roughness: f32,
988 pub ambient_occlusion: f32,
990 #[serde(default, skip_serializing_if = "Option::is_none")]
992 pub backface_color: Option<Color>,
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 = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
998 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
999 pub struct GetEntityType {
1000 pub entity_id: Uuid,
1002 }
1003
1004 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1006 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1007 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1008 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1009 pub struct Solid3dGetAllEdgeFaces {
1010 pub object_id: Uuid,
1012 pub edge_id: Uuid,
1014 }
1015
1016 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1018 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1019 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1020 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1021 pub struct Solid3dFlip {
1022 pub object_id: Uuid,
1024 }
1025
1026 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1029 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1030 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1031 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1032 pub struct Solid3dFlipFace {
1033 pub object_id: Uuid,
1035 pub face_id: Uuid,
1037 }
1038
1039 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1041 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1042 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1043 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1044 pub struct Solid2dAddHole {
1045 pub object_id: Uuid,
1047 pub hole_id: Uuid,
1049 }
1050
1051 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1053 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1054 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1055 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1056 pub struct Solid3dGetAllOppositeEdges {
1057 pub object_id: Uuid,
1059 pub edge_id: Uuid,
1061 pub along_vector: Option<Point3d<f64>>,
1063 }
1064
1065 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1067 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1068 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1069 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1070 pub struct Solid3dGetOppositeEdge {
1071 pub object_id: Uuid,
1073 pub edge_id: Uuid,
1075 pub face_id: Uuid,
1077 }
1078
1079 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1081 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1082 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1083 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1084 pub struct Solid3dGetNextAdjacentEdge {
1085 pub object_id: Uuid,
1087 pub edge_id: Uuid,
1089 pub face_id: Uuid,
1091 }
1092
1093 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1095 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1096 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1097 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1098 pub struct Solid3dGetPrevAdjacentEdge {
1099 pub object_id: Uuid,
1101 pub edge_id: Uuid,
1103 pub face_id: Uuid,
1105 }
1106
1107 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1109 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1110 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1111 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1112 pub struct Solid3dGetCommonEdge {
1113 pub object_id: Uuid,
1115 pub face_ids: [Uuid; 2]
1117 }
1118
1119 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1121 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1122 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1123 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1124 pub struct Solid3dFilletEdge {
1125 pub object_id: Uuid,
1127 #[serde(default)]
1129 pub edge_id: Option<Uuid>,
1130 #[serde(default)]
1132 #[builder(default)]
1133 pub edge_ids: Vec<Uuid>,
1134 pub radius: LengthUnit,
1136 pub tolerance: LengthUnit,
1138 #[serde(default)]
1140 #[builder(default)]
1141 pub cut_type: CutType,
1142 #[serde(default)]
1144 #[builder(default)]
1145 pub strategy: CutStrategy,
1146 #[serde(default)]
1154 #[builder(default)]
1155 pub extra_face_ids: Vec<Uuid>,
1156 }
1157
1158 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1160 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1161 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1162 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1163 pub struct Solid3dCutEdges {
1164 pub object_id: Uuid,
1166 #[serde(default)]
1168 #[builder(default)]
1169 pub edge_ids: Vec<Uuid>,
1170 pub cut_type: CutTypeV2,
1172 pub tolerance: LengthUnit,
1175 #[serde(default)]
1177 #[builder(default)]
1178 pub strategy: CutStrategy,
1179 #[serde(default)]
1187 #[builder(default)]
1188 pub extra_face_ids: Vec<Uuid>,
1189 }
1190
1191 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1193 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1194 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1195 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1196 pub struct FaceIsPlanar {
1197 pub object_id: Uuid,
1199 }
1200
1201 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1203 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1204 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1205 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1206 pub struct FaceGetPosition {
1207 pub object_id: Uuid,
1209
1210 pub uv: Point2d<f64>,
1212 }
1213
1214 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1216 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1217 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1218 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1219 pub struct FaceGetCenter {
1220 pub object_id: Uuid,
1222 }
1223
1224 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1226 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1227 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1228 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1229 pub struct FaceGetGradient {
1230 pub object_id: Uuid,
1232
1233 pub uv: Point2d<f64>,
1235 }
1236
1237 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1239 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1240 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1241 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1242 pub struct SendObject {
1243 pub object_id: Uuid,
1245 pub front: bool,
1247 }
1248 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1250 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1251 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1252 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1253 pub struct EntitySetOpacity {
1254 pub entity_id: Uuid,
1256 pub opacity: f32,
1260 }
1261
1262 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1264 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1265 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1266 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1267 pub struct EntityFade {
1268 pub entity_id: Uuid,
1270 pub fade_in: bool,
1272 #[serde(default = "default_animation_seconds")]
1274 pub duration_seconds: f64,
1275 }
1276
1277 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1279 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1280 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1281 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1282 pub struct MakePlane {
1283 pub origin: Point3d<LengthUnit>,
1285 pub x_axis: Point3d<f64>,
1287 pub y_axis: Point3d<f64>,
1289 pub size: LengthUnit,
1293 pub clobber: bool,
1295 pub hide: Option<bool>,
1297 }
1298
1299 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1301 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1302 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1303 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1304 pub struct PlaneSetColor {
1305 pub plane_id: Uuid,
1307 pub color: Color,
1309 }
1310
1311 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1313 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1314 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1315 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1316 pub struct SetTool {
1317 pub tool: SceneToolType,
1319 }
1320
1321 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1323 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1324 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1325 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1326 pub struct MouseMove {
1327 pub window: Point2d,
1329 pub sequence: Option<u32>,
1334 }
1335
1336 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1339 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1340 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1341 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1342 pub struct MouseClick {
1343 pub window: Point2d,
1345 }
1346
1347 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1351 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1352 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1353 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1354 pub struct SketchModeDisable {}
1355
1356 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1358 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1359 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1360 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1361 pub struct GetSketchModePlane {}
1362
1363 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1365 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1366 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1367 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1368 pub struct CurveSetConstraint {
1369 pub object_id: Uuid,
1371 pub constraint_bound: PathComponentConstraintBound,
1373 pub constraint_type: PathComponentConstraintType,
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 = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1381 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1382 pub struct EnableSketchMode {
1383 pub entity_id: Uuid,
1385 pub ortho: bool,
1388 pub animated: bool,
1390 pub adjust_camera: bool,
1392 pub planar_normal: Option<Point3d<f64>>,
1395 }
1396
1397 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1401 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1402 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1403 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1404 pub struct EnableDryRun {}
1405
1406 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1410 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1411 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1412 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1413 pub struct DisableDryRun {}
1414
1415 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1417 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1418 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1419 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1420 pub struct SetBackgroundColor {
1421 pub color: Color,
1423 }
1424
1425 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1427 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1428 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1429 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1430 pub struct SetCurrentToolProperties {
1431 pub color: Option<Color>,
1433 }
1434
1435 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1437 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1438 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1439 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1440 pub struct SetDefaultSystemProperties {
1441 #[serde(default)]
1443 pub color: Option<Color>,
1444 #[serde(default)]
1446 pub backface_color: Option<Color>,
1447 }
1448
1449 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1451 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1452 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1453 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1454 pub struct CurveGetType {
1455 pub curve_id: Uuid,
1457 }
1458
1459 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1461 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1462 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1463 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1464 pub struct CurveGetControlPoints {
1465 pub curve_id: Uuid,
1467 }
1468
1469 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1471 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1472 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1473 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1474 pub struct ProjectEntityToPlane {
1475 pub entity_id: Uuid,
1477 pub plane_id: Uuid,
1479 pub use_plane_coords: bool,
1482 }
1483
1484 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1486 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1487 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1488 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1489 pub struct ProjectPointsToPlane {
1490 pub plane_id: Uuid,
1492 pub points: Vec<Point3d<f64>>,
1494 pub use_plane_coords: bool,
1497 }
1498
1499 #[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, JsonSchema, FromStr, Display)]
1501 #[serde(rename_all = "snake_case")]
1502 #[display(style = "snake_case")]
1503 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1504 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1505 #[cfg_attr(feature = "python", pyo3::pyclass, pyo3_stub_gen::derive::gen_stub_pyclass_enum)]
1506 pub enum ImageFormat {
1507 Png,
1509 Jpeg,
1511 }
1512
1513 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1515 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1516 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1517 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1518 pub struct TakeSnapshot {
1519 pub format: ImageFormat,
1521 }
1522
1523 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1525 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1526 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1527 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1528 pub struct MakeAxesGizmo {
1529 pub gizmo_mode: bool,
1532 pub clobber: bool,
1534 }
1535
1536 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1538 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1539 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1540 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1541 pub struct PathGetInfo {
1542 pub path_id: Uuid,
1544 }
1545
1546 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1548 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1549 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1550 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1551 pub struct PathGetCurveUuidsForVertices {
1552 pub path_id: Uuid,
1554
1555 pub vertex_ids: Vec<Uuid>,
1557 }
1558
1559 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1561 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1562 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1563 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1564 pub struct PathGetCurveUuid {
1565 pub path_id: Uuid,
1567
1568 pub index: u32,
1570 }
1571
1572 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1574 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1575 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1576 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1577 pub struct PathGetVertexUuids {
1578 pub path_id: Uuid,
1580 }
1581
1582 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1584 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1585 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1586 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1587 pub struct PathGetSketchTargetUuid {
1588 pub path_id: Uuid,
1590 }
1591
1592 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1594 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1595 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1596 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1597 pub struct HandleMouseDragStart {
1598 pub window: Point2d,
1600 }
1601
1602 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1604 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1605 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1606 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1607 pub struct HandleMouseDragMove {
1608 pub window: Point2d,
1610 pub sequence: Option<u32>,
1615 }
1616
1617 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1619 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1620 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1621 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1622 pub struct HandleMouseDragEnd {
1623 pub window: Point2d,
1625 }
1626
1627 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1629 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1630 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1631 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1632 pub struct RemoveSceneObjects {
1633 pub object_ids: HashSet<Uuid>,
1635 }
1636
1637 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1640 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1641 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1642 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1643 pub struct PlaneIntersectAndProject {
1644 pub plane_id: Uuid,
1646 pub window: Point2d,
1648 }
1649
1650 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1652 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1653 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1654 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1655 pub struct CurveGetEndPoints {
1656 pub curve_id: Uuid,
1658 }
1659
1660 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1662 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1663 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1664 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1665 pub struct ReconfigureStream {
1666 pub width: u32,
1668 pub height: u32,
1670 pub fps: u32,
1672 #[serde(default)]
1674 pub bitrate: Option<u32>,
1675 }
1676
1677 #[derive(Debug, Eq, PartialEq, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1679 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1680 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1681 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1682 pub struct ImportFiles {
1683 pub files: Vec<super::ImportFile>,
1685 pub format: crate::format::InputFormat3d,
1687 }
1688
1689 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1694 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1695 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1696 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1697 pub struct SetSceneUnits {
1698 pub unit: units::UnitLength,
1700 }
1701
1702 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1704 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1705 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1706 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1707 pub struct Mass {
1708 pub entity_ids: Vec<Uuid>,
1711 pub material_density: f64,
1713 pub material_density_unit: units::UnitDensity,
1715 pub output_unit: units::UnitMass,
1717 }
1718
1719 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1721 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1722 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1723 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1724 pub struct Density {
1725 pub entity_ids: Vec<Uuid>,
1728 pub material_mass: f64,
1730 pub material_mass_unit: units::UnitMass,
1732 pub output_unit: units::UnitDensity,
1734 }
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 = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1740 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1741 pub struct Volume {
1742 pub entity_ids: Vec<Uuid>,
1745 pub output_unit: units::UnitVolume,
1747 }
1748
1749 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1751 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1752 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1753 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1754 pub struct CenterOfMass {
1755 pub entity_ids: Vec<Uuid>,
1758 pub output_unit: units::UnitLength,
1760 }
1761
1762 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1764 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1765 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1766 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1767 pub struct SurfaceArea {
1768 pub entity_ids: Vec<Uuid>,
1771 pub output_unit: units::UnitArea,
1773 }
1774
1775 #[derive(
1777 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
1778 Builder
1779 )]
1780 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1781 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1782 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1783 pub struct DefaultCameraFocusOn {
1784 pub uuid: Uuid,
1786 }
1787 #[derive(
1789 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
1790 Builder
1791 )]
1792 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1793 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1794 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1795 pub struct SetSelectionType {
1796 pub selection_type: SceneSelectionType,
1798 }
1799
1800 #[derive(
1802 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
1803 Builder
1804 )]
1805 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1806 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1807 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1808 pub struct SetSelectionFilter {
1809 pub filter: Vec<EntityType>,
1812 }
1813
1814 #[derive(
1816 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
1817 Builder
1818 )]
1819 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1820 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1821 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1822 pub struct SceneGetEntityIds {
1823 pub filter: Vec<EntityType>,
1825 pub skip: u32,
1828 #[schemars(range(min = 1, max = 1000))]
1833 pub take: u32,
1834 }
1835
1836 #[derive(
1838 Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
1839 Builder
1840 )]
1841 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1842 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1843 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1844 pub struct DefaultCameraSetOrthographic {}
1845
1846 #[derive(
1848 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
1849 Builder
1850 )]
1851 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1852 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1853 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1854 pub struct DefaultCameraSetPerspective {
1855 pub parameters: Option<PerspectiveCameraParameters>,
1857 }
1858
1859 #[derive(
1862 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder
1863 )]
1864 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1865 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1866 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1867 pub struct DefaultCameraCenterToSelection {
1868 #[serde(default)]
1871 #[builder(default)]
1872 pub camera_movement: CameraMovement,
1873 }
1874
1875 #[derive(
1877 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder
1878 )]
1879 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1880 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1881 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1882 pub struct DefaultCameraCenterToScene {
1883 #[serde(default)]
1886 #[builder(default)]
1887 pub camera_movement: CameraMovement,
1888 }
1889
1890 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1892 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1893 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1894 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1895 pub struct ZoomToFit {
1896 #[serde(default)]
1898 #[builder(default)]
1899 pub object_ids: Vec<Uuid>,
1900 #[serde(default)]
1905 #[builder(default)]
1906 pub padding: f32,
1907 #[serde(default)]
1909 #[builder(default)]
1910 pub animated: bool,
1911 }
1912
1913 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1915 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1916 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1917 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1918 pub struct OrientToFace {
1919 pub face_id: Uuid,
1921 #[serde(default)]
1926 #[builder(default)]
1927 pub padding: f32,
1928 #[serde(default)]
1930 #[builder(default)]
1931 pub animated: bool,
1932 }
1933
1934 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1936 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1937 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1938 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1939 pub struct ViewIsometric {
1940 #[serde(default)]
1945 #[builder(default)]
1946 pub padding: f32,
1947 }
1948
1949 #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
1951 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1952 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1953 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1954 pub struct Solid3dGetExtrusionFaceInfo {
1955 pub object_id: Uuid,
1957 pub edge_id: Uuid,
1959 }
1960
1961 #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
1963 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1964 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1965 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1966 pub struct Solid3dGetAdjacencyInfo {
1967 pub object_id: Uuid,
1969 pub edge_id: Uuid,
1971 }
1972
1973
1974 #[derive(Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
1976 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1977 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1978 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1979 pub struct SelectClear {}
1980
1981 #[derive(Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
1983 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1984 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1985 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1986 pub struct SelectGet {}
1987
1988 #[derive(
1990 Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
1991 Builder
1992 )]
1993 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1994 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1995 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1996 pub struct GetNumObjects {}
1997
1998 #[derive(
2000 Clone, Debug, Deserialize, PartialEq, JsonSchema, Serialize, ModelingCmdVariant,
2001 Builder
2002 )]
2003 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2004 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2005 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2006 pub struct SetObjectTransform
2007 {
2008 pub object_id: Uuid,
2010 pub transforms: Vec<ComponentTransform>,
2012 }
2013
2014 #[derive(
2017 Clone, Debug, Deserialize, PartialEq, JsonSchema, Serialize, ModelingCmdVariant,
2018 Builder
2019 )]
2020 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2021 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2022 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2023 pub struct BooleanUnion
2024 {
2025 pub solid_ids: Vec<Uuid>,
2028 pub tolerance: LengthUnit,
2030 }
2031
2032 #[derive(
2035 Clone, Debug, Deserialize, PartialEq, JsonSchema, Serialize, ModelingCmdVariant,
2036 Builder
2037 )]
2038 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2039 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2040 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2041 pub struct BooleanIntersection
2042 {
2043 pub solid_ids: Vec<Uuid>,
2045 pub tolerance: LengthUnit,
2047 }
2048
2049 #[derive(
2053 Clone, Debug, Deserialize, PartialEq, JsonSchema, Serialize, ModelingCmdVariant,
2054 Builder
2055 )]
2056 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2057 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2058 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2059 pub struct BooleanSubtract
2060 {
2061 pub target_ids: Vec<Uuid>,
2063 pub tool_ids: Vec<Uuid>,
2065 pub tolerance: LengthUnit,
2067 }
2068
2069 #[derive(
2071 Clone, Debug, Deserialize, PartialEq, JsonSchema, Serialize, ModelingCmdVariant,
2072 Builder
2073 )]
2074 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2075 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2076 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2077 pub struct BooleanImprint
2078 {
2079 pub body_ids: Vec<Uuid>,
2081 pub tolerance: LengthUnit,
2083 }
2084
2085 #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
2088 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2089 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2090 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2091 pub struct MakeOffsetPath {
2092 pub object_id: Uuid,
2094 #[serde(default)]
2099 pub face_id: Option<Uuid>,
2100 pub offset: LengthUnit,
2102 }
2103
2104 #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
2106 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2107 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2108 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2109 pub struct AddHoleFromOffset {
2110 pub object_id: Uuid,
2112 pub offset: LengthUnit,
2114 }
2115
2116 #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
2118 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2119 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2120 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2121 pub struct SetGridReferencePlane {
2122 pub grid_id: Uuid,
2124 pub reference_id: Uuid,
2127 }
2128
2129 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2131 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2132 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2133 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2134 pub struct SetGridScale {
2135 pub value: f32,
2137 pub units: units::UnitLength,
2139 }
2140
2141 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2144 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2145 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2146 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2147 pub struct SetGridAutoScale {
2148 }
2149
2150 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2153 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2154 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2155 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2156 pub struct SetOrderIndependentTransparency {
2157 pub enabled: Option<bool>,
2160 }
2161
2162 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2166 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2167 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2168 pub struct CreateRegion {
2169 pub object_id: Uuid,
2171 pub segment: Uuid,
2173 pub intersection_segment: Uuid,
2176 #[serde(default = "super::negative_one")]
2180 pub intersection_index: i32,
2181 #[serde(default)]
2184 pub curve_clockwise: bool,
2185 }
2186
2187 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
2190 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2191 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2192 pub struct SelectRegionFromPoint {
2193 pub selected_at_window: Point2d,
2195 }
2196 }
2197}
2198
2199pub(crate) fn negative_one() -> i32 {
2200 -1
2201}
2202
2203impl ModelingCmd {
2204 pub fn is_safe_to_batch(&self) -> bool {
2206 use ModelingCmd::*;
2207 matches!(
2208 self,
2209 MovePathPen(_)
2210 | ExtendPath(_)
2211 | Extrude(_)
2212 | Revolve(_)
2213 | Solid3dFilletEdge(_)
2214 | ClosePath(_)
2215 | UpdateAnnotation(_)
2216 | ObjectVisible(_)
2217 | ObjectBringToFront(_)
2218 | Solid2dAddHole(_)
2219 | SendObject(_)
2220 | EntitySetOpacity(_)
2221 | PlaneSetColor(_)
2222 | SetTool(_)
2223 )
2224 }
2225}
2226
2227#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, Eq, PartialEq)]
2231#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2232#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2233pub struct ImportFile {
2234 pub path: String,
2236 #[serde(
2238 serialize_with = "serde_bytes::serialize",
2239 deserialize_with = "serde_bytes::deserialize"
2240 )]
2241 pub data: Vec<u8>,
2242}