Draw in a generic opengl context without triangulation

Hi, is possible to draw a topods_shape (or it graphic3d_structure) in another opengl context without triangulation? that is, is possible to draw something using same drawing method but without the viewer? (using directly the opengl_graphicdriver).

Steve Lockley's picture

Yes, you can mesh the shape with BRepMesh tools to get the triangles and then use the OpenGL tessellator to render however you wish.

ACCA's picture

thanks for the answer,
but the is a method for utilize the drawing function of open cascade and draw in a generic opengl context? the only solution is to triangulate the shape?

Steve Lockley's picture

Sorry I may have confused your problem a little.
I thought you wanted to draw a TopoDS_Shape without using OpenCascade drawing tools. You can do this but you still have to triangulate. I use the OpenGL triangulation algorithms to do this, these obviously integrate well with OpenGL drawing functions. However, they are easy to use only if your shapes are planar faces with linear edges but if you have curved edges things get more complicated.