Fix: Remove special case from curve segment size function
The idea that curves with two points cannot be cyclic came from some existing code, but there's not fundamental reason for it, so remove the check in this function. The case can be handled elsewhere if necessary.
This commit is contained in:
@@ -351,13 +351,12 @@ class CurvesGeometry : public ::CurvesGeometry {
|
||||
namespace curves {
|
||||
|
||||
/**
|
||||
* The number of segments between control points, accounting for the last segment of cyclic curves,
|
||||
* and the fact that curves with two points cannot be cyclic. The logic is simple, but this
|
||||
* function should be used to make intentions clearer.
|
||||
* The number of segments between control points, accounting for the last segment of cyclic
|
||||
* curves. The logic is simple, but this function should be used to make intentions clearer.
|
||||
*/
|
||||
inline int curve_segment_size(const int points_num, const bool cyclic)
|
||||
{
|
||||
return (cyclic && points_num > 2) ? points_num : points_num - 1;
|
||||
return cyclic ? points_num : points_num - 1;
|
||||
}
|
||||
|
||||
namespace bezier {
|
||||
|
||||
Reference in New Issue
Block a user