artisynth.core.femmodels
Class FemContactConstraint

java.lang.Object
  extended by artisynth.core.mechmodels.DeformableContactConstraintBase
      extended by artisynth.core.mechmodels.DeformableContactConstraintGeneric
          extended by artisynth.core.femmodels.FemContactConstraint
All Implemented Interfaces:
DeformableContactConstraint

public class FemContactConstraint
extends DeformableContactConstraintGeneric


Nested Class Summary
 
Nested classes/interfaces inherited from class artisynth.core.mechmodels.DeformableContactConstraintBase
DeformableContactConstraintBase.CompInfo, DeformableContactConstraintBase.FrameInfo, DeformableContactConstraintBase.PointInfo
 
Field Summary
 
Fields inherited from class artisynth.core.mechmodels.DeformableContactConstraintBase
BODY_FACE, EDGE_BODY, EDGE_EDGE, VERTEX_BODY, VERTEX_FACE
 
Constructor Summary
FemContactConstraint()
           
FemContactConstraint(FemMeshVertex v0, FemMeshVertex v1)
          Creates a new contact constraint identified by three vertices.
FemContactConstraint(FemMeshVertex v0, FemMeshVertex v1, FemMeshVertex v2)
          Creates a new contact constraint identified by three vertices.
FemContactConstraint(Vertex3d... vtxs)
          Creates a new contact constraint identified by three vertices.
 
Method Summary
 void getAuxStateOld(DataBuffer data)
           
 int numMyVertices()
           
 int numVertices()
           
 void setAuxStateOld(DataBuffer data, FemModel3d model, PolygonalMesh mesh0, PolygonalMesh mesh1, Collidable otherComponent)
           
 void setBodyFace(Vector3d nrml, double mu, FemMeshVertex v0, FemMeshVertex v1, FemMeshVertex v2, double w0, double w1, double w2, Vertex3d vbody, RigidBody body, Point3d loc, double wrb)
          Sets the constraint for rigidBody-deformable node-face contact
 void setEdgeBody(Vector3d nrml, double mu, FemMeshVertex v0, FemMeshVertex v1, double w0, double w1, RigidBody body, Point3d loc, double wrb)
          Set the constraint for a deformable-rigidBody edge-edge contact.
 void setEdgeEdge(Vector3d nrml, double mu, FemMeshVertex v0, FemMeshVertex v1, FemMeshVertex v2, FemMeshVertex v3, double w0, double w1, double w2, double w3)
          Set the constraint for a deformable-deformable edge-edge contact.
 void setEdgeEdge(Vector3d nrml, double mu, FemMeshVertex v0, FemMeshVertex v1, Point3d loc1, double w0, double w1, Vertex3d v2, Vertex3d v3, Point3d loc2, double w2, double w3, DeformableCollisionData otherData)
          Set the constraint for a deformable-deformable edge-edge contact.
 void setFace(Face f)
           
 void setVertexBody(Vector3d nrml, double mu, FemMeshVertex v0, double w0, RigidBody body, Point3d loc, double wrb)
          Set the constraint for a deformable-rigidBody node-face contact.
 void setVertexFace(Vector3d nrml, double mu, FemMeshVertex v0, double w0, Vertex3d v1, Vertex3d v2, Vertex3d v3, Point3d loc2, double w1, double w2, double w3, DeformableCollisionData otherData)
          Set the constraint for a deformable-deformable node-face contact.
 void setVertexFace(Vector3d nrml, double mu, FemMeshVertex v0, FemMeshVertex v1, FemMeshVertex v2, FemMeshVertex v3, double w0, double w1, double w2)
          Set the constraint for a deformable-deformable node-face contact.
 void skipAuxState(DataBuffer data)
           
 void skipAuxStateOld(DataBuffer data)
           
 
Methods inherited from class artisynth.core.mechmodels.DeformableContactConstraintGeneric
clearVertices, equals, getVertices, hashCode, print, setEdgeEdge, setEdgeRigidBody, setFaceRigidBody, setVertexDeformable, setVertexFace, setVertexRigidBody, setVertices, toString
 
Methods inherited from class artisynth.core.mechmodels.DeformableContactConstraintBase
addConstraintBlocks, addFrame, addFrictionConstraints, addPoint, beginSet, componentsChanged, endSet, getAuxState, getDerivative, getDistance, getFriction, getImpulse, getNormal, getSolveIndex, isActive, isAdded, isControllable, numFrames, numPoints, printConstraintInfo, setActive, setAdded, setAuxState, setBodyFace, setDistance, setEdgeBody, setEdgeEdge, setFriction, setImpulse, setSolveIndex, setVertexBody, setVertexFace, updateFriction
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FemContactConstraint

public FemContactConstraint()

FemContactConstraint

public FemContactConstraint(FemMeshVertex v0,
                            FemMeshVertex v1)
Creates a new contact constraint identified by three vertices.


FemContactConstraint

public FemContactConstraint(FemMeshVertex v0,
                            FemMeshVertex v1,
                            FemMeshVertex v2)
Creates a new contact constraint identified by three vertices.


FemContactConstraint

public FemContactConstraint(Vertex3d... vtxs)
Creates a new contact constraint identified by three vertices.

Method Detail

setFace

public void setFace(Face f)

setEdgeEdge

public void setEdgeEdge(Vector3d nrml,
                        double mu,
                        FemMeshVertex v0,
                        FemMeshVertex v1,
                        FemMeshVertex v2,
                        FemMeshVertex v3,
                        double w0,
                        double w1,
                        double w2,
                        double w3)
Set the constraint for a deformable-deformable edge-edge contact. This constraint can be used to prevent interpenetration of two edges edge1 and edge0 as follows: n0, n1 are the nodes on the ends of edge0. n2, n3 are the nodes on the ends of edge1. w0, w1 are the weights of the nodes n0, n1: 0 <= w0 <= 1, w1 = 1 - w0 They define a position p0 on edge0: p0 = w0*n0.getPosition() + w1*n1.getPosition() Similarly, w2, w3 are the weights of the nodes n2, n3: 0 <= w2 <= 1, w3 = 1 - w2 They define a position p1 on edge1: p1 = w2 * n2.getPosition() + w3 * n3.getPosition() nrml is the direction in which p0 should move to remove the interpenetration. The constraint will ensure that q > 0 where q = (p0 - p1).dot(nrml). and will remain active as long as q < 0. The constraint also generates frictional forces opposite to the direction of any relative motion perpendicular to nrml.


setEdgeEdge

public void setEdgeEdge(Vector3d nrml,
                        double mu,
                        FemMeshVertex v0,
                        FemMeshVertex v1,
                        Point3d loc1,
                        double w0,
                        double w1,
                        Vertex3d v2,
                        Vertex3d v3,
                        Point3d loc2,
                        double w2,
                        double w3,
                        DeformableCollisionData otherData)
Set the constraint for a deformable-deformable edge-edge contact. This constraint can be used to prevent interpenetration of two edges edge1 and edge0 as follows: n0, n1 are the nodes on the ends of edge0. n2, n3 are the nodes on the ends of edge1. w0, w1 are the weights of the nodes n0, n1: 0 <= w0 <= 1, w1 = 1 - w0 They define a position p0 on edge0: p0 = w0*n0.getPosition() + w1*n1.getPosition() Similarly, w2, w3 are the weights of the nodes n2, n3: 0 <= w2 <= 1, w3 = 1 - w2 They define a position p1 on edge1: p1 = w2 * n2.getPosition() + w3 * n3.getPosition() nrml is the direction in which p0 should move to remove the interpenetration. The constraint will ensure that q > 0 where q = (p0 - p1).dot(nrml). and will remain active as long as q < 0. The constraint also generates frictional forces opposite to the direction of any relative motion perpendicular to nrml.


setVertexFace

public void setVertexFace(Vector3d nrml,
                          double mu,
                          FemMeshVertex v0,
                          FemMeshVertex v1,
                          FemMeshVertex v2,
                          FemMeshVertex v3,
                          double w0,
                          double w1,
                          double w2)
Set the constraint for a deformable-deformable node-face contact. For CollisionHandlerOld


setVertexFace

public void setVertexFace(Vector3d nrml,
                          double mu,
                          FemMeshVertex v0,
                          double w0,
                          Vertex3d v1,
                          Vertex3d v2,
                          Vertex3d v3,
                          Point3d loc2,
                          double w1,
                          double w2,
                          double w3,
                          DeformableCollisionData otherData)
Set the constraint for a deformable-deformable node-face contact.


setBodyFace

public void setBodyFace(Vector3d nrml,
                        double mu,
                        FemMeshVertex v0,
                        FemMeshVertex v1,
                        FemMeshVertex v2,
                        double w0,
                        double w1,
                        double w2,
                        Vertex3d vbody,
                        RigidBody body,
                        Point3d loc,
                        double wrb)
Sets the constraint for rigidBody-deformable node-face contact


setVertexBody

public void setVertexBody(Vector3d nrml,
                          double mu,
                          FemMeshVertex v0,
                          double w0,
                          RigidBody body,
                          Point3d loc,
                          double wrb)
Set the constraint for a deformable-rigidBody node-face contact.


setEdgeBody

public void setEdgeBody(Vector3d nrml,
                        double mu,
                        FemMeshVertex v0,
                        FemMeshVertex v1,
                        double w0,
                        double w1,
                        RigidBody body,
                        Point3d loc,
                        double wrb)
Set the constraint for a deformable-rigidBody edge-edge contact.


numMyVertices

public int numMyVertices()

numVertices

public int numVertices()

skipAuxState

public void skipAuxState(DataBuffer data)
Specified by:
skipAuxState in interface DeformableContactConstraint
Overrides:
skipAuxState in class DeformableContactConstraintBase

getAuxStateOld

public void getAuxStateOld(DataBuffer data)

setAuxStateOld

public void setAuxStateOld(DataBuffer data,
                           FemModel3d model,
                           PolygonalMesh mesh0,
                           PolygonalMesh mesh1,
                           Collidable otherComponent)

skipAuxStateOld

public void skipAuxStateOld(DataBuffer data)