Non-destructive, partial surface extrudes/revolves/sweeps etc#1130
Non-destructive, partial surface extrudes/revolves/sweeps etc#1130adamchalmers wants to merge 6 commits intomainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1130 +/- ##
=======================================
Coverage ? 30.22%
=======================================
Files ? 34
Lines ? 1588
Branches ? 0
=======================================
Hits ? 480
Misses ? 1108
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Good question. I'll ask @max-mrgrsk and @nicboone8. Perhaps it should be configurable. |
|
I would expect them merged by default, but making it configurable is a good idea |
| @@ -265,6 +302,15 @@ define_modeling_cmd_enum! { | |||
| /// Which sketch to revolve. | |||
| /// Must be a closed 2D solid. | |||
| pub target: ModelingCmdId, | |||
There was a problem hiding this comment.
Documentation inconsistency: Revolve.target still says "Must be a closed 2D solid" but should be updated to "Must be a 2D sketch" to match the Extrude operation and reflect support for partial surface revolves via the new segments field.
| /// Which sketch to sweep. | |
| /// Must be a closed 2D solid. | |
| pub target: ModelingCmdId, | |
| /// If given, extrude each of these segments into a separate body with the given ID. | |
| #[serde(default, skip_serializing_if = "Option::is_none")] | |
| pub segments: Option<Vec<IdPair>>, | |
| /// When two collinear segments are extruded, what should happen? | |
| /// If true, creates a body with two surfaces. | |
| /// If false, creates a body with one surface, spanning both collinear segments. | |
| #[serde(default)] | |
| #[builder(default)] | |
| pub keep_seams: bool, | |
| /// Path along which to sweep. | |
| pub trajectory: ModelingCmdId, | |
| /// If true, the sweep will be broken up into sub-sweeps (extrusions, revolves, sweeps) based on the trajectory path components. | |
| /// Which sketch to revolve. | |
| /// Must be a 2D sketch. | |
| pub target: ModelingCmdId, | |
Spotted by Graphite
Is this helpful? React 👍 or 👎 to let us know.
This proposes a new way to surface extrude/revolve/sweep for sketch 2. Instead of extruding an entire sketch (solid2D) at once, we instead take a list of segments and extrude each of those separately. Each segment has a (segment ID, new body ID) pair, so the segment IDs are NOT absorbed into new body IDs. The sketch and all its segments are not modified.
485f01e to
06477d1
Compare
This proposes a new way to surface extrude/revolve/sweep for sketch 2. Part of KittyCAD/modeling-app#10386
Background
Currently, the engine extrude/revolve/sweep/etc endpoints take an entire sketch as their target. That worked fine for sketch 1 solid extrudes (where the sketch is a closed profile) and for surface extrudes (where the sketch could be closed or open, either way, it extrudes each segment separately).
Problem
In sketch 2, the user might want to surface extrude only some segments in the sketch. Like in the below example, only k of the n segments are selected for extrusion.
Right now the API doesn't allow for this. Clients send the ID of the overall sketch, and the server extrudes the whole thing. There's no way to only surface extrude k of the n segments.
Solution
Instead of extruding an entire sketch (solid2D) at once, we instead take a list of segments and extrude each of those separately.
Here's a motivating example:
In this example, after extruding:
We want to:
Ideally we would not need any follow-up calls to query these bodies. Let's just send back all relevant information in the Extrude response.
Here's my proposed return for Extrude. I'm using YAML because it's more concise, but we'd actually be sending JSON. See the attachment for syntax highlighting, or copypastable here: