add class GeomArcOfConic to reduce code duplication
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user