TITLE: 3D Mesh Cleanup Tutorial: Fossil Crab (Advanced)
AUTHORS: Elizabeth G. Clark, Kelsey M Jenkins, Craig R Brodersen

[DESCRIPTION]
This protocol details about 3D mesh cleanup tutorial of fossil crab (Advanced).

[GUIDELINES]
Skills developed: Advanced mesh editing 

3D meshes of fossil specimens extracted directly from 3D imaging data often need post-processing to be useful for paleontological analyses. Here, we present the workflow that was used to digitally process Cretapsara athanata (Luque et al. 2021), the most complete fossil crab ever discovered, as a tutorial. This tutorial uses two pieces of software: the opensource mesh editing program Meshlab (Meshlab.net) and the 3D modeling software Autodesk Maya (autodesk.com/products/maya) that can be downloaded for free by students or through an institutional subscription. It is highly recommended that the first two tutorials in this series are completed before beginning this one. Note that this tutorial utilizes Meshlab 2021.10 and Autodesk Maya 2017, and other versions may have slightly different layouts and functions.

  
When the digitized fossil crab was first exported as a mesh from the 3D processing software, a number of common issues were evident. The right eye is missing, a leg is detatched, tips of the claws are floating, isolated faces, and debris surround and abut the specimen. This tutorial will walk through how to rectify these issues. 


[STEPS]
SECTION: Skills developed: Advanced mesh editing
1. Import the crab into Meshlab by following Part 1 in the Cupule Cleanup Tutorial. 

  

SECTION: Remove External Debris
2. The imported mesh includes the crab, but it also includes other small isolated meshes that are 3D reconstructions of bits of the matrix. Remove this external debris by running a filter that removes small isolated mesh particles. 
Go to Filters > Remeshing, Simplification and Reconstruction > Remove isolated pieces with respect to face number. 

  

SECTION: Remove External Debris
3. This option may be under “Cleaning and Repairing” in other versions of the software. As the 3D mesh of the crab is a large connected mesh with a relatively high number of faces, start by removing meshes with a relatively small number of faces (e.g., 200) and increase incrementally (e.g., by 50-500) until the bulk of the isolated extraneous mesh pieces are removed.

 
   

SECTION: Remove External Debris
4. The scene still contains a few relatively large bits of extraneous isolated meshes. To select and delete these faces manually, first click on the Interactive Selection tool in the top right of the icon-based menu. 

  
   

SECTION: Remove External Debris
5. Hold left click and drag your cursor to select faces. 
 

To add faces to your selection, hold command (Mac) or ctrl (PC) while you left click and drag. To delete faces from your selection, hold shift while you left click and drag. 

  

SECTION: Remove External Debris
6. Delete these faces by deselecting the Interactive Selection tool and selecting“Delete Selected Faces and Vertices” on the right of the icon-based menu.
  
  
  

SECTION: Remove External Debris
7. 
Next, repeat these steps to select and delete the small, rounded pebbles that are touching the crab mesh. 
 
    
SECTION: Fill Holes
9. Clean up the mesh by selecting Filters > Remeshing, Simplification and Reconstruction > Repair non Manifold edges. Select Remove Faces and click Apply. 
SECTION: Fill Holes
11. Close holes that formed in the crab mesh during the deletion of articulating debris by selecting Filters >Remeshing, Simplification and Reconstruction > Close Holes. Set “Max size to be closed” to 500 and select Apply. Alternatively, holes can be patched via the sculpting method described in the previous tutorial.

  

   

SECTION: Fill Holes
12. Deselect everything by selecting Filters > Selection > Select None. 
SECTION: Shrinkwrap surface
13. Now, we’re going to shrinkwrap a copy of the crab mesh to fill the leftover holes and smooth the surface of the crab. 
The first step to do this is to hollow out the inside of the mesh. Duplicate the mesh and select Filters > Color Creation and Processing > Ambient Occlusion. Keep default settings selected click “okay” on the popup window. This tags the external faces white and internal faces dark. 

SECTION: Shrinkwrap surface
15. Select Filters > Remeshing Simplification and Reconstruction > Surface Reconstruction: Screened Poisson.

  

SECTION: Shrinkwrap surface
16. Check “Pre-Clean” and click Apply.

  

SECTION: Shrinkwrap surface
17. This new version of the mesh has filled holes and a smooth surface; however, some detail has been removed. Merge the new Poisson mesh with the mesh saved previously by making these two meshes visible and hiding any others by selecting the eye icon. 

  

SECTION: Shrinkwrap surface
18. Right click one of the meshes and select “Flatten Visible Layers” to create a merged mesh. Keep default settings selected.

  

SECTION: Shrinkwrap surface
19. Save this mesh by selecting File > Export Mesh. Name the file “Body remesh.” A new pop-up window will appear. Select “none” in the bottom left corner and click “OK.”
SECTION: Repair Missing Features: Eye
20. To simplify your scene and get rid of unwanted meshes, close and restart Meshlab. Reopen Crab before.obj in Meshlab.
SECTION: Repair Missing Features: Eye
21. Position the left eye of the crab at the center of the project window by holding Command (Mac) or ctrl (PC) and dragging the mesh, or holding down the scroll wheel and dragging on a mouse.

  

