From 4a3d2113780d100afd6f8dd9b5ea58e8096f0318 Mon Sep 17 00:00:00 2001 From: Uwe Date: Mon, 29 Nov 2021 01:34:03 +0100 Subject: [PATCH] [PD] prevent invalid helix geometry in the height-turns-growth model height and growth must not be equally zero --- src/Mod/PartDesign/App/FeatureHelix.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Mod/PartDesign/App/FeatureHelix.cpp b/src/Mod/PartDesign/App/FeatureHelix.cpp index 5d6b6c8c54..d10c1bd01c 100644 --- a/src/Mod/PartDesign/App/FeatureHelix.cpp +++ b/src/Mod/PartDesign/App/FeatureHelix.cpp @@ -128,11 +128,14 @@ App::DocumentObjectExecReturn *Helix::execute(void) if (Height.getValue() < Precision::Confusion()) return new App::DocumentObjectExecReturn("Error: height too small!"); if (Turns.getValue() < Precision::Confusion()) - return new App::DocumentObjectExecReturn("Error turns too small!"); + return new App::DocumentObjectExecReturn("Error: turns too small!"); Pitch.setValue(Height.getValue()/Turns.getValue()); } else if (mode == HelixMode::height_turns_growth) { if (Turns.getValue() < Precision::Confusion()) - return new App::DocumentObjectExecReturn("Error turns too small!"); + return new App::DocumentObjectExecReturn("Error: turns too small!"); + if ((Height.getValue() < Precision::Confusion()) + && (Growth.getValue() < Precision::Confusion())) + return new App::DocumentObjectExecReturn("Error: either height or growth must not be zero!"); Pitch.setValue(Height.getValue()/Turns.getValue()); } else { return new App::DocumentObjectExecReturn("Error: unsupported mode");