Skip to content

Commit

Permalink
Use new offset capabilities to add a hole to a closed path with unifo…
Browse files Browse the repository at this point in the history
…rm thickness from the perimeter (#685)

* Extrude can send IDs for the new faces

When extruding a 2D shape into a 3D shape, a bunch of new faces are created.
These faces need IDs. The backend currently generates these IDs randomly.
Add a new option to allow the client to send the IDs.

* AddHoleFromOffset

---------

Co-authored-by: Adam Chalmers <[email protected]>
Co-authored-by: gserena <[email protected]>
  • Loading branch information
3 people authored Dec 19, 2024
1 parent 1f0c60e commit c7cc1b1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
9 changes: 9 additions & 0 deletions modeling-cmds/src/def_enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1211,6 +1211,15 @@ define_modeling_cmd_enum! {
/// The distance to offset the path (positive for outset, negative for inset)
pub offset: LengthUnit,
}

/// Add a hole to a closed path by offsetting it a uniform distance inward.
#[derive(Clone, Debug, Deserialize, JsonSchema, Serialize, ModelingCmdVariant)]
pub struct AddHoleFromOffset {
/// The closed path to add a hole to.
pub object_id: Uuid,
/// The distance to offset the path (positive for outset, negative for inset)
pub offset: LengthUnit,
}
}
}

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 @@ -440,6 +440,16 @@ define_ok_modeling_cmd_response_enum! {
pub entity_ids: Vec<Uuid>,
}

/// The response from the `AddHoleFromOffset` command.
#[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
pub struct AddHoleFromOffset {
/// If the offset path splits into multiple paths, this will contain the UUIDs of the
/// new paths.
/// If the offset path remains as a single path, this will be empty, and the resulting ID
/// of the (single) new path will be the ID of the `AddHoleFromOffset` command.
pub entity_ids: Vec<Uuid>,
}

/// The response from the `DefaultCameraFocusOn` command.
#[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
pub struct DefaultCameraFocusOn { }
Expand Down

0 comments on commit c7cc1b1

Please sign in to comment.