Removing Duplicated Vertices

 
< 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.

Update 3.x The --compact function now already contains the --remove_d command thus making it redundant in this context. Also "--remove_d" will be automatically used when importing an .stl file.

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 47,918 faces but 143,754 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 26,138 vertices and thus it is more lean and much more suitable for real-time rendering or similar purposes relying on mesh optimizations.

Note however that in 3.0 the result will loose its UV Coordinates if the input uses any. In this case simply use the "--compact" function if you want to optimize or simply import an .stl file and export it into another format such as .obj to get rid of the duplicated vertices. This behaviour is subject to change with version 3.1, so that removing duplicated vertices does not has any effect on the UV coordinates.

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 >