# Model Generation : Cleaning 3D models with MeshLab

&#x20;**3D Mesh Changes in MeshLab**

1. Open MeshLab and load in the mesh: File → Import Mesh → *\[Select your mesh]*
2. To clean up your mesh, apply tools in *Edit* or *Filters*. Some very useful filters include:
   * Filters → Cleaning and Repairing → Remove Isolated (wrt Diameter)
     * Adjust the max diameter percentage until artifacts are removed.
     * Clean any undesired artifacts smaller than the desired final mesh.

       ![](https://lh5.googleusercontent.com/vuhQeo5UCBV3SPj8mMtMnD2dddZNJitqU8tf4M0SEqKJ5xhq9X7VRBpqFhIgVygmimKOMtSQCtagkZiPZgGUTUQ2fokPbix-UXG_rTwHPGuG0dX-s4N25tRdUu6rXnMMtpmAgnlu)
   * Filters → Remeshing, Simplification and Reconstruction → *Simplification: Quadric Edge Collapse Decimation*&#x20;
     * Reduce the vertex count of the mesh for reduced file size.
     * Adjust the  *Percentage reduction* parameter to simplify the mesh. Because this is a percentage, it’s helpful to begin with a larger value to be preserved (e.g. 0.8) and work down from there. The current vertex count can be viewed in the bottom right (purple window).
     * Click  ***Apply*** to simplify the mesh accordingly.

![](https://lh3.googleusercontent.com/eyp6Y4jWI5HCItPPfp4Rg2VsXpVZ16fnT55YLkJRZ2AsbQbvvsRMm2-KGSqIEZe7dxNdLp5eKdA3Nz7qTIgZxO7nKG6sAiZBNdR8DOZt3Ky5yMPTnHhCVGHg7AMs70YkV2gX4faw)

&#x20;    3\. To save the final mesh:

1. 1. File → Export Mesh As
   2. Select .obj at the bottom of the popup menu and select your desired directory.

&#x20;    4\. If your mesh contains unconnected parts that you want to export separately:

1. 1. Make sure the *Layer Dialog* is toggled on and find your mesh (there should only be one for now).

      ![](https://lh5.googleusercontent.com/2I3tQvo3d6d9raJmaEJScg3zOMCkcxpdWUX1jofy3cBGbeXhd3IQlF7D3mhXGMuN_uIwlKULqm08epzsEAQzRMyTqK2zEtLfipw_z47pz8SQOcn3hp7Ro_o19HQtirCY_CTV4de_)
   2. Right-click on the mesh name and click  ***Split*** ***in Connected Components*** in the drop-down.

      ![](https://lh4.googleusercontent.com/diz2W-gX4YI3J2bHKXVNGXd0xTOgh9UbxpxLPXOwUxj-aeEAXx_DJy8F8gq-l6EyNzac-jB4tsZ-t_mRte25BM0iW31ebZySmrxaMNI3zjk6HSIfNlpEf2pmARLSPqEJEXMaitbc)
2. 1. &#x20;***IMPORTANT:***  If your 3D Slicer OBJ contains a lot of artifacts (they usually do), make sure you followed step 2a. properly. If not, all artifacts will be separated into individual meshes, which may crash the program.
   2. Select each separated piece of the mesh and export them individually as described above.

&#x20;    5\. Congratulations, you now have a clean, segmented mesh!


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://gitbook.brown.edu/xromm/model-generation/xromm-cleaning-3d-models-with-meshlab.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
