## Attaching a Surface Mesh

A deformed surface mesh is the visible part of a DMM Object. A Surface Mesh is "attached" to a DMM Object to allow it to be deformed and fractured as part of a DMM Object. The Surface Mesh should be completely inside the DMM Object Tet Mesh before it is attached. However if the object won't be breakable some amount of the surface mesh can stick out without causing a problem.

DMM deforms the vertices of the surface mesh. If the Surface Mesh does not have sufficient vertices, it will not deform well. More vertices may need to be added. Setting surface mesh preparation as breakable clips surface mesh so it adds more surface vertices. The breakable flag is set via the DMM Asset Manager or the attributes of the Prepare Mesh node (PrepMesh). This node can be selected by clicking on "Clipping Settings".

Note: By default the Surface Mesh is set as breakable. When the Input Surface Mesh is a separate mesh (it's not the same mesh as the Tet Cage) there is one benefit of having it as non-breakable: by not running the surface mesh preparation, you can avoid the creation of a large number of extra vertices. In this case the material needs to be adjusted to make sure that the object doesn't break or bend much, otherwise some visual artifacts might occur.

Setting the prepared mesh to breakable also creates inside faces that will be shown when object breaks. This is why a breakable object needs to have water tight and manifold surface mesh.

A polymesh can be checked to make sure that it will work as an attached Surface Mesh. The "DMM Asset >> Verify Polymesh" menu item will check the mesh and highlight any problem faces.

Maya materials can be assigned to a surface mesh or any face of a Surface Mesh before attaching it to a DMM Object, and the material assignments will be reflected in the simulated surface mesh after attachment. If you change the Maya materials of the input surface mesh after it is attached, make sure you modify the Input Surface Mesh, and not the simulated one (the Output Surface Mesh). Once the changes made, you must select "Edit DMM->Refresh Surface Mesh" menu item for the material change to be reflected in the simulated (output) mesh.

For breakable DMM objects (objects with the prepare mesh breakable flag on):

- If the object has one Maya material, that material is used for the outer faces and the inner faces.
- If the object has more than one Maya material, the least used material is assigned to the inner faces, any outer face with the least used material is reassigned the most used material for the simulation (output) mesh.

So to assign a Maya material to the inner faces, make sure to select a face of the Input Surface Mesh that is assigned the most used Maya material and then assign it the Maya material for the inner faces. The most used Maya material for an object is the Maya material that is assigned to the highest number of faces of the Input Surface Mesh.

Requirements for an Input Surface Mesh Need to be watertight Can have more than one component Can have convex and non convex faces (if it is not splinterized) Can have non-planar faces (to some degree if it is not splinterized) Can be an instance If the DMM Object is breakable, the parts of Surface Mesh sticking outside the Tet Cage will be clipped off. If not breakable, they won't be clipped off, but the further outside the piece of the surface mesh is, the more it will deform in unexpected ways as the Tet Mesh deforms. If the DMM Object is not breakable, the Input Surface Mesh doesn't have to be watertight. If the object is breakable and not watertight (and not splinterized), normal interior faces are not computed. Instead, for every surface triangle that is generated, a back face is generated. So, the result is a thin "shell". The reason that back faces are generated is so that pieces won't seem to just disappear when the object breaks. Note: The surface mesh may contain internal cavities.

Next: Setting Physical Materials