Fix T97831: Curve to mesh node can create invalid wire mesh

When the profile only has one control point, its segment count was
determined incorrectly. There needs to be a special case for a single
control point, when there are no segments even if the curve is cyclic.
This commit is contained in:
Hans Goudey
2022-05-04 12:26:59 +02:00
parent 79e94caa6b
commit 302584bd6e

View File

@@ -412,7 +412,7 @@ namespace curves {
inline int curve_segment_size(const int points_num, const bool cyclic)
{
BLI_assert(points_num > 0);
return cyclic ? points_num : points_num - 1;
return (cyclic && points_num > 1) ? points_num : points_num - 1;
}
inline float2 encode_surface_bary_coord(const float3 &v)