From a819a89ede332bd2f79e135563e15ef463b84e65 Mon Sep 17 00:00:00 2001 From: David Osterberg Date: Fri, 5 Feb 2021 20:42:11 +0100 Subject: [PATCH] PartDesign: fix regression in Helix --- src/Mod/PartDesign/App/FeatureHelix.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Mod/PartDesign/App/FeatureHelix.cpp b/src/Mod/PartDesign/App/FeatureHelix.cpp index 695c02dde7..b571df9a78 100644 --- a/src/Mod/PartDesign/App/FeatureHelix.cpp +++ b/src/Mod/PartDesign/App/FeatureHelix.cpp @@ -397,6 +397,14 @@ TopoDS_Shape Helix::generateHelixPath(void) double radius = std::fabs(axisOffset); bool turned = axisOffset < 0; + if (radius < Precision::Confusion()) { + // in this case ensure that axis is not in the sketch plane + if (v*normal < Precision::Confusion()) + throw Base::ValueError("Error: Result is self intersecting"); + radius = 1.0; //fallback to radius 1 + startOffset = 0.0; + } + //build the helix path TopoShape helix = TopoShape().makeLongHelix(pitch, height, radius, angle, leftHanded); TopoDS_Shape path = helix.getShape();