From a976e63def3e196ae754495bb9c334c4a8af15e3 Mon Sep 17 00:00:00 2001 From: Richard Brice <37087370+RickBrice@users.noreply.github.com> Date: Tue, 21 May 2024 16:22:44 -0700 Subject: [PATCH] Fixes divide by zero error for zero-length segments. See Issue #4713. --- src/ifcgeom/taxonomy.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ifcgeom/taxonomy.cpp b/src/ifcgeom/taxonomy.cpp index 9339a472e3..feecc9c39c 100644 --- a/src/ifcgeom/taxonomy.cpp +++ b/src/ifcgeom/taxonomy.cpp @@ -473,6 +473,8 @@ ifcopenshell::geometry::taxonomy::item::ptr ifcopenshell::geometry::taxonomy::pi num_steps = (unsigned)std::ceil(param); } + num_steps = std::max(1u, num_steps); // never have fewer than 1 step + return evaluate(0.0, curve_length, num_steps); }