public class SignedDistanceGrid extends DistanceGrid implements Renderable
The field is implemented using a regular 3D grid composed of
numVX
X numVY
X numVZ
vertices along
the x, y and z directions, dividing the volume into (numVX-1)
X
(numVY-1)
X (numVZ-1)
cells. For vertices close to
the mesh, nearby faces are examined to determine the distance from the mesh
to the vertex. A sweep method and ray-casting are then used to propogate
distance values throughout the volume and determine whether vertices are
inside or outside. The algorithm is based on C++ code provided by Robert
Bridson at UBC.
The grid is constructed in local mesh coordinates, and all queries are assumed to be performed in local mesh coordinates. The mesh is assumed to be closed; if it is not, the results are undefined. The distance field is defined so as to be negative within the mesh and positive outside it. Normals are computed at each vertex using numeric differentation of the distances associated with the surrounding vertices. Trilinear interpolation of vertex values across each cell is used to compute the distance and normal for a general point within the grid volume.
DistanceGrid.DistanceMethod, DistanceGrid.GridEdge, DistanceGrid.TetDesc, DistanceGrid.TetID
culledQueries, DEFAULT_DISTANCE_METHOD, totalQueries, useNormalsForQuadGrad
OUTSIDE_GRID
TRANSPARENT, TWO_DIMENSIONAL
Modifier and Type | Method and Description |
---|---|
Face |
getClosestFace(int idx)
Returns the closest face to the vertex indexed by
idx . |
checkGradient, clearFeatures, computeDifference01, computeDifference10, computeDistances, computeDistances, computeFromFeatures, computeFromFeaturesOBB, computeFromMesh, computeIntersection, computeQuadCoefs, computeQuadCoefsStub, computeUnion, createQuadDistanceSurface, epsilonEquals, findQuadSurfaceIntersection, findQuadSurfaceTangent, findSurfaceEdgeTets, findSurfaceIntersectingEdges, fitToFeatures, fitToFeatures, fitToFeaturesOBB, fitToFeaturesOBB, getClosestFeature, getDistanceMethod, getFeatures, getLocalDistance, getLocalDistanceAndGradient, getLocalDistanceAndGradient, getLocalDistanceAndNormal, getLocalDistanceAndNormal, getLocalDistanceAndNormal, getNearestLocalFeature, getNearestWorldFeature, getQuadCellInfo, getQuadDistance, getQuadDistanceAndGradient, getQuadTet, getRenderVector, getRenderVectorScale, getVertexDistance, getVertexDistances, getWorldDistance, getWorldDistanceAndGradient, getWorldDistanceAndGradient, getWorldDistanceAndNormal, getWorldDistanceAndNormal, getWorldQuadDistance, getWorldQuadDistanceAndGradient, isSigned, markOutsideQuadtets, scaleDistance, set, setDistanceMethod, setDistancesAndFeatures, setLocalToWorld, setResolution, setVertexDistances, smooth, smooth, smooth, smooth, zeroVertexDistances
createDistanceSurface, createDistanceSurface, createDistanceSurface, epsilonEquals, getParameterType, setVertexValue
clearColors, createRenderProps, epsilonEquals, getCellVertex, getCellWidths, getCenter, getCenterAndOrientation, getClosestVertex, getDebug, getDefaultVertexColor, getGridToLocalTransformer, getLocalToWorld, getLocalToWorldTransformer, getLocalVertexCoords, getLocalVertexCoords, getOrientation, getRadius, getRenderHints, getRenderProps, getRenderRanges, getRenderVector, getResolution, getSelection, getVertexColor, getWidths, getWidths, getWorldCenter, getWorldOrientation, getWorldVertexCoords, getWorldVertexCoords, hasLocalToWorld, isSelectable, isVertexRenderingEnabled, isWritable, numSelectionQueriesNeeded, numVertices, parseRenderRanges, prerender, prerender, render, render, scan, set, setCenter, setCenterAndOrientation, setDebug, setDefaultVertexColor, setOrientation, setRenderProps, setRenderRanges, setVertexColor, setVertexRenderingEnabled, updateBounds, vertexToXyzIndices, write, xyzIndicesToVertex
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getSelection, isSelectable, numSelectionQueriesNeeded
getRenderHints, prerender, render, updateBounds
createRenderProps, getRenderProps, setRenderProps
public Face getClosestFace(int idx)
idx
.idx
- vertex index