Fix: Division by zero in curve spiral primitive node

This commit is contained in:
Hans Goudey 2021-09-15 14:12:48 -05:00
parent 231948f33f
commit acb8909021
1 changed files with 1 additions and 1 deletions

View File

@ -41,7 +41,7 @@ static std::unique_ptr<CurveEval> create_spiral_curve(const float rotations,
std::unique_ptr<CurveEval> curve = std::make_unique<CurveEval>();
std::unique_ptr<PolySpline> spline = std::make_unique<PolySpline>();
const int totalpoints = resolution * rotations;
const int totalpoints = std::max(int(resolution * rotations), 1);
const float delta_radius = (end_radius - start_radius) / (float)totalpoints;
float radius = start_radius;
const float delta_height = height / (float)totalpoints;