Removing Duplicated Vertices

Important Note

Outdated Version:
You are looking at an outdated documentation version for an older RapidCompact CLI distribution. If you are using a newer version of the CLI please refer to the documentation of the current CLI release version.

< previous page next page >

Within this tutorial, we are going to use RapidCompact CLI to remove duplicated vertices of a mesh. Depending on the 3D model, format and amount of duplicated vertices the resulting mesh can be much smaller or almost equal to the input mesh. For example STL files having all vertices duplicated due to the simplicity of the format (single faces); If we now export such a file to another format without removing the duplicated vertices, the result will have an unnecessary high number of vertices.

Table of Contents

Getting the Data

 back to top

To demonstrate the --remove_duplicate_vertices command we will reuse the cassini.stl model from the last tutorial. In case you need the file again you can download the cassini model here.

The model is saved in the STL format and thus does only support single indexed vertices. That means that there will be always substancially more vertices than faces and edges compared to other file formats. As you can see removing duplicated vertices with the RapidCompact CLI makes alot of sense here before exporting the file to another format. However also with cases when the input mesh has duplicated vertices for other reasons, for example from a digital sculpting with overlapping geometries, removing/merging them makes always sense for visualization and real- time purposes.

Removing the Duplicated Vertices

 back to top

At first we will import the STL file into the RapidCompact CLI and after that export it to the OBJ format:

     rpdx -i cassini.stl -e cassini.obj         

As you can see, the resulting mesh has only 25,736 faces but 77,208 vertices. Let us now make use of the --remove_duplicate_vertices command by adding the following:

     rpdx -i cassini.stl --remove_d -e cassini.obj         

The cassini.obj should now have only 15,053 vertices and thus it is more lean and much more suitable for real-time rendering or similar purposes relying on mesh optimizations.

Tip When using commands for mesh operations the RapidCompact CLI usually also supports shortcuts or shorter spellings; In this example -c and
--remove_d instead of --compact and --remove_duplicated_vertices.

< previous page next page >