X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAPI%2FGeomAPI_Cone.cpp;h=a08a07535e93dc1f9d1cd73961c1ef227e0b03e9;hb=026f5b80ebe2c718246d80f9cb9bea3887406c12;hp=e18d4d333e6cb87f05f8ed034a083e00ec945e41;hpb=5ff96b13035a4e95572580dbc6aa6f2c526d0a45;p=modules%2Fshaper.git diff --git a/src/GeomAPI/GeomAPI_Cone.cpp b/src/GeomAPI/GeomAPI_Cone.cpp index e18d4d333..a08a07535 100644 --- a/src/GeomAPI/GeomAPI_Cone.cpp +++ b/src/GeomAPI/GeomAPI_Cone.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-20xx CEA/DEN, EDF R&D +// Copyright (C) 2018-2019 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -12,10 +12,9 @@ // // 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 +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include @@ -61,11 +60,19 @@ GeomAPI_Cone::GeomAPI_Cone(const std::shared_ptr& theLocation, const double theSemiAngle, const double theRadius1, const double theRadius2) - : GeomAPI_Interface( - newCone(theLocation->impl(), theAxis->impl(), theSemiAngle, theRadius1)), - myRadius1(theRadius1), + : myRadius1(theRadius1), myRadius2(theRadius2) { + gp_Pnt aLoc = theLocation->impl(); + gp_Dir aDir = theAxis->impl(); + if (theRadius1 > theRadius2) { + aLoc.ChangeCoord() += aDir.XYZ() * (theRadius1 - theRadius2) / Tan(theSemiAngle); + aDir.Reverse(); + myRadius1 = theRadius2; + myRadius2 = theRadius1; + } + + setImpl(newCone(aLoc, aDir, theSemiAngle, myRadius1)); } //=================================================================================================