Py::Object CirclePy::getAxis(void) const { Handle_Geom_Circle circle = Handle_Geom_Circle::DownCast(getGeomCirclePtr()->handle()); gp_Ax1 axis = circle->Axis(); gp_Dir dir = axis.Direction(); return Py::Vector(Base::Vector3d(dir.X(), dir.Y(), dir.Z())); }
// returns a string which represents the object e.g. when printed in python std::string CirclePy::representation(void) const { Handle_Geom_Circle circle = Handle_Geom_Circle::DownCast(getGeomCirclePtr()->handle()); gp_Ax1 axis = circle->Axis(); gp_Dir dir = axis.Direction(); gp_Pnt loc = axis.Location(); Standard_Real fRad = circle->Radius(); std::stringstream str; str << "Circle ("; str << "Radius : " << fRad << ", "; str << "Position : (" << loc.X() << ", "<< loc.Y() << ", "<< loc.Z() << "), "; str << "Direction : (" << dir.X() << ", "<< dir.Y() << ", "<< dir.Z() << ")"; str << ")"; return str.str(); }
// returns a string which represents the object e.g. when printed in python std::string ArcOfCirclePy::representation(void) const { Handle_Geom_TrimmedCurve trim = Handle_Geom_TrimmedCurve::DownCast (getGeomArcOfCirclePtr()->handle()); Handle_Geom_Circle circle = Handle_Geom_Circle::DownCast(trim->BasisCurve()); gp_Ax1 axis = circle->Axis(); gp_Dir dir = axis.Direction(); gp_Pnt loc = axis.Location(); Standard_Real fRad = circle->Radius(); Standard_Real u1 = trim->FirstParameter(); Standard_Real u2 = trim->LastParameter(); std::stringstream str; str << "ArcOfCircle ("; str << "Radius : " << fRad << ", "; str << "Position : (" << loc.X() << ", "<< loc.Y() << ", "<< loc.Z() << "), "; str << "Direction : (" << dir.X() << ", "<< dir.Y() << ", "<< dir.Z() << "), "; str << "Parameter : (" << u1 << ", " << u2 << ")"; str << ")"; return str.str(); }