[Bf-blender-cvs] [5b1ec08f040] master: Fix T93546: Fill curve node ignores last point of non-cylic curves
Hans Goudey
noreply at git.blender.org
Thu Apr 28 18:51:09 CEST 2022
Commit: 5b1ec08f040ab238b2f4d80fa3bc7b169eeb3820
Author: Hans Goudey
Date: Thu Apr 28 11:50:55 2022 -0500
Branches: master
https://developer.blender.org/rB5b1ec08f040ab238b2f4d80fa3bc7b169eeb3820
Fix T93546: Fill curve node ignores last point of non-cylic curves
The node is meant to consider all curves cyclic, which means that it
shouldn't account for one fewer segment on non-cyclic curves.
===================================================================
M source/blender/nodes/geometry/nodes/node_geo_curve_fill.cc
===================================================================
diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_fill.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_fill.cc
index f29b193d98b..c9a8dba55b2 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_curve_fill.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_curve_fill.cc
@@ -48,20 +48,18 @@ static meshintersect::CDT_result<double> do_cdt(const bke::CurvesGeometry &curve
input.vert.reinitialize(curves.evaluated_points_num());
input.face.reinitialize(curves.curves_num());
- VArray<bool> cyclic = curves.cyclic();
Span<float3> positions = curves.evaluated_positions();
for (const int i_curve : curves.curves_range()) {
const IndexRange points = curves.evaluated_points_for_curve(i_curve);
- const int segment_size = bke::curves::curve_segment_size(points.size(), cyclic[i_curve]);
for (const int i : points) {
input.vert[i] = double2(positions[i].x, positions[i].y);
}
- input.face[i_curve].resize(segment_size);
+ input.face[i_curve].resize(points.size());
MutableSpan<int> face_verts = input.face[i_curve];
- for (const int i : IndexRange(segment_size)) {
+ for (const int i : face_verts.index_range()) {
face_verts[i] = points[i];
}
}
More information about the Bf-blender-cvs
mailing list