Simulation Topics
=================
.. include:: physical_simulation.include.rst
.. include:: simulation_objects.include.rst
.. include:: attachments.include.rst
.. include:: collisions.include.rst
Real World Units
----------------
Ziva VFX uses real-world scientific units for most parameters:
+---------------------+----------------------------------------+
|Value | = Units |
+=====================+========================================+
|Lengths | = meters [m] |
+---------------------+----------------------------------------+
|Times | = seconds [s] |
+---------------------+----------------------------------------+
|Masses | = kilograms [kg] |
+---------------------+----------------------------------------+
|Material stiffness | = N/m :sup:`2` = Pa = kg/(s :sup:`2` m)|
+---------------------+----------------------------------------+
|Fiber strength | = N/m :sup:`2` |
+---------------------+----------------------------------------+
|Attachment stiffness | = N/m :sup:`3` |
+---------------------+----------------------------------------+
|Density | = kg/m :sup:`3` |
+---------------------+----------------------------------------+
Real world values are available for many materials, such as
`on Wikipedia `_
and `other sources `_.
.. include:: materials.include.rst
.. _sec-volume-preservation:
Volume Preservation
-------------------
Volume preservation is visually important for the simulation of solids (tissues).
Our plugin offers multiple ways to control tissue volume preservation.
First, there is the Poisson’s ratio parameter.
Poisson's ratio defines the relative change in volume under material stretching and successfully controls volume preservation under small deformations.
Mathematically, it does not apply to large deformations, although it is often used in practice for that purpose also.
Values near 0.5 cause the simulated material to act unnaturally stiff, so we don’t recommend putting Poisson’s ratio too high (e.g. stay below 0.45).
Under large deformations, our plugin can preserve volume via the volume conservation parameter.
The higher this setting, the more the tissue preserves volume.
Alternatively, the compression resistance parameter can be used to prevent compression, but permit expansion.
The compression resistance strength scales with Young’s modulus (stiffness) and typical effective values are in the 100’s and 1000’s, occasionally up to 10,000 or higher.
The volume conservation parameter is independent of Young’s modulus, and typical effective values may be 10 :sup:`2` to 10 :sup:`7` times larger than Young’s modulus.
Large values for compression resistance may cause simulation instabilities requiring more substeps or Newton iterations to resolve.
The volume conservation setting is typically more stable.
Using volume conservation or compression resistance makes it possible to simulate very soft materials.
For example, try decreasing Young’s modulus to a very small value.
With a sufficient level of volume conservation or compression resistance, you should see soft, goop-like behavior.
.. include:: muscles.include.rst
.. include:: tetmeshing.include.rst
Embedding Meshes into Tissues
--------------------------------------
The tissues in our system are simulated as tetrahedral meshes.
When you generate a tissue, its triangle mesh is automatically embedded into the generated tet mesh.
Additional Maya triangle meshes can be embedded into our tissue tet mesh, allowing you to easily update your simulation, say, if the triangle model is refined at a later stage in the production.
Our attachments, collisions and space-varying coefficients are authored on triangle mesh geometry.
Our solver then transfers these values to the tissue tet mesh.
As a result, the editing of volume data is no more difficult than painting the weights for a skinCluster.
Damping
-------
Damping is the mechanism by which objects lose energy and slow down.
Our plugin provides two kinds of damping, both adjustable in the solver node.
"Stiffness damping" primarily dampens high-frequencies (rapid vibrations, in space and/or time).
It is useful to increase stability without damping the simulation too much.
"Mass damping" is a non-physical damping, somewhat like being under water.
It slows all motions equally.
We usually set "mass damping" to zero, and use a small amount of "stiffness damping".
Note that you definitely need a small amount of damping to keep the simulation stable.
Inertial Damping
----------------
Inertial damping is a non-physical effect useful to enhance stability or handle non-physical inputs.
Inertial damping prevents tissues from ‘feeling’ inertia due to large-scale motions (all affine modes: translation, rotation, shear, and scale).
Tissues with inertial damping have no momentum from these modes.
The tissue effectively acts like a quasi-statics for these modes, but normal dynamics for higher-frequency components.
Small-scale deformations still have all of their inertia, so elastic waves travel through objects normally.
Using this, tissues can be subjected to extreme acceleration without flying themselves apart.
Enable this on the zTissue node.
This is very different from the mass and stiffness damping available on the zSolver node.
We prefer to leave this turned off until we see a specific need for it.
Animatable Inertial Frame
-------------------------
The solver node can be transformed / animated using its translate, rotate and scale attributes, in the usual Maya fashion.
If the solver node, and the bones of a creature, are transformed in unison, the space that the tissues or cloth are being solved in, will rigidly transform with the solver, canceling any inertial effect due to bone motion.
This is useful for moving simulations away from origin without incurring inertial effects.
Isosurface Triangle Mesh Creation
---------------------------------
We can create well-conditioned triangle meshes using our Isosurface Triangle mesh generator.
We use a level-set-based approach and 3D Delaunay meshing.
The input is an arbitrary Maya polygonal mesh that does not need to be closed, manifold or well-formed.
It can have cracks, duplicate faces, T-vertices, etc.
The output is a 3D triangle re-meshing of the same surface, or an offset surface.
For the offset, both positive, zero and negative values are supported.
The re-mesher can also remesh triangular meshes that do not enclose any volume -- in which case the provided offset must be greater than zero.
.. figure:: images/features3.png
:scale: 30 %
:alt: features3 image
Above: A long muscle meshed with the isomesher.
All the angles in the output triangulation are equal or greater than 30 degrees (unless manifoldness of the output surface is enforced, below).
The output of this node is a Maya mesh.
As such, it is independent of our solver, and can be used for any purpose in Maya.
The re-mesher does not assume that the input mesh is manifold or well-formed.
It can work with arbitrary “polygon-soup meshes”, including one-sided surfaces and surfaces with holes.
The remesher can be used to fill holes in non-watertight geometry and to create a good-looking surface matching the input geometry.
In the context of our plugin, the remesher can be used to create a well-formed mesh to serve an input to tissue creation.
The output of this node also provides a good starting point for Delaunay Tetrahedralization.
The parameters to the remesher are the level-set value to mesh (the “isoValue”), the target size of the output triangles, and the level-set resolution.
The isoValue is specified in scene units, and can be positive, zero, or negative.
Zero and negative values only make sense when the input object represents a solid volume.
In such cases, the zero isosurface will effectively remesh the input surface.
A negative value will effectively “shrink” the object, whereas a positive value will enlarge it.
If the input is not a closed volume, then the zero (or negative) isosurface will be empty.
The triangle size is specified in dimensionless units, where 1.0 is a default triangle size.
This parameter controls the size of the output triangles.
For example, if you set it to 2.0, you can expect the output triangles to be approximately 2x larger than with 1.0.
The larger the value, the coarser the mesh.
Conversely, the smaller the value, the smaller the mesh, and the longer the running time.
The resolution controls the resolution of the internal level set representation.
This controls what geometric features are visible to the method.
Increasing the resolution will cause the output mesh to respect input detailed features more closely, at the cost of more memory and computation.
In many cases, the output of the remesher is a manifold surface.
When it is not, the produceManifoldMesh parameter, if enabled, applies a post-processing step that attempts to make the mesh manifold by removing hanging faces and performing edge collapses.
You can disable this post-processing by turning produceManifoldMesh off.
The Delaunay 3D tet mesher needs a manifold mesh as input.
A demonstration of isomeshing is available in the
Built-in demo "Isomesher" (on the Ziva Tools menu).
Thread Management
-----------------
Our solver automatically uses threading to accelerate the computation.
The amount of threading is controlled using the Maya multithreading settings (e.g. the threadCount command).
The mesh and the problem must be sufficiently large (e.g., at least a few hundred tets) to see any advantage from multithreading.