diff --git a/modeling-cmds/src/def_enum.rs b/modeling-cmds/src/def_enum.rs index b112a13c..975a68bb 100644 --- a/modeling-cmds/src/def_enum.rs +++ b/modeling-cmds/src/def_enum.rs @@ -100,9 +100,11 @@ define_modeling_cmd_enum! { /// Segment to append to the path. /// This segment will implicitly begin at the current "pen" location. pub segment: PathSegment, + /// Optional label to associate with the new path segment. + #[serde(default, skip_serializing_if = "String::is_empty")] + pub label: String, } - /// Command for extruding a solid 2d. #[derive( Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, diff --git a/modeling-session/examples/cube_png.rs b/modeling-session/examples/cube_png.rs index 54397cb3..05216902 100644 --- a/modeling-session/examples/cube_png.rs +++ b/modeling-session/examples/cube_png.rs @@ -90,6 +90,7 @@ async fn main() -> Result<()> { end: point, relative: false, }, + label: Default::default(), } .into(), ) diff --git a/modeling-session/examples/cube_png_batch.rs b/modeling-session/examples/cube_png_batch.rs index 505acaca..7e10d691 100644 --- a/modeling-session/examples/cube_png_batch.rs +++ b/modeling-session/examples/cube_png_batch.rs @@ -87,6 +87,7 @@ async fn main() -> Result<()> { cmd: ModelingCmd::ExtendPath(ExtendPath { path, segment: PathSegment::Line { end, relative: false }, + label: Default::default(), }), }), ); diff --git a/modeling-session/examples/lsystem_png_batch.rs b/modeling-session/examples/lsystem_png_batch.rs index 69e44166..078014f2 100644 --- a/modeling-session/examples/lsystem_png_batch.rs +++ b/modeling-session/examples/lsystem_png_batch.rs @@ -121,6 +121,7 @@ async fn main() -> Result<()> { }, relative: false, }, + label: Default::default(), }), }); }