kittycad_modeling_cmds/
ok_response.rs

1use kittycad_modeling_cmds_macros::define_ok_modeling_cmd_response_enum;
2use serde::{Deserialize, Serialize};
3
4impl crate::ModelingCmdOutput for () {}
5
6define_ok_modeling_cmd_response_enum! {
7    /// Output from Modeling API commands.
8    pub mod output {
9        use kittycad_modeling_cmds_macros::ModelingCmdOutput;
10        use schemars::JsonSchema;
11        use serde::{Deserialize, Serialize};
12        use uuid::Uuid;
13        use crate::shared::CameraSettings;
14        use crate::shared::CameraViewState;
15
16        use crate::{self as kittycad_modeling_cmds};
17        use crate::{
18            base64::Base64Data,
19            id::ModelingCmdId,
20            length_unit::LengthUnit,
21            shared::{CurveType, EntityType, ExportFile, ExtrusionFaceCapType, PathCommand, Point2d, Point3d},
22            units,
23        };
24
25        /// The response of the `EngineUtilEvaluatePath` endpoint
26        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
27        pub struct EngineUtilEvaluatePath {
28            /// The evaluated path curve position
29            pub pos: Point3d<LengthUnit>,
30        }
31
32        /// The response from the `StartPath` endpoint.
33        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
34        pub struct StartPath {
35        }
36
37        /// The response from the `MovePathPen` endpoint.
38        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
39        pub struct MovePathPen {
40        }
41
42        /// The response from the `ExtendPath` endpoint.
43        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
44        pub struct ExtendPath {
45        }
46
47        /// The response from the `Extrude` endpoint.
48        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
49        pub struct Extrude {
50        }
51
52        /// The response from the `ExtrudeToReference` endpoint.
53        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
54        pub struct ExtrudeToReference {
55        }
56
57        /// The response from the `TwistExtrude` endpoint.
58        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
59        pub struct TwistExtrude {
60        }
61
62        /// The response from the `Sweep` endpoint.
63        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
64        pub struct Sweep {
65        }
66
67        /// The response from the `Revolve` endpoint.
68        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
69        pub struct Revolve {
70        }
71
72        /// The response from the `Solid3dShellFace` endpoint.
73        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
74        pub struct Solid3dShellFace {
75        }
76
77        /// The response from the `RevolveAboutEdge` endpoint.
78        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
79        pub struct RevolveAboutEdge {
80        }
81
82        /// The response from the `CameraDragStart` endpoint.
83        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
84        pub struct CameraDragStart {
85        }
86
87        /// The response from the `DefaultCameraLookAt` endpoint.
88        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
89        pub struct DefaultCameraLookAt {
90        }
91
92        /// The response from the `DefaultCameraPerspectiveSettings` endpoint.
93        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
94        pub struct DefaultCameraPerspectiveSettings {
95        }
96
97        /// The response from the `SelectAdd` endpoint.
98        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
99        pub struct SelectAdd {
100        }
101        /// The response from the `SelectRemove` endpoint.
102        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
103        pub struct SelectRemove {
104        }
105
106        /// The response from the `SceneClearAll` endpoint.
107        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
108        pub struct SceneClearAll {
109        }
110
111        /// The response from the `SelectReplace` endpoint.
112        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
113        pub struct SelectReplace {
114        }
115
116        /// The response from the `HighlightSetEntities` endpoint.
117        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
118        pub struct HighlightSetEntities {
119        }
120
121        /// The response from the `NewAnnotation` endpoint.
122        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
123        pub struct NewAnnotation {
124        }
125
126        /// The response from the `UpdateAnnotation` endpoint.
127        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
128        pub struct UpdateAnnotation {
129        }
130
131        /// The response from the `EdgeLinesVisible` endpoint.
132        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
133        pub struct EdgeLinesVisible {
134        }
135
136        /// The response from the `ObjectVisible` endpoint.
137        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
138        pub struct ObjectVisible {
139        }
140
141        /// The response from the `ObjectBringToFront` endpoint.
142        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
143        pub struct ObjectBringToFront {
144        }
145
146        /// The response from the `ObjectSetMaterialParamsPbr` endpoint.
147        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
148        pub struct ObjectSetMaterialParamsPbr {
149        }
150
151        /// The response from the `Solid2dAddHole` endpoint.
152        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
153        pub struct Solid2dAddHole {
154        }
155
156        /// The response from the `Solid3dFilletEdge` endpoint.
157        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
158        pub struct Solid3dFilletEdge {
159        }
160
161        /// The response from the `SendObject` endpoint.
162        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
163        pub struct SendObject {
164        }
165
166        /// The response from the `EntitySetOpacity` endpoint.
167        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
168        pub struct EntitySetOpacity {
169        }
170
171        /// The response from the `EntityFade` endpoint.
172        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
173        pub struct EntityFade {
174        }
175
176        /// The response from the `MakePlane` endpoint.
177        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
178        pub struct MakePlane {
179        }
180
181        /// The response from the `PlaneSetColor` endpoint.
182        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
183        pub struct PlaneSetColor {
184        }
185
186        /// The response from the `SetTool` endpoint.
187        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
188        pub struct SetTool {
189        }
190
191        /// The response from the `MouseMove` endpoint.
192        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
193        pub struct MouseMove {
194        }
195
196        /// The response from the `SketchModeDisable` endpoint.
197        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
198        pub struct SketchModeDisable {
199        }
200
201        /// The response from the `EnableDryRun` endpoint.
202        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
203        pub struct EnableDryRun {
204        }
205
206        /// The response from the `DisableDryRun` endpoint.
207        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
208        pub struct DisableDryRun {
209        }
210
211        /// The response from the `CurveSetConstraint` endpoint.
212        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
213        pub struct CurveSetConstraint {
214        }
215
216        /// The response from the `EnableSketchMode` endpoint.
217        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
218        pub struct EnableSketchMode {
219        }
220
221        /// The response from the `SetBackgroundColor` endpoint.
222        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
223        pub struct SetBackgroundColor {
224        }
225
226        /// The response from the `SetCurrentToolProperties` endpoint.
227        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
228        pub struct SetCurrentToolProperties {
229        }
230
231        /// The response from the `SetDefaultSystemProperties` endpoint.
232        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
233        pub struct SetDefaultSystemProperties {
234        }
235
236        /// The response from the `MakeAxesGizmo` endpoint.
237        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
238        pub struct MakeAxesGizmo {
239        }
240
241        /// The response from the `HandleMouseDragStart` endpoint.
242        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
243        pub struct HandleMouseDragStart {
244        }
245
246        /// The response from the `HandleMouseDragMove` endpoint.
247        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
248        pub struct HandleMouseDragMove {
249        }
250
251        /// The response from the `HandleMouseDragEnd` endpoint.
252        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
253        pub struct HandleMouseDragEnd {
254        }
255
256        /// The response from the `RemoveSceneObjects` endpoint.
257        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
258        pub struct RemoveSceneObjects {
259        }
260
261        /// The response from the `ReconfigureStream` endpoint.
262        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
263        pub struct ReconfigureStream {
264        }
265
266        /// The response from the `SetSceneUnits` endpoint.
267        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
268        pub struct SetSceneUnits {
269        }
270
271        /// The response from the `SetSelectionType` endpoint.
272        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
273        pub struct SetSelectionType {
274        }
275
276        /// The response from the `SetSelectionFilter` endpoint.
277        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
278        pub struct SetSelectionFilter {
279        }
280
281        /// The response from the `DefaultCameraSetOrthographic` endpoint.
282        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
283        pub struct DefaultCameraSetOrthographic {
284        }
285
286        /// The response from the `DefaultCameraSetPerspective` endpoint.
287        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
288        pub struct DefaultCameraSetPerspective {
289        }
290
291        /// The response from the `DefaultCameraCenterToSelection` endpoint.
292        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
293        pub struct DefaultCameraCenterToSelection {
294        }
295
296        /// The response from the `DefaultCameraCenterToScene` endpoint.
297        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
298        pub struct DefaultCameraCenterToScene {
299        }
300
301        /// The response from the `SelectClear` endpoint.
302        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
303        pub struct SelectClear {
304        }
305
306        /// The response from the `Export2d` endpoint.
307        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
308        pub struct Export2d {
309            /// The files that were exported.
310            pub files: Vec<ExportFile>,
311        }
312
313        /// The response from the `Export3d` endpoint.
314        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
315        pub struct Export3d {
316            /// The files that were exported.
317            pub files: Vec<ExportFile>,
318        }
319
320        /// The response from the `Export` endpoint.
321        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
322        pub struct Export {
323            /// The files that were exported.
324            pub files: Vec<ExportFile>,
325        }
326
327        /// The response from the `SelectWithPoint` command.
328        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
329        pub struct SelectWithPoint {
330            /// The UUID of the entity that was selected.
331            pub entity_id: Option<Uuid>,
332        }
333        /// The response from the `HighlightSetEntity` command.
334        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
335        pub struct HighlightSetEntity {
336            /// The UUID of the entity that was highlighted.
337            pub entity_id: Option<Uuid>,
338            /// If the client sent a sequence ID with its request, the backend sends it back.
339            pub sequence: Option<u32>,
340        }
341        /// The response from the `EntityGetChildUuid` command.
342        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
343        pub struct EntityGetChildUuid {
344            /// The UUID of the child entity.
345            pub entity_id: Uuid,
346        }
347        /// The response from the `EntityGetNumChildren` command.
348        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
349        pub struct EntityGetNumChildren {
350            /// The number of children the entity has.
351            pub num: u32,
352        }
353        /// The response from the `EntityGetParentId` command.
354        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
355        pub struct EntityGetParentId {
356            /// The UUID of the parent entity.
357            pub entity_id: Uuid,
358        }
359        /// The response from the `EntityGetAllChildUuids` command.
360        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
361        pub struct EntityGetAllChildUuids {
362            /// The UUIDs of the child entities.
363            pub entity_ids: Vec<Uuid>,
364        }
365
366        /// The response from the `EntityGetSketchPaths` command.
367        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
368        pub struct EntityGetSketchPaths {
369            /// The UUIDs of the sketch paths.
370            pub entity_ids: Vec<Uuid>,
371        }
372
373        /// The response from the `Loft` command.
374        #[derive(Debug, Serialize, Deserialize, JsonSchema, ModelingCmdOutput, Clone)]
375        pub struct Loft {
376            ///The UUID of the newly created solid loft.
377            pub solid_id: Uuid,
378        }
379
380        /// The response from the `ClosePath` command.
381        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
382        pub struct ClosePath {
383            /// The UUID of the lone face of the resulting solid2D.
384            pub face_id: Uuid,
385        }
386
387        /// The response from the `CameraDragMove` command.
388        /// Note this is an "unreliable" channel message, so this data may need more data like a "sequence"
389        //  to work properly
390        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
391        pub struct CameraDragMove {
392            /// Camera settings
393            pub settings: CameraSettings
394        }
395
396        /// The response from the `CameraDragEnd` command.
397        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
398        pub struct CameraDragEnd {
399            /// Camera settings
400            pub settings: CameraSettings
401        }
402
403        /// The response from the `DefaultCameraGetSettings` command.
404        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
405        pub struct DefaultCameraGetSettings {
406            /// Camera settings
407            pub settings: CameraSettings
408        }
409
410        /// The response from the `DefaultCameraGetView` command.
411        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
412        pub struct DefaultCameraGetView {
413            /// Camera view state
414            pub view: CameraViewState
415        }
416
417        /// The response from the `DefaultCameraSetView` command.
418        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
419        pub struct DefaultCameraSetView {}
420
421        /// The response from the `DefaultCameraZoom` command.
422        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
423        pub struct DefaultCameraZoom {
424            /// Camera settings
425            pub settings: CameraSettings
426        }
427
428        /// The response from the `ZoomToFit` command.
429        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
430        pub struct ZoomToFit {
431            /// Camera settings
432            pub settings: CameraSettings
433        }
434
435        /// The response from the `OrientToFace` command.
436        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
437        pub struct OrientToFace {
438            /// Camera settings
439            pub settings: CameraSettings
440        }
441
442        /// The response from the `ViewIsometric` command.
443        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
444        pub struct ViewIsometric {
445            /// Camera settings
446            pub settings: CameraSettings
447        }
448
449        /// The response from the `GetNumObjects` command.
450        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
451        pub struct GetNumObjects {
452            /// The number of objects in the scene.
453            pub num_objects: u32,
454        }
455
456        /// The response from the `MakeOffsetPath` command.
457        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
458        pub struct MakeOffsetPath {
459            /// If the offset path splits into multiple paths, this will contain the UUIDs of the
460            /// new paths.
461            /// If the offset path remains as a single path, this will be empty, and the resulting ID
462            /// of the (single) new path will be the ID of the `MakeOffsetPath` command.
463            pub entity_ids: Vec<Uuid>,
464        }
465
466        /// The response from the `SetObjectTransform` command.
467        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
468        pub struct SetObjectTransform {}
469
470        /// The response from the `AddHoleFromOffset` command.
471        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
472        pub struct AddHoleFromOffset {
473            /// If the offset path splits into multiple paths, this will contain the UUIDs of the
474            /// new paths.
475            /// If the offset path remains as a single path, this will be empty, and the resulting ID
476            /// of the (single) new path will be the ID of the `AddHoleFromOffset` command.
477            pub entity_ids: Vec<Uuid>,
478        }
479
480        /// The response from the `DefaultCameraFocusOn` command.
481        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
482        pub struct DefaultCameraFocusOn { }
483
484        /// The response from the `SelectGet` command.
485        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
486        pub struct SelectGet {
487            /// The UUIDs of the selected entities.
488            pub entity_ids: Vec<Uuid>,
489        }
490
491        /// Extrusion face info struct (useful for maintaining mappings between source path segment ids and extrusion faces)
492        /// This includes the opposite and adjacent faces and edges.
493        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
494        pub struct Solid3dGetAdjacencyInfo {
495            /// Details of each edge.
496            pub edges: Vec<AdjacencyInfo>,
497        }
498
499        /// The response from the `Solid3dGetAllEdgeFaces` command.
500        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
501        pub struct Solid3dGetAllEdgeFaces {
502            /// The UUIDs of the faces.
503            pub faces: Vec<Uuid>,
504        }
505
506        /// The response from the `Solid3dGetAllOppositeEdges` command.
507        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
508        pub struct Solid3dGetAllOppositeEdges {
509            /// The UUIDs of the edges.
510            pub edges: Vec<Uuid>,
511        }
512
513        /// The response from the `Solid3dGetOppositeEdge` command.
514        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
515        pub struct Solid3dGetOppositeEdge {
516            /// The UUID of the edge.
517            pub edge: Uuid,
518        }
519
520        /// The response from the `Solid3dGetNextAdjacentEdge` command.
521        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
522        pub struct Solid3dGetNextAdjacentEdge {
523            /// The UUID of the edge.
524            pub edge: Option<Uuid>,
525        }
526
527        /// The response from the `Solid3dGetPrevAdjacentEdge` command.
528        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
529        pub struct Solid3dGetPrevAdjacentEdge {
530            /// The UUID of the edge.
531            pub edge: Option<Uuid>,
532        }
533
534        /// The response from the `Solid3DGetCommonEdge` command.
535        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
536        pub struct Solid3dGetCommonEdge {
537            /// The UUID of the common edge, if any.
538            pub edge: Option<Uuid>,
539        }
540
541        /// The response from the `GetEntityType` command.
542        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
543        pub struct GetEntityType {
544            /// The type of the entity.
545            pub entity_type: EntityType,
546        }
547        /// The response from the `CurveGetControlPoints` command.
548        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
549        pub struct CurveGetControlPoints {
550            /// Control points in the curve.
551            pub control_points: Vec<Point3d<f64>>,
552        }
553
554        /// The response from the `ProjectEntityToPlane` command.
555        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
556        pub struct ProjectEntityToPlane {
557            /// Projected points.
558            pub projected_points: Vec<Point3d<f64>>,
559        }
560
561        /// The response from the `ProjectPointsToPlane` command.
562        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
563        pub struct ProjectPointsToPlane {
564            /// Projected points.
565            pub projected_points: Vec<Point3d<f64>>,
566        }
567
568        /// The response from the `CurveGetType` command.
569        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, Eq, PartialEq, ModelingCmdOutput)]
570        pub struct CurveGetType {
571            /// Curve type
572            pub curve_type: CurveType,
573        }
574
575        /// The response from the `MouseClick` command.
576        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
577        pub struct MouseClick {
578            /// Entities that are modified.
579            pub entities_modified: Vec<Uuid>,
580            /// Entities that are selected.
581            pub entities_selected: Vec<Uuid>,
582        }
583
584        /// The response from the `TakeSnapshot` command.
585        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
586        pub struct TakeSnapshot {
587            /// Contents of the image.
588            pub contents: Base64Data,
589        }
590
591        /// The response from the `PathGetInfo` command.
592        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
593        pub struct PathGetInfo {
594            /// All segments in the path, in the order they were added.
595            pub segments: Vec<PathSegmentInfo>,
596        }
597
598        /// Info about a path segment
599        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
600        pub struct PathSegmentInfo {
601            /// Which command created this path?
602            /// This field is absent if the path command is not actually creating a path segment,
603            /// e.g. moving the pen doesn't create a path segment.
604            pub command_id: Option<ModelingCmdId>,
605            /// What is the path segment?
606            pub command: PathCommand,
607            ///Whether or not this segment is a relative offset
608            pub relative: bool,
609        }
610
611        /// The response from the `PathGetCurveUuidsForVertices` command.
612        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
613        pub struct PathGetCurveUuidsForVertices {
614            /// The UUIDs of the curve entities.
615            pub curve_ids: Vec<Uuid>,
616        }
617
618        /// The response from the `PathGetCurveUuid` command.
619        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
620        pub struct PathGetCurveUuid {
621            /// The UUID of the curve entity.
622            pub curve_id: Uuid,
623        }
624
625        /// The response from the `PathGetVertexUuids` command.
626        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
627        pub struct PathGetVertexUuids {
628            /// The UUIDs of the vertex entities.
629            pub vertex_ids: Vec<Uuid>,
630        }
631
632        /// The response from the `PathGetSketchTargetUuid` command.
633        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
634        pub struct PathGetSketchTargetUuid {
635            /// The UUID of the sketch target.
636            pub target_id: Option<Uuid>,
637        }
638
639        /// Endpoints of a curve
640        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
641        pub struct CurveGetEndPoints {
642            /// Start
643            pub start: Point3d<LengthUnit>,
644            /// End
645            pub end: Point3d<LengthUnit>,
646        }
647
648        /// Surface-local planar axes (if available)
649        #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdOutput)]
650        pub struct FaceIsPlanar {
651            /// plane's origin
652            pub origin: Option<Point3d<LengthUnit>>,
653
654            /// plane's local x-axis
655            pub x_axis: Option<Point3d<f64>>,
656
657            /// plane's local y-axis
658            pub y_axis: Option<Point3d<f64>>,
659
660            /// plane's local z-axis (normal)
661            pub z_axis: Option<Point3d<f64>>,
662        }
663
664        /// The 3D position on the surface that was evaluated
665        #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdOutput)]
666        pub struct FaceGetPosition {
667            /// The 3D position on the surface that was evaluated
668            pub pos: Point3d<LengthUnit>,
669        }
670
671        /// The 3D center of mass on the surface
672        #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdOutput)]
673        pub struct FaceGetCenter {
674            /// The 3D position on the surface center of mass
675            pub pos: Point3d<LengthUnit>,
676        }
677
678        /// The gradient (dFdu, dFdv) + normal vector on a brep face
679        #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdOutput)]
680        pub struct FaceGetGradient {
681            /// dFdu
682            pub df_du: Point3d<f64>,
683
684            /// dFdv
685            pub df_dv: Point3d<f64>,
686
687            /// Normal (||dFdu x dFdv||)
688            pub normal: Point3d<f64>,
689        }
690
691        /// Corresponding coordinates of given window coordinates, intersected on given plane.
692        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
693        pub struct PlaneIntersectAndProject {
694            /// Corresponding coordinates of given window coordinates, intersected on given plane.
695            pub plane_coordinates: Option<Point2d<LengthUnit>>,
696        }
697
698        /// Data from importing the files
699        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
700        pub struct ImportFiles {
701            /// ID of the imported 3D models within the scene.
702            pub object_id: Uuid,
703        }
704
705        /// Data from importing the files
706        #[derive(Debug, Eq, PartialEq, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
707        pub struct ImportedGeometry {
708            /// ID of the imported 3D models within the scene.
709            pub id: Uuid,
710            /// The original file paths that held the geometry.
711            pub value: Vec<String>,
712        }
713
714        /// The mass response.
715        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
716        #[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
717        pub struct Mass {
718            /// The mass.
719            pub mass: f64,
720            /// The output unit for the mass.
721            pub output_unit: units::UnitMass,
722        }
723
724        /// The volume response.
725        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
726        #[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
727        pub struct Volume {
728            /// The volume.
729            pub volume: f64,
730            /// The output unit for the volume.
731            pub output_unit: units::UnitVolume,
732        }
733
734        /// The density response.
735        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
736        #[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
737        pub struct Density {
738            /// The density.
739            pub density: f64,
740            /// The output unit for the density.
741            pub output_unit: units::UnitDensity,
742        }
743
744        /// The surface area response.
745        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
746        #[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
747        pub struct SurfaceArea {
748            /// The surface area.
749            pub surface_area: f64,
750            /// The output unit for the surface area.
751            pub output_unit: units::UnitArea,
752        }
753
754        /// The center of mass response.
755        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
756        #[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
757        pub struct CenterOfMass {
758            /// The center of mass.
759            pub center_of_mass: Point3d<f64>,
760            /// The output unit for the center of mass.
761            pub output_unit: units::UnitLength,
762        }
763
764        /// The plane for sketch mode.
765        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
766        pub struct GetSketchModePlane {
767            /// The origin.
768            pub origin: Point3d<LengthUnit>,
769            /// The x axis.
770            pub x_axis: Point3d<f64>,
771            /// The y axis.
772            pub y_axis: Point3d<f64>,
773            /// The z axis (normal).
774            pub z_axis: Point3d<f64>,
775        }
776
777        /// The response from the `EntitiesGetDistance` command.
778        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
779        pub struct EntityGetDistance {
780            /// The minimum distance between the input entities.
781            pub min_distance: LengthUnit,
782            /// The maximum distance between the input entities.
783            pub max_distance: LengthUnit,
784        }
785
786        /// Faces and edges id info (most used in identifying geometry in patterned and mirrored objects).
787        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
788        pub struct FaceEdgeInfo {
789            /// The UUID of the object.
790            pub object_id: Uuid,
791            /// The faces of each object.
792            pub faces: Vec<Uuid>,
793            /// The edges of each object.
794            pub edges: Vec<Uuid>,
795        }
796
797        /// A list of faces for a specific edge.
798        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
799        pub struct EdgeInfo {
800            /// The UUID of the id.
801            pub edge_id: Uuid,
802            /// The faces of each edge.
803            pub faces: Vec<Uuid>,
804        }
805
806        /// The response from the `EntityClone` command.
807        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
808        pub struct EntityClone {
809            /// The Face and Edge Ids of the cloned entity.
810            #[serde(default, skip_serializing_if = "Vec::is_empty")]
811            pub face_edge_ids: Vec<FaceEdgeInfo>,
812        }
813
814        /// The response from the `EntityLinearPatternTransform` command.
815        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
816        pub struct EntityLinearPatternTransform {
817            /// The Face, edge, and entity ids of the patterned entities.
818            #[serde(default, skip_serializing_if = "Vec::is_empty")]
819            pub entity_face_edge_ids: Vec<FaceEdgeInfo>,
820        }
821
822        /// The response from the `EntityLinearPattern` command.
823        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
824        pub struct EntityLinearPattern {
825            /// The Face, edge, and entity ids of the patterned entities.
826            #[serde(default, skip_serializing_if = "Vec::is_empty")]
827            pub entity_face_edge_ids: Vec<FaceEdgeInfo>,
828        }
829
830        /// The response from the `EntityCircularPattern` command.
831        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
832        pub struct EntityCircularPattern {
833            /// The Face, edge, and entity ids of the patterned entities.
834            #[serde(default, skip_serializing_if = "Vec::is_empty")]
835            pub entity_face_edge_ids: Vec<FaceEdgeInfo>,
836        }
837
838        /// The response from the `EntityMirror` endpoint.
839        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
840        pub struct EntityMirror {
841            /// The Face, edge, and entity ids of the patterned entities.
842            #[serde(default, skip_serializing_if = "Vec::is_empty")]
843            pub entity_face_edge_ids: Vec<FaceEdgeInfo>,
844        }
845
846        /// The response from the `EntityMirrorAcrossEdge` endpoint.
847        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
848        pub struct EntityMirrorAcrossEdge {
849            /// The Face, edge, and entity ids of the patterned entities.
850            #[serde(default, skip_serializing_if = "Vec::is_empty")]
851            pub entity_face_edge_ids: Vec<FaceEdgeInfo>,
852        }
853
854        /// The response from the `EntityMakeHelix` endpoint.
855        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
856        pub struct EntityMakeHelix {
857        }
858
859        /// The response from the `EntityMakeHelixFromParams` endpoint.
860        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
861        pub struct EntityMakeHelixFromParams {
862        }
863
864        /// The response from the `EntityMakeHelixFromEdge` endpoint.
865        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
866        pub struct EntityMakeHelixFromEdge {
867        }
868
869        /// Extrusion face info struct (useful for maintaining mappings between source path segment ids and extrusion faces)
870        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
871        pub struct Solid3dGetExtrusionFaceInfo {
872            /// Details of each face.
873            pub faces: Vec<ExtrusionFaceInfo>,
874        }
875
876        /// Extrusion face info struct (useful for maintaining mappings between source path segment ids and extrusion faces)
877        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
878        pub struct ExtrusionFaceInfo {
879            /// Path component (curve) UUID.
880            pub curve_id: Option<Uuid>,
881
882            /// Face uuid.
883            pub face_id: Option<Uuid>,
884
885            /// Whether or not this extrusion face is a top/bottom cap face or not.
886            /// Note that top/bottom cap faces will not have associated curve IDs.
887            pub cap: ExtrusionFaceCapType,
888        }
889
890        /// Struct to contain the edge information of a wall of an extrude/rotate/loft/sweep.
891        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
892        pub struct ComplementaryEdges {
893            /// The opposite edge has no common vertices with the original edge. A wall may not
894            /// have an opposite edge (i.e. a revolve that touches the axis of rotation).
895            pub opposite_id: Option<Uuid>,
896            /// Every edge that shared one common vertex with the original edge.
897            pub adjacent_ids: Vec<Uuid>,
898        }
899
900
901        /// Edge info struct (useful for maintaining mappings between edges and faces and
902        /// adjacent/opposite edges).
903        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
904        pub struct AdjacencyInfo {
905            /// Original edge id and face info.
906            #[serde(default, skip_serializing_if = "Option::is_none")]
907            pub original_info: Option<EdgeInfo>,
908            /// Opposite edge and face info.
909            #[serde(default, skip_serializing_if = "Option::is_none")]
910            pub opposite_info: Option<EdgeInfo>,
911            /// Adjacent edge and face info.
912            #[serde(default, skip_serializing_if = "Option::is_none")]
913            pub adjacent_info: Option<EdgeInfo>,
914        }
915
916        /// The response from the 'SetGridReferencePlane'.
917        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
918        pub struct SetGridReferencePlane {}
919
920        /// The response from the 'BooleanUnion'.
921        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
922        pub struct BooleanUnion {
923            /// If the operation produced just one solid, then its ID will be the
924            /// ID of the modeling command request.
925            /// But if any extra solids are produced, then their IDs will be included
926            /// here.
927            #[serde(default, skip_serializing_if = "Vec::is_empty")]
928            pub extra_solid_ids: Vec<Uuid>,
929        }
930
931        /// The response from the 'BooleanIntersection'.
932        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
933        pub struct BooleanIntersection {
934            /// If the operation produced just one solid, then its ID will be the
935            /// ID of the modeling command request.
936            /// But if any extra solids are produced, then their IDs will be included
937            /// here.
938            #[serde(default, skip_serializing_if = "Vec::is_empty")]
939            pub extra_solid_ids: Vec<Uuid>,
940        }
941
942        /// The response from the 'BooleanSubtract'.
943        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
944        pub struct BooleanSubtract {
945            /// If the operation produced just one solid, then its ID will be the
946            /// ID of the modeling command request.
947            /// But if any extra solids are produced, then their IDs will be included
948            /// here.
949            #[serde(default, skip_serializing_if = "Vec::is_empty")]
950            pub extra_solid_ids: Vec<Uuid>,
951        }
952
953        /// The response from the 'SetGridScale'.
954        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
955        pub struct SetGridScale {}
956
957        /// The response from the 'SetGridScale'.
958        #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
959        pub struct SetGridAutoScale {}
960    }
961}