Skip to content

Commit 9de3f41

Browse files
committed
updates
Signed-off-by: Jess Frazelle <[email protected]>
1 parent 6da2ac7 commit 9de3f41

File tree

1 file changed

+19
-25
lines changed

1 file changed

+19
-25
lines changed

modeling-cmds/src/ok_response.rs

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ impl crate::ModelingCmdOutput for () {}
66
define_ok_modeling_cmd_response_enum! {
77
/// Output from Modeling API commands.
88
pub mod output {
9-
use std::collections::HashMap;
10-
119
use kittycad_modeling_cmds_macros::ModelingCmdOutput;
1210
use schemars::JsonSchema;
1311
use serde::{Deserialize, Serialize};
@@ -483,17 +481,10 @@ define_ok_modeling_cmd_response_enum! {
483481
/// Extrusion face info struct (useful for maintaining mappings between source path segment ids and extrusion faces)
484482
#[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
485483
pub struct Solid3dGetInfo {
486-
/// Details of each face.
487-
pub edges: Vec<Uuid>,
488-
/// List of opposite edges
489-
pub opposite_edges: Vec<Uuid>,
490-
/// List of adjacent edges
491-
pub adjacent_edges: Vec<Uuid>,
492-
/// List of opposite faces (two per opposite edge)
493-
pub opposite_faces: Vec<Uuid>,
494-
/// List of adjacent faces (two per adjacent face)
495-
pub adjacent_faces: Vec<Uuid>,
484+
/// Details of each edge.
485+
pub edges: Vec<EdgeInfo>,
496486
}
487+
497488
/// The response from the `Solid3dGetAllEdgeFaces` command.
498489
#[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
499490
pub struct Solid3dGetAllEdgeFaces {
@@ -905,21 +896,24 @@ define_ok_modeling_cmd_response_enum! {
905896
}
906897

907898

908-
/// Solid info struct (useful for maintaining mappings between edges and faces and
899+
/// Edge info struct (useful for maintaining mappings between edges and faces and
909900
/// adjacent/opposite edges).
910901
#[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
911-
pub struct SolidInfo {
912-
/// UUID for top cap.
913-
pub top_cap_id: Option<Uuid>,
914-
915-
/// UUID for bottom cap.
916-
pub bottom_cap_id: Option<Uuid>,
917-
918-
/// A map containing the common faces for all edges.
919-
pub common_edges: HashMap<Uuid, Vec<Uuid>>,
920-
921-
/// A map containing the adjacent and opposite edge ids of each wall face.
922-
pub complementary_edges: HashMap<Uuid, ComplementaryEdges>,
902+
pub struct EdgeInfo {
903+
/// Edge id.
904+
pub edge_id: Uuid,
905+
/// Opposite edge id.
906+
#[serde(default, skip_serializing_if = "Option::is_none")]
907+
pub opposite_edge_id: Option<Uuid>,
908+
/// Adjacent edge id.
909+
#[serde(default, skip_serializing_if = "Option::is_none")]
910+
pub adjacent_edge_id: Option<Uuid>,
911+
/// Opposite face ids.
912+
#[serde(default, skip_serializing_if = "Vec::is_empty")]
913+
pub opposite_face_ids: Vec<Uuid>,
914+
/// Adjacent face ids.
915+
#[serde(default, skip_serializing_if = "Vec::is_empty")]
916+
pub adjacent_face_ids: Vec<Uuid>,
923917
}
924918

925919
/// The response from the 'SetGridReferencePlane'.

0 commit comments

Comments
 (0)