DMM Object Creation Overview

Introduction

The purpose of this document is to give a quick overview for the creation of DMM objects. A DMM object is something that is not only simulated by the DMM middleware but also renderable by the display mechanism a game engine or 3D environment simulator. Typically an object already exists a 3D polygonal surface mesh and one wishes it to behave as an object would in the real world. This surface mesh can be "converted" to a DMM object then combination of the DMM simulator and the rendering system augmented with DMM "support" will allow the object to deform and fracture in a realistic way.

What DMM Object Consists Of

A DMM object is described by a tetrahedral mesh, a set of physical properties, and a "prepared" surface mesh. The tetrahedral mesh and the physical properties are the only part of the object that the DMM simulator deals with. It knows nothing at all of surface meshes. The deformation and display of the surface mesh is part of the DMM support runtime that runs completely outside the simulator.

The tetrahedral mesh, which is the basis for the finite element methods that the simulator uses, can have different material properties for different parts of it. The resolution of the material properties is a single tetrahedron. So a DMM object will have a "default" set of properties for the whole mesh with optional other properties for regions of the mesh.

The DMM simulator support "gluing" of different tetrahedral meshes together to form a compound DMM object. Gluing can be done on a tet (tetrahedron) by tet basis, but is usually done by specifying what glue group an object is in and gluing any overlapped tets of objects in the same glue group.

The DMM authoring pipeline consists of a set of tools to create tetrahedral meshes and to prepare surface meshes. The creation of surface meshes is not part of the pipeline. Any tradition 3D authoring tool is sufficient for that job.

The Tetrahedral Mesh

A tetrahedron is the simplest possible pyramid. It consists of a triangle base and a forth vertex above the base. The forth vertex is attached to the base by 3 triangles. So a tetrahedron has 4 sides, which are triangles, and four vertices. A tetrahedral mesh is a set of tetrahedrons that are attached by sharing faces. Because a tetrahedron describes a volume, so does a tetrahedral mesh.

It is worth noting that the surface of a non-intersecting tetrahedral mesh is always a manifold triangle mesh. The tools that support creation of a tetrahedral mesh always create a triangle surface mesh first. The inside of this mesh is then "filled in" with additional vertices to create a volumetric tetrahedral mesh. It is important for the purposes of accurate simulation, nice deformation, and good looking fracture that the tetrahedrons be reasonably equilateral and not have faces that line up in obvious patterns.

Creating a Good Triangle Mesh

The surftriutil or the surtri library can be used to triangulate a polygonal mesh. Each face of the mesh is triangulated using the Delaunay criteria. Basically the circumcenter of each triangle contains no other vertices than the three triangle vertices that are, in fact, exactly on the circumcenter. The area of the triangles is specified as a parameter and so directly effects the density of the resulting triangle mesh. The original polygonal mesh should engulf the objects surface mesh; no parts should stick out. surftiutil (and the surftri library) are very well suited for polygonal meshes with large faces compared to the desired triangle area. Since all vertices from the original mesh are used in the triangle mesh, large polygons give allows surftri to create nicely shaped triangles by adding vertices on the face. Relatively small polygon faces will not have any vertices added when triangulated and surfti does not have the chance to form nice triangles.

Examples:

| create a triangle mesh from polygonal mesh "input.obj" with maximum triangle area of 1 and smallest triangle angle of 10 degrees

surftriutil input.obj 1 10

| create a triangle mesh from polygonal mesh "inputb.obj" with maximum triangle area of .25 and smallest triangle angle of 20 degrees

surftriutil inputb.obj 0.25 20

Surftri's weakness is seen on objects with small faces relative to the triangle size desired. An example problem object would be a sphere with a lot of faces to display nice curvature. The better utility to use in the case of curved surface representations and other polygonal meshes with small faces is autotetutil (the library version is autotet). autotetutil does not require the step of creating a polygonal mesh that engulfs the objects surface mesh. It creates a triangle mesh that engulfs a source object surface mesh. Like surftiutil the maximum triangle area is specified. Additionally a gap distance is specified to choose how tightly the triangle mesh should wrap the object surface mesh. There is also an optional smoothing parameter to specify how smooth or sharp the triangle mesh should be at points of curvature. Smooth values go from 0.1 to 10 with 1 being the default and .1 being the most smooth and 10 being the most sharp.

