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)]
267 pub relative_to: Option<RelativeTo>,
268 #[serde(default, skip_serializing_if = "Option::is_none")]
271 pub version: Option<u8>,
272 #[serde(default, skip_serializing_if = "Option::is_none")]
277 pub translate_profile_to_path: Option<bool>,
278 #[serde(default, skip_serializing_if = "Option::is_none")]
283 pub orient_profile_perpendicular: Option<bool>,
284 }
285
286 #[derive(
288 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
289 )]
290 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
291 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
292 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
293 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
294 pub struct Revolve {
295 pub target: ModelingCmdId,
298 pub origin: Point3d<LengthUnit>,
300 pub axis: Point3d<f64>,
302 pub axis_is_2d: bool,
304 pub angle: Angle,
306 pub tolerance: LengthUnit,
308 #[serde(default)]
311 #[builder(default)]
312 pub opposite: Opposite<Angle>,
313 #[serde(default)]
315 #[builder(default)]
316 pub body_type: BodyType,
317 }
318
319 #[derive(
321 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
322 )]
323 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
324 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
325 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
326 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
327 pub struct Solid3dShellFace {
328 pub object_id: Uuid,
330 pub face_ids: Vec<Uuid>,
332 pub shell_thickness: LengthUnit,
335 #[serde(default)]
337 #[builder(default)]
338 pub hollow: bool,
339 }
340
341 #[derive(
347 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
348 )]
349 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
350 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
351 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
352 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
353 pub struct Solid3dJoin {
354 pub object_id: Uuid,
356 }
357
358 #[derive(
360 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
361 )]
362 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
363 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
364 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
365 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
366 pub struct Solid3dMultiJoin {
367 pub object_ids: Vec<Uuid>,
369 pub tolerance: LengthUnit,
371 }
372
373
374 #[derive(
376 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
377 )]
378 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
379 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
380 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
381 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
382 pub struct SurfaceBlend {
383 #[schemars(length(min = 2, max = 2))]
385 pub surfaces: Vec<SurfaceEdgeReference>,
386 #[serde(default)]
388 #[builder(default)]
389 pub blend_type: BlendType,
390 }
391
392 #[derive(
394 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
395 )]
396 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
397 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
398 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
399 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
400 pub struct Solid3dGetEdgeUuid {
401 pub object_id: Uuid,
403
404 pub edge_index: u32,
406 }
407
408 #[derive(
410 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
411 )]
412 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
413 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
414 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
415 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
416 pub struct Solid3dGetFaceUuid {
417 pub object_id: Uuid,
419
420 pub face_index: u32,
422 }
423
424 #[derive(
426 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
427 )]
428 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
429 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
430 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
431 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
432 pub struct Solid3dGetBodyType {
433 pub object_id: Uuid,
435 }
436
437 #[derive(
439 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
440 )]
441 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
442 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
443 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
444 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
445 pub struct RevolveAboutEdge {
446 pub target: ModelingCmdId,
449 #[serde(default, skip_serializing_if = "Option::is_none")]
451 pub edge_id: Option<Uuid>,
452 #[serde(default, skip_serializing_if = "Option::is_none")]
455 pub edge_reference: Option<EdgeSpecifier>,
456 pub angle: Angle,
458 pub tolerance: LengthUnit,
460 #[serde(default)]
463 #[builder(default)]
464 pub opposite: Opposite<Angle>,
465 #[serde(default)]
467 #[builder(default)]
468 pub body_type: BodyType,
469 }
470
471 #[derive(
473 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
474 )]
475 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
476 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
477 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
478 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
479 pub struct Loft {
480 pub section_ids: Vec<Uuid>,
483 pub v_degree: std::num::NonZeroU32,
486 pub bez_approximate_rational: bool,
490 pub base_curve_index: Option<u32>,
492 pub tolerance: LengthUnit,
494 #[serde(default)]
496 #[builder(default)]
497 pub body_type: BodyType,
498 }
499
500
501 #[derive(
503 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
504 )]
505 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
506 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
507 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
508 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
509 pub struct ClosePath {
510 pub path_id: Uuid,
512 }
513
514 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
516 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
517 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
518 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
519 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
520 pub struct CameraDragStart {
521 pub interaction: CameraDragInteractionType,
523 pub window: Point2d,
525 }
526
527 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
529 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
530 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
531 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
532 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
533 pub struct CameraDragMove {
534 pub interaction: CameraDragInteractionType,
536 pub window: Point2d,
538 pub sequence: Option<u32>,
543 }
544
545 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
547 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
548 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
549 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
550 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
551 pub struct CameraDragEnd {
552 pub interaction: CameraDragInteractionType,
554 pub window: Point2d,
556 }
557
558 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
560 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
561 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
562 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
563 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
564 pub struct DefaultCameraGetSettings {}
565
566 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
568 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
569 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
570 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
571 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
572 pub struct DefaultCameraGetView {}
573
574 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
576 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
577 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
578 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
579 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
580 pub struct DefaultCameraSetView {
581 pub view: CameraViewState,
583 }
584
585 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
587 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
588 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
589 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
590 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
591 pub struct DefaultCameraLookAt {
592 pub vantage: Point3d,
594 pub center: Point3d,
596 pub up: Point3d,
598 pub sequence: Option<u32>,
603 }
604
605 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
607 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
608 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
609 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
610 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
611 pub struct DefaultCameraPerspectiveSettings {
612 pub vantage: Point3d,
614 pub center: Point3d,
616 pub up: Point3d,
618 pub fov_y: Option<f32>,
620 pub z_near: Option<f32>,
622 pub z_far: Option<f32>,
624 pub sequence: Option<u32>,
629 }
630
631 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
633 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
634 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
635 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
636 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
637 pub struct DefaultCameraZoom {
638 pub magnitude: f32,
642 }
643
644 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
646 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
647 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
648 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
649 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
650 pub struct Export2d {
651 pub entity_ids: Vec<Uuid>,
653 pub format: OutputFormat2d,
655 }
656
657 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
659 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
660 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
661 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
662 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
663 pub struct Export3d {
664 #[builder(default)]
666 pub entity_ids: Vec<Uuid>,
667 pub format: OutputFormat3d,
669 }
670
671 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
673 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
674 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
675 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
676 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
677 pub struct Export {
678 #[builder(default)]
680 pub entity_ids: Vec<Uuid>,
681 pub format: OutputFormat3d,
683 }
684
685 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
687 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
688 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
689 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
690 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
691 pub struct EntityGetParentId {
692 pub entity_id: Uuid,
694 }
695
696 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
698 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
699 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
700 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
701 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
702 pub struct EntityGetNumChildren {
703 pub entity_id: Uuid,
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 = "arbitrary", derive(arbitrary::Arbitrary))]
711 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
712 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
713 pub struct EntityGetChildUuid {
714 pub entity_id: Uuid,
716 pub child_index: u32,
718 }
719
720 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
722 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
723 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
724 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
725 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
726 pub struct EntityGetIndex {
727 pub entity_id: Uuid,
729 }
730
731 #[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 EntityGetPrimitiveIndex {
738 pub entity_id: Uuid,
740 }
741
742 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
745 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
746 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
747 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
748 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
749 pub struct EntityDeleteChildren {
750 pub entity_id: Uuid,
752 pub child_entity_ids: HashSet<Uuid>,
754 }
755
756 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
758 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
759 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
760 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
761 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
762 pub struct EntityGetAllChildUuids {
763 pub entity_id: Uuid,
765 }
766
767 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
769 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
770 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
771 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
772 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
773 pub struct EntityGetSketchPaths {
774 pub entity_id: Uuid,
776 }
777
778 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
780 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
781 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
782 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
783 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
784 pub struct EntityGetDistance {
785 pub entity_id1: Uuid,
787 pub entity_id2: Uuid,
789 pub distance_type: DistanceType,
791 }
792
793 #[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 EdgeGetLength {
800 pub edge_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 EntityClone {
812 pub entity_id: Uuid,
814 }
815
816 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
819 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
820 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
821 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
822 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
823 pub struct EntityLinearPatternTransform {
824 pub entity_id: Uuid,
826 #[serde(default)]
830 #[builder(default)]
831 pub transform: Vec<crate::shared::Transform>,
832 #[serde(default)]
836 #[builder(default)]
837 pub transforms: Vec<Vec<crate::shared::Transform>>,
838 }
839
840 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
842 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
843 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
844 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
845 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
846 pub struct EntityLinearPattern {
847 pub entity_id: Uuid,
849 pub axis: Point3d<f64>,
852 pub num_repetitions: u32,
854 pub spacing: LengthUnit,
856 }
857 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
859 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
860 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
861 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
862 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
863 pub struct EntityCircularPattern {
864 pub entity_id: Uuid,
866 pub axis: Point3d<f64>,
869 pub center: Point3d<LengthUnit>,
872 pub num_repetitions: u32,
874 pub arc_degrees: f64,
876 pub rotate_duplicates: bool,
878 }
879
880 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
882 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
883 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
884 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
885 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
886 pub struct EntityMakeHelix {
887 pub cylinder_id: Uuid,
889 pub revolutions: f64,
891 #[serde(default)]
893 #[builder(default)]
894 pub start_angle: Angle,
895 pub is_clockwise: bool,
897 pub length: Option<LengthUnit>,
899 }
900
901 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
903 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
904 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
905 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
906 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
907 pub struct EntityMakeHelixFromParams {
908 pub radius: LengthUnit,
910 pub length: LengthUnit,
912 pub revolutions: f64,
914 #[serde(default)]
916 #[builder(default)]
917 pub start_angle: Angle,
918 pub is_clockwise: bool,
920 pub center: Point3d<LengthUnit>,
922 pub axis: Point3d<f64>,
924 }
925
926 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
928 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
929 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
930 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
931 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
932 pub struct EntityMakeHelixFromEdge {
933 pub radius: LengthUnit,
935 pub length: Option<LengthUnit>,
937 pub revolutions: f64,
939 #[serde(default)]
941 #[builder(default)]
942 pub start_angle: Angle,
943 pub is_clockwise: bool,
945 #[serde(default, skip_serializing_if = "Option::is_none")]
948 pub edge_id: Option<Uuid>,
949 #[serde(default, skip_serializing_if = "Option::is_none")]
952 pub edge_reference: Option<EdgeSpecifier>,
953 }
954
955 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
957 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
958 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
959 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
960 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
961 pub struct EntityMirrorAcross {
962 pub ids: Vec<Uuid>,
964 pub across: MirrorAcross,
966 }
967
968
969 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
972 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
973 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
974 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
975 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
976 pub struct EntityMirror {
977 pub ids: Vec<Uuid>,
979 pub axis: Point3d<f64>,
981 pub point: Point3d<LengthUnit>,
983 }
984
985 #[derive(
988 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
989 )]
990 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
991 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
992 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
993 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
994 pub struct EntityMirrorAcrossEdge {
995 pub ids: Vec<Uuid>,
997 #[serde(default, skip_serializing_if = "Option::is_none")]
1000 pub edge_id: Option<Uuid>,
1001 #[serde(default, skip_serializing_if = "Option::is_none")]
1004 pub edge_reference: Option<EdgeSpecifier>,
1005 }
1006
1007 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1010 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1011 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1012 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1013 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1014 pub struct SelectWithPoint {
1015 pub selected_at_window: Point2d,
1017 pub selection_type: SceneSelectionType,
1019 }
1020
1021 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1025 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1026 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1027 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1028 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1029 pub struct QueryEntityTypeWithPoint {
1030 pub selected_at_window: Point2d,
1032 pub selection_type: SceneSelectionType,
1034 }
1035
1036 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1040 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1041 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1042 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1043 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1044 pub struct QueryEntityType {
1045 pub entity_id: Uuid,
1047 }
1048
1049 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1051 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1052 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1053 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1054 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1055 pub struct SelectAdd {
1056 pub entities: Vec<Uuid>,
1058 }
1059
1060 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1062 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1063 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1064 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1065 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1066 pub struct SelectRemove {
1067 pub entities: Vec<Uuid>,
1069 }
1070
1071 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1073 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1074 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1075 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1076 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1077 pub struct SceneClearAll {}
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 = "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 SelectReplace {
1086 pub entities: Vec<Uuid>,
1088 }
1089
1090 #[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1093 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1094 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1095 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1096 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1097 pub struct HighlightSetEntity {
1098 pub selected_at_window: Point2d,
1100 pub sequence: Option<u32>,
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 = "arbitrary", derive(arbitrary::Arbitrary))]
1111 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1112 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1113 pub struct HighlightSetEntities {
1114 pub entities: Vec<Uuid>,
1116 }
1117
1118 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1120 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1121 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1122 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1123 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1124 pub struct NewAnnotation {
1125 pub options: AnnotationOptions,
1127 pub clobber: bool,
1129 pub annotation_type: AnnotationType,
1131 }
1132
1133 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1135 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1136 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1137 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1138 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1139 pub struct UpdateAnnotation {
1140 pub annotation_id: Uuid,
1142 pub options: AnnotationOptions,
1145 }
1146
1147 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1149 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1150 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1151 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1152 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1153 pub struct EdgeLinesVisible {
1154 pub hidden: bool,
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 = "arbitrary", derive(arbitrary::Arbitrary))]
1162 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1163 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1164 pub struct ObjectVisible {
1165 pub object_id: Uuid,
1167 pub hidden: bool,
1169 }
1170
1171 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1173 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1174 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1175 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1176 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1177 pub struct ObjectBringToFront {
1178 pub object_id: Uuid,
1180 }
1181
1182 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1184 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1185 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1186 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1187 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1188 pub struct ObjectSetMaterialParamsPbr {
1189 pub object_id: Uuid,
1191 pub color: Color,
1193 pub metalness: f32,
1195 pub roughness: f32,
1197 pub ambient_occlusion: f32,
1199 #[serde(default, skip_serializing_if = "Option::is_none")]
1201 pub backface_color: Option<Color>,
1202 }
1203
1204 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1206 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1207 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1208 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1209 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1210 pub struct ObjectSetName {
1211 pub object_id: Uuid,
1213 #[serde(default, skip_serializing_if = "String::is_empty")]
1215 pub name: String,
1216 }
1217
1218 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1220 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1221 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1222 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1223 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1224 pub struct GetEntityType {
1225 pub entity_id: Uuid,
1227 }
1228
1229 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1231 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1232 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1233 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1234 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1235 pub struct Solid3dGetAllEdgeFaces {
1236 pub object_id: Uuid,
1238 pub edge_id: Uuid,
1240 }
1241
1242 #[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 Solid3dFlip {
1249 pub object_id: Uuid,
1251 }
1252
1253 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1256 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1257 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1258 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1259 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1260 pub struct Solid3dFlipFace {
1261 pub object_id: Uuid,
1263 pub face_id: Uuid,
1265 }
1266
1267 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1269 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1270 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1271 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1272 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1273 pub struct Solid2dAddHole {
1274 pub object_id: Uuid,
1276 pub hole_id: Uuid,
1278 }
1279
1280 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1282 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1283 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1284 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1285 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1286 pub struct Solid3dGetAllOppositeEdges {
1287 pub object_id: Uuid,
1289 pub edge_id: Uuid,
1291 pub along_vector: Option<Point3d<f64>>,
1293 }
1294
1295 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1297 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1298 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1299 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1300 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1301 pub struct Solid3dGetOppositeEdge {
1302 pub object_id: Uuid,
1304 pub edge_id: Uuid,
1306 pub face_id: Uuid,
1308 }
1309
1310 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1312 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1313 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1314 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1315 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1316 pub struct Solid3dGetNextAdjacentEdge {
1317 pub object_id: Uuid,
1319 pub edge_id: Uuid,
1321 pub face_id: Uuid,
1323 }
1324
1325 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1327 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1328 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1329 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1330 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1331 pub struct Solid3dGetPrevAdjacentEdge {
1332 pub object_id: Uuid,
1334 pub edge_id: Uuid,
1336 pub face_id: Uuid,
1338 }
1339
1340 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1342 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1343 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1344 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1345 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1346 pub struct Solid3dGetCommonEdge {
1347 pub object_id: Uuid,
1349 pub face_ids: [Uuid; 2]
1351 }
1352
1353 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1355 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1356 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1357 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1358 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1359 pub struct Solid3dFilletEdge {
1360 pub object_id: Uuid,
1362 #[serde(default)]
1364 pub edge_id: Option<Uuid>,
1365 #[serde(default)]
1367 #[builder(default)]
1368 pub edge_ids: Vec<Uuid>,
1369 #[serde(default, skip_serializing_if = "Vec::is_empty")]
1371 #[builder(default)]
1372 pub edges_references: Vec<EdgeSpecifier>,
1373 pub radius: LengthUnit,
1375 pub tolerance: LengthUnit,
1377 #[serde(default)]
1379 #[builder(default)]
1380 pub cut_type: CutType,
1381 #[serde(default)]
1383 #[builder(default)]
1384 pub strategy: CutStrategy,
1385 #[serde(default)]
1393 #[builder(default)]
1394 pub extra_face_ids: Vec<Uuid>,
1395 #[serde(default, skip_serializing_if = "super::is_false")]
1397 #[builder(default)]
1398 pub use_legacy: bool,
1399 #[serde(default, skip_serializing_if = "EdgeCutVersion::is_default")]
1401 #[builder(default)]
1402 pub version: EdgeCutVersion,
1403 }
1404
1405 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1407 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1408 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1409 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1410 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1411 pub struct Solid3dCutEdgeReferences {
1412 pub object_id: Uuid,
1414 #[serde(default)]
1416 #[builder(default)]
1417 pub edges_references: Vec<EdgeSpecifier>,
1418 pub cut_type: CutTypeV2,
1420 pub tolerance: LengthUnit,
1423 #[serde(default)]
1425 #[builder(default)]
1426 pub strategy: CutStrategy,
1427 #[serde(default)]
1435 #[builder(default)]
1436 pub extra_face_ids: Vec<Uuid>,
1437 #[serde(default, skip_serializing_if = "super::is_false")]
1439 #[builder(default)]
1440 pub use_legacy: bool,
1441 #[serde(default, skip_serializing_if = "EdgeCutVersion::is_default")]
1443 #[builder(default)]
1444 pub version: EdgeCutVersion,
1445 }
1446
1447 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1449 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1450 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1451 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1452 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1453 pub struct Solid3dCutEdges {
1454 pub object_id: Uuid,
1456 #[serde(default)]
1458 #[builder(default)]
1459 pub edge_ids: Vec<Uuid>,
1460 pub cut_type: CutTypeV2,
1462 pub tolerance: LengthUnit,
1465 #[serde(default)]
1467 #[builder(default)]
1468 pub strategy: CutStrategy,
1469 #[serde(default)]
1477 #[builder(default)]
1478 pub extra_face_ids: Vec<Uuid>,
1479 #[serde(default, skip_serializing_if = "super::is_false")]
1481 #[builder(default)]
1482 pub use_legacy: bool,
1483 #[serde(default, skip_serializing_if = "EdgeCutVersion::is_default")]
1485 #[builder(default)]
1486 pub version: EdgeCutVersion,
1487 }
1488
1489 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1491 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1492 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1493 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1494 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1495 pub struct FaceIsPlanar {
1496 pub object_id: Uuid,
1498 }
1499
1500 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1502 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1503 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1504 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1505 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1506 pub struct FaceGetPosition {
1507 pub object_id: Uuid,
1509
1510 pub uv: Point2d<f64>,
1512 }
1513
1514 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1516 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1517 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1518 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1519 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1520 pub struct FaceGetCenter {
1521 pub object_id: Uuid,
1523 }
1524
1525 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1527 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1528 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1529 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1530 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1531 pub struct FaceGetGradient {
1532 pub object_id: Uuid,
1534
1535 pub uv: Point2d<f64>,
1537 }
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 SendObject {
1546 pub object_id: Uuid,
1548 pub front: bool,
1550 }
1551 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1553 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1554 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1555 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1556 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1557 pub struct EntitySetOpacity {
1558 pub entity_id: Uuid,
1560 pub opacity: f32,
1564 }
1565
1566 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1568 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1569 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1570 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1571 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1572 pub struct EntityFade {
1573 pub entity_id: Uuid,
1575 pub fade_in: bool,
1577 #[serde(default = "default_animation_seconds")]
1579 #[builder(default = default_animation_seconds())]
1580 pub duration_seconds: f64,
1581 }
1582
1583 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1585 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1586 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1587 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1588 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1589 pub struct MakePlane {
1590 pub origin: Point3d<LengthUnit>,
1592 pub x_axis: Point3d<f64>,
1594 pub y_axis: Point3d<f64>,
1596 pub size: LengthUnit,
1600 pub clobber: bool,
1602 pub hide: Option<bool>,
1604 }
1605
1606 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1608 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1609 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1610 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1611 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1612 pub struct PlaneSetColor {
1613 pub plane_id: Uuid,
1615 pub color: Color,
1617 }
1618
1619 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1621 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1622 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1623 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1624 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1625 pub struct SetTool {
1626 pub tool: SceneToolType,
1628 }
1629
1630 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1632 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1633 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1634 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1635 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1636 pub struct MouseMove {
1637 pub window: Point2d,
1639 pub sequence: Option<u32>,
1644 }
1645
1646 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1649 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1650 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1651 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1652 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1653 pub struct MouseClick {
1654 pub window: Point2d,
1656 }
1657
1658 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1662 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1663 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1664 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1665 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1666 pub struct SketchModeDisable {}
1667
1668 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1670 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1671 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1672 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1673 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1674 pub struct GetSketchModePlane {}
1675
1676 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1678 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1679 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1680 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1681 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1682 pub struct CurveSetConstraint {
1683 pub object_id: Uuid,
1685 pub constraint_bound: PathComponentConstraintBound,
1687 pub constraint_type: PathComponentConstraintType,
1689 }
1690
1691 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1693 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1694 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1695 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1696 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1697 pub struct EnableSketchMode {
1698 pub entity_id: Uuid,
1700 pub ortho: bool,
1703 pub animated: bool,
1705 pub adjust_camera: bool,
1707 pub planar_normal: Option<Point3d<f64>>,
1710 }
1711
1712 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1716 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1717 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1718 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1719 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1720 pub struct EnableDryRun {}
1721
1722 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1726 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1727 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1728 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1729 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1730 pub struct DisableDryRun {}
1731
1732 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1734 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1735 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1736 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1737 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1738 pub struct SetBackgroundColor {
1739 pub color: Color,
1741 }
1742
1743 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1745 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1746 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1747 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1748 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1749 pub struct SetCurrentToolProperties {
1750 pub color: Option<Color>,
1752 }
1753
1754 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1756 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1757 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1758 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1759 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1760 pub struct SetDefaultSystemProperties {
1761 #[serde(default)]
1763 pub color: Option<Color>,
1764 #[serde(default)]
1766 pub backface_color: Option<Color>,
1767 #[serde(default)]
1769 pub highlight_color: Option<Color>,
1770 #[serde(default)]
1772 pub selection_color: Option<Color>,
1773 }
1774
1775 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1777 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1778 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1779 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1780 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1781 pub struct CurveGetType {
1782 pub curve_id: Uuid,
1784 }
1785
1786 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1788 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1789 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1790 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1791 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1792 pub struct CurveGetControlPoints {
1793 pub curve_id: Uuid,
1795 }
1796
1797 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1799 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1800 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1801 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1802 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1803 pub struct ProjectEntityToPlane {
1804 #[serde(default, skip_serializing_if = "Option::is_none")]
1806 pub entity_id: Option<Uuid>,
1807 #[serde(default, skip_serializing_if = "Option::is_none")]
1809 pub entity_reference: Option<EntityReference>,
1810 pub plane_id: Uuid,
1812 pub use_plane_coords: bool,
1815 }
1816
1817 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1819 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1820 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1821 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1822 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1823 pub struct ProjectPointsToPlane {
1824 pub plane_id: Uuid,
1826 pub points: Vec<Point3d<f64>>,
1828 pub use_plane_coords: bool,
1831 }
1832
1833 #[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, JsonSchema, FromStr, Display)]
1835 #[serde(rename_all = "snake_case")]
1836 #[display(style = "snake_case")]
1837 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1838 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1839 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1840 #[cfg_attr(feature = "python", pyo3::pyclass(from_py_object), pyo3_stub_gen::derive::gen_stub_pyclass_enum)]
1841 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1842 pub enum ImageFormat {
1843 Png,
1845 Jpeg,
1847 }
1848
1849 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1851 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1852 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1853 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1854 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1855 pub struct TakeSnapshot {
1856 pub format: ImageFormat,
1858 }
1859
1860 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1862 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1863 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1864 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1865 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1866 pub struct MakeAxesGizmo {
1867 pub gizmo_mode: bool,
1870 pub clobber: bool,
1872 }
1873
1874 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1876 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1877 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1878 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1879 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1880 pub struct PathGetInfo {
1881 pub path_id: Uuid,
1883 }
1884
1885 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1887 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1888 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1889 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1890 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1891 pub struct PathGetCurveUuidsForVertices {
1892 pub path_id: Uuid,
1894
1895 pub vertex_ids: Vec<Uuid>,
1897 }
1898
1899 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1901 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1902 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1903 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1904 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1905 pub struct PathGetCurveUuid {
1906 pub path_id: Uuid,
1908
1909 pub index: u32,
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 = "arbitrary", derive(arbitrary::Arbitrary))]
1917 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1918 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1919 pub struct PathGetVertexUuids {
1920 pub path_id: Uuid,
1922 }
1923
1924 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1926 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1927 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1928 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1929 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1930 pub struct PathGetSketchTargetUuid {
1931 pub path_id: Uuid,
1933 }
1934
1935 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1937 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1938 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1939 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1940 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1941 pub struct HandleMouseDragStart {
1942 pub window: Point2d,
1944 }
1945
1946 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1948 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1949 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1950 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1951 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1952 pub struct HandleMouseDragMove {
1953 pub window: Point2d,
1955 pub sequence: Option<u32>,
1960 }
1961
1962 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1964 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1965 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1966 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1967 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1968 pub struct HandleMouseDragEnd {
1969 pub window: Point2d,
1971 }
1972
1973 #[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 RemoveSceneObjects {
1980 pub object_ids: HashSet<Uuid>,
1982 }
1983
1984 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1987 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1988 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1989 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1990 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1991 pub struct PlaneIntersectAndProject {
1992 pub plane_id: Uuid,
1994 pub window: Point2d,
1996 }
1997
1998 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2000 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2001 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2002 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2003 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2004 pub struct CurveGetEndPoints {
2005 pub curve_id: Uuid,
2007 }
2008
2009 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2011 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2012 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2013 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2014 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2015 pub struct ReconfigureStream {
2016 pub width: u32,
2018 pub height: u32,
2020 pub fps: u32,
2022 #[serde(default)]
2024 pub bitrate: Option<u32>,
2025 }
2026
2027 #[derive(Debug, Eq, PartialEq, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2029 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2030 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2031 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2032 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2033 pub struct ImportFiles {
2034 pub files: Vec<super::ImportFile>,
2036 pub format: crate::format::InputFormat3d,
2038 }
2039
2040 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2046 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2047 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2048 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2049 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2050 pub struct SetSceneUnits {
2051 pub unit: units::UnitLength,
2053 }
2054
2055 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2057 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2058 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2059 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2060 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2061 pub struct Mass {
2062 #[builder(default)]
2065 pub entity_ids: Vec<Uuid>,
2066 pub material_density: f64,
2068 pub material_density_unit: units::UnitDensity,
2070 pub output_unit: units::UnitMass,
2072 }
2073
2074 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2076 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2077 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2078 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2079 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2080 pub struct Density {
2081 #[builder(default)]
2084 pub entity_ids: Vec<Uuid>,
2085 pub material_mass: f64,
2087 pub material_mass_unit: units::UnitMass,
2089 pub output_unit: units::UnitDensity,
2091 }
2092
2093 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2095 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2096 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2097 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2098 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2099 pub struct Volume {
2100 #[builder(default)]
2103 pub entity_ids: Vec<Uuid>,
2104 pub output_unit: units::UnitVolume,
2106 }
2107
2108 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2110 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2111 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2112 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2113 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2114 pub struct CenterOfMass {
2115 #[builder(default)]
2118 pub entity_ids: Vec<Uuid>,
2119 pub output_unit: units::UnitLength,
2121 }
2122
2123 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2125 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2126 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2127 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2128 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2129 pub struct SurfaceArea {
2130 #[builder(default)]
2133 pub entity_ids: Vec<Uuid>,
2134 pub output_unit: units::UnitArea,
2136 }
2137
2138 #[derive(
2140 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
2141 Builder
2142 )]
2143 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2144 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2145 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2146 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2147 pub struct DefaultCameraFocusOn {
2148 pub uuid: Uuid,
2150 }
2151 #[derive(
2153 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
2154 Builder
2155 )]
2156 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2157 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2158 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2159 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2160 pub struct SetSelectionType {
2161 pub selection_type: SceneSelectionType,
2163 }
2164
2165 #[derive(
2167 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
2168 Builder
2169 )]
2170 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2171 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2172 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2173 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2174 pub struct SetSelectionFilter {
2175 pub filter: Vec<EntityType>,
2178 }
2179
2180 #[derive(
2182 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
2183 Builder
2184 )]
2185 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2186 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2187 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2188 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2189 pub struct SceneGetEntityIds {
2190 pub filter: Vec<EntityType>,
2192 pub skip: u32,
2195 #[schemars(range(min = 1, max = 1000))]
2200 pub take: u32,
2201 }
2202
2203 #[derive(
2205 Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
2206 Builder
2207 )]
2208 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2209 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2210 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2211 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2212 pub struct DefaultCameraSetOrthographic {}
2213
2214 #[derive(
2216 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
2217 Builder
2218 )]
2219 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2220 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2221 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2222 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2223 pub struct DefaultCameraSetPerspective {
2224 pub parameters: Option<PerspectiveCameraParameters>,
2226 }
2227
2228 #[derive(
2231 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder
2232 )]
2233 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2234 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2235 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2236 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2237 pub struct DefaultCameraCenterToSelection {
2238 #[serde(default)]
2241 #[builder(default)]
2242 pub camera_movement: CameraMovement,
2243 }
2244
2245 #[derive(
2247 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder
2248 )]
2249 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2250 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2251 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2252 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2253 pub struct DefaultCameraCenterToScene {
2254 #[serde(default)]
2257 #[builder(default)]
2258 pub camera_movement: CameraMovement,
2259 }
2260
2261 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2263 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2264 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2265 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2266 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2267 pub struct ZoomToFit {
2268 #[serde(default)]
2270 #[builder(default)]
2271 pub object_ids: Vec<Uuid>,
2272 #[serde(default)]
2277 #[builder(default)]
2278 pub padding: f32,
2279 #[serde(default)]
2281 #[builder(default)]
2282 pub animated: bool,
2283 }
2284
2285 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2287 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2288 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2289 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2290 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2291 pub struct OrientToFace {
2292 pub face_id: Uuid,
2294 #[serde(default)]
2299 #[builder(default)]
2300 pub padding: f32,
2301 #[serde(default)]
2303 #[builder(default)]
2304 pub animated: bool,
2305 }
2306
2307 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2309 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2310 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2311 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2312 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2313 pub struct ViewIsometric {
2314 #[serde(default)]
2319 #[builder(default)]
2320 pub padding: f32,
2321 }
2322
2323 #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
2325 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2326 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2327 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2328 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2329 pub struct Solid3dGetExtrusionFaceInfo {
2330 pub object_id: Uuid,
2332 pub edge_id: Uuid,
2334 }
2335
2336 #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
2338 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2339 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2340 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2341 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2342 pub struct Solid3dGetAdjacencyInfo {
2343 pub object_id: Uuid,
2345 pub edge_id: Uuid,
2347 }
2348
2349
2350 #[derive(Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
2352 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2353 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2354 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2355 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2356 pub struct SelectClear {}
2357
2358 #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
2361 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2362 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2363 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2364 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2365 pub struct SelectEntity {
2366 pub entities: Vec<EntityReference>,
2368 }
2369
2370 #[derive(Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
2372 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2373 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2374 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2375 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2376 pub struct SelectGet {}
2377
2378 #[derive(
2380 Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
2381 Builder
2382 )]
2383 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2384 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2385 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2386 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2387 pub struct GetNumObjects {}
2388
2389 #[derive(
2391 Clone, Debug, Deserialize, PartialEq, JsonSchema, Serialize, ModelingCmdVariant,
2392 Builder
2393 )]
2394 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2395 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2396 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2397 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2398 pub struct SetObjectTransform
2399 {
2400 pub object_id: Uuid,
2402 pub transforms: Vec<ComponentTransform>,
2404 }
2405
2406 #[derive(
2409 Clone, Debug, Deserialize, PartialEq, JsonSchema, Serialize, ModelingCmdVariant,
2410 Builder
2411 )]
2412 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2413 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2414 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2415 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2416 pub struct BooleanUnion
2417 {
2418 pub solid_ids: Vec<Uuid>,
2421 #[serde(default)]
2423 #[builder(default)]
2424 pub separate_bodies: bool,
2425 #[serde(default, skip_serializing_if = "super::is_false")]
2427 #[builder(default)]
2428 pub use_legacy: bool,
2429 pub tolerance: LengthUnit,
2431 }
2432
2433 #[derive(
2436 Clone, Debug, Deserialize, PartialEq, JsonSchema, Serialize, ModelingCmdVariant,
2437 Builder
2438 )]
2439 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2440 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2441 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2442 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2443 pub struct BooleanIntersection
2444 {
2445 pub solid_ids: Vec<Uuid>,
2447 #[serde(default)]
2449 #[builder(default)]
2450 pub separate_bodies: bool,
2451 #[serde(default, skip_serializing_if = "super::is_false")]
2453 #[builder(default)]
2454 pub use_legacy: bool,
2455 pub tolerance: LengthUnit,
2457 }
2458
2459 #[derive(
2463 Clone, Debug, Deserialize, PartialEq, JsonSchema, Serialize, ModelingCmdVariant,
2464 Builder
2465 )]
2466 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2467 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2468 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2469 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2470 pub struct BooleanSubtract
2471 {
2472 pub target_ids: Vec<Uuid>,
2474 pub tool_ids: Vec<Uuid>,
2476 #[serde(default)]
2478 #[builder(default)]
2479 pub separate_bodies: bool,
2480 #[serde(default, skip_serializing_if = "super::is_false")]
2482 #[builder(default)]
2483 pub use_legacy: bool,
2484 pub tolerance: LengthUnit,
2486 }
2487
2488 #[derive(
2490 Clone, Debug, Deserialize, PartialEq, JsonSchema, Serialize, ModelingCmdVariant,
2491 Builder
2492 )]
2493 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2494 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2495 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2496 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2497 pub struct BooleanImprint
2498 {
2499 #[serde(alias = "target_ids")]
2501 pub body_ids: Vec<Uuid>,
2502 #[serde(default)]
2505 pub tool_ids: Option<Vec<Uuid>>,
2506 #[serde(default)]
2508 #[builder(default)]
2509 pub separate_bodies: bool,
2510 #[serde(default, skip_serializing_if = "super::is_false")]
2512 #[builder(default)]
2513 pub use_legacy: bool,
2514 #[serde(default)]
2516 #[builder(default)]
2517 pub keep_tools: bool,
2518 pub tolerance: LengthUnit,
2520 }
2521
2522 #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
2525 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2526 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2527 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2528 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2529 pub struct MakeOffsetPath {
2530 pub object_id: Uuid,
2532 #[serde(default)]
2537 pub face_id: Option<Uuid>,
2538 pub offset: LengthUnit,
2540 }
2541
2542 #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
2544 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2545 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2546 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2547 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2548 pub struct AddHoleFromOffset {
2549 pub object_id: Uuid,
2551 pub offset: LengthUnit,
2553 }
2554
2555 #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
2557 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2558 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2559 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2560 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2561 pub struct SetGridReferencePlane {
2562 pub grid_id: Uuid,
2564 pub reference_id: Uuid,
2567 }
2568
2569 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2571 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2572 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2573 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2574 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2575 pub struct SetGridScale {
2576 pub value: f32,
2578 pub units: units::UnitLength,
2580 }
2581
2582 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2585 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2586 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2587 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2588 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2589 pub struct SetGridAutoScale {
2590 }
2591
2592 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2595 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2596 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2597 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2598 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2599 pub struct SetOrderIndependentTransparency {
2600 pub enabled: Option<bool>,
2603 }
2604
2605 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2609 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2610 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2611 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2612 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2613 pub struct CreateRegion {
2614 pub object_id: Uuid,
2616 pub segment: Uuid,
2618 pub intersection_segment: Uuid,
2621 #[serde(default = "super::negative_one")]
2625 #[builder(default = super::negative_one())]
2626 pub intersection_index: i32,
2627 #[serde(default)]
2630 #[builder(default)]
2631 pub curve_clockwise: bool,
2632 #[serde(default, skip_serializing_if = "RegionVersion::is_zero")]
2634 #[builder(default)]
2635 pub version: RegionVersion,
2636 }
2637
2638 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2640 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2641 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2642 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2643 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2644 pub struct RegionGetResolvableIntersectionInfo {
2645 pub region_id: Uuid,
2647 }
2648
2649 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2653 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2654 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2655 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2656 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2657 pub struct CreateRegionFromQueryPoint {
2658 pub object_id: Uuid,
2660
2661 pub query_point: Point2d<LengthUnit>,
2664 #[serde(default, skip_serializing_if = "RegionVersion::is_zero")]
2666 #[builder(default)]
2667 pub version: RegionVersion,
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 RegionGetQueryPoint {
2677 pub region_id: Uuid,
2679 }
2680
2681 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2684 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2685 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2686 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2687 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2688 pub struct SelectRegionFromPoint {
2689 pub selected_at_window: Point2d,
2691 }
2692
2693 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2695 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2696 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2697 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2698 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2699 pub struct BoundingBox {
2700 #[builder(default)]
2703 pub entity_ids: Vec<Uuid>,
2704 #[builder(default = mm())]
2706 #[serde(default = "mm")]
2707 pub output_unit: units::UnitLength,
2708 }
2709
2710 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2712 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2713 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2714 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2715 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2716 pub struct OffsetSurface {
2717 pub surface_id: Uuid,
2719 pub distance: LengthUnit,
2721 pub flip: bool,
2723 }
2724
2725 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2727 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2728 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2729 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2730 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2731 pub struct ClosestEdge {
2732 #[serde(default)]
2735 pub object_id: Option<Uuid>,
2736 pub closest_to: Point3d<f64>,
2739 }
2740 }
2741}
2742
2743pub(crate) fn is_false(b: &bool) -> bool {
2744 !b
2745}
2746
2747pub(crate) fn negative_one() -> i32 {
2748 -1
2749}
2750
2751impl ModelingCmd {
2752 pub fn is_safe_to_batch(&self) -> bool {
2754 use ModelingCmd::*;
2755 matches!(
2756 self,
2757 MovePathPen(_)
2758 | ExtendPath(_)
2759 | Extrude(_)
2760 | Revolve(_)
2761 | Solid3dFilletEdge(_)
2762 | ClosePath(_)
2763 | UpdateAnnotation(_)
2764 | ObjectVisible(_)
2765 | ObjectBringToFront(_)
2766 | Solid2dAddHole(_)
2767 | SendObject(_)
2768 | EntitySetOpacity(_)
2769 | PlaneSetColor(_)
2770 | SetTool(_)
2771 )
2772 }
2773}
2774
2775#[derive(Clone, Serialize, Deserialize, JsonSchema, Eq, PartialEq, bon::Builder)]
2779#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2780#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2781#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2782#[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2783pub struct ImportFile {
2784 pub path: String,
2786 #[serde(
2788 serialize_with = "serde_bytes::serialize",
2789 deserialize_with = "serde_bytes::deserialize"
2790 )]
2791 pub data: Vec<u8>,
2792}
2793
2794impl std::fmt::Debug for ImportFile {
2795 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2796 f.debug_struct("ImportFile")
2797 .field("path", &self.path)
2798 .field("data", &"<redacted>")
2799 .finish()
2800 }
2801}