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
5 changes: 5 additions & 0 deletions modeling-cmds/src/def_enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ define_modeling_cmd_enum! {
/// Should the extrusion create a new object or be part of the existing object.
#[serde(default)]
pub extrude_method: ExtrudeMethod,
/// Only used if the extrusion is created from a face and extrude_method = Merge
/// If true, seams between the extrusion and the original body will be shown.
/// Otherwise, seams resulting from the extrusion will be removed where possible.
#[serde(default)]
pub merge_coplanar_faces: Option<bool>,
Comment on lines +133 to +136
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The field name merge_coplanar_faces contradicts its documented behavior. The name implies that when true, coplanar faces should be merged (hiding seams), but the documentation states "If true, seams between the extrusion and the original body will be shown." This semantic inversion will cause incorrect usage in production.

Fix: Either rename the field to match the behavior or fix the documentation:

// Option 1: Rename field to match documented behavior
pub show_seams: Option<bool>,

// Option 2: Fix documentation to match field name
/// If true, coplanar faces will be merged and seams will be hidden.
/// Otherwise, seams between the extrusion and original body will be shown.
pub merge_coplanar_faces: Option<bool>,
Suggested change
/// If true, seams between the extrusion and the original body will be shown.
/// Otherwise, seams resulting from the extrusion will be removed where possible.
#[serde(default)]
pub merge_coplanar_faces: Option<bool>,
/// If true, coplanar faces will be merged and seams will be hidden.
/// Otherwise, seams between the extrusion and original body will be shown.
#[serde(default)]
pub merge_coplanar_faces: Option<bool>,

Spotted by Graphite Agent

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

/// Should this extrude create a solid body or a surface?
#[serde(default)]
pub body_type: BodyType,
Expand Down
1 change: 1 addition & 0 deletions modeling-session/examples/cube_png.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ async fn main() -> Result<()> {
faces: None,
opposite: Default::default(),
extrude_method: Default::default(),
merge_coplanar_faces: Default::default(),
body_type: Default::default(),
}
.into(),
Expand Down
1 change: 1 addition & 0 deletions modeling-session/examples/cube_png_batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ async fn main() -> Result<()> {
faces: None,
opposite: Default::default(),
extrude_method: Default::default(),
merge_coplanar_faces: Default::default(),
body_type: Default::default(),
}),
cmd_id: random_id(),
Expand Down
1 change: 1 addition & 0 deletions modeling-session/examples/lsystem_png_batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ async fn main() -> Result<()> {
faces: None,
opposite: Default::default(),
extrude_method: Default::default(),
merge_coplanar_faces: Default::default(),
body_type: Default::default(),
}),
cmd_id: random_id(),
Expand Down
Loading