Examples:

| create a triangle mesh around polygonal mesh "surface.obj" with maximum triangle area of 1 and and an offset distance of 0.25

autotet surface.obj 0.25 1

| create a triangle mesh around polygonal mesh "surface.obj" with maximum triangle area of 0.3 and and an offset distance of 0.1 and a smoothing factor of 1.3 (sharper than default)

autotet surface.obj 0.1 0.3 -smooth 1.3

After creating a nice triangle surface mesh, a tetrahedral mesh is easily created with netgentest (or the netgenmesh library). netgentest adds vertices where required to meet the maximum height for a tetrahedron specified and connects the vertices to form a tetrahedral mesh (or "tet mesh" for short). The surface of the tet mesh is exactly the input triangle mesh.

Example:

| create a tetrahedral mesh from triangle mesh "input.obj" where the tetrahedrons have a maximum height of 0.5 (fineness is 1 and not second order)

netgentest input.obj 0.5 1 0

If an object is not visible, but only used for collisions, for instance, then the tet mesh is all that is required (along with an assigned physical material of course). For visible DMM objects, a surface meshed needs to be "prepared" and the tet mesh is an input for that preparation.

Preparing a Surface Mesh

The DMM simulator works on tet meshes. Tet mesh node positions are used to deform and "fracture" visible surface meshes. In order to use a tet mesh to deform a surface mesh, each vertex in the surface mesh must be assigned to the appropriate tet that will control its position. In the case of breakable objects, the surface mesh must be clipped at break points (all possible break points). Also, the resulting holes caused by clipping must filled to give the illusion that the surface mesh represents a solid object. These holes are filled with additional triangles referred to as "inner surfaces."

The preparemeshutil utility or the preparemesh library is used to create a prepared version of a surface mesh. The resulting prepared surface mesh has its per vertex information augmented with tetrahedron assignment. In the case of breakable objects, the prepared mesh has additional vertices added at the points where the original faces were clipped. The prepared mesh also has "inner surface" triangle faces to augment the the original faces.

Examples:

| create a prepared version of a surface mesh, surface1.obj, using tet mesh tet1.vtm. The object is deformable but not breakable

preparemeshutil tet1.vtm surface1.obj -n

| create a prepared version of a surface mesh, surface2.obj, using tet mesh tet2.vtm. The object is deformable but not breakable but where the original surface mesh does not have enough vertices to provide for good deformation. So clip to provide extra vertices.

preparemeshutil tet2.vtm surface2.obj -s

| create a prepared version of a surface mesh, surface3.obj, using tet mesh tet3.vtm. The object is deformable and breakable.

preparemeshutil tet3.vtm surface3.obj

Splinters

In the previous examples of preparing a surface mesh for fracture, the surface mesh was clipped by the tet mesh in order to create a "breakable" mesh. This leads to triangular looking breaks. These look OK for crystalline type materials but not so good for wood or rock or other non-crystalline materials. It is possible to specify the shapes of breaks. This is done through the use of splinters. Specifically by specifying a "splinter cage" when preparing a surface mesh.

I splinter cage is a polygonal mesh made of of watertight cells. Separate watertight meshes can simply be combined into a single mesh, and the resulting mesh is a perfectly good splinter cage. In general the cells must be convex or close to convex. However if a cell can be considered an extrusion of a 2D shape, then it can be non-convex. If a cell cannot be considered an extrusion of a 2D shape and it is non-convex, the convex hull of the cell will be used as the splinter shape.

The splingenutil utility (and the SplintGen library) can be used to create a splinter cage from a set of one or more 2D texture maps. Dark areas of the texture maps are treated as edges and are extruded to become faces in 3D. When more than one texture map is used each map defines a layer of the splinter cage.

The utility splintprep is prepares a surface mesh to be a breakable object with splinters. The splinterizer library can be used to clip a surface mesh for breaking followed by a call to the preparemesh library to finish the surface preparation by doing the tet ID assignments. In case of a splinterized object, each surface vertex gets to tet IDs assigned. One for before fracture occurs and one after.

Example:

| create a prepared version of a surface mesh, surface1.obj, using tet mesh tet1.vtm and splintercage splinter1.obj. The object is deformable and breakable with splinters.

splintprep surface1.obj splinter1.obj tet1.vtm