public class IntersectionContour extends java.util.ArrayList<IntersectionPoint>
Modifier and Type | Field and Description |
---|---|
Face |
containingFace |
boolean |
isClosed |
boolean |
isContinuable |
double |
singleFaceArea |
Constructor and Description |
---|
IntersectionContour() |
Modifier and Type | Method and Description |
---|---|
Point3d |
computeCentroid()
Computes the centroid of this contour, rejecting points that are
very close together.
|
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.
|
IntersectionContour |
copy() |
boolean |
dividesMesh(PolygonalMesh mesh)
Returns
true if this contour divides the specified mesh
into "inside" and "outside" regions. |
boolean |
equals(IntersectionContour contour,
java.lang.StringBuilder msg) |
int |
findSegmentFaceStart(Face face,
PolygonalMesh mesh)
Returns an index at which the indicated face first appears as a segment
face for the indicated mesh, or -1 if no such starting index is found,
which means either that the segment face does not appear at all, or
appears along the whole contour.
|
IntersectionPoint |
firstFaceEntryPoint(PolygonalMesh mesh,
Face face)
Returns the point where the contour first enters the specified
face on mesh . |
IntersectionPoint |
firstNonCoincidentPoint(double tol)
Returns a point on the contour whose distance from the preceeding point
is either
null (for open contours), or whose distance from
the preceeding point exceeds tol . |
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 |
getNext(IntersectionPoint p)
Returns the next intersection point after
p on this
contour. |
IntersectionPoint |
getPrev(IntersectionPoint p)
Returns the previous intersection point after
p on this
contour. |
void |
getState(DataBuffer data,
PolygonalMesh mesh0,
PolygonalMesh mesh1) |
IntersectionPoint |
getWrapped(int idx)
Get with wrapping implemented for closed contours.
|
int |
getWrappedIndex(int idx)
Takes an arbitrary index value for a contour point returns either its
wrapped value (for closed contours), or checks its range and returns
either the index itself or -1 if it is out of range (for open
contours).
|
boolean |
isClosed()
Query if this contour is closed.
|
void |
printCornerPoints(java.lang.String name,
java.lang.String fmt,
RigidTransform3d T) |
void |
reverse() |
void |
setState(DataBuffer data,
PolygonalMesh mesh0,
PolygonalMesh mesh1) |
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
public boolean isClosed
public boolean isContinuable
public Face containingFace
public double singleFaceArea
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. This will be true if
true
if this contour divides the meshpublic void reverse()
public IntersectionPoint getWrapped(int idx)
idx
- index of point to getpublic int getWrappedIndex(int idx)
idx
- index value to checkidx
is out of rangepublic double computePlanarArea()
public void computeCentroid(Vector3d centroid)
centroid
- returns the centroidpublic Point3d computeCentroid()
public 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 getNext(IntersectionPoint p)
p
on this
contour. If the contour is open and p
is the last
point, returns null
.public IntersectionPoint getPrev(IntersectionPoint p)
p
on this
contour. If the contour is open and p
is the first
point, returns null
.public IntersectionPoint getLast()
null
public int findSegmentFaceStart(Face face, PolygonalMesh mesh)
public IntersectionPoint firstFaceEntryPoint(PolygonalMesh mesh, Face face)
face
on mesh
. If the contour does not enter the
face, or if it is entirely located on the face, the method returns
-1
.
If face
is null
, then the methods returns
the first point where the contour first enters any face. For open
contours, this is always the first point. If the contour is closed and
entirely associated with one face, there is no entry index and the method
returns null
.
public IntersectionPoint firstNonCoincidentPoint(double tol)
null
(for open contours), or whose distance from
the preceeding point exceeds tol
. On closed contours, the
latter is found by searching in reverse from the first point. If no such
point is found (i.e., all points have a distance <=
tol
between them), null
is returned.public IntersectionContour copy()
public void getState(DataBuffer data, PolygonalMesh mesh0, PolygonalMesh mesh1)
public void setState(DataBuffer data, PolygonalMesh mesh0, PolygonalMesh mesh1)
public boolean equals(IntersectionContour contour, java.lang.StringBuilder msg)