From abe7c4404d0784d949ade97fe6aef90b6970676e Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Mon, 28 Nov 2016 15:10:25 -0800 Subject: [PATCH] Enhance makeHelix to also support helixes that spiral downwards. --- src/Mod/Part/App/TopoShape.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Mod/Part/App/TopoShape.cpp b/src/Mod/Part/App/TopoShape.cpp index b67187db38..d8d0531751 100644 --- a/src/Mod/Part/App/TopoShape.cpp +++ b/src/Mod/Part/App/TopoShape.cpp @@ -1659,12 +1659,15 @@ TopoDS_Shape TopoShape::makeHelix(Standard_Real pitch, Standard_Real height, Standard_Boolean leftHanded, Standard_Boolean newStyle) const { - if (pitch < Precision::Confusion()) + if (fabs(pitch) < Precision::Confusion()) Standard_Failure::Raise("Pitch of helix too small"); - if (height < Precision::Confusion()) + if (fabs(height) < Precision::Confusion()) Standard_Failure::Raise("Height of helix too small"); + if ((height > 0 && pitch < 0) || (height < 0 && pitch > 0)) + Standard_Failure::Raise("Pitch and height of helix not compatible"); + gp_Ax2 cylAx2(gp_Pnt(0.0,0.0,0.0) , gp::DZ()); Handle_Geom_Surface surf; if (angle < Precision::Confusion()) {