For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings

 

Need to speed up your development?
Have a look at our:

Samples & Tools

 

Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

How to determine whether TopoDS_Face is flat or volumetric?

Malcolm Revenge's picture
Forums: 

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! :-)