mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-18 06:21:40 +00:00
Prevents divide by zero when clothoid constant is 0.0
This commit is contained in:
@@ -171,7 +171,9 @@ class curve_segment_evaluator {
|
|||||||
} else {
|
} else {
|
||||||
// This functor is f'(x) = dy/dx
|
// This functor is f'(x) = dy/dx
|
||||||
auto df = [fnX,fnY](double t) -> double {
|
auto df = [fnX,fnY](double t) -> double {
|
||||||
return fnY(t) / fnX(t);
|
auto dy = fnY(t);
|
||||||
|
auto dx = fnX(t);
|
||||||
|
return dx ? dy / dx : 0.0;
|
||||||
};
|
};
|
||||||
|
|
||||||
// This functor computes the curve length
|
// This functor computes the curve length
|
||||||
|
|||||||
Reference in New Issue
Block a user