SECTION: Repair Missing Features: Eye
22. Zoom in using the scroll wheel on the mouse. 
SECTION: Repair Missing Features: Eye
23. Select the eye using the Interactive Selection tool (
  
). 

  

SECTION: Repair Missing Features: Eye
24. Select everything except for the eye by selecting Filters> Selection> Invert selection. Check both Invert Faces and Invert Vertices, and click “Apply.”All of the mesh components except those of the eye will be selected in red.

  

SECTION: Repair Missing Features: Eye
25. Delete selected faces and vertices 
  

SECTION: Repair Missing Features: Eye
26. Shrinkwrap the eye. Perform the ambient occlusion filter and delete the internal vertices. Save this mesh by duplicating it. (See “Shrinkwrap surface” section for details.)
SECTION: Repair Missing Features: Eye
27. Apply the Surface Reconstruction: Poisson Remesh. Enter 4 into the “Reconstruction Depth” window. 
SECTION: Repair Missing Features: Eye
28. Merge the two meshes of the eye created here. Perform a Poisson Remesh of this new mesh: enter 5 into the “Reconstruction Depth” window. Export the file as “Eye remesh.”
SECTION: Repair Missing Features: Leg
29. Close and restart Meshlab. Import and merge “Body remesh” and “Eye remesh”.
SECTION: Repair Missing Features: Leg
30. Select the leg that's isolated from the rest of the body. 
SECTION: Repair Missing Features: Leg
31. Copy the mesh. 

  

SECTION: Repair Missing Features: Leg
32. From the original mesh, invert the selection and delete the rest of the body.
SECTION: Repair Missing Features: Leg
33. Export this mesh “Leg remesh.”

  

SECTION: Repair Missing Features: Leg
34. In the copy of the mesh, delete the leg. Export this mesh as “Crab body and eye remesh”.

  
  

SECTION: Reposition and combine meshes
35. Open Maya.

  

SECTION: Reposition and combine meshes
36. Import “Crab body and eye remesh.obj” and “Leg remesh.obj” into Maya by going to File > Import and selecting these files. 

  

SECTION: Reposition and combine meshes
37. Click “A” to view all imported files. To rotate through the scene, hold “Alt” and left click while dragging the cursor.
SECTION: Reposition and combine meshes
38. On the lefthand side of the screen, there are tools for moving, rotating and scaling the objects within the scene.

  

SECTION: Reposition and combine meshes
38.1. One of them is the transform tool:
  

SECTION: Reposition and combine meshes
38.2. And another is the rotation tool:
  

SECTION: Reposition and combine meshes
39. Click on the leg, and use these tools to transform and rotate the leg to reattach it to the body of the crab. 

  

SECTION: Reposition and combine meshes
40. Now, we’re going to make a copy of the left eye to use as the right. 
SECTION: Reposition and combine meshes
41. Reopen “Crab body and eye remesh.obj” in Meshlab.

  

SECTION: Reposition and combine meshes
42. Select the eye. 

   

SECTION: Reposition and combine meshes
43. Invert selection and delete the body, leaving only the eye. 

  

 

SECTION: Reposition and combine meshes
44. Export mesh as “Eye remesh 2.obj”.
SECTION: Reposition and combine meshes
45. Import “Eye remesh 2.obj” into Maya.

  

SECTION: Reposition and combine meshes
46. To mirror the eye, first, select the scale icon on the left:
  

SECTION: Reposition and combine meshes
47. Click the icon to the right of the X, Y, Z in the first icon-based menu at the top of the screen and set to “Relative transform”.
  

SECTION: Reposition and combine meshes
48. Type -1 into the Z box and push “Enter”.
SECTION: Reposition and combine meshes
49. Select the newly mirrored eye and move to the correct location on the crab using the transform and rotate tools. 
 


  

SECTION: Reposition and combine meshes
50. Next, select all mesh components by clicking the selection icon, holding left click and dragging the cursor over all of the objects. Command A also works. 
SECTION: Reposition and combine meshes
51. Select Mesh – Combine in the first menu at the top to merge all mesh components together. 

  

SECTION: Reposition and combine meshes
52. Repeat the Repair Missing Elements protocol for the eyes to fix the tip of the claws and legs. Congratulations on making a beautiful crab! 
SECTION: Remove External Debris
8. Duplicate the mesh by right clicking the file name and selecting “Duplicate the Current Layer.” Select the eye icon on the original layer to toggle visibility so you can see deletions on the new layer more clearly. You may wish to delete extraneous mesh little-by-little as you are just beginning, as opposed to all at once (as shown in the image below). 

  
  

SECTION: Fill Holes
10. Then, remove small isolated pieces that might have been formed during previous steps repeating Filters > Remeshing, Simplification and Reconstruction > Remove isolated pieces with respect to face number. Save this mesh layer by duplicating it. 
SECTION: Shrinkwrap surface
14. Next, select Filters > Selection> Select by Vertex Quality. Check preview selection. Move the sliders to set Min and Max to optimize the highest number of internal faces and minimal external ones (e.g., Min at 0 and Max at 0.132944) (review cupule tutorial for details). Click “Apply.”