public class IntersectionContour extends java.util.ArrayList<IntersectionPoint>
Modifier and Type | Field and Description |
---|---|
boolean |
isClosed |
boolean |
isContinuable |
boolean |
openMesh |
Constructor and Description |
---|
IntersectionContour() |
Modifier and Type | Method and Description |
---|---|
void |
computeCentroid(Vector3d centroid)
Computes the centroid of this contour, rejecting points that are
very close together.
|
double |
computeLength()
Computes the length of this contour
|
double |
computePlanarArea()
Computes the area of this contour with respect to a plane formed
by computing the centroid and then summing the cross products of
rays from the centroid to adjacent contour points.
|
double |
computePlanarArea(Vector3d nrm,
Point3d p0,
boolean clockwiseContour)
Computes the area of this contour projected onto a plane defined by a
normal vector.
|
boolean |
dividesMesh(PolygonalMesh mesh)
Returns
true if this contour divides the specified mesh
into "inside" and "outside" regions. |
java.util.ArrayList<IntersectionPoint> |
fitPlane(Vector3d areaVec,
Vector3d centroid,
double pointTol)
Fits this contour to a plane by first computing the centroid,
and then forming a normal by summing the cross products of
adjacent rays between the centroid and the contour points.
|
java.util.ArrayList<IntersectionPoint> |
getCornerPoints() |
java.util.ArrayList<IntersectionPoint> |
getCornerPoints(double tol)
Return the subset of points that form the corners of this contour.
|
IntersectionPoint |
getFirst()
Returns the first point of this contour, or null if the contour is empty.
|
IntersectionPoint |
getLast()
Returns the last point of this contour, or null if the contour is empty.
|
IntersectionPoint |
getWrapped(int idx)
Get with wrapping implemented for closed contours.
|
boolean |
isClosed()
Query if this contour is closed.
|
void |
printCornerPoints(java.lang.String name,
java.lang.String fmt,
RigidTransform3d T) |
void |
reverse() |
public boolean isClosed
public boolean isContinuable
public boolean openMesh
public boolean isClosed()
true
if the contour is closed.public boolean dividesMesh(PolygonalMesh mesh)
true
if this contour divides the specified mesh
into "inside" and "outside" regions. The contour will be bounded if
true
if this contour divides the meshpublic void reverse()
public IntersectionPoint getWrapped(int idx)
idx
- index of point to getpublic double computePlanarArea()
public void computeCentroid(Vector3d centroid)
centroid
- returns the centroidpublic double computeLength()
public double computePlanarArea(Vector3d nrm, Point3d p0, boolean clockwiseContour)
public java.util.ArrayList<IntersectionPoint> getCornerPoints()
public java.util.ArrayList<IntersectionPoint> getCornerPoints(double tol)
public void printCornerPoints(java.lang.String name, java.lang.String fmt, RigidTransform3d T)
public java.util.ArrayList<IntersectionPoint> fitPlane(Vector3d areaVec, Vector3d centroid, double pointTol)
areaVec
.
When computing the centroid, points closer to each other
than pointTol
are ignored. The points that are
actually used are collected into a separate list that is
returned by this method.
areaVec
- if non-null, returns the computed area vector.
Normalizing this vector gives the normal for the plane, while
the length of this vector gives twice the area of the contour
with respect to the plane.centroid
- if non-null, returns the computed centroid.pointTol
- minimum distance between contour points used for
computing the planepointTol
removed.public IntersectionPoint getFirst()
null
public IntersectionPoint getLast()
null