
Thu, 01/29/2015 - 06:24
Forums:
Hello,
I'm new to OpenCascade and would like to convert a loaded shape (TopoDS_Shape, AIS_Shape,) to a polygon representation that I can inspect / export?
I've been able to project a shape onto a plane (using Prs3d_Projector, HLRBRep_HLRToShape), but I'd like to also get it's polygonal representation.
Thanks,
Ben
Thu, 01/29/2015 - 15:18
Hi Ben,
Do you mean the mesh for the TopoDS_Shape?
Best Regards,
Shing Liu
Thu, 01/29/2015 - 22:04
Shing Liu,
I think that describes what I'm trying to do.
I'm trying to get a wireframe (or polygonal) representation of the imported CAD file.
The application I'm writing doesn't support CAD files directly (STEP, IGES), so I'm trying to get them into a representation that I can handle such as vertices and polygons/faces/mesh.
All I currently need from the CAD file is the outline in X/Y plane. I've been able to project an imported IGES disc object onto the X/Y plane. See the attached image of the disc before and after projected onto the X/Y plane. I need the outline vertices (for the red projected disc).
Any help is greatly appreciated. I'm very new to OpenCascade.
Thanks,
Ben
Thu, 01/29/2015 - 23:51
I'm noticing some example source that will likely help:
occ-install-dir/samples/mfc/occtdemo/Tesselate
These examples didn't get built by default using custom.bat/msvc.bat, so I didn't initially notice it.
Sat, 01/31/2015 - 12:25
Hi Ben,
If you just want to display the outline of a shape, I think you can explorer the Edges of the shape, and get the representation data from an Edge by:
Handle_Poly_Polygon3D aPolygon = BRep_Tool::Polygon3D(const TopoDS_Edge &E, TopLoc_Location &L);
then project the aPolygon points into XOY plane.
Best Regards,
Shing