add class GeomArcOfConic to reduce code duplication

This commit is contained in:
wmayer
2016-12-04 14:20:56 +01:00
parent adf3cc0f95
commit 932eab40fc
18 changed files with 595 additions and 799 deletions

View File

@@ -111,30 +111,12 @@ Py::Float ConicPy::getEccentricity(void) const
Py::Float ConicPy::getAngleXU(void) const
{
Handle_Geom_Conic conic = Handle_Geom_Conic::DownCast(getGeomConicPtr()->handle());
gp_Pnt center = conic->Axis().Location();
gp_Dir normal = conic->Axis().Direction();
gp_Dir xdir = conic->XAxis().Direction();
gp_Ax2 xdirref(center, normal); // this is a reference system, might be CCW or CW depending on the creation method
return Py::Float(-xdir.AngleWithRef(xdirref.XDirection(),normal));
return Py::Float(getGeomConicPtr()->getAngleXU());
}
void ConicPy::setAngleXU(Py::Float arg)
{
Handle_Geom_Conic conic = Handle_Geom_Conic::DownCast(getGeomConicPtr()->handle());
gp_Pnt center = conic->Axis().Location();
gp_Dir normal = conic->Axis().Direction();
gp_Ax1 normaxis(center, normal);
gp_Ax2 xdirref(center, normal);
xdirref.Rotate(normaxis,arg);
conic->SetPosition(xdirref);
getGeomConicPtr()->setAngleXU((double)arg);
}
Py::Object ConicPy::getAxis(void) const