Turning facets to faces
One straightforward approach to "reverse engineering" is the direct conversion of mesh facets to the corresponding B-rep entities (i.e., CAD faces). Although such a conversion is incapable of generating curved surfaces, it still has its application areas, especially if the following stars align:
- Your mesh is a perfect faceted representation of a solid object without any noise and outliers.
- You need to convert your geometry to a more suitable format, e.g., switch from STL/OBJ to STEP.
Besides unlocking the data translation workflow (some applications could not work with mesh files, only with real CAD formats, such as STEP, IGES, SAT, XT, etc.), turning meshes to solids allows for running modeling operations, such as Booleans, for example. A typical workflow is then:
- Load a mesh (STL) file.
- Turn facets to faces.
- Maximize faces (unite all planar regions).
- Run whatever modeling API (e.g., drill a hole with Booleans).
- Save the final model to a CAD format (e.g., STEP).
The following image illustrates a "good" mesh model for conversion.
Use the following sequence of Tcl commands to turn facets to faces and maximize them into larger planar regions:
> convert-to-brep > maximize-faces
The convert-to-brep command brings you a conventional CAD model that you can export to a STEP file and continue using in your downstream workflows.