Transform an STL Mesh


I have an STL file that I read into OCCT using RWSTL::ReadFile(). The output is Poly_Triangulation data structure. I want to be able to rotate the mesh about my custom axis. For TopoDS_Shape type we have BRepBuilderAPI_Transform but I could not find a way to transform the STL mesh - in "Poly_Triangulation" or any other format. Please suggest.

Also, is there a way to obtain a section of the STL mesh sliced by a plane, with knowledge of what part of the section is "inside of the solid geometry" and what parts or loops of sections are "outside of the solid geometry"?

Eugene Zaliznyak's picture

Hello Archak, as an idea:
const TColgp_Array1OfPnt& aNodes = aTriangulation->Nodes();
for (auto& n : aNodes)