public class TriFaceClipperTest extends UnitTest
TriFaceClipper.
Clipping results are checked against an independent reference
implementation (RefRegion), which finds the parameter interval of a
segment lying within the region by intersecting [0,1] with the four
half spaces that bound the region. The reference implementation is itself
anchored by a sampling test which classifies points along the segment
directly, and by explicit tests on a canonical triangle for which the region
is known by inspection.
| Constructor and Description |
|---|
TriFaceClipperTest() |
| Modifier and Type | Method and Description |
|---|---|
static void |
main(java.lang.String[] args) |
void |
test() |
void |
testAdjacency()
Tests the coordinate reuse optimization of
maxClippedDistance(Face,int,boolean). |
void |
testAreaClipping()
Tests the triangle based
maxClippedDistance() on triangles which
are large enough to span the region without any of their edges entering
it. |
void |
testErrors()
Tests error handling.
|
void |
testFaceMethods()
|
void |
testRandom()
Tests clipping for randomly generated triangles and segments.
|
void |
testRegionPredicate()
Tests the region predicate used by the reference implementation against
points whose location is known by inspection, and checks that the clipper
agrees about whether or not a point lies inside the region.
|
void |
testSpecificCases()
Tests clipping for cases whose results are known by inspection.
|
check, checkEquals, checkEquals, checkEquals, checkEquals, checkEquals, checkEquals, checkEquals, checkEquals, checkEquals, checkEquals, checkNormedEquals, checkNormedEquals, getSilent, printUsageAndExit, runtest, setSilentpublic void testRegionPredicate()
public void testSpecificCases()
public void testRandom()
public void testErrors()
public void testFaceMethods()
public void testAdjacency()
maxClippedDistance(Face,int,boolean).public void testAreaClipping()
maxClippedDistance() on triangles which
are large enough to span the region without any of their edges entering
it. These are the cases which an edge based estimate misses, and so they
are checked explicitly here in addition to being covered by the random
tests.public static void main(java.lang.String[] args)