1use kittycad_modeling_cmds_macros::define_modeling_cmd_enum;
2use schemars::JsonSchema;
3use serde::{Deserialize, Serialize};
4
5pub use self::each_cmd::*;
6use crate::{self as kittycad_modeling_cmds};
7
8define_modeling_cmd_enum! {
9 pub mod each_cmd {
10 use std::collections::HashSet;
11
12 use bon::Builder;
13 use crate::{self as kittycad_modeling_cmds};
14 use kittycad_modeling_cmds_macros::{ModelingCmdVariant};
15 use parse_display_derive::{Display, FromStr};
16 use schemars::JsonSchema;
17 use serde::{Deserialize, Serialize};
18 use uuid::Uuid;
19 use crate::shared::CameraViewState;
20 use crate::shared::MirrorAcross;
21
22 use crate::{
23 format::{OutputFormat2d, OutputFormat3d},
24 id::ModelingCmdId,
25 length_unit::LengthUnit,
26 shared::{
27 Angle,
28 RegionVersion,
29 BlendType,
30 BodyType,
31 EdgeCutVersion,
32 ComponentTransform,
33 RelativeTo,
34 CutType, CutTypeV2,
35 CutStrategy,
36 CameraMovement,
37 DirectionType,
38 EdgeSpecifier,
39 EntityReference,
40 ExtrudedFaceInfo, ExtrudeMethod,
41 AnnotationOptions, AnnotationType, CameraDragInteractionType, Color, DistanceType, EntityType,
42 PathComponentConstraintBound, PathComponentConstraintType, PathSegment, PerspectiveCameraParameters,
43 Point2d, Point3d, ExtrudeReference, SceneSelectionType, SceneToolType, SurfaceEdgeReference, Opposite,
44 },
45 units,
46 };
47
48 fn default_animation_seconds() -> f64 {
50 0.4
51 }
52
53 fn mm() -> crate::units::UnitLength {
54 crate::units::UnitLength::Millimeters
55 }
56
57 #[derive(
59 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
60 )]
61 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
62 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
63 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
64 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
65 pub struct EngineUtilEvaluatePath {
66 pub path_json: String,
68
69 pub t: f64,
71 }
72
73 #[derive(
75 Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant,
76 Builder
77 )]
78 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
79 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
80 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
81 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
82 pub struct StartPath {}
83
84 #[derive(
92 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
93 )]
94 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
95 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
96 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
97 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
98 pub struct MovePathPen {
99 pub path: ModelingCmdId,
101 pub to: Point3d<LengthUnit>,
103 }
104
105 #[derive(
108 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
109 )]
110 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
111 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
112 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
113 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
114 pub struct ExtendPath {
115 pub path: ModelingCmdId,
117 pub segment: PathSegment,
120 #[serde(default, skip_serializing_if = "Option::is_none")]
122 pub label: Option<String>,
123 }
124
125 #[derive(
127 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
128 )]
129 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
130 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
131 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
132 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
133 pub struct Extrude {
134 pub target: ModelingCmdId,
137 pub distance: LengthUnit,
139 #[serde(default, skip_serializing_if = "Option::is_none")]
141 pub direction: Option<DirectionType>,
142 #[serde(default, skip_serializing_if = "Option::is_none")]
146 pub draft_angle: Option<Angle>,
147 #[serde(default)]
150 pub faces: Option<ExtrudedFaceInfo>,
151 #[serde(default)]
154 #[builder(default)]
155 pub opposite: Opposite<LengthUnit>,
156 #[builder(default)]
158 #[serde(default)]
159 pub extrude_method: ExtrudeMethod,
160 #[serde(default, skip_serializing_if = "Option::is_none")]
164 pub merge_coplanar_faces: Option<bool>,
165
166 #[serde(default)]
168 #[builder(default)]
169 pub body_type: BodyType,
170 }
171
172 #[derive(
174 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
175 )]
176 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
177 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
178 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
179 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
180 pub struct ExtrudeToReference {
181 pub target: ModelingCmdId,
184 pub reference: ExtrudeReference,
187 #[serde(default)]
190 pub faces: Option<ExtrudedFaceInfo>,
191 #[serde(default)]
193 #[builder(default)]
194 pub extrude_method: ExtrudeMethod,
195 #[serde(default)]
197 #[builder(default)]
198 pub body_type: BodyType,
199 }
200
201 fn default_twist_extrude_section_interval() -> Angle {
202 Angle::from_degrees(15.0)
203 }
204
205 #[derive(
207 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
208 )]
209 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
210 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
211 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
212 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
213 pub struct TwistExtrude {
214 pub target: ModelingCmdId,
217 pub distance: LengthUnit,
219 #[serde(default)]
222 pub faces: Option<ExtrudedFaceInfo>,
223 #[serde(default)]
226 #[builder(default)]
227 pub center_2d: Point2d<f64>,
228 pub total_rotation_angle: Angle,
230 #[serde(default = "default_twist_extrude_section_interval")]
232 #[builder(default = default_twist_extrude_section_interval())]
233 pub angle_step_size: Angle,
234 pub tolerance: LengthUnit,
236 #[serde(default)]
238 #[builder(default)]
239 pub body_type: BodyType,
240 }
241
242 #[derive(
244 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder
245 )]
246 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
247 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
248 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
249 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
250 pub struct Sweep {
251 pub target: ModelingCmdId,
254 pub trajectory: ModelingCmdId,
256 pub sectional: bool,
258 pub tolerance: LengthUnit,
260 #[serde(default)]
262 #[builder(default)]
263 pub body_type: BodyType,
264 #[serde(default)]
266 #[builder(default)]
267 pub relative_to: RelativeTo,
268 #[serde(default, skip_serializing_if = "Option::is_none")]
271 pub version: Option<u8>,
272 }
273
274 #[derive(
276 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
277 )]
278 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
279 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
280 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
281 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
282 pub struct Revolve {
283 pub target: ModelingCmdId,
286 pub origin: Point3d<LengthUnit>,
288 pub axis: Point3d<f64>,
290 pub axis_is_2d: bool,
292 pub angle: Angle,
294 pub tolerance: LengthUnit,
296 #[serde(default)]
299 #[builder(default)]
300 pub opposite: Opposite<Angle>,
301 #[serde(default)]
303 #[builder(default)]
304 pub body_type: BodyType,
305 }
306
307 #[derive(
309 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
310 )]
311 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
312 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
313 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
314 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
315 pub struct Solid3dShellFace {
316 pub object_id: Uuid,
318 pub face_ids: Vec<Uuid>,
320 pub shell_thickness: LengthUnit,
323 #[serde(default)]
325 #[builder(default)]
326 pub hollow: bool,
327 }
328
329 #[derive(
335 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
336 )]
337 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
338 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
339 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
340 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
341 pub struct Solid3dJoin {
342 pub object_id: Uuid,
344 }
345
346 #[derive(
348 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
349 )]
350 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
351 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
352 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
353 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
354 pub struct Solid3dMultiJoin {
355 pub object_ids: Vec<Uuid>,
357 pub tolerance: LengthUnit,
359 }
360
361
362 #[derive(
364 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
365 )]
366 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
367 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
368 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
369 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
370 pub struct SurfaceBlend {
371 #[schemars(length(min = 2, max = 2))]
373 pub surfaces: Vec<SurfaceEdgeReference>,
374 #[serde(default)]
376 #[builder(default)]
377 pub blend_type: BlendType,
378 }
379
380 #[derive(
382 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
383 )]
384 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
385 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
386 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
387 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
388 pub struct Solid3dGetEdgeUuid {
389 pub object_id: Uuid,
391
392 pub edge_index: u32,
394 }
395
396 #[derive(
398 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
399 )]
400 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
401 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
402 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
403 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
404 pub struct Solid3dGetFaceUuid {
405 pub object_id: Uuid,
407
408 pub face_index: u32,
410 }
411
412 #[derive(
414 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
415 )]
416 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
417 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
418 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
419 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
420 pub struct Solid3dGetBodyType {
421 pub object_id: Uuid,
423 }
424
425 #[derive(
427 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
428 )]
429 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
430 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
431 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
432 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
433 pub struct RevolveAboutEdge {
434 pub target: ModelingCmdId,
437 #[serde(default, skip_serializing_if = "Option::is_none")]
439 pub edge_id: Option<Uuid>,
440 #[serde(default, skip_serializing_if = "Option::is_none")]
443 pub edge_reference: Option<EdgeSpecifier>,
444 pub angle: Angle,
446 pub tolerance: LengthUnit,
448 #[serde(default)]
451 #[builder(default)]
452 pub opposite: Opposite<Angle>,
453 #[serde(default)]
455 #[builder(default)]
456 pub body_type: BodyType,
457 }
458
459 #[derive(
461 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
462 )]
463 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
464 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
465 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
466 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
467 pub struct Loft {
468 pub section_ids: Vec<Uuid>,
471 pub v_degree: std::num::NonZeroU32,
474 pub bez_approximate_rational: bool,
478 pub base_curve_index: Option<u32>,
480 pub tolerance: LengthUnit,
482 #[serde(default)]
484 #[builder(default)]
485 pub body_type: BodyType,
486 }
487
488
489 #[derive(
491 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
492 )]
493 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
494 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
495 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
496 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
497 pub struct ClosePath {
498 pub path_id: Uuid,
500 }
501
502 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
504 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
505 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
506 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
507 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
508 pub struct CameraDragStart {
509 pub interaction: CameraDragInteractionType,
511 pub window: Point2d,
513 }
514
515 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
517 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
518 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
519 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
520 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
521 pub struct CameraDragMove {
522 pub interaction: CameraDragInteractionType,
524 pub window: Point2d,
526 pub sequence: Option<u32>,
531 }
532
533 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
535 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
536 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
537 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
538 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
539 pub struct CameraDragEnd {
540 pub interaction: CameraDragInteractionType,
542 pub window: Point2d,
544 }
545
546 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
548 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
549 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
550 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
551 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
552 pub struct DefaultCameraGetSettings {}
553
554 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
556 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
557 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
558 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
559 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
560 pub struct DefaultCameraGetView {}
561
562 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
564 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
565 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
566 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
567 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
568 pub struct DefaultCameraSetView {
569 pub view: CameraViewState,
571 }
572
573 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
575 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
576 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
577 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
578 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
579 pub struct DefaultCameraLookAt {
580 pub vantage: Point3d,
582 pub center: Point3d,
584 pub up: Point3d,
586 pub sequence: Option<u32>,
591 }
592
593 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
595 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
596 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
597 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
598 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
599 pub struct DefaultCameraPerspectiveSettings {
600 pub vantage: Point3d,
602 pub center: Point3d,
604 pub up: Point3d,
606 pub fov_y: Option<f32>,
608 pub z_near: Option<f32>,
610 pub z_far: Option<f32>,
612 pub sequence: Option<u32>,
617 }
618
619 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
621 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
622 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
623 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
624 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
625 pub struct DefaultCameraZoom {
626 pub magnitude: f32,
630 }
631
632 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
634 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
635 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
636 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
637 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
638 pub struct Export2d {
639 pub entity_ids: Vec<Uuid>,
641 pub format: OutputFormat2d,
643 }
644
645 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
647 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
648 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
649 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
650 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
651 pub struct Export3d {
652 #[builder(default)]
654 pub entity_ids: Vec<Uuid>,
655 pub format: OutputFormat3d,
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 = "arbitrary", derive(arbitrary::Arbitrary))]
663 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
664 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
665 pub struct Export {
666 #[builder(default)]
668 pub entity_ids: Vec<Uuid>,
669 pub format: OutputFormat3d,
671 }
672
673 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
675 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
676 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
677 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
678 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
679 pub struct EntityGetParentId {
680 pub entity_id: Uuid,
682 }
683
684 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
686 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
687 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
688 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
689 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
690 pub struct EntityGetNumChildren {
691 pub entity_id: Uuid,
693 }
694
695 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
697 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
698 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
699 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
700 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
701 pub struct EntityGetChildUuid {
702 pub entity_id: Uuid,
704 pub child_index: u32,
706 }
707
708 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
710 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
711 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
712 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
713 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
714 pub struct EntityGetIndex {
715 pub entity_id: Uuid,
717 }
718
719 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
721 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
722 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
723 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
724 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
725 pub struct EntityGetPrimitiveIndex {
726 pub entity_id: Uuid,
728 }
729
730 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
733 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
734 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
735 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
736 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
737 pub struct EntityDeleteChildren {
738 pub entity_id: Uuid,
740 pub child_entity_ids: HashSet<Uuid>,
742 }
743
744 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
746 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
747 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
748 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
749 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
750 pub struct EntityGetAllChildUuids {
751 pub entity_id: Uuid,
753 }
754
755 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
757 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
758 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
759 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
760 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
761 pub struct EntityGetSketchPaths {
762 pub entity_id: Uuid,
764 }
765
766 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
768 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
769 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
770 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
771 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
772 pub struct EntityGetDistance {
773 pub entity_id1: Uuid,
775 pub entity_id2: Uuid,
777 pub distance_type: DistanceType,
779 }
780
781 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
783 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
784 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
785 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
786 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
787 pub struct EdgeGetLength {
788 pub edge_id: Uuid,
790 }
791
792 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
795 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
796 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
797 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
798 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
799 pub struct EntityClone {
800 pub entity_id: Uuid,
802 }
803
804 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
807 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
808 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
809 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
810 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
811 pub struct EntityLinearPatternTransform {
812 pub entity_id: Uuid,
814 #[serde(default)]
818 #[builder(default)]
819 pub transform: Vec<crate::shared::Transform>,
820 #[serde(default)]
824 #[builder(default)]
825 pub transforms: Vec<Vec<crate::shared::Transform>>,
826 }
827
828 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
830 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
831 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
832 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
833 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
834 pub struct EntityLinearPattern {
835 pub entity_id: Uuid,
837 pub axis: Point3d<f64>,
840 pub num_repetitions: u32,
842 pub spacing: LengthUnit,
844 }
845 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
847 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
848 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
849 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
850 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
851 pub struct EntityCircularPattern {
852 pub entity_id: Uuid,
854 pub axis: Point3d<f64>,
857 pub center: Point3d<LengthUnit>,
860 pub num_repetitions: u32,
862 pub arc_degrees: f64,
864 pub rotate_duplicates: bool,
866 }
867
868 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
870 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
871 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
872 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
873 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
874 pub struct EntityMakeHelix {
875 pub cylinder_id: Uuid,
877 pub revolutions: f64,
879 #[serde(default)]
881 #[builder(default)]
882 pub start_angle: Angle,
883 pub is_clockwise: bool,
885 pub length: Option<LengthUnit>,
887 }
888
889 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
891 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
892 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
893 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
894 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
895 pub struct EntityMakeHelixFromParams {
896 pub radius: LengthUnit,
898 pub length: LengthUnit,
900 pub revolutions: f64,
902 #[serde(default)]
904 #[builder(default)]
905 pub start_angle: Angle,
906 pub is_clockwise: bool,
908 pub center: Point3d<LengthUnit>,
910 pub axis: Point3d<f64>,
912 }
913
914 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
916 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
917 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
918 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
919 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
920 pub struct EntityMakeHelixFromEdge {
921 pub radius: LengthUnit,
923 pub length: Option<LengthUnit>,
925 pub revolutions: f64,
927 #[serde(default)]
929 #[builder(default)]
930 pub start_angle: Angle,
931 pub is_clockwise: bool,
933 #[serde(default, skip_serializing_if = "Option::is_none")]
936 pub edge_id: Option<Uuid>,
937 #[serde(default, skip_serializing_if = "Option::is_none")]
940 pub edge_reference: Option<EdgeSpecifier>,
941 }
942
943 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
945 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
946 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
947 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
948 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
949 pub struct EntityMirrorAcross {
950 pub ids: Vec<Uuid>,
952 pub across: MirrorAcross,
954 }
955
956
957 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
960 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
961 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
962 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
963 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
964 pub struct EntityMirror {
965 pub ids: Vec<Uuid>,
967 pub axis: Point3d<f64>,
969 pub point: Point3d<LengthUnit>,
971 }
972
973 #[derive(
976 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
977 )]
978 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
979 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
980 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
981 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
982 pub struct EntityMirrorAcrossEdge {
983 pub ids: Vec<Uuid>,
985 #[serde(default, skip_serializing_if = "Option::is_none")]
988 pub edge_id: Option<Uuid>,
989 #[serde(default, skip_serializing_if = "Option::is_none")]
992 pub edge_reference: Option<EdgeSpecifier>,
993 }
994
995 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
998 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
999 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1000 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1001 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1002 pub struct SelectWithPoint {
1003 pub selected_at_window: Point2d,
1005 pub selection_type: SceneSelectionType,
1007 }
1008
1009 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1013 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1014 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1015 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1016 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1017 pub struct QueryEntityTypeWithPoint {
1018 pub selected_at_window: Point2d,
1020 pub selection_type: SceneSelectionType,
1022 }
1023
1024 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1028 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1029 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1030 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1031 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1032 pub struct QueryEntityType {
1033 pub entity_id: Uuid,
1035 }
1036
1037 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1039 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1040 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1041 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1042 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1043 pub struct SelectAdd {
1044 pub entities: Vec<Uuid>,
1046 }
1047
1048 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1050 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1051 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1052 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1053 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1054 pub struct SelectRemove {
1055 pub entities: Vec<Uuid>,
1057 }
1058
1059 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1061 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1062 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1063 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1064 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1065 pub struct SceneClearAll {}
1066
1067 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1069 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1070 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1071 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1072 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1073 pub struct SelectReplace {
1074 pub entities: Vec<Uuid>,
1076 }
1077
1078 #[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1081 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1082 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1083 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1084 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1085 pub struct HighlightSetEntity {
1086 pub selected_at_window: Point2d,
1088 pub sequence: Option<u32>,
1093 }
1094
1095 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1097 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1098 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1099 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1100 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1101 pub struct HighlightSetEntities {
1102 pub entities: Vec<Uuid>,
1104 }
1105
1106 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1108 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1109 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1110 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1111 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1112 pub struct NewAnnotation {
1113 pub options: AnnotationOptions,
1115 pub clobber: bool,
1117 pub annotation_type: AnnotationType,
1119 }
1120
1121 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1123 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1124 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1125 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1126 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1127 pub struct UpdateAnnotation {
1128 pub annotation_id: Uuid,
1130 pub options: AnnotationOptions,
1133 }
1134
1135 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1137 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1138 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1139 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1140 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1141 pub struct EdgeLinesVisible {
1142 pub hidden: bool,
1144 }
1145
1146 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1148 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1149 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1150 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1151 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1152 pub struct ObjectVisible {
1153 pub object_id: Uuid,
1155 pub hidden: bool,
1157 }
1158
1159 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1161 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1162 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1163 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1164 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1165 pub struct ObjectBringToFront {
1166 pub object_id: Uuid,
1168 }
1169
1170 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1172 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1173 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1174 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1175 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1176 pub struct ObjectSetMaterialParamsPbr {
1177 pub object_id: Uuid,
1179 pub color: Color,
1181 pub metalness: f32,
1183 pub roughness: f32,
1185 pub ambient_occlusion: f32,
1187 #[serde(default, skip_serializing_if = "Option::is_none")]
1189 pub backface_color: Option<Color>,
1190 }
1191
1192 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1194 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1195 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1196 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1197 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1198 pub struct ObjectSetName {
1199 pub object_id: Uuid,
1201 #[serde(default, skip_serializing_if = "String::is_empty")]
1203 pub name: String,
1204 }
1205
1206 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1208 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1209 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1210 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1211 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1212 pub struct GetEntityType {
1213 pub entity_id: Uuid,
1215 }
1216
1217 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1219 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1220 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1221 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1222 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1223 pub struct Solid3dGetAllEdgeFaces {
1224 pub object_id: Uuid,
1226 pub edge_id: Uuid,
1228 }
1229
1230 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1232 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1233 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1234 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1235 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1236 pub struct Solid3dFlip {
1237 pub object_id: Uuid,
1239 }
1240
1241 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1244 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1245 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1246 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1247 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1248 pub struct Solid3dFlipFace {
1249 pub object_id: Uuid,
1251 pub face_id: Uuid,
1253 }
1254
1255 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1257 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1258 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1259 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1260 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1261 pub struct Solid2dAddHole {
1262 pub object_id: Uuid,
1264 pub hole_id: Uuid,
1266 }
1267
1268 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1270 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1271 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1272 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1273 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1274 pub struct Solid3dGetAllOppositeEdges {
1275 pub object_id: Uuid,
1277 pub edge_id: Uuid,
1279 pub along_vector: Option<Point3d<f64>>,
1281 }
1282
1283 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1285 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1286 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1287 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1288 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1289 pub struct Solid3dGetOppositeEdge {
1290 pub object_id: Uuid,
1292 pub edge_id: Uuid,
1294 pub face_id: Uuid,
1296 }
1297
1298 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1300 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1301 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1302 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1303 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1304 pub struct Solid3dGetNextAdjacentEdge {
1305 pub object_id: Uuid,
1307 pub edge_id: Uuid,
1309 pub face_id: Uuid,
1311 }
1312
1313 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1315 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1316 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1317 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1318 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1319 pub struct Solid3dGetPrevAdjacentEdge {
1320 pub object_id: Uuid,
1322 pub edge_id: Uuid,
1324 pub face_id: Uuid,
1326 }
1327
1328 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1330 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1331 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1332 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1333 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1334 pub struct Solid3dGetCommonEdge {
1335 pub object_id: Uuid,
1337 pub face_ids: [Uuid; 2]
1339 }
1340
1341 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1343 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1344 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1345 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1346 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1347 pub struct Solid3dFilletEdge {
1348 pub object_id: Uuid,
1350 #[serde(default)]
1352 pub edge_id: Option<Uuid>,
1353 #[serde(default)]
1355 #[builder(default)]
1356 pub edge_ids: Vec<Uuid>,
1357 #[serde(default, skip_serializing_if = "Vec::is_empty")]
1359 #[builder(default)]
1360 pub edges_references: Vec<EdgeSpecifier>,
1361 pub radius: LengthUnit,
1363 pub tolerance: LengthUnit,
1365 #[serde(default)]
1367 #[builder(default)]
1368 pub cut_type: CutType,
1369 #[serde(default)]
1371 #[builder(default)]
1372 pub strategy: CutStrategy,
1373 #[serde(default)]
1381 #[builder(default)]
1382 pub extra_face_ids: Vec<Uuid>,
1383 #[serde(default, skip_serializing_if = "super::is_false")]
1385 #[builder(default)]
1386 pub use_legacy: bool,
1387 #[serde(default, skip_serializing_if = "EdgeCutVersion::is_default")]
1389 #[builder(default)]
1390 pub version: EdgeCutVersion,
1391 }
1392
1393 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1395 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1396 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1397 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1398 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1399 pub struct Solid3dCutEdgeReferences {
1400 pub object_id: Uuid,
1402 #[serde(default)]
1404 #[builder(default)]
1405 pub edges_references: Vec<EdgeSpecifier>,
1406 pub cut_type: CutTypeV2,
1408 pub tolerance: LengthUnit,
1411 #[serde(default)]
1413 #[builder(default)]
1414 pub strategy: CutStrategy,
1415 #[serde(default)]
1423 #[builder(default)]
1424 pub extra_face_ids: Vec<Uuid>,
1425 #[serde(default, skip_serializing_if = "super::is_false")]
1427 #[builder(default)]
1428 pub use_legacy: bool,
1429 #[serde(default, skip_serializing_if = "EdgeCutVersion::is_default")]
1431 #[builder(default)]
1432 pub version: EdgeCutVersion,
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 = "arbitrary", derive(arbitrary::Arbitrary))]
1439 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1440 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1441 pub struct Solid3dCutEdges {
1442 pub object_id: Uuid,
1444 #[serde(default)]
1446 #[builder(default)]
1447 pub edge_ids: Vec<Uuid>,
1448 pub cut_type: CutTypeV2,
1450 pub tolerance: LengthUnit,
1453 #[serde(default)]
1455 #[builder(default)]
1456 pub strategy: CutStrategy,
1457 #[serde(default)]
1465 #[builder(default)]
1466 pub extra_face_ids: Vec<Uuid>,
1467 #[serde(default, skip_serializing_if = "super::is_false")]
1469 #[builder(default)]
1470 pub use_legacy: bool,
1471 #[serde(default, skip_serializing_if = "EdgeCutVersion::is_default")]
1473 #[builder(default)]
1474 pub version: EdgeCutVersion,
1475 }
1476
1477 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1479 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1480 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1481 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1482 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1483 pub struct FaceIsPlanar {
1484 pub object_id: Uuid,
1486 }
1487
1488 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1490 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1491 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1492 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1493 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1494 pub struct FaceGetPosition {
1495 pub object_id: Uuid,
1497
1498 pub uv: Point2d<f64>,
1500 }
1501
1502 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1504 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1505 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1506 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1507 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1508 pub struct FaceGetCenter {
1509 pub object_id: Uuid,
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 = "arbitrary", derive(arbitrary::Arbitrary))]
1517 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1518 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1519 pub struct FaceGetGradient {
1520 pub object_id: Uuid,
1522
1523 pub uv: Point2d<f64>,
1525 }
1526
1527 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1529 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1530 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1531 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1532 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1533 pub struct SendObject {
1534 pub object_id: Uuid,
1536 pub front: bool,
1538 }
1539 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1541 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1542 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1543 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1544 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1545 pub struct EntitySetOpacity {
1546 pub entity_id: Uuid,
1548 pub opacity: f32,
1552 }
1553
1554 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1556 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1557 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1558 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1559 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1560 pub struct EntityFade {
1561 pub entity_id: Uuid,
1563 pub fade_in: bool,
1565 #[serde(default = "default_animation_seconds")]
1567 #[builder(default = default_animation_seconds())]
1568 pub duration_seconds: f64,
1569 }
1570
1571 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1573 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1574 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1575 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1576 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1577 pub struct MakePlane {
1578 pub origin: Point3d<LengthUnit>,
1580 pub x_axis: Point3d<f64>,
1582 pub y_axis: Point3d<f64>,
1584 pub size: LengthUnit,
1588 pub clobber: bool,
1590 pub hide: Option<bool>,
1592 }
1593
1594 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1596 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1597 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1598 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1599 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1600 pub struct PlaneSetColor {
1601 pub plane_id: Uuid,
1603 pub color: Color,
1605 }
1606
1607 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1609 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1610 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1611 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1612 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1613 pub struct SetTool {
1614 pub tool: SceneToolType,
1616 }
1617
1618 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1620 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1621 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1622 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1623 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1624 pub struct MouseMove {
1625 pub window: Point2d,
1627 pub sequence: Option<u32>,
1632 }
1633
1634 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1637 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1638 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1639 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1640 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1641 pub struct MouseClick {
1642 pub window: Point2d,
1644 }
1645
1646 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1650 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1651 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1652 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1653 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1654 pub struct SketchModeDisable {}
1655
1656 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1658 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1659 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1660 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1661 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1662 pub struct GetSketchModePlane {}
1663
1664 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1666 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1667 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1668 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1669 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1670 pub struct CurveSetConstraint {
1671 pub object_id: Uuid,
1673 pub constraint_bound: PathComponentConstraintBound,
1675 pub constraint_type: PathComponentConstraintType,
1677 }
1678
1679 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1681 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1682 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1683 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1684 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1685 pub struct EnableSketchMode {
1686 pub entity_id: Uuid,
1688 pub ortho: bool,
1691 pub animated: bool,
1693 pub adjust_camera: bool,
1695 pub planar_normal: Option<Point3d<f64>>,
1698 }
1699
1700 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1704 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1705 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1706 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1707 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1708 pub struct EnableDryRun {}
1709
1710 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1714 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1715 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1716 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1717 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1718 pub struct DisableDryRun {}
1719
1720 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1722 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1723 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1724 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1725 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1726 pub struct SetBackgroundColor {
1727 pub color: Color,
1729 }
1730
1731 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1733 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1734 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1735 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1736 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1737 pub struct SetCurrentToolProperties {
1738 pub color: Option<Color>,
1740 }
1741
1742 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1744 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1745 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1746 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1747 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1748 pub struct SetDefaultSystemProperties {
1749 #[serde(default)]
1751 pub color: Option<Color>,
1752 #[serde(default)]
1754 pub backface_color: Option<Color>,
1755 #[serde(default)]
1757 pub highlight_color: Option<Color>,
1758 #[serde(default)]
1760 pub selection_color: Option<Color>,
1761 }
1762
1763 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1765 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1766 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1767 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1768 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1769 pub struct CurveGetType {
1770 pub curve_id: Uuid,
1772 }
1773
1774 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1776 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1777 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1778 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1779 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1780 pub struct CurveGetControlPoints {
1781 pub curve_id: Uuid,
1783 }
1784
1785 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1787 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1788 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1789 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1790 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1791 pub struct ProjectEntityToPlane {
1792 #[serde(default, skip_serializing_if = "Option::is_none")]
1794 pub entity_id: Option<Uuid>,
1795 #[serde(default, skip_serializing_if = "Option::is_none")]
1797 pub entity_reference: Option<EntityReference>,
1798 pub plane_id: Uuid,
1800 pub use_plane_coords: bool,
1803 }
1804
1805 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1807 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1808 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1809 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1810 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1811 pub struct ProjectPointsToPlane {
1812 pub plane_id: Uuid,
1814 pub points: Vec<Point3d<f64>>,
1816 pub use_plane_coords: bool,
1819 }
1820
1821 #[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, JsonSchema, FromStr, Display)]
1823 #[serde(rename_all = "snake_case")]
1824 #[display(style = "snake_case")]
1825 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1826 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1827 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1828 #[cfg_attr(feature = "python", pyo3::pyclass(from_py_object), pyo3_stub_gen::derive::gen_stub_pyclass_enum)]
1829 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1830 pub enum ImageFormat {
1831 Png,
1833 Jpeg,
1835 }
1836
1837 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1839 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1840 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1841 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1842 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1843 pub struct TakeSnapshot {
1844 pub format: ImageFormat,
1846 }
1847
1848 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1850 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1851 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1852 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1853 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1854 pub struct MakeAxesGizmo {
1855 pub gizmo_mode: bool,
1858 pub clobber: bool,
1860 }
1861
1862 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1864 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1865 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1866 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1867 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1868 pub struct PathGetInfo {
1869 pub path_id: Uuid,
1871 }
1872
1873 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1875 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1876 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1877 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1878 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1879 pub struct PathGetCurveUuidsForVertices {
1880 pub path_id: Uuid,
1882
1883 pub vertex_ids: Vec<Uuid>,
1885 }
1886
1887 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1889 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1890 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1891 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1892 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1893 pub struct PathGetCurveUuid {
1894 pub path_id: Uuid,
1896
1897 pub index: u32,
1899 }
1900
1901 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1903 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1904 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1905 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1906 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1907 pub struct PathGetVertexUuids {
1908 pub path_id: Uuid,
1910 }
1911
1912 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1914 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1915 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1916 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1917 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1918 pub struct PathGetSketchTargetUuid {
1919 pub path_id: Uuid,
1921 }
1922
1923 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1925 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1926 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1927 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1928 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1929 pub struct HandleMouseDragStart {
1930 pub window: Point2d,
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 = "arbitrary", derive(arbitrary::Arbitrary))]
1938 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1939 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1940 pub struct HandleMouseDragMove {
1941 pub window: Point2d,
1943 pub sequence: Option<u32>,
1948 }
1949
1950 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1952 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1953 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1954 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1955 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1956 pub struct HandleMouseDragEnd {
1957 pub window: Point2d,
1959 }
1960
1961 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1963 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1964 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1965 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1966 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1967 pub struct RemoveSceneObjects {
1968 pub object_ids: HashSet<Uuid>,
1970 }
1971
1972 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1975 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1976 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1977 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1978 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1979 pub struct PlaneIntersectAndProject {
1980 pub plane_id: Uuid,
1982 pub window: Point2d,
1984 }
1985
1986 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1988 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1989 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1990 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1991 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1992 pub struct CurveGetEndPoints {
1993 pub curve_id: Uuid,
1995 }
1996
1997 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1999 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2000 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2001 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2002 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2003 pub struct ReconfigureStream {
2004 pub width: u32,
2006 pub height: u32,
2008 pub fps: u32,
2010 #[serde(default)]
2012 pub bitrate: Option<u32>,
2013 }
2014
2015 #[derive(Debug, Eq, PartialEq, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2017 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2018 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2019 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2020 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2021 pub struct ImportFiles {
2022 pub files: Vec<super::ImportFile>,
2024 pub format: crate::format::InputFormat3d,
2026 }
2027
2028 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2034 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2035 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2036 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2037 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2038 pub struct SetSceneUnits {
2039 pub unit: units::UnitLength,
2041 }
2042
2043 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2045 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2046 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2047 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2048 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2049 pub struct Mass {
2050 #[builder(default)]
2053 pub entity_ids: Vec<Uuid>,
2054 pub material_density: f64,
2056 pub material_density_unit: units::UnitDensity,
2058 pub output_unit: units::UnitMass,
2060 }
2061
2062 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2064 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2065 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2066 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2067 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2068 pub struct Density {
2069 #[builder(default)]
2072 pub entity_ids: Vec<Uuid>,
2073 pub material_mass: f64,
2075 pub material_mass_unit: units::UnitMass,
2077 pub output_unit: units::UnitDensity,
2079 }
2080
2081 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2083 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2084 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2085 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2086 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2087 pub struct Volume {
2088 #[builder(default)]
2091 pub entity_ids: Vec<Uuid>,
2092 pub output_unit: units::UnitVolume,
2094 }
2095
2096 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2098 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2099 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2100 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2101 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2102 pub struct CenterOfMass {
2103 #[builder(default)]
2106 pub entity_ids: Vec<Uuid>,
2107 pub output_unit: units::UnitLength,
2109 }
2110
2111 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2113 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2114 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2115 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2116 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2117 pub struct SurfaceArea {
2118 #[builder(default)]
2121 pub entity_ids: Vec<Uuid>,
2122 pub output_unit: units::UnitArea,
2124 }
2125
2126 #[derive(
2128 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
2129 Builder
2130 )]
2131 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2132 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2133 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2134 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2135 pub struct DefaultCameraFocusOn {
2136 pub uuid: Uuid,
2138 }
2139 #[derive(
2141 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
2142 Builder
2143 )]
2144 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2145 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2146 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2147 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2148 pub struct SetSelectionType {
2149 pub selection_type: SceneSelectionType,
2151 }
2152
2153 #[derive(
2155 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
2156 Builder
2157 )]
2158 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2159 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2160 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2161 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2162 pub struct SetSelectionFilter {
2163 pub filter: Vec<EntityType>,
2166 }
2167
2168 #[derive(
2170 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
2171 Builder
2172 )]
2173 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2174 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2175 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2176 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2177 pub struct SceneGetEntityIds {
2178 pub filter: Vec<EntityType>,
2180 pub skip: u32,
2183 #[schemars(range(min = 1, max = 1000))]
2188 pub take: u32,
2189 }
2190
2191 #[derive(
2193 Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
2194 Builder
2195 )]
2196 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2197 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2198 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2199 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2200 pub struct DefaultCameraSetOrthographic {}
2201
2202 #[derive(
2204 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
2205 Builder
2206 )]
2207 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2208 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2209 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2210 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2211 pub struct DefaultCameraSetPerspective {
2212 pub parameters: Option<PerspectiveCameraParameters>,
2214 }
2215
2216 #[derive(
2219 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder
2220 )]
2221 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2222 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2223 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2224 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2225 pub struct DefaultCameraCenterToSelection {
2226 #[serde(default)]
2229 #[builder(default)]
2230 pub camera_movement: CameraMovement,
2231 }
2232
2233 #[derive(
2235 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder
2236 )]
2237 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2238 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2239 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2240 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2241 pub struct DefaultCameraCenterToScene {
2242 #[serde(default)]
2245 #[builder(default)]
2246 pub camera_movement: CameraMovement,
2247 }
2248
2249 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2251 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2252 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2253 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2254 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2255 pub struct ZoomToFit {
2256 #[serde(default)]
2258 #[builder(default)]
2259 pub object_ids: Vec<Uuid>,
2260 #[serde(default)]
2265 #[builder(default)]
2266 pub padding: f32,
2267 #[serde(default)]
2269 #[builder(default)]
2270 pub animated: bool,
2271 }
2272
2273 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2275 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2276 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2277 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2278 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2279 pub struct OrientToFace {
2280 pub face_id: Uuid,
2282 #[serde(default)]
2287 #[builder(default)]
2288 pub padding: f32,
2289 #[serde(default)]
2291 #[builder(default)]
2292 pub animated: bool,
2293 }
2294
2295 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2297 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2298 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2299 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2300 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2301 pub struct ViewIsometric {
2302 #[serde(default)]
2307 #[builder(default)]
2308 pub padding: f32,
2309 }
2310
2311 #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
2313 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2314 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2315 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2316 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2317 pub struct Solid3dGetExtrusionFaceInfo {
2318 pub object_id: Uuid,
2320 pub edge_id: Uuid,
2322 }
2323
2324 #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
2326 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2327 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2328 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2329 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2330 pub struct Solid3dGetAdjacencyInfo {
2331 pub object_id: Uuid,
2333 pub edge_id: Uuid,
2335 }
2336
2337
2338 #[derive(Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
2340 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2341 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2342 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2343 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2344 pub struct SelectClear {}
2345
2346 #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
2349 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2350 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2351 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2352 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2353 pub struct SelectEntity {
2354 pub entities: Vec<EntityReference>,
2356 }
2357
2358 #[derive(Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
2360 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2361 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2362 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2363 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2364 pub struct SelectGet {}
2365
2366 #[derive(
2368 Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
2369 Builder
2370 )]
2371 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2372 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2373 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2374 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2375 pub struct GetNumObjects {}
2376
2377 #[derive(
2379 Clone, Debug, Deserialize, PartialEq, JsonSchema, Serialize, ModelingCmdVariant,
2380 Builder
2381 )]
2382 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2383 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2384 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2385 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2386 pub struct SetObjectTransform
2387 {
2388 pub object_id: Uuid,
2390 pub transforms: Vec<ComponentTransform>,
2392 }
2393
2394 #[derive(
2397 Clone, Debug, Deserialize, PartialEq, JsonSchema, Serialize, ModelingCmdVariant,
2398 Builder
2399 )]
2400 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2401 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2402 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2403 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2404 pub struct BooleanUnion
2405 {
2406 pub solid_ids: Vec<Uuid>,
2409 #[serde(default)]
2411 #[builder(default)]
2412 pub separate_bodies: bool,
2413 #[serde(default, skip_serializing_if = "super::is_false")]
2415 #[builder(default)]
2416 pub use_legacy: bool,
2417 pub tolerance: LengthUnit,
2419 }
2420
2421 #[derive(
2424 Clone, Debug, Deserialize, PartialEq, JsonSchema, Serialize, ModelingCmdVariant,
2425 Builder
2426 )]
2427 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2428 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2429 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2430 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2431 pub struct BooleanIntersection
2432 {
2433 pub solid_ids: Vec<Uuid>,
2435 #[serde(default)]
2437 #[builder(default)]
2438 pub separate_bodies: bool,
2439 #[serde(default, skip_serializing_if = "super::is_false")]
2441 #[builder(default)]
2442 pub use_legacy: bool,
2443 pub tolerance: LengthUnit,
2445 }
2446
2447 #[derive(
2451 Clone, Debug, Deserialize, PartialEq, JsonSchema, Serialize, ModelingCmdVariant,
2452 Builder
2453 )]
2454 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2455 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2456 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2457 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2458 pub struct BooleanSubtract
2459 {
2460 pub target_ids: Vec<Uuid>,
2462 pub tool_ids: Vec<Uuid>,
2464 #[serde(default)]
2466 #[builder(default)]
2467 pub separate_bodies: bool,
2468 #[serde(default, skip_serializing_if = "super::is_false")]
2470 #[builder(default)]
2471 pub use_legacy: bool,
2472 pub tolerance: LengthUnit,
2474 }
2475
2476 #[derive(
2478 Clone, Debug, Deserialize, PartialEq, JsonSchema, Serialize, ModelingCmdVariant,
2479 Builder
2480 )]
2481 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2482 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2483 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2484 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2485 pub struct BooleanImprint
2486 {
2487 #[serde(alias = "target_ids")]
2489 pub body_ids: Vec<Uuid>,
2490 #[serde(default)]
2493 pub tool_ids: Option<Vec<Uuid>>,
2494 #[serde(default)]
2496 #[builder(default)]
2497 pub separate_bodies: bool,
2498 #[serde(default, skip_serializing_if = "super::is_false")]
2500 #[builder(default)]
2501 pub use_legacy: bool,
2502 #[serde(default)]
2504 #[builder(default)]
2505 pub keep_tools: bool,
2506 pub tolerance: LengthUnit,
2508 }
2509
2510 #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
2513 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2514 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2515 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2516 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2517 pub struct MakeOffsetPath {
2518 pub object_id: Uuid,
2520 #[serde(default)]
2525 pub face_id: Option<Uuid>,
2526 pub offset: LengthUnit,
2528 }
2529
2530 #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
2532 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2533 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2534 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2535 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2536 pub struct AddHoleFromOffset {
2537 pub object_id: Uuid,
2539 pub offset: LengthUnit,
2541 }
2542
2543 #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
2545 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2546 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2547 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2548 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2549 pub struct SetGridReferencePlane {
2550 pub grid_id: Uuid,
2552 pub reference_id: Uuid,
2555 }
2556
2557 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2559 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2560 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2561 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2562 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2563 pub struct SetGridScale {
2564 pub value: f32,
2566 pub units: units::UnitLength,
2568 }
2569
2570 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2573 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2574 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2575 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2576 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2577 pub struct SetGridAutoScale {
2578 }
2579
2580 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2583 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2584 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2585 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2586 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2587 pub struct SetOrderIndependentTransparency {
2588 pub enabled: Option<bool>,
2591 }
2592
2593 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2597 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2598 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2599 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2600 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2601 pub struct CreateRegion {
2602 pub object_id: Uuid,
2604 pub segment: Uuid,
2606 pub intersection_segment: Uuid,
2609 #[serde(default = "super::negative_one")]
2613 #[builder(default = super::negative_one())]
2614 pub intersection_index: i32,
2615 #[serde(default)]
2618 #[builder(default)]
2619 pub curve_clockwise: bool,
2620 #[serde(default, skip_serializing_if = "RegionVersion::is_zero")]
2622 #[builder(default)]
2623 pub version: RegionVersion,
2624 }
2625
2626 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2630 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2631 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2632 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2633 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2634 pub struct CreateRegionFromQueryPoint {
2635 pub object_id: Uuid,
2637
2638 pub query_point: Point2d<LengthUnit>,
2641 #[serde(default, skip_serializing_if = "RegionVersion::is_zero")]
2643 #[builder(default)]
2644 pub version: RegionVersion,
2645 }
2646
2647 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2649 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2650 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2651 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2652 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2653 pub struct RegionGetQueryPoint {
2654 pub region_id: Uuid,
2656 }
2657
2658 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2661 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2662 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2663 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2664 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2665 pub struct SelectRegionFromPoint {
2666 pub selected_at_window: Point2d,
2668 }
2669
2670 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2672 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2673 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2674 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2675 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2676 pub struct BoundingBox {
2677 #[builder(default)]
2680 pub entity_ids: Vec<Uuid>,
2681 #[builder(default = mm())]
2683 #[serde(default = "mm")]
2684 pub output_unit: units::UnitLength,
2685 }
2686
2687 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2689 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2690 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2691 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2692 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2693 pub struct OffsetSurface {
2694 pub surface_id: Uuid,
2696 pub distance: LengthUnit,
2698 pub flip: bool,
2700 }
2701
2702 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2704 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2705 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2706 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2707 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2708 pub struct ClosestEdge {
2709 #[serde(default)]
2712 pub object_id: Option<Uuid>,
2713 pub closest_to: Point3d<f64>,
2716 }
2717 }
2718
2719
2720}
2721
2722pub(crate) fn is_false(b: &bool) -> bool {
2723 !b
2724}
2725
2726pub(crate) fn negative_one() -> i32 {
2727 -1
2728}
2729
2730impl ModelingCmd {
2731 pub fn is_safe_to_batch(&self) -> bool {
2733 use ModelingCmd::*;
2734 matches!(
2735 self,
2736 MovePathPen(_)
2737 | ExtendPath(_)
2738 | Extrude(_)
2739 | Revolve(_)
2740 | Solid3dFilletEdge(_)
2741 | ClosePath(_)
2742 | UpdateAnnotation(_)
2743 | ObjectVisible(_)
2744 | ObjectBringToFront(_)
2745 | Solid2dAddHole(_)
2746 | SendObject(_)
2747 | EntitySetOpacity(_)
2748 | PlaneSetColor(_)
2749 | SetTool(_)
2750 )
2751 }
2752}
2753
2754#[derive(Clone, Serialize, Deserialize, JsonSchema, Eq, PartialEq, bon::Builder)]
2758#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2759#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2760#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2761#[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2762pub struct ImportFile {
2763 pub path: String,
2765 #[serde(
2767 serialize_with = "serde_bytes::serialize",
2768 deserialize_with = "serde_bytes::deserialize"
2769 )]
2770 pub data: Vec<u8>,
2771}
2772
2773impl std::fmt::Debug for ImportFile {
2774 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2775 f.debug_struct("ImportFile")
2776 .field("path", &self.path)
2777 .field("data", &"<redacted>")
2778 .finish()
2779 }
2780}