How to determine whether TopoDS_Face is flat or volumetric?

Guys, I iterateTopoDS_Face of Shape in the loop. Is there any way to define, this face is flat and all of its vertices lie in one plane (for example, a face of 3d box) or is it a volumetric 3D face, perhaps a sphere sector or something like that ... How can you determine this?

Thanks

qa qa's picture

Hello Malcolm,

The following snippet gets type of face underlying surface:

  TopoDS_Shape aShape;
  TopExp_Explorer anExp(aShape, TopAbs_FACE);
  for (; anExp.More(); anExp.Next())
  {
    const TopoDS_Face& aFace = TopoDS::Face(anExp.Current());
    BRepAdaptor_Surface anAdaptor(aFace);
    anAdaptor.GetType();
  }

Method GetType will return item from GeomAbs_SurfaceType enumeration.

qaqa

Malcolm Revenge's picture

Ohh....thanks you! You save me! :-)