OCC TopExp_Explorer 用法

#include <iostream>
#include <TopoDS_Shape.hxx>
#include <TopExp_Explorer.hxx>

using namespace std;

int main()
{
  // Create a TopoDS_Shape object.
  TopoDS_Shape shape;

  // Create a TopExp_Explorer object and explore the shape.
  TopExp_Explorer exp(shape, TopAbs_FACE);

  // While there are more faces, print the face's name.
  while (exp.More())
  {
    cout << exp.Current().Name() << endl;
    exp.Next();
  }

  return 0;
}



    Enjoy Reading This Article?

    Here are some more articles you might like to read next:

  • al-folio 本地部署记录(Ubuntu 24.04)
  • C++ Traits
  • 道格拉斯-普克算法(Douglas–Peucker algorithm)
  • CMake支持库收集
  • QGC代码架构解析:飞行前检查(起飞条件)