Hi
How can I determine whether a face is a sphere, cylinder or cone face? when I count edge and vertex numbers, they all have same (3 edges & 2 vertices)
Thanks
xaeroxx
Bearloga Thu, 09/18/2008 - 18:12
Count the number of degenerated edges. Sphere has 2 such edges, cone 1 and cylinder 0.
you can try BRepAdaptor_Surface::GetType()
but it will return you the type of the opencascade entity, not the "shape" of your face. ex : if you have a bspline surface representing a sphere, you will get GeomAbs_BSplineSurface and not GeomAbs_Sphere.
Thu, 09/18/2008 - 18:12
Count the number of degenerated edges. Sphere has 2 such edges, cone 1 and cylinder 0.
Thu, 09/18/2008 - 18:20
you can try BRepAdaptor_Surface::GetType()
but it will return you the type of the opencascade entity, not the "shape" of your face. ex : if you have a bspline surface representing a sphere, you will get GeomAbs_BSplineSurface and not GeomAbs_Sphere.
Stephane
Thu, 09/18/2008 - 18:23
You can get the surface of the face and compare the type of the face.
Handle_Geom_Surface hSurface = BRep_Tool::Surface(m_face);
if(hSurface->IsKind(STANDARD_TYPE(Geom_CylindricalSurface))) //Cylindrical Surface
{
}
else if(hSurface->IsKind(STANDARD_TYPE(Geom_ConicalSurface))) //Conical Surface
{
}