DiscussionsIssue archiveOther usage issues

Archived discussion

Face Type

Other usage issuesThu, 09/18/2008 - 17:193 replies

Browse this forum
QuestionAuthor

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
Author

Discussion

3 archived replies

Posts are displayed in their archived order.

01Commenter-1

Count the number of degenerated edges. Sphere has 2 such edges, cone 1 and cylinder 0.

02Commenter-2

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.

Commenter-2

03Commenter-3

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
{
}