We can apply a linear forces to the muscle with the function below:
|Po - P| 1 + cos( ---------- pi ) P' = P + ( R ) (Pd - Po) t ------------------------ 2Po is the point where the force is applied, Pd is the point of attractive force, and P is every face vertex in the bounding box. The variable R defines the radius of influence, and while R should generally cover the same area as the bounding box, is a separate parameter. Singularities will appear if R is much smaller than the bounding box. Note that the Pd - Po term moves all the vertices in the bounding box and the radius of influence parallel to the vector between the point of force application towards the point of attraction. In effect, the point of attraction actually defines a plane of attraction for the bounding volume.
Not all muscles on the face apply force linearly. Sphincter muscles around the lips, for example, do not work well with this formula unmodified. For such muscles, we use the following formula:
|Po - P| 1 + cos( ---------- pi ) P' = P + K ( R ) (P - Pd) t ------------------------ 2
There are two important differences. The K term was introduced to allow the muscle to contract in one axis and expand in another, instead of a uniform contraction or expansion. The direction of motion is now defined by P - Pd, which is in the direction of the point of attraction (similar to formula 1). The reason we inverted the sign of this formula was because we felt that a positive K should denote contraction and a negative K should denote expansion, in order to be consistent with formula 2. The example on the left below shows a contracting sphincter muscle and the one on the right shows an expanding sphincter muscle: