1use kittycad_modeling_cmds_macros::define_modeling_cmd_enum;
2use schemars::JsonSchema;
3use serde::{Deserialize, Serialize};
4
5pub use self::each_cmd::*;
6use crate::{self as kittycad_modeling_cmds};
7
8define_modeling_cmd_enum! {
9 pub mod each_cmd {
10 use std::collections::HashSet;
11
12 use bon::Builder;
13 use crate::{self as kittycad_modeling_cmds};
14 use kittycad_modeling_cmds_macros::{ModelingCmdVariant};
15 use parse_display_derive::{Display, FromStr};
16 use schemars::JsonSchema;
17 use serde::{Deserialize, Serialize};
18 use uuid::Uuid;
19 use crate::shared::CameraViewState;
20
21 use crate::{
22 format::{OutputFormat2d, OutputFormat3d},
23 id::ModelingCmdId,
24 length_unit::LengthUnit,
25 shared::{
26 Angle,
27 BlendType,
28 BodyType,
29 ComponentTransform,
30 RelativeTo,
31 CutType, CutTypeV2,
32 CutStrategy,
33 CameraMovement,
34 ExtrudedFaceInfo, ExtrudeMethod,
35 AnnotationOptions, AnnotationType, CameraDragInteractionType, Color, DistanceType, EntityType,
36 PathComponentConstraintBound, PathComponentConstraintType, PathSegment, PerspectiveCameraParameters,
37 Point2d, Point3d, ExtrudeReference, SceneSelectionType, SceneToolType, SurfaceEdgeReference, Opposite,
38 },
39 units,
40 };
41
42 fn default_animation_seconds() -> f64 {
44 0.4
45 }
46
47 fn mm() -> crate::units::UnitLength {
48 crate::units::UnitLength::Millimeters
49 }
50
51 #[derive(
53 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
54 )]
55 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
56 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
57 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
58 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
59 pub struct EngineUtilEvaluatePath {
60 pub path_json: String,
62
63 pub t: f64,
65 }
66
67 #[derive(
69 Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant,
70 Builder
71 )]
72 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
73 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
74 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
75 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
76 pub struct StartPath {}
77
78 #[derive(
86 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
87 )]
88 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
89 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
90 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
91 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
92 pub struct MovePathPen {
93 pub path: ModelingCmdId,
95 pub to: Point3d<LengthUnit>,
97 }
98
99 #[derive(
102 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
103 )]
104 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
105 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
106 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
107 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
108 pub struct ExtendPath {
109 pub path: ModelingCmdId,
111 pub segment: PathSegment,
114 #[serde(default, skip_serializing_if = "Option::is_none")]
116 pub label: Option<String>,
117 }
118
119 #[derive(
121 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
122 )]
123 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
124 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
125 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
126 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
127 pub struct Extrude {
128 pub target: ModelingCmdId,
131 pub distance: LengthUnit,
133 #[serde(default)]
136 pub faces: Option<ExtrudedFaceInfo>,
137 #[serde(default)]
140 #[builder(default)]
141 pub opposite: Opposite<LengthUnit>,
142 #[builder(default)]
144 #[serde(default)]
145 pub extrude_method: ExtrudeMethod,
146 #[serde(default, skip_serializing_if = "Option::is_none")]
150 pub merge_coplanar_faces: Option<bool>,
151
152 #[serde(default)]
154 #[builder(default)]
155 pub body_type: BodyType,
156 }
157
158 #[derive(
160 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
161 )]
162 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
163 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
164 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
165 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
166 pub struct ExtrudeToReference {
167 pub target: ModelingCmdId,
170 pub reference: ExtrudeReference,
173 #[serde(default)]
176 pub faces: Option<ExtrudedFaceInfo>,
177 #[serde(default)]
179 #[builder(default)]
180 pub extrude_method: ExtrudeMethod,
181 #[serde(default)]
183 #[builder(default)]
184 pub body_type: BodyType,
185 }
186
187 fn default_twist_extrude_section_interval() -> Angle {
188 Angle::from_degrees(15.0)
189 }
190
191 #[derive(
193 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
194 )]
195 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
196 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
197 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
198 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
199 pub struct TwistExtrude {
200 pub target: ModelingCmdId,
203 pub distance: LengthUnit,
205 #[serde(default)]
208 pub faces: Option<ExtrudedFaceInfo>,
209 #[serde(default)]
212 #[builder(default)]
213 pub center_2d: Point2d<f64>,
214 pub total_rotation_angle: Angle,
216 #[serde(default = "default_twist_extrude_section_interval")]
218 #[builder(default = default_twist_extrude_section_interval())]
219 pub angle_step_size: Angle,
220 pub tolerance: LengthUnit,
222 #[serde(default)]
224 #[builder(default)]
225 pub body_type: BodyType,
226 }
227
228 #[derive(
230 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder
231 )]
232 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
233 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
234 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
235 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
236 pub struct Sweep {
237 pub target: ModelingCmdId,
240 pub trajectory: ModelingCmdId,
242 pub sectional: bool,
244 pub tolerance: LengthUnit,
246 #[serde(default)]
248 #[builder(default)]
249 pub body_type: BodyType,
250 #[serde(default)]
252 #[builder(default)]
253 pub relative_to: RelativeTo,
254 #[serde(default, skip_serializing_if = "Option::is_none")]
257 pub version: Option<u8>,
258 }
259
260 #[derive(
262 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
263 )]
264 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
265 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
266 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
267 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
268 pub struct Revolve {
269 pub target: ModelingCmdId,
272 pub origin: Point3d<LengthUnit>,
274 pub axis: Point3d<f64>,
276 pub axis_is_2d: bool,
278 pub angle: Angle,
280 pub tolerance: LengthUnit,
282 #[serde(default)]
285 #[builder(default)]
286 pub opposite: Opposite<Angle>,
287 #[serde(default)]
289 #[builder(default)]
290 pub body_type: BodyType,
291 }
292
293 #[derive(
295 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
296 )]
297 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
298 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
299 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
300 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
301 pub struct Solid3dShellFace {
302 pub object_id: Uuid,
304 pub face_ids: Vec<Uuid>,
306 pub shell_thickness: LengthUnit,
309 #[serde(default)]
311 #[builder(default)]
312 pub hollow: bool,
313 }
314
315 #[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 Solid3dJoin {
328 pub object_id: Uuid,
330 }
331
332 #[derive(
334 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
335 )]
336 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
337 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
338 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
339 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
340 pub struct Solid3dMultiJoin {
341 pub object_ids: Vec<Uuid>,
343 pub tolerance: LengthUnit,
345 }
346
347
348 #[derive(
350 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
351 )]
352 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
353 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
354 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
355 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
356 pub struct SurfaceBlend {
357 #[schemars(length(min = 2, max = 2))]
359 pub surfaces: Vec<SurfaceEdgeReference>,
360 #[serde(default)]
362 #[builder(default)]
363 pub blend_type: BlendType,
364 }
365
366 #[derive(
368 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
369 )]
370 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
371 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
372 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
373 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
374 pub struct Solid3dGetEdgeUuid {
375 pub object_id: Uuid,
377
378 pub edge_index: u32,
380 }
381
382 #[derive(
384 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
385 )]
386 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
387 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
388 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
389 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
390 pub struct Solid3dGetFaceUuid {
391 pub object_id: Uuid,
393
394 pub face_index: u32,
396 }
397
398 #[derive(
400 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
401 )]
402 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
403 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
404 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
405 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
406 pub struct Solid3dGetBodyType {
407 pub object_id: Uuid,
409 }
410
411 #[derive(
413 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
414 )]
415 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
416 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
417 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
418 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
419 pub struct RevolveAboutEdge {
420 pub target: ModelingCmdId,
423 pub edge_id: Uuid,
425 pub angle: Angle,
427 pub tolerance: LengthUnit,
429 #[serde(default)]
432 #[builder(default)]
433 pub opposite: Opposite<Angle>,
434 #[serde(default)]
436 #[builder(default)]
437 pub body_type: BodyType,
438 }
439
440 #[derive(
442 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
443 )]
444 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
445 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
446 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
447 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
448 pub struct Loft {
449 pub section_ids: Vec<Uuid>,
452 pub v_degree: std::num::NonZeroU32,
455 pub bez_approximate_rational: bool,
459 pub base_curve_index: Option<u32>,
461 pub tolerance: LengthUnit,
463 #[serde(default)]
465 #[builder(default)]
466 pub body_type: BodyType,
467 }
468
469
470 #[derive(
472 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
473 )]
474 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
475 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
476 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
477 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
478 pub struct ClosePath {
479 pub path_id: Uuid,
481 }
482
483 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
485 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
486 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
487 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
488 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
489 pub struct CameraDragStart {
490 pub interaction: CameraDragInteractionType,
492 pub window: Point2d,
494 }
495
496 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
498 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
499 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
500 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
501 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
502 pub struct CameraDragMove {
503 pub interaction: CameraDragInteractionType,
505 pub window: Point2d,
507 pub sequence: Option<u32>,
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 CameraDragEnd {
521 pub interaction: CameraDragInteractionType,
523 pub window: Point2d,
525 }
526
527 #[derive(Debug, Clone, Default, 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 DefaultCameraGetSettings {}
534
535 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
537 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
538 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
539 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
540 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
541 pub struct DefaultCameraGetView {}
542
543 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
545 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
546 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
547 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
548 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
549 pub struct DefaultCameraSetView {
550 pub view: CameraViewState,
552 }
553
554 #[derive(Debug, Clone, 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 DefaultCameraLookAt {
561 pub vantage: Point3d,
563 pub center: Point3d,
565 pub up: Point3d,
567 pub sequence: Option<u32>,
572 }
573
574 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
576 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
577 #[cfg_attr(feature = "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 DefaultCameraPerspectiveSettings {
581 pub vantage: Point3d,
583 pub center: Point3d,
585 pub up: Point3d,
587 pub fov_y: Option<f32>,
589 pub z_near: Option<f32>,
591 pub z_far: Option<f32>,
593 pub sequence: Option<u32>,
598 }
599
600 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
602 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
603 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
604 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
605 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
606 pub struct DefaultCameraZoom {
607 pub magnitude: f32,
611 }
612
613 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
615 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
616 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
617 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
618 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
619 pub struct Export2d {
620 pub entity_ids: Vec<Uuid>,
622 pub format: OutputFormat2d,
624 }
625
626 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
628 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
629 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
630 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
631 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
632 pub struct Export3d {
633 #[builder(default)]
635 pub entity_ids: Vec<Uuid>,
636 pub format: OutputFormat3d,
638 }
639
640 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
642 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
643 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
644 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
645 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
646 pub struct Export {
647 #[builder(default)]
649 pub entity_ids: Vec<Uuid>,
650 pub format: OutputFormat3d,
652 }
653
654 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
656 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
657 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
658 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
659 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
660 pub struct EntityGetParentId {
661 pub entity_id: Uuid,
663 }
664
665 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
667 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
668 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
669 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
670 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
671 pub struct EntityGetNumChildren {
672 pub entity_id: Uuid,
674 }
675
676 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
678 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
679 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
680 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
681 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
682 pub struct EntityGetChildUuid {
683 pub entity_id: Uuid,
685 pub child_index: u32,
687 }
688
689 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
691 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
692 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
693 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
694 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
695 pub struct EntityGetIndex {
696 pub entity_id: Uuid,
698 }
699
700 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
702 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
703 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
704 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
705 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
706 pub struct EntityGetPrimitiveIndex {
707 pub entity_id: Uuid,
709 }
710
711 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
714 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
715 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
716 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
717 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
718 pub struct EntityDeleteChildren {
719 pub entity_id: Uuid,
721 pub child_entity_ids: HashSet<Uuid>,
723 }
724
725 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
727 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
728 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
729 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
730 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
731 pub struct EntityGetAllChildUuids {
732 pub entity_id: Uuid,
734 }
735
736 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
738 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
739 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
740 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
741 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
742 pub struct EntityGetSketchPaths {
743 pub entity_id: Uuid,
745 }
746
747 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
749 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
750 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
751 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
752 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
753 pub struct EntityGetDistance {
754 pub entity_id1: Uuid,
756 pub entity_id2: Uuid,
758 pub distance_type: DistanceType,
760 }
761
762 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
765 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
766 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
767 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
768 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
769 pub struct EntityClone {
770 pub entity_id: Uuid,
772 }
773
774 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
777 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
778 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
779 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
780 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
781 pub struct EntityLinearPatternTransform {
782 pub entity_id: Uuid,
784 #[serde(default)]
788 #[builder(default)]
789 pub transform: Vec<crate::shared::Transform>,
790 #[serde(default)]
794 #[builder(default)]
795 pub transforms: Vec<Vec<crate::shared::Transform>>,
796 }
797
798 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
800 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
801 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
802 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
803 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
804 pub struct EntityLinearPattern {
805 pub entity_id: Uuid,
807 pub axis: Point3d<f64>,
810 pub num_repetitions: u32,
812 pub spacing: LengthUnit,
814 }
815 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
817 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
818 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
819 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
820 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
821 pub struct EntityCircularPattern {
822 pub entity_id: Uuid,
824 pub axis: Point3d<f64>,
827 pub center: Point3d<LengthUnit>,
830 pub num_repetitions: u32,
832 pub arc_degrees: f64,
834 pub rotate_duplicates: bool,
836 }
837
838 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
840 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
841 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
842 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
843 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
844 pub struct EntityMakeHelix {
845 pub cylinder_id: Uuid,
847 pub revolutions: f64,
849 #[serde(default)]
851 #[builder(default)]
852 pub start_angle: Angle,
853 pub is_clockwise: bool,
855 pub length: Option<LengthUnit>,
857 }
858
859 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
861 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
862 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
863 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
864 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
865 pub struct EntityMakeHelixFromParams {
866 pub radius: LengthUnit,
868 pub length: LengthUnit,
870 pub revolutions: f64,
872 #[serde(default)]
874 #[builder(default)]
875 pub start_angle: Angle,
876 pub is_clockwise: bool,
878 pub center: Point3d<LengthUnit>,
880 pub axis: Point3d<f64>,
882 }
883
884 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
886 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
887 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
888 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
889 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
890 pub struct EntityMakeHelixFromEdge {
891 pub radius: LengthUnit,
893 pub length: Option<LengthUnit>,
895 pub revolutions: f64,
897 #[serde(default)]
899 #[builder(default)]
900 pub start_angle: Angle,
901 pub is_clockwise: bool,
903 pub edge_id: Uuid,
905 }
906
907 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
909 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
910 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
911 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
912 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
913 pub struct EntityMirror {
914 pub ids: Vec<Uuid>,
916 pub axis: Point3d<f64>,
918 pub point: Point3d<LengthUnit>,
920 }
921
922 #[derive(
924 Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder
925 )]
926 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
927 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
928 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
929 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
930 pub struct EntityMirrorAcrossEdge {
931 pub ids: Vec<Uuid>,
933 pub edge_id: Uuid,
935 }
936
937 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
940 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
941 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
942 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
943 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
944 pub struct SelectWithPoint {
945 pub selected_at_window: Point2d,
947 pub selection_type: SceneSelectionType,
949 }
950
951 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
953 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
954 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
955 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
956 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
957 pub struct SelectAdd {
958 pub entities: Vec<Uuid>,
960 }
961
962 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
964 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
965 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
966 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
967 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
968 pub struct SelectRemove {
969 pub entities: Vec<Uuid>,
971 }
972
973 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
975 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
976 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
977 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
978 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
979 pub struct SceneClearAll {}
980
981 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
983 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
984 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
985 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
986 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
987 pub struct SelectReplace {
988 pub entities: Vec<Uuid>,
990 }
991
992 #[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
995 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
996 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
997 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
998 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
999 pub struct HighlightSetEntity {
1000 pub selected_at_window: Point2d,
1002 pub sequence: Option<u32>,
1007 }
1008
1009 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1011 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1012 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1013 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1014 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1015 pub struct HighlightSetEntities {
1016 pub entities: Vec<Uuid>,
1018 }
1019
1020 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1022 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1023 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1024 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1025 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1026 pub struct NewAnnotation {
1027 pub options: AnnotationOptions,
1029 pub clobber: bool,
1031 pub annotation_type: AnnotationType,
1033 }
1034
1035 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1037 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1038 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1039 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1040 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1041 pub struct UpdateAnnotation {
1042 pub annotation_id: Uuid,
1044 pub options: AnnotationOptions,
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 EdgeLinesVisible {
1056 pub hidden: bool,
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 ObjectVisible {
1067 pub object_id: Uuid,
1069 pub hidden: bool,
1071 }
1072
1073 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1075 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1076 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1077 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1078 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1079 pub struct ObjectBringToFront {
1080 pub object_id: Uuid,
1082 }
1083
1084 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1086 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1087 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1088 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1089 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1090 pub struct ObjectSetMaterialParamsPbr {
1091 pub object_id: Uuid,
1093 pub color: Color,
1095 pub metalness: f32,
1097 pub roughness: f32,
1099 pub ambient_occlusion: f32,
1101 #[serde(default, skip_serializing_if = "Option::is_none")]
1103 pub backface_color: Option<Color>,
1104 }
1105 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1107 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1108 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1109 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1110 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1111 pub struct GetEntityType {
1112 pub entity_id: Uuid,
1114 }
1115
1116 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1118 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1119 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1120 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1121 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1122 pub struct Solid3dGetAllEdgeFaces {
1123 pub object_id: Uuid,
1125 pub edge_id: Uuid,
1127 }
1128
1129 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1131 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1132 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1133 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1134 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1135 pub struct Solid3dFlip {
1136 pub object_id: Uuid,
1138 }
1139
1140 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1143 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1144 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1145 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1146 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1147 pub struct Solid3dFlipFace {
1148 pub object_id: Uuid,
1150 pub face_id: Uuid,
1152 }
1153
1154 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1156 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1157 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1158 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1159 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1160 pub struct Solid2dAddHole {
1161 pub object_id: Uuid,
1163 pub hole_id: Uuid,
1165 }
1166
1167 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1169 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1170 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1171 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1172 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1173 pub struct Solid3dGetAllOppositeEdges {
1174 pub object_id: Uuid,
1176 pub edge_id: Uuid,
1178 pub along_vector: Option<Point3d<f64>>,
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 Solid3dGetOppositeEdge {
1189 pub object_id: Uuid,
1191 pub edge_id: Uuid,
1193 pub face_id: Uuid,
1195 }
1196
1197 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1199 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1200 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1201 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1202 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1203 pub struct Solid3dGetNextAdjacentEdge {
1204 pub object_id: Uuid,
1206 pub edge_id: Uuid,
1208 pub face_id: Uuid,
1210 }
1211
1212 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1214 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1215 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1216 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1217 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1218 pub struct Solid3dGetPrevAdjacentEdge {
1219 pub object_id: Uuid,
1221 pub edge_id: Uuid,
1223 pub face_id: Uuid,
1225 }
1226
1227 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1229 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1230 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1231 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1232 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1233 pub struct Solid3dGetCommonEdge {
1234 pub object_id: Uuid,
1236 pub face_ids: [Uuid; 2]
1238 }
1239
1240 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1242 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1243 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1244 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1245 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1246 pub struct Solid3dFilletEdge {
1247 pub object_id: Uuid,
1249 #[serde(default)]
1251 pub edge_id: Option<Uuid>,
1252 #[serde(default)]
1254 #[builder(default)]
1255 pub edge_ids: Vec<Uuid>,
1256 pub radius: LengthUnit,
1258 pub tolerance: LengthUnit,
1260 #[serde(default)]
1262 #[builder(default)]
1263 pub cut_type: CutType,
1264 #[serde(default)]
1266 #[builder(default)]
1267 pub strategy: CutStrategy,
1268 #[serde(default)]
1276 #[builder(default)]
1277 pub extra_face_ids: Vec<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 Solid3dCutEdges {
1287 pub object_id: Uuid,
1289 #[serde(default)]
1291 #[builder(default)]
1292 pub edge_ids: Vec<Uuid>,
1293 pub cut_type: CutTypeV2,
1295 pub tolerance: LengthUnit,
1298 #[serde(default)]
1300 #[builder(default)]
1301 pub strategy: CutStrategy,
1302 #[serde(default)]
1310 #[builder(default)]
1311 pub extra_face_ids: Vec<Uuid>,
1312 }
1313
1314 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1316 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1317 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1318 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1319 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1320 pub struct FaceIsPlanar {
1321 pub object_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 FaceGetPosition {
1332 pub object_id: Uuid,
1334
1335 pub uv: Point2d<f64>,
1337 }
1338
1339 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1341 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1342 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1343 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1344 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1345 pub struct FaceGetCenter {
1346 pub object_id: Uuid,
1348 }
1349
1350 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1352 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1353 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1354 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1355 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1356 pub struct FaceGetGradient {
1357 pub object_id: Uuid,
1359
1360 pub uv: Point2d<f64>,
1362 }
1363
1364 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1366 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1367 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1368 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1369 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1370 pub struct SendObject {
1371 pub object_id: Uuid,
1373 pub front: bool,
1375 }
1376 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1378 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1379 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1380 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1381 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1382 pub struct EntitySetOpacity {
1383 pub entity_id: Uuid,
1385 pub opacity: f32,
1389 }
1390
1391 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1393 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1394 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1395 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1396 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1397 pub struct EntityFade {
1398 pub entity_id: Uuid,
1400 pub fade_in: bool,
1402 #[serde(default = "default_animation_seconds")]
1404 #[builder(default = default_animation_seconds())]
1405 pub duration_seconds: f64,
1406 }
1407
1408 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1410 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1411 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1412 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1413 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1414 pub struct MakePlane {
1415 pub origin: Point3d<LengthUnit>,
1417 pub x_axis: Point3d<f64>,
1419 pub y_axis: Point3d<f64>,
1421 pub size: LengthUnit,
1425 pub clobber: bool,
1427 pub hide: Option<bool>,
1429 }
1430
1431 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1433 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1434 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1435 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1436 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1437 pub struct PlaneSetColor {
1438 pub plane_id: Uuid,
1440 pub color: Color,
1442 }
1443
1444 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1446 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1447 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1448 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1449 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1450 pub struct SetTool {
1451 pub tool: SceneToolType,
1453 }
1454
1455 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1457 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1458 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1459 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1460 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1461 pub struct MouseMove {
1462 pub window: Point2d,
1464 pub sequence: Option<u32>,
1469 }
1470
1471 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1474 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1475 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1476 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1477 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1478 pub struct MouseClick {
1479 pub window: Point2d,
1481 }
1482
1483 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1487 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1488 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1489 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1490 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1491 pub struct SketchModeDisable {}
1492
1493 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1495 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1496 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1497 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1498 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1499 pub struct GetSketchModePlane {}
1500
1501 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1503 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1504 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1505 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1506 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1507 pub struct CurveSetConstraint {
1508 pub object_id: Uuid,
1510 pub constraint_bound: PathComponentConstraintBound,
1512 pub constraint_type: PathComponentConstraintType,
1514 }
1515
1516 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1518 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1519 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1520 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1521 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1522 pub struct EnableSketchMode {
1523 pub entity_id: Uuid,
1525 pub ortho: bool,
1528 pub animated: bool,
1530 pub adjust_camera: bool,
1532 pub planar_normal: Option<Point3d<f64>>,
1535 }
1536
1537 #[derive(Debug, Clone, Default, 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 EnableDryRun {}
1546
1547 #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1551 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1552 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1553 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1554 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1555 pub struct DisableDryRun {}
1556
1557 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1559 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1560 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1561 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1562 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1563 pub struct SetBackgroundColor {
1564 pub color: Color,
1566 }
1567
1568 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1570 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1571 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1572 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1573 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1574 pub struct SetCurrentToolProperties {
1575 pub color: Option<Color>,
1577 }
1578
1579 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1581 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1582 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1583 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1584 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1585 pub struct SetDefaultSystemProperties {
1586 #[serde(default)]
1588 pub color: Option<Color>,
1589 #[serde(default)]
1591 pub backface_color: Option<Color>,
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 CurveGetType {
1601 pub curve_id: Uuid,
1603 }
1604
1605 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1607 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1608 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1609 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1610 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1611 pub struct CurveGetControlPoints {
1612 pub curve_id: Uuid,
1614 }
1615
1616 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1618 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1619 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1620 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1621 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1622 pub struct ProjectEntityToPlane {
1623 pub entity_id: Uuid,
1625 pub plane_id: Uuid,
1627 pub use_plane_coords: bool,
1630 }
1631
1632 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1634 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1635 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1636 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1637 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1638 pub struct ProjectPointsToPlane {
1639 pub plane_id: Uuid,
1641 pub points: Vec<Point3d<f64>>,
1643 pub use_plane_coords: bool,
1646 }
1647
1648 #[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, JsonSchema, FromStr, Display)]
1650 #[serde(rename_all = "snake_case")]
1651 #[display(style = "snake_case")]
1652 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1653 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1654 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1655 #[cfg_attr(feature = "python", pyo3::pyclass, pyo3_stub_gen::derive::gen_stub_pyclass_enum)]
1656 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1657 pub enum ImageFormat {
1658 Png,
1660 Jpeg,
1662 }
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 TakeSnapshot {
1671 pub format: ImageFormat,
1673 }
1674
1675 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1677 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1678 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1679 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1680 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1681 pub struct MakeAxesGizmo {
1682 pub gizmo_mode: bool,
1685 pub clobber: bool,
1687 }
1688
1689 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1691 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1692 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1693 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1694 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1695 pub struct PathGetInfo {
1696 pub path_id: Uuid,
1698 }
1699
1700 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1702 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1703 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1704 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1705 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1706 pub struct PathGetCurveUuidsForVertices {
1707 pub path_id: Uuid,
1709
1710 pub vertex_ids: Vec<Uuid>,
1712 }
1713
1714 #[derive(Debug, Clone, 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 PathGetCurveUuid {
1721 pub path_id: Uuid,
1723
1724 pub index: u32,
1726 }
1727
1728 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1730 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1731 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1732 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1733 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1734 pub struct PathGetVertexUuids {
1735 pub path_id: Uuid,
1737 }
1738
1739 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1741 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1742 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1743 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1744 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1745 pub struct PathGetSketchTargetUuid {
1746 pub path_id: Uuid,
1748 }
1749
1750 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1752 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1753 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1754 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1755 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1756 pub struct HandleMouseDragStart {
1757 pub window: Point2d,
1759 }
1760
1761 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1763 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1764 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1765 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1766 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1767 pub struct HandleMouseDragMove {
1768 pub window: Point2d,
1770 pub sequence: Option<u32>,
1775 }
1776
1777 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1779 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1780 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1781 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1782 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1783 pub struct HandleMouseDragEnd {
1784 pub window: Point2d,
1786 }
1787
1788 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1790 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1791 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1792 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1793 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1794 pub struct RemoveSceneObjects {
1795 pub object_ids: HashSet<Uuid>,
1797 }
1798
1799 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1802 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1803 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1804 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1805 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1806 pub struct PlaneIntersectAndProject {
1807 pub plane_id: Uuid,
1809 pub window: Point2d,
1811 }
1812
1813 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1815 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1816 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1817 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1818 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1819 pub struct CurveGetEndPoints {
1820 pub curve_id: Uuid,
1822 }
1823
1824 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1826 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1827 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1828 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1829 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1830 pub struct ReconfigureStream {
1831 pub width: u32,
1833 pub height: u32,
1835 pub fps: u32,
1837 #[serde(default)]
1839 pub bitrate: Option<u32>,
1840 }
1841
1842 #[derive(Debug, Eq, PartialEq, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1844 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1845 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1846 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1847 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1848 pub struct ImportFiles {
1849 pub files: Vec<super::ImportFile>,
1851 pub format: crate::format::InputFormat3d,
1853 }
1854
1855 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1860 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1861 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1862 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1863 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1864 pub struct SetSceneUnits {
1865 pub unit: units::UnitLength,
1867 }
1868
1869 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1871 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1872 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1873 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1874 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1875 pub struct Mass {
1876 #[builder(default)]
1879 pub entity_ids: Vec<Uuid>,
1880 pub material_density: f64,
1882 pub material_density_unit: units::UnitDensity,
1884 pub output_unit: units::UnitMass,
1886 }
1887
1888 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1890 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1891 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1892 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1893 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1894 pub struct Density {
1895 #[builder(default)]
1898 pub entity_ids: Vec<Uuid>,
1899 pub material_mass: f64,
1901 pub material_mass_unit: units::UnitMass,
1903 pub output_unit: units::UnitDensity,
1905 }
1906
1907 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1909 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1910 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1911 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1912 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1913 pub struct Volume {
1914 #[builder(default)]
1917 pub entity_ids: Vec<Uuid>,
1918 pub output_unit: units::UnitVolume,
1920 }
1921
1922 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1924 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1925 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1926 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1927 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1928 pub struct CenterOfMass {
1929 #[builder(default)]
1932 pub entity_ids: Vec<Uuid>,
1933 pub output_unit: units::UnitLength,
1935 }
1936
1937 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
1939 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1940 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1941 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1942 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1943 pub struct SurfaceArea {
1944 #[builder(default)]
1947 pub entity_ids: Vec<Uuid>,
1948 pub output_unit: units::UnitArea,
1950 }
1951
1952 #[derive(
1954 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
1955 Builder
1956 )]
1957 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1958 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1959 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1960 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1961 pub struct DefaultCameraFocusOn {
1962 pub uuid: Uuid,
1964 }
1965 #[derive(
1967 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
1968 Builder
1969 )]
1970 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1971 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1972 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1973 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1974 pub struct SetSelectionType {
1975 pub selection_type: SceneSelectionType,
1977 }
1978
1979 #[derive(
1981 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
1982 Builder
1983 )]
1984 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1985 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1986 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1987 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
1988 pub struct SetSelectionFilter {
1989 pub filter: Vec<EntityType>,
1992 }
1993
1994 #[derive(
1996 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
1997 Builder
1998 )]
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 SceneGetEntityIds {
2004 pub filter: Vec<EntityType>,
2006 pub skip: u32,
2009 #[schemars(range(min = 1, max = 1000))]
2014 pub take: u32,
2015 }
2016
2017 #[derive(
2019 Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
2020 Builder
2021 )]
2022 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2023 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2024 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2025 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2026 pub struct DefaultCameraSetOrthographic {}
2027
2028 #[derive(
2030 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,
2031 Builder
2032 )]
2033 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2034 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2035 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2036 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2037 pub struct DefaultCameraSetPerspective {
2038 pub parameters: Option<PerspectiveCameraParameters>,
2040 }
2041
2042 #[derive(
2045 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder
2046 )]
2047 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2048 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2049 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2050 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2051 pub struct DefaultCameraCenterToSelection {
2052 #[serde(default)]
2055 #[builder(default)]
2056 pub camera_movement: CameraMovement,
2057 }
2058
2059 #[derive(
2061 Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder
2062 )]
2063 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2064 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2065 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2066 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2067 pub struct DefaultCameraCenterToScene {
2068 #[serde(default)]
2071 #[builder(default)]
2072 pub camera_movement: CameraMovement,
2073 }
2074
2075 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2077 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2078 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2079 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2080 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2081 pub struct ZoomToFit {
2082 #[serde(default)]
2084 #[builder(default)]
2085 pub object_ids: Vec<Uuid>,
2086 #[serde(default)]
2091 #[builder(default)]
2092 pub padding: f32,
2093 #[serde(default)]
2095 #[builder(default)]
2096 pub animated: bool,
2097 }
2098
2099 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2101 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2102 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2103 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2104 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2105 pub struct OrientToFace {
2106 pub face_id: Uuid,
2108 #[serde(default)]
2113 #[builder(default)]
2114 pub padding: f32,
2115 #[serde(default)]
2117 #[builder(default)]
2118 pub animated: bool,
2119 }
2120
2121 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2123 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2124 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2125 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2126 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2127 pub struct ViewIsometric {
2128 #[serde(default)]
2133 #[builder(default)]
2134 pub padding: f32,
2135 }
2136
2137 #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
2139 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2140 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2141 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2142 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2143 pub struct Solid3dGetExtrusionFaceInfo {
2144 pub object_id: Uuid,
2146 pub edge_id: Uuid,
2148 }
2149
2150 #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
2152 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2153 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2154 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2155 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2156 pub struct Solid3dGetAdjacencyInfo {
2157 pub object_id: Uuid,
2159 pub edge_id: Uuid,
2161 }
2162
2163
2164 #[derive(Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
2166 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2167 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2168 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2169 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2170 pub struct SelectClear {}
2171
2172 #[derive(Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
2174 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2175 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2176 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2177 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2178 pub struct SelectGet {}
2179
2180 #[derive(
2182 Clone, Debug, Default, 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 GetNumObjects {}
2190
2191 #[derive(
2193 Clone, Debug, Deserialize, PartialEq, 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 SetObjectTransform
2201 {
2202 pub object_id: Uuid,
2204 pub transforms: Vec<ComponentTransform>,
2206 }
2207
2208 #[derive(
2211 Clone, Debug, Deserialize, PartialEq, JsonSchema, Serialize, ModelingCmdVariant,
2212 Builder
2213 )]
2214 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2215 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2216 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2217 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2218 pub struct BooleanUnion
2219 {
2220 pub solid_ids: Vec<Uuid>,
2223 #[serde(default)]
2225 #[builder(default)]
2226 pub separate_bodies: bool,
2227 pub tolerance: LengthUnit,
2229 }
2230
2231 #[derive(
2234 Clone, Debug, Deserialize, PartialEq, JsonSchema, Serialize, ModelingCmdVariant,
2235 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 BooleanIntersection
2242 {
2243 pub solid_ids: Vec<Uuid>,
2245 #[serde(default)]
2247 #[builder(default)]
2248 pub separate_bodies: bool,
2249 pub tolerance: LengthUnit,
2251 }
2252
2253 #[derive(
2257 Clone, Debug, Deserialize, PartialEq, JsonSchema, Serialize, ModelingCmdVariant,
2258 Builder
2259 )]
2260 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2261 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2262 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2263 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2264 pub struct BooleanSubtract
2265 {
2266 pub target_ids: Vec<Uuid>,
2268 pub tool_ids: Vec<Uuid>,
2270 #[serde(default)]
2272 #[builder(default)]
2273 pub separate_bodies: bool,
2274 pub tolerance: LengthUnit,
2276 }
2277
2278 #[derive(
2280 Clone, Debug, Deserialize, PartialEq, JsonSchema, Serialize, ModelingCmdVariant,
2281 Builder
2282 )]
2283 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2284 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2285 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2286 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2287 pub struct BooleanImprint
2288 {
2289 #[serde(alias = "target_ids")]
2291 pub body_ids: Vec<Uuid>,
2292 #[serde(default)]
2295 pub tool_ids: Option<Vec<Uuid>>,
2296 #[serde(default)]
2298 #[builder(default)]
2299 pub separate_bodies: bool,
2300 #[serde(default)]
2302 #[builder(default)]
2303 pub keep_tools: bool,
2304 pub tolerance: LengthUnit,
2306 }
2307
2308 #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
2311 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2312 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2313 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2314 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2315 pub struct MakeOffsetPath {
2316 pub object_id: Uuid,
2318 #[serde(default)]
2323 pub face_id: Option<Uuid>,
2324 pub offset: LengthUnit,
2326 }
2327
2328 #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
2330 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2331 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2332 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2333 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2334 pub struct AddHoleFromOffset {
2335 pub object_id: Uuid,
2337 pub offset: LengthUnit,
2339 }
2340
2341 #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)]
2343 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2344 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2345 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2346 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2347 pub struct SetGridReferencePlane {
2348 pub grid_id: Uuid,
2350 pub reference_id: Uuid,
2353 }
2354
2355 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2357 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2358 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2359 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2360 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2361 pub struct SetGridScale {
2362 pub value: f32,
2364 pub units: units::UnitLength,
2366 }
2367
2368 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
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 SetGridAutoScale {
2376 }
2377
2378 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2381 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2382 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2383 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2384 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2385 pub struct SetOrderIndependentTransparency {
2386 pub enabled: Option<bool>,
2389 }
2390
2391 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2395 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2396 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2397 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2398 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2399 pub struct CreateRegion {
2400 pub object_id: Uuid,
2402 pub segment: Uuid,
2404 pub intersection_segment: Uuid,
2407 #[serde(default = "super::negative_one")]
2411 #[builder(default = super::negative_one())]
2412 pub intersection_index: i32,
2413 #[serde(default)]
2416 #[builder(default)]
2417 pub curve_clockwise: bool,
2418 }
2419
2420 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2424 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2425 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2426 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2427 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2428 pub struct CreateRegionFromQueryPoint {
2429 pub object_id: Uuid,
2431
2432 pub query_point: Point2d<LengthUnit>,
2435 }
2436
2437 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
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 RegionGetQueryPoint {
2444 pub region_id: Uuid,
2446 }
2447
2448 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2451 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2452 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2453 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2454 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2455 pub struct SelectRegionFromPoint {
2456 pub selected_at_window: Point2d,
2458 }
2459
2460 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2462 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2463 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2464 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2465 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2466 pub struct BoundingBox {
2467 #[builder(default)]
2470 pub entity_ids: Vec<Uuid>,
2471 #[builder(default = mm())]
2473 #[serde(default = "mm")]
2474 pub output_unit: units::UnitLength,
2475 }
2476
2477 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2479 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2480 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2481 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2482 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2483 pub struct OffsetSurface {
2484 pub surface_id: Uuid,
2486 pub distance: LengthUnit,
2488 pub flip: bool,
2490 }
2491
2492 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
2494 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
2495 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2496 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
2497 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
2498 pub struct ClosestEdge {
2499 #[serde(default)]
2502 pub object_id: Option<Uuid>,
2503 pub closest_to: Point3d<f64>,
2506 }
2507 }
2508
2509
2510}
2511
2512pub(crate) fn negative_one() -> i32 {
2513 -1
2514}
2515
2516impl ModelingCmd {
2517 pub fn is_safe_to_batch(&self) -> bool {
2519 use ModelingCmd::*;
2520 matches!(
2521 self,
2522 MovePathPen(_)
2523 | ExtendPath(_)
2524 | Extrude(_)
2525 | Revolve(_)
2526 | Solid3dFilletEdge(_)
2527 | ClosePath(_)
2528 | UpdateAnnotation(_)
2529 | ObjectVisible(_)
2530 | ObjectBringToFront(_)
2531 | Solid2dAddHole(_)
2532 | SendObject(_)
2533 | EntitySetOpacity(_)
2534 | PlaneSetColor(_)
2535 | SetTool(_)
2536 )
2537 }
2538}
2539
2540#[derive(Clone, Serialize, Deserialize, JsonSchema, Eq, PartialEq, bon::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)]
2548pub struct ImportFile {
2549 pub path: String,
2551 #[serde(
2553 serialize_with = "serde_bytes::serialize",
2554 deserialize_with = "serde_bytes::deserialize"
2555 )]
2556 pub data: Vec<u8>,
2557}
2558
2559impl std::fmt::Debug for ImportFile {
2560 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2561 f.debug_struct("ImportFile")
2562 .field("path", &self.path)
2563 .field("data", &"<redacted>")
2564 .finish()
2565 }
2566}