Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions modeling-cmds/openapi/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -6579,6 +6579,30 @@
"selected_at_window",
"type"
]
},
{
"description": "Get the smallest box that could contain the given parts.",
"type": "object",
"properties": {
"entity_ids": {
"description": "IDs of the entities to be included in the box. If this is empty, then all entities are included (the entire scene).",
"type": "array",
"items": {
"type": "string",
"format": "uuid"
}
},
"type": {
"type": "string",
"enum": [
"bounding_box"
]
}
},
"required": [
"entity_ids",
"type"
]
}
]
},
Expand Down
13 changes: 13 additions & 0 deletions modeling-cmds/src/def_enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2395,6 +2395,19 @@ define_modeling_cmd_enum! {
/// Where in the window was selected
pub selected_at_window: Point2d,
}

/// Get the smallest box that could contain the given parts.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)]
#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
#[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
pub struct BoundingBox {
/// IDs of the entities to be included in the box.
/// If this is empty, then all entities are included (the entire scene).
#[builder(default)]
pub entity_ids: Vec<Uuid>,
}
}
}

Expand Down
10 changes: 10 additions & 0 deletions modeling-cmds/src/ok_response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1226,5 +1226,15 @@ define_ok_modeling_cmd_response_enum! {
pub region: Option<crate::shared::SelectedRegion>,
}

/// The response from the 'BoundingBox'.
#[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
#[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
pub struct BoundingBox {
/// Center of the box.
pub center: Point3d<f64>,
/// Dimensions of the box along each axis.
pub dimensions: Point3d<f64>,
}

}
}