diff --git a/node-graph/gcore/src/vector/vector_nodes.rs b/node-graph/gcore/src/vector/vector_nodes.rs index f5773407..fc0200ec 100644 --- a/node-graph/gcore/src/vector/vector_nodes.rs +++ b/node-graph/gcore/src/vector/vector_nodes.rs @@ -1331,6 +1331,14 @@ async fn poisson_disk_points( #[node_macro::node(category(""), path(graphene_core::vector))] async fn subpath_segment_lengths(_: impl Ctx, content: Table) -> Vec { + let pathseg_perimeter = |segment: PathSeg| { + if is_linear(segment) { + Line::new(segment.start(), segment.end()).perimeter(DEFAULT_ACCURACY) + } else { + segment.perimeter(DEFAULT_ACCURACY) + } + }; + content .into_iter() .flat_map(|vector| { @@ -1340,7 +1348,7 @@ async fn subpath_segment_lengths(_: impl Ctx, content: Table) -> Vec>() + bezpath.segments().map(pathseg_perimeter).collect::>() }) .collect::>() })