PartDesign: Improve Helix parameter proposals

The previous initial proposed parameters could cause self intersection
when the user switches axis
This commit is contained in:
David Osterberg
2021-02-15 14:33:36 +01:00
committed by wwmayer
parent 17b1dc1ae8
commit 86f148175f

View File

@@ -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);