For using the API to write any format, you need first to call the Dtk_API::StartAPI method, and the Dtk_API::StopAPI at the end.
There are two kinds of writers
The following information is generic. You can refer to writers specific chapters for prerequisites and more specifications.
To use B-Rep writers, you have to create and fill a Dtk_Body class. Dtk_Body supports Solid, Surface and Wireframe information.
Once created, you have to add a Dtk_Shell. Dtk_Shell could be :
You can add wireframe to all kinds of Dtk_Shell using AddWire() method. Faces are added using AddFace() method.
Dtk_Face can be trimmed by UV boundaries and/or 3D ones:
To trim a Dtk_Face you have to create a Dtk_Loop and add it as many Dtk_Coedge as a segment of boundaries.
Each Dtk_Coedge is based on a Dtk_Edge which is trimmed by vertice.
3D geometry of boundaries is added with AddGeom() method of Dtk_Edge.
UV geometry of boundaries is added with AddGeom() method of Dtk_Coedge.
Dtk_Coedges must be ordered in the loop.
See more information about topological classes: How to use Dtk_Body Class
See how to create geometrical classes: How to use Geometrical Classes
See how to create Dtk_mesh class : How to use Dtk_mesh Class