5
$\begingroup$

How CAD programs handle displaying B-Reps and NURBS/T-Splines in their viewports? Assuming viewport uses OpenGL API - are those programs transform every object into triangles and creating/deleting vertex/index buffers when needed?

$\endgroup$
4
$\begingroup$

Depends on the CAD program. But yes basically they do just what you describe they triangulate the model into a mesh/lines on demand and then display that. How they chose to do this depends on the CAD, most modernized codebases probably use buffers. But older cads may in fact use the old immediate mode draw calls.

This said it is possible that the triangulation happens on the GPU. Though i doubt it is implemented that way in many CAD software. There are also other reasons for the CAD to triangulate the meshes, such as intersection testing, CAM path planning and export, that has nothing to do with display as such and would result in the need of implementing both a software and a gpu triangulator doubling workload or and making maintenance difficult.

Most CAD systems allow you to access the triangulated representation, through their API as well as export. But if all else fails you could just attach a debug dll to see what data the CAD dumps to the display card. So for a definitive answer ask your CAD software to tell it to you.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.