Source and output

Project Files

(Right-click on projects to save)
How to Compile and Run

Mesh Assembly

This sample program meshes a STEP assembly. It creates meshes for all geometry in the file, them prints the assembly structure with the positioning and mesh details. The example facets the STEP file shown below and included with the example, but you can easily change it to take any file from the command line.

The program the assembly structure and summary information about and each mesh. Set the PRINT_ALL_TRIANGLES flag at the top of the program if you would like a list of coordinates for each triangle transformed into the proper place in the assembly. In particular, if you look at the meshes for the BOLT, you can see how it is used at six different locations in the assembly.

Since this code touches all of the facets and transforms them with any assembly placements, you can adapt this code as needed to feed a display system or some other application instead of printing. In particular, the print_mesh_details() function shows how to get to each triangle in the mesh.

This code creates the meshes in parallel. The stix_mesh_make_all() function builds meshes in parallel for all solids in the file. If you don't need a mesh for everything, the stix_mesh_make() function can be used to facet a particular solid or face.