From cd208c5477ba335d584b3edd47c1efb14893af88 Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Tue, 7 Jun 2022 20:20:29 +0200 Subject: [PATCH] Part: Geometry - Add Ellipse minor radio convenience function --- src/Mod/Part/App/Geometry.cpp | 11 +++++++++++ src/Mod/Part/App/Geometry.h | 1 + 2 files changed, 12 insertions(+) diff --git a/src/Mod/Part/App/Geometry.cpp b/src/Mod/Part/App/Geometry.cpp index 575a9d49cc..1457e89205 100644 --- a/src/Mod/Part/App/Geometry.cpp +++ b/src/Mod/Part/App/Geometry.cpp @@ -2722,6 +2722,17 @@ Base::Vector3d GeomEllipse::getMajorAxisDir() const return Base::Vector3d(xdir.X(), xdir.Y(), xdir.Z()); } +/*! + * \brief GeomEllipse::getMinorAxisDir + * \return the direction vector (unit-length) of minor axis of the ellipse. + */ +Base::Vector3d GeomEllipse::getMinorAxisDir() const +{ + gp_Dir ydir = myCurve->YAxis().Direction(); + return Base::Vector3d(ydir.X(), ydir.Y(), ydir.Z()); +} + + /*! * \brief GeomEllipse::setMajorAxisDir Rotates the ellipse in its plane, so * that its major axis is as close as possible to the provided direction. diff --git a/src/Mod/Part/App/Geometry.h b/src/Mod/Part/App/Geometry.h index 24a2f16176..d325a5f027 100644 --- a/src/Mod/Part/App/Geometry.h +++ b/src/Mod/Part/App/Geometry.h @@ -538,6 +538,7 @@ public: void setMinorRadius(double Radius); Base::Vector3d getMajorAxisDir() const; void setMajorAxisDir(Base::Vector3d newdir); + Base::Vector3d getMinorAxisDir() const; // Persistence implementer --------------------- virtual unsigned int getMemSize(void) const;