public class DistanceGridFeatureQuery
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
DistanceGridFeatureQuery.InsideQuery |
Modifier and Type | Field and Description |
---|---|
boolean |
debug |
java.lang.String |
lastCase |
Constructor and Description |
---|
DistanceGridFeatureQuery() |
Modifier and Type | Method and Description |
---|---|
Face |
getFaceForInsideOrientedTest(Point3d nearLoc,
Vector2d uv)
If called immediately after either
isInsideOrientedMesh(PolygonalMesh,Point3d,double) or
isInsideOrientedMesh(DistanceGrid,Point3d,double) ,
returns the nearest face
that was used to resolve whether or not the query point is actually
inside the mesh. |
static Face |
getNearestFaceToPoint(Point3d nearPnt,
Vector2d uv,
PolygonalMesh mesh,
Point3d pnt)
Returns the nearest triangular mesh face to a point.
|
DistanceGridFeatureQuery.InsideQuery |
isInsideMesh(PolygonalMesh mesh,
DistanceGrid sdgrid,
Point3d pnt,
double tol)
Determines if a point is on or inside a closed triangular mesh, the faces
of which are contained within a specified signed distance grid.
|
static DistanceGridFeatureQuery.InsideQuery |
isInsideMesh(PolygonalMesh mesh,
Point3d pnt)
Determines if a point is on or inside a closed triangular mesh.
|
DistanceGridFeatureQuery.InsideQuery |
isInsideMesh(PolygonalMesh mesh,
Point3d pnt,
double tol)
Determines if a point is on or inside a closed triangular mesh.
|
boolean |
isInsideOrientedMesh(DistanceGrid grid,
Point3d pnt,
double tol)
Returns true if a point is on or inside an oriented triangular mesh, the
faces of which are contained within a specified distance grid.
|
static boolean |
isInsideOrientedMesh(PolygonalMesh mesh,
Point3d pnt)
Returns true if a point is on or inside an oriented triangular
mesh.
|
boolean |
isInsideOrientedMesh(PolygonalMesh mesh,
Point3d pnt,
double tol)
Returns true if a point is on or inside an oriented triangular
mesh.
|
DistanceGridFeatureQuery.InsideQuery |
isInsideOrOnMesh(PolygonalMesh mesh,
DistanceGrid sdgrid,
Point3d pnt,
double tol) |
Feature |
nearestEdgeToPoint(Point3d nearPnt,
DoubleHolder sval,
DistanceGrid dgrid,
Point3d pnt)
Returns the nearest edge to a point, using a specified distance grid.
|
Face |
nearestFaceToPoint(Point3d nearPnt,
Vector2d uv,
DistanceGrid sdgrid,
Point3d pnt)
Returns the nearest triangular face to a point, using a specified
distance grid.
|
Face |
nearestFaceToPoint(Point3d nearPnt,
Vector2d uv,
PolygonalMesh mesh,
Point3d pnt)
Returns the nearest triangular mesh face to a point.
|
Feature |
nearestFeatureToPoint(Point3d nearPnt,
DistanceGrid featureGrid,
Point3d pnt)
Find the nearest feature to a point
|
Vertex3d |
nearestVertexToPoint(DistanceGrid dgrid,
Point3d pnt)
Returns the nearest mesh vertex to a point, using a specified distance grid
|
public Face nearestFaceToPoint(Point3d nearPnt, Vector2d uv, PolygonalMesh mesh, Point3d pnt)
nearPnt
- if not null
, returns the nearest
point on the face in world coordinates.uv
- if not null
, returns the UV coordinates
of the nearest face point. These are the barycentric coordinates
with respect to the second and third vertices.mesh
- mesh containing the faces.pnt
- point for which the nearest face should be found.null
if the mesh contains no faces.public Feature nearestFeatureToPoint(Point3d nearPnt, DistanceGrid featureGrid, Point3d pnt)
nearPnt
- populates with location of nearest point on set of featuresfeatureGrid
- distance grid containing desired featurespnt
- point from which to find the nearest featurepublic Face nearestFaceToPoint(Point3d nearPnt, Vector2d uv, DistanceGrid sdgrid, Point3d pnt)
nearPnt
- if not null
, returns the nearest
point on the face in world coordinates.uv
- if not null
, returns the UV coordinates
of the nearest face point. These are the barycentric coordinates
with respect to the second and third vertices.sdgrid
- distance grid containing the faces.pnt
- point for which the nearest face should be found.null
if sdgrid
contains no faces.public static Face getNearestFaceToPoint(Point3d nearPnt, Vector2d uv, PolygonalMesh mesh, Point3d pnt)
nearPnt
- if not null
, returns the nearest
point on the face in world coordinates.uv
- if not null
, returns the UV coordinates
of the nearest face point. These are the barycentric coordinates
with respect to the second and third vertices.mesh
- mesh containing the faces.pnt
- point for which the nearest face should be found.null
if the mesh contains no faces.public static boolean isInsideOrientedMesh(PolygonalMesh mesh, Point3d pnt)
The method works by inspecting the nearest face, edge or vertex to
the point. Hence the mesh does not need to be closed, and the method is
faster, though possibly less numerically robust, than isInsideMesh(PolygonalMesh,Point3d)
, which uses ray casting.
mesh
- mesh which point may be inside.pnt
- point to check.pnt
is on or inside the mesh.public boolean isInsideOrientedMesh(PolygonalMesh mesh, Point3d pnt, double tol)
The method works by inspecting the nearest face, edge or vertex to
the point. Hence the mesh does not need to be closed, and the method is
faster, though possibly less numerically robust, than isInsideMesh(PolygonalMesh,Point3d,double)
, which uses ray casting.
mesh
- mesh which point may be inside.pnt
- point to check (in world coordinates)tol
- tolerance within which the point is considered to be on the
mesh surfaces. A value of -1 will cause the tolerance to be computed
automatically.pnt
is on or inside the mesh.public boolean isInsideOrientedMesh(DistanceGrid grid, Point3d pnt, double tol)
The method works by inspecting the nearest face, edge or vertex to
the point. Hence the mesh does not need to be closed, and the method is
faster, though possibly less numerically robust, than isInsideMesh(PolygonalMesh,DistanceGrid,Point3d,double)
.
grid
- distance grid containing the faces.pnt
- point to check (in world coordinates)tol
- tolerance within which the point is considered to be on the
mesh surface. A value of -1 will cause the tolerance to be computed
automatically.pnt
is on or inside the mesh.public Face getFaceForInsideOrientedTest(Point3d nearLoc, Vector2d uv)
isInsideOrientedMesh(PolygonalMesh,Point3d,double)
or
isInsideOrientedMesh(DistanceGrid,Point3d,double)
,
returns the nearest face
that was used to resolve whether or not the query point is actually
inside the mesh. If the point is outside the mesh's distance grid, then
no nearest face will have been computed and this method will return
null
.nearLoc
- if not null
, and if the returned face is not
null
, returns the nearest point (to the query point) on the
face in mesh local coordinates.uv
- if not null
, and if the returned face is not
null
, returns the UV coordinates of the nearest point on the
face. These are the barycentric coordinates with respect to the second
and third vertices.public static DistanceGridFeatureQuery.InsideQuery isInsideMesh(PolygonalMesh mesh, Point3d pnt)
mesh
- mesh which point may be inside.pnt
- point to check.pnt
is inside, InsideQuery.ON if on,
InsideQuery.OUTSIDE if it is outside.public DistanceGridFeatureQuery.InsideQuery isInsideMesh(PolygonalMesh mesh, Point3d pnt, double tol)
mesh
- mesh which point may be inside.pnt
- point to check.tol
- tolerance within which the point is considered to be on the
mesh surface. A value of -1 will cause the tolerance to be computed
automatically.pnt
is inside, InsideQuery.ON if on,
InsideQuery.OUTSIDE if it is outside.public DistanceGridFeatureQuery.InsideQuery isInsideMesh(PolygonalMesh mesh, DistanceGrid sdgrid, Point3d pnt, double tol)
mesh
- mesh which point may be inside.sdgrid
- signed distance grid containing the mesh.pnt
- point to check.tol
- tolerance within which the point is considered to be on the
mesh surface. A value of -1 will cause the tolerance to be computed
automatically.pnt
is inside or on,
InsideQuery.OUTSIDE if it is outside.public DistanceGridFeatureQuery.InsideQuery isInsideOrOnMesh(PolygonalMesh mesh, DistanceGrid sdgrid, Point3d pnt, double tol)
public Vertex3d nearestVertexToPoint(DistanceGrid dgrid, Point3d pnt)
dgrid
- distance-grid containing the vertices.pnt
- point for which the nearest vertex should be found.null
if
dgrid
contains no vertices.public Feature nearestEdgeToPoint(Point3d nearPnt, DoubleHolder sval, DistanceGrid dgrid, Point3d pnt)
nearPnt
- if not null
, returns the nearest point on
the edge.sval
- if not null
, returns a coordinate in the
range [0,1] giving the location of the nearest point along the edge.dgrid
- distance grid containing the features.pnt
- point for which the nearest edge should be found.null
if
bvh
contains no edges.