Within this tutorial, we are going to use RapidCompact CLI to remove invisible interior parts of a mesh. If the input model has a high amount of interior geometry, which for example CAD files often have, the resulting model will be significantly smaller than the original file, but visually identical when viewed from the outside.
Name | Type | Default | Valid Range | Quick Description |
---|---|---|---|---|
compact:removeInvisibleGeometry | Flag | false | {true, false} | remove invisible triangles after decimation, but before unwrapping |
Visibility
Name | Type | Default | Valid Range | Quick Description |
---|---|---|---|---|
visibility:ignoreTransparency | Flag | false | {true, false} | treat transparent meshes as opaque if true |
visibility:perMesh | Flag | false | {true, false} | switches visibility computation between per mesh and global |
visibility:diffusion | String | none | none, conservative | control if neighbours of visible triangles are also flagged as visible |
visibility:quality | String | default | {'default', 'fast', 'thorough', 'extreme'} | specify how fast or thorough triangle visibility should be determined |
To get started with this tutorial, we will need to have a 3D model to play with. Please go ahead and download the cassini model (courtesy of NASA), which we will use throughout the tutorial, here. The data should look like this:
To apply the culling of interior parts, which will reduce the mesh further, apply now the following command on your command line (for example, Windows PowerShell) and adjust the decimation target value to 100% for better comparison:
rpdx -i cassini.stl -s compact:removeInvisibleGeometry true -c f:100% -e result/cassini.stl
This will create a new directory called result, and the resulting STL file will be stored there. As you can see by checking the size of the resulting model, the optimized data set is a lot smaller than the original data. With an x-ray rendering, we can see the difference in the 3D mesh and interior geometry before and after the optimization. This is how the original looks like:
As you can see in the following view of the optimized model, the cassini model has some interior parts which can be removed to improve the overall polycount and thus filesize:
Note how the cube structure and other smaller interior parts were completely deleted, while other mesh-parts were partially removed.
rpdx -i cassini.stl -s compact:removeInvisibleGeometry true -c f:100% -e result/cassini.stl