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
18 changes: 9 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions modeling-cmds/openapi/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -1267,6 +1267,7 @@
"type": "object",
"properties": {
"entity_reference": {
"description": "Extrudes along the normal of the top face until it is as close to the entity as possible. An entity can be a solid, a path, a face, etc.",
"type": "object",
"properties": {
"entity_id": {
Expand All @@ -1290,6 +1291,7 @@
"type": "object",
"properties": {
"axis": {
"description": "Extrudes until the top face is as close as possible to this given axis.",
"type": "object",
"properties": {
"axis": {
Expand Down
44 changes: 36 additions & 8 deletions modeling-cmds/src/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1191,17 +1191,15 @@ pub enum ExtrudeReference {
/// Extrudes along the normal of the top face until it is as close to the entity as possible.
/// An entity can be a solid, a path, a face, etc.
EntityReference {
/// The UUID of the entity to extrude to.
entity_id: Uuid,
/// What to extrude to.
#[serde(flatten)]
target: ExtrudeReferenceEntity,
},
/// Extrudes until the top face is as close as possible to this given axis.
Axis {
/// The axis to extrude to.
axis: Point3d<f64>,
/// Point the axis goes through.
/// Defaults to (0, 0, 0).
#[serde(default)]
point: Point3d<LengthUnit>,
/// What to extrude to.
#[serde(flatten)]
target: ExtrudeReferenceAxis,
},
/// Extrudes until the top face is as close as possible to this given point.
Point {
Expand All @@ -1210,6 +1208,36 @@ pub enum ExtrudeReference {
},
}

/// Extrudes until the top face is as close as possible to this given axis.
#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, JsonSchema, Builder)]
#[serde(rename_all = "snake_case")]
#[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 ExtrudeReferenceAxis {
/// The axis to extrude to.
pub axis: Point3d<f64>,
/// Point the axis goes through.
/// Defaults to (0, 0, 0).
#[serde(default)]
#[builder(default)]
pub point: Point3d<LengthUnit>,
}

#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, JsonSchema, Builder)]
#[serde(rename_all = "snake_case")]
#[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)]
/// Extrudes along the normal of the top face until it is as close to the entity as possible.
/// An entity can be a solid, a path, a face, etc.
pub struct ExtrudeReferenceEntity {
/// The UUID of the entity to extrude to.
pub entity_id: Uuid,
}

/// IDs for the extruded faces.
#[derive(Debug, PartialEq, Serialize, Deserialize, JsonSchema, Clone, Builder)]
#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
Expand Down
Loading