From 86f148175fd1a55ca5aa94cb519ec5bdcc85e433 Mon Sep 17 00:00:00 2001 From: David Osterberg Date: Mon, 15 Feb 2021 14:33:36 +0100 Subject: [PATCH] PartDesign: Improve Helix parameter proposals The previous initial proposed parameters could cause self intersection when the user switches axis --- src/Mod/PartDesign/App/FeatureHelix.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Mod/PartDesign/App/FeatureHelix.cpp b/src/Mod/PartDesign/App/FeatureHelix.cpp index 8b13651589..327f6581ae 100644 --- a/src/Mod/PartDesign/App/FeatureHelix.cpp +++ b/src/Mod/PartDesign/App/FeatureHelix.cpp @@ -504,7 +504,12 @@ double Helix::safePitch() void Helix::proposeParameters(bool force) { if (force || !HasBeenEdited.getValue()) { - double pitch = 1.1*safePitch(); + TopoDS_Shape sketchshape = getVerifiedFace(); + Bnd_Box bb; + BRepBndLib::Add(sketchshape, bb); + bb.SetGap(0.0); + double pitch = 1.1 * sqrt(bb.SquareExtent()); + Pitch.setValue(pitch); Height.setValue(pitch*3.0); HasBeenEdited.setValue(1);