public class FemMeshComp extends FemMeshBase implements CollidableBody, PointAttachable
Collidable.Collidability, Collidable.GroupModelComponent.NavpanelVisibilityCompositeComponent.NavpanelDisplay| Modifier and Type | Field and Description | 
|---|---|
| static PropertyList | myProps | 
DEFAULT_COLOR_INTERPOLATION, DEFAULT_VERTEX_COLOR_MIXINGenforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNamesAll, AllBodies, Deformable, Rigid, SelfTG_ARTICULATED, TG_DRAGGER, TG_PRESERVE_ORIENTATION, TG_SIMULATINGTRANSPARENT, TWO_DIMENSIONAL| Constructor and Description | 
|---|
| FemMeshComp() | 
| FemMeshComp(FemModel3d fem) | 
| FemMeshComp(FemModel3d fem,
           java.lang.String name) | 
| Modifier and Type | Method and Description | 
|---|---|
| void | addVertexAttachment(PointAttachment attachment) | 
| boolean | allowCollision(ContactPoint cpnt,
              Collidable other,
              java.util.Set<Vertex3d> attachedVertices)Returns  trueif a collision between this Collidable
 andothershould be allowed for the contact pointcpnt. | 
| void | connectToHierarchy()Called by the system after this component is added to the
 component hierarchy (i.e., when it is added as a child of another
 CompositeComponent). | 
| boolean | containsContactMaster(CollidableDynamicComponent comp)Returns true if this Collidable contains a specified contact master
 component. | 
| FemMeshComp | copy(int flags,
    java.util.Map<ModelComponent,ModelComponent> copyMap) | 
| static FemMeshComp | createEmbedded(FemMeshComp surf,
              MeshBase mesh) | 
| static FemMeshComp | createEmbedded(FemMeshComp surf,
              MeshBase mesh,
              FemModel3d fem) | 
| static FemMeshComp | createEmbedded(FemModel3d fem,
              MeshBase mesh) | 
| PointFem3dAttachment | createPointAttachment(Point pnt)Returns a PointAttachment that attaches  pntto this component. | 
| void | createSurface(java.util.Collection<FemElement3d> elems) | 
| void | createSurface(FemModel.ElementFilter efilter) | 
| static FemMeshComp | createSurface(java.lang.String name,
             FemModel3d fem) | 
| static FemMeshComp | createSurface(java.lang.String name,
             FemModel3d fem,
             java.util.Collection<FemElement3d> elems) | 
| static FemMeshComp | createSurface(java.lang.String name,
             FemModel3d fem,
             FemModel.ElementFilter efilter) | 
| void | disconnectFromHierarchy()Called by the system after this component is removed from the component
 hierarchy (i.e., when it is removed as a child of its parent). | 
| PropertyList | getAllPropertyInfo()Returns a list giving static information about all properties exported by
 this object. | 
| PointAttachment | getAttachment(int idx) | 
| PointAttachment | getAttachment(Vertex3d vtx) | 
| Collidable.Collidability | getCollidable()Returns the  Collidable.Collidabilityof this Collidable. | 
| Collidable | getCollidableAncestor()Returns the most immediate Collidable ancestor of this Collidable,
 if any. | 
| int | getCollidableIndex() | 
| PolygonalMesh | getCollisionMesh()Returns the mesh that should be used for computing collisions, or
  nullif there is no such mesh. | 
| DistanceGrid | getDistanceGrid()Returns a signed distance grid that can be used with a 
 SignedDistanceCollider, or  nullif this Collidable
 does not support a signed distance grid (i.e., ifCollidableBody.hasDistanceGrid()returnsfalse). | 
| FemElement3d | getFaceElement(Face face) | 
| FemModel3d | getFem() | 
| double | getMass() | 
| FemModel3d | getModel() | 
| FemNode3d | getNodeForVertex(Vertex3d vtx)Returns the node to which a specified vertex is directly attached,
 or  nullif no such node exists. | 
| Vertex3d | getVertexForNode(FemNode3d node)Returns a vertex which is directly attached to the specified
 node, or  nullif no such vertex exists. | 
| void | getVertexMasters(java.util.List<ContactMaster> mlist,
                Vertex3d vtx)Returns all the contact master components associated with a particular
 mesh vertex. | 
