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