-// Copyright (C) 2018-20xx CEA/DEN, EDF R&D
+// Copyright (C) 2018-2023 CEA, EDF
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <GeomAPI_Cone.h>
const double theSemiAngle,
const double theRadius1,
const double theRadius2)
- : GeomAPI_Interface(
- newCone(theLocation->impl<gp_Pnt>(), theAxis->impl<gp_Dir>(), theSemiAngle, theRadius1)),
- myRadius1(theRadius1),
+ : myRadius1(theRadius1),
myRadius2(theRadius2)
{
+ gp_Pnt aLoc = theLocation->impl<gp_Pnt>();
+ gp_Dir aDir = theAxis->impl<gp_Dir>();
+ if (theRadius1 > theRadius2) {
+ aLoc.ChangeCoord() += aDir.XYZ() * (theRadius1 - theRadius2) / Tan(theSemiAngle);
+ aDir.Reverse();
+ myRadius1 = theRadius2;
+ myRadius2 = theRadius1;
+ }
+
+ setImpl(newCone(aLoc, aDir, theSemiAngle, myRadius1));
}
//=================================================================================================