| boolean | hasDistanceGrid()Returns  trueif this Collidable supports a signed
 distance grid that can be used with a SignedDistanceCollider. | 
| boolean | hasNodeDependency(FemNode3d node)Check if this mesh depends on a particular node | 
| boolean | isCompound()Queries whether or not this collidable has sub-collidables. | 
| boolean | isDeformable()Returns  trueif this collidable is deformable. | 
| boolean | isSingleNodeMapped()Returns  trueif every vertex in this mesh is
 directly attached to a single FEM node. | 
| boolean | isSurfaceMesh() | 
| int | numAttachments() | 
| void | render(Renderer renderer,
      int flags)Render this object using the functionality of the supplied
  Renderer. | 
| MeshBase | scanMesh(ReaderTokenizer rtok)Scans this mesh from a file, using the format described for
  writeMesh(java.lang.String). | 
| void | setCollidable(Collidable.Collidability c) | 
| void | setCollidableIndex(int idx) | 
| void | setSurfaceRendering(FemModel.SurfaceRender mode) | 
| void | setVertexAttachment(int vidx,
                   double[] weights,
                   FemNode3d[] nodes) | 
| void | setVertexAttachment(int vidx,
                   PointAttachment attachment) | 
| boolean | writeMesh(java.io.PrintWriter pw)Writes the mesh for this FemMeshComp out to a PrintWriter, using a format
 of the form | 
| boolean | writeMesh(java.io.PrintWriter pw,
         boolean nodeFormat) | 
| boolean | writeMesh(java.lang.String fileName)Writes the mesh for this FemMeshComp out to a named file,
 using the format described for
  writeMesh(PrintWriter). | 
getColorMap, getColorMapMode, getSelection, getStressPlotRange, getStressPlotRangeMode, getStressPlotRanging, getStressPlotRangingMode, getSurfaceRendering, getSurfaceRenderingMode, isStressOrStrainRendering, numSelectionQueriesNeeded, prerender, render, resetStressPlotRange, setColorMap, setColorMapMode, setMeshFromInfo, setStressPlotRange, setStressPlotRangeMode, setStressPlotRanging, setStressPlotRangingMode, setSurfaceRenderingModecomponentChanged, findComponent, get, get, getByNumber, getNavpanelDisplay, getNavpanelVisibility, getNumberLimit, getSurfaceMesh, getSurfaceMeshes, hierarchyContainsReferences, indexOf, numComponents, numSurfaceMeshes, postscan, scaleDistance, scan, setDisplayMode, setNavpanelDisplay, transformGeometry, updateNameMap, updateSlavePos, updateSlaveVeladdTransformableDependencies, createRenderProps, createSurfaceMeshArray, getColorInterpolation, getFileTransform, getMesh, getMeshToWorld, getSurfaceMeshes, getVertex, getVertexColorMixing, isFileTransformRigid, isMeshModfied, numSurfaceMeshes, numVertices, scaleMass, setColorInterpolation, setDefaultValues, setMesh, setMesh, setMesh, setMeshToWorld, setVertexColorMixing, transformGeometry, updateBounds, updatePositiongetRenderHints, getRenderProps, isSelectable, setRenderProps, updateRenderPropscheckFlag, checkName, checkNameUniqueness, clearFlag, clone, createTempFlag, getChildren, getGrandParent, getHardReferences, getName, getNameRange, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, hasChildren, hasState, isConnectedToHierarchy, isFixed, isMarked, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setSelected, updateReferences, writeequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, hasState, isFixed, isMarked, isSelected, notifyParentOfChange, postscan, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, updateReferencesgetPropertygetChildren, hasChildrenisWritable, writepublic static PropertyList myProps
public FemMeshComp()
public FemMeshComp(FemModel3d fem)
public FemMeshComp(FemModel3d fem, java.lang.String name)
public PropertyList getAllPropertyInfo()
HasPropertiesgetAllPropertyInfo in interface HasPropertiesgetAllPropertyInfo in class FemMeshBasepublic void setSurfaceRendering(FemModel.SurfaceRender mode)
setSurfaceRendering in class FemMeshBasepublic void render(Renderer renderer, int flags)
IsRenderableRenderer.render in interface IsRenderablerender in class MeshComponentrenderer - provides the functionality used to perform the rendering.flags - flags that may be used to control different 
 aspects of the rendering. Flags are defined in Renderer
 and currently include
 Renderer.HIGHLIGHT and
 Renderer.SORT_FACES.public int numAttachments()
numAttachments in class FemMeshBasepublic PointAttachment getAttachment(Vertex3d vtx)
public PointAttachment getAttachment(int idx)
getAttachment in class FemMeshBasepublic boolean isSingleNodeMapped()
true if every vertex in this mesh is
 directly attached to a single FEM node. If this is the case, then
 getNodeForVertex(maspack.geometry.Vertex3d) and getVertexForNode(artisynth.core.femmodels.FemNode3d) will never return
 null.true if every vertex is attached
 a single nodepublic FemNode3d getNodeForVertex(Vertex3d vtx)
null if no such node exists. In particular,
 if the specified vertex is controlled by multiple nodes,
 then this method will return null.vtx - vertex being queriedvtx is directly attached, or
 null.public Vertex3d getVertexForNode(FemNode3d node)
null if no such vertex exists.node - node whose vertex is being queriednull.public FemElement3d getFaceElement(Face face)
public static FemMeshComp createEmbedded(FemMeshComp surf, MeshBase mesh)
public FemModel3d getFem()
public void addVertexAttachment(PointAttachment attachment)
public void setVertexAttachment(int vidx,
                                PointAttachment attachment)
public void setVertexAttachment(int vidx,
                                double[] weights,
                                FemNode3d[] nodes)
public static FemMeshComp createEmbedded(FemMeshComp surf, MeshBase mesh, FemModel3d fem)
public static FemMeshComp createEmbedded(FemModel3d fem, MeshBase mesh)
public static FemMeshComp createSurface(java.lang.String name, FemModel3d fem, java.util.Collection<FemElement3d> elems)
public static FemMeshComp createSurface(java.lang.String name, FemModel3d fem, FemModel.ElementFilter efilter)
public static FemMeshComp createSurface(java.lang.String name, FemModel3d fem)
public void createSurface(FemModel.ElementFilter efilter)
public void createSurface(java.util.Collection<FemElement3d> elems)
public boolean writeMesh(java.lang.String fileName)
writeMesh(PrintWriter).fileName - Name of file to write the mesh totrue if the mesh is a polygonal mesh and was written,
 and false otherwise.public boolean writeMesh(java.io.PrintWriter pw)
[ v 3 1.0 v 3 0.5 1 0.5 v 1 0.25 2 0.35 3 0.25 4 0.25 v 2 0.5 4 0.5 v 4 1.0 f 1 3 2 f 1 5 3 f 3 5 4 ]Here each line beginning with
v describes a mesh
 vertex in terms of the FEM nodes to which it is attached.
 This takes the form of a list of number/weight pairs:
 v n_0 w_0 n_1 w_1 n_2 w_2 ...where
n_i and w_i indicate, respectively,
 a FEM node (using its number as returned by
 getNumber()),
 and its corresponding weight. In the case where a vertex
 is not associated with any nodes, then it is described by
 a line of the form
 v -1 pz py pzwhere
px, py, and pz
 give the vertex's (fixed) position in space.
 
 Each line beginning with f describes a mesh face,
 using the vertex numbers in counter-clockwise order about the
 outward facing normal. To be consistent with Wavefront .obj
 format, the vertex numbers are 1-based and so are equal to the
 vertex indices plus one.
 
 If the mesh is not an instance of
 PolygonalMesh, then the method does
 nothing and returns null.
pw - writer to whichmesh is writtentrue if the mesh is a polygonal mesh and was written,
 and false otherwise.public boolean writeMesh(java.io.PrintWriter pw,
                         boolean nodeFormat)
public MeshBase scanMesh(ReaderTokenizer rtok) throws java.io.IOException
writeMesh(java.lang.String). For backward compatibility, a format
 of the form
 [ f 0 1 2 f 2 3 4 f 4 5 6 ]Where no vertex information is given, and each face is instead described using the numbers of the FEM nodes that underlie each vertex. This makes the assumption that the mesh is single node mapped (i.e.,
isSingleNodeMapped() returns
 true), so that each vertex is associated with
 a single FEM node.rtok - tokenizer from which mesh is readjava.io.IOExceptionpublic void connectToHierarchy()
ModelComponentBase
 When this method is called, ModelComponent.getParent() will return
 the new parent component; the system will have set this beforehand.
connectToHierarchy in interface ModelComponentconnectToHierarchy in class FemMeshBasepublic void disconnectFromHierarchy()
ModelComponentBase When this
 method is called, ModelComponent.getParent() will still return this original
 parent component; the system will set this to null after.
disconnectFromHierarchy in interface ModelComponentdisconnectFromHierarchy in class FemMeshBasepublic FemMeshComp copy(int flags, java.util.Map<ModelComponent,ModelComponent> copyMap)
copy in class FemMeshBasepublic boolean isSurfaceMesh()
public boolean hasNodeDependency(FemNode3d node)
public PolygonalMesh getCollisionMesh()
CollidableBodynull if there is no such mesh. If this method
 returns null, then no collisions will
 be performed for this collidable, regardless any default or explicit
 collision behaviors that have been arranged by the system.getCollisionMesh in interface CollidableBodypublic boolean hasDistanceGrid()
CollidableBodytrue if this Collidable supports a signed
 distance grid that can be used with a SignedDistanceCollider. At
 present, this will only be true for non-deformable bodies.hasDistanceGrid in interface CollidableBodytrue if this Collidable supports a signed
 distance gridpublic DistanceGrid getDistanceGrid()
CollidableBodynull if this Collidable
 does not support a signed distance grid (i.e., if 
 CollidableBody.hasDistanceGrid() returns false).getDistanceGrid in interface CollidableBodypublic Collidable.Collidability getCollidable()
CollidableCollidable.Collidability of this Collidable. This provides
 control over whether external and/or internal collisions are enabled for
 this Collidable. This setting takes precedence over default and
 explicitly requested collision behaviors.
 Note that for collisions to actually occur, they still need to be enabled through either a default or explicit collision behavior in the MechModel.
getCollidable in interface Collidablepublic void setCollidable(Collidable.Collidability c)
public Collidable getCollidableAncestor()
Collidablenull.getCollidableAncestor in interface Collidablenull.public boolean isCompound()
CollidableisCompound in interface Collidabletrue if this collidable has sub-collidablespublic boolean isDeformable()
Collidabletrue if this collidable is deformable. Whether or
 not a collidable is deformable determines how it responds to default
 collision behaviors involving deformable and rigid collidables. Also,
 self-collisions among sub-collidables of a collidable A are permitted
 only if A is deformable.isDeformable in interface Collidabletrue if this collidable is deformablepublic double getMass()
getMass in interface CollidableBodypublic void getVertexMasters(java.util.List<ContactMaster> mlist, Vertex3d vtx)
CollidableBodymlist. The list should not be cleared. The vertex
 should be a vertex of the mesh returned by CollidableBody.getCollisionMesh().getVertexMasters in interface CollidableBodymlist - collected master component informationvtx - vertex for which the master components are requestedpublic boolean containsContactMaster(CollidableDynamicComponent comp)
CollidableBodycontainsContactMaster in interface CollidableBodycomp - component to test fortrue if comp is contained in
 this Collidablepublic boolean allowCollision(ContactPoint cpnt, Collidable other, java.util.Set<Vertex3d> attachedVertices)
CollidableBodytrue if a collision between this Collidable
 and other should be allowed for the contact point
 cpnt. In making this decision, this method may
 refer to attachedVertices, which supplies a list
 of vertices on this Collidable which are attached in some way 
 to the other Collidable.allowCollision in interface CollidableBodycpnt - contact point being testedother - opposing collidableattachedVertices - list of vertices attached to other.true if the collision should be allowedpublic int getCollidableIndex()
getCollidableIndex in interface CollidableBodypublic void setCollidableIndex(int idx)
setCollidableIndex in interface CollidableBodypublic PointFem3dAttachment createPointAttachment(Point pnt)
PointAttachablepnt
 to this component. It should not be assumed that pnt
 is currently connected to the component hierarchy, and no attempt
 should be made to connect the returned attachment to the hierarchy;
 the latter, if desired, is the responsibility of the caller.
 
 In some cases, it may not be possible to attach the point at its present location. In that case, the method will create an attachment to the nearest feasible location.
createPointAttachment in interface PointAttachablepnt - point for which an attachment should be createdpnt to this componentpublic FemModel3d getModel()