## Glue Regions

Glue Regions let you create compound objects by gluing one DMM Object to another one. Glue is applied to the intersecting parts of DMM Objects that fall inside the same Glue Region. Also, Glue Regions need to be shared by two intersecting objects for them to be glued together.

As a visual hint, the Glue Region polymeshes are applied a semi-transparent yellow color but they are not rendered (the Primary Visibility, Visible In Reflections and Visible In Refractions attributes are turned off). Just as any shape, a Glue Region can be deformed or scaled.

To create a Glue Region and assign it to the selected DMM Objects, use "DMM Asset >> Add New Glue Region to DMM Object" menu item, or use the appropriate shelf icon.

The created mesh is of the size of the bounding box encompassing the selected object. If multiple objects are selected, one Glue Region is created and assigned to all of them.

The mesh can be moved, resized, and reoriented to place it around the parts of the DMM Objects that need to be glued together. Any number of Glue Regions can be added to an object and shared between multiple DMM Objects.

If a shape other than a box is preferred for a Glue Region then any convex shape can be used. First select a polymesh, and then choose "DMM Asset >> Make Polymesh into Glue Region" menu item, or click on the appropriate shelf icon.

It is important to note that the Glue Regions define which intersecting tetrahedra of two distinct tetrahedral meshes will be glued together. If no actual tetrahedron are intersecting within a Glue Region, the region will have no effect. As a consequence, tetrahedra of two DMM Objects will be glued together only if: They overlap They have at least one vertex located in a Glue Region shared by the two DMM Objects Also, the glue might not happen is the size ratio between two glued tetrahedra is too big.

The Glue is computed on the second frame of the simulation, using the position of the tetrahedra at that frame. So it is recommended to not animate any DMM Object before the second frame. Once the Glue computed, the simulator remembers which pairs of tetrahedra are glued together and compute frame after frame using that information. The glue breaks when the two tetrahedra no longer overlap. At that point the glue information is lost. If the tetrahedra happen to intersect again during the simulation, the glue won't be recreated.

The nature of the glue can be modified by selecting the Glue Region and then by editing the extra attributes of the node in Maya's Attribute Editor. The Glue Strength attribute is currently ignored by DMM.

Tetrahedra are glued using a spring/dampener force. The initial distance between the center of masses of the tetrahedra when glued defines the rest length of the spring.
The glue is currently defined by 2 parameters. 0 maps to a default value for the Spring Constant (it's gravity times 500 which gives us 4905) and the Dampening Constant (half the Spring Constant, 2452.5).

You can find a complete explanation of spring systems with dampener on Wikipedia.

Spring Constant | How stiff the glue is: larger values mean stiffer, smaller values mean more elastic.
Dampening Coefficient | How much energy the glue dissipate as heat when under stress

Requirements for a Glue Region Needs to be convex Needs to be made of one connected component DMM Glue Regions affect DMM Objects only at the second frame. From there the simulator knows which objects are glued together. The glue is removed when the pair of tetrahedra separate, and it is not re-created if they happen to intersect again.

Gluing two object together can make them to look like their material is more stiff. This is because gluing tetrahedra together adds a new constraint between them. For example a soft object (a cushion for example) glued to a stiff one (a chair) will behave differently once glued. The glue binds some of the cushion's tetrahedra to some of the chair's which are made of a much stiffer material. So the cushion's tetrahedra can't deform as much anymore because their are tied to those of the chair.

Here is an example on how the glue can affect the behavior of an object. There are four beams, grouped in two pairs. Each pair has a Glue Region so to keep the two beams together. The red beams are glued with a stronger glue than the blue ones.

The five following screenshots show how the simulation unfolds. Because the glue is stronger on the red beams, the bond between their intersecting tetrahedra is adding more of a constraint, thus restricting their relative movement.

The DMM Scene node has a "Glue All" attribute. This global glue (also called "implicit glue") is enabled by default. So any intersecting tetrahedra from different DMM Objects are glued together. By default the implicit Glue is set with parameters that make it very weak so to not hold things together too much. The effect of Glue Regions override those of the the implicit Glue.
The parameters of this global glue are available as attributes of the Scene node. To select the active DMM Scene node, click on the "DMM Scene >> Select Active DMM Scene Node" menu item.

Next: Attaching a Surface Mesh