89 |
|
|
90 |
/** |
/** |
91 |
* Segment vectors containing solid areas and holes |
* Segment vectors containing solid areas and holes |
92 |
|
* This is package-private to avoid an accessor method. |
93 |
*/ |
*/ |
94 |
private Vector solids; |
Vector solids; |
95 |
|
|
96 |
/** |
/** |
97 |
* Segment vectors containing solid areas and holes |
* Segment vectors containing solid areas and holes |
98 |
|
* This is package-private to avoid an accessor method. |
99 |
*/ |
*/ |
100 |
private Vector holes; |
Vector holes; |
101 |
|
|
102 |
/** |
/** |
103 |
* Vector (temporary) storing curve-curve intersections |
* Vector (temporary) storing curve-curve intersections |
1317 |
* This is a reasonably accurate method, although the recursion depth |
* This is a reasonably accurate method, although the recursion depth |
1318 |
* is typically around 20, the bounding-box tests allow for significant |
* is typically around 20, the bounding-box tests allow for significant |
1319 |
* pruning of the subdivision tree. |
* pruning of the subdivision tree. |
1320 |
|
* |
1321 |
|
* This is package-private to avoid an accessor method. |
1322 |
*/ |
*/ |
1323 |
private Intersection[] cubicCubicIntersect(CubicSegment curve1, |
Intersection[] cubicCubicIntersect(CubicSegment curve1, CubicSegment curve2) |
|
CubicSegment curve2) |
|
1324 |
{ |
{ |
1325 |
Rectangle2D r1 = curve1.getBounds(); |
Rectangle2D r1 = curve1.getBounds(); |
1326 |
Rectangle2D r2 = curve2.getBounds(); |
Rectangle2D r2 = curve2.getBounds(); |
1352 |
* Or null if no intersections are found1 |
* Or null if no intersections are found1 |
1353 |
* This is done through combining the line's equation with the |
* This is done through combining the line's equation with the |
1354 |
* parametric form of the Bezier and solving the resulting quadratic. |
* parametric form of the Bezier and solving the resulting quadratic. |
1355 |
|
* This is package-private to avoid an accessor method. |
1356 |
*/ |
*/ |
1357 |
private Intersection[] lineQuadIntersect(LineSegment l, QuadSegment c) |
Intersection[] lineQuadIntersect(LineSegment l, QuadSegment c) |
1358 |
{ |
{ |
1359 |
double[] y = new double[3]; |
double[] y = new double[3]; |
1360 |
double[] x = new double[3]; |
double[] x = new double[3]; |
1457 |
* Returns the intersections between a line and a cubic segment |
* Returns the intersections between a line and a cubic segment |
1458 |
* This is done through combining the line's equation with the |
* This is done through combining the line's equation with the |
1459 |
* parametric form of the Bezier and solving the resulting quadratic. |
* parametric form of the Bezier and solving the resulting quadratic. |
1460 |
|
* This is package-private to avoid an accessor method. |
1461 |
*/ |
*/ |
1462 |
private Intersection[] lineCubicIntersect(LineSegment l, CubicSegment c) |
Intersection[] lineCubicIntersect(LineSegment l, CubicSegment c) |
1463 |
{ |
{ |
1464 |
double[] y = new double[4]; |
double[] y = new double[4]; |
1465 |
double[] x = new double[4]; |
double[] x = new double[4]; |
1565 |
/** |
/** |
1566 |
* Returns the intersection between two lines, or null if there is no |
* Returns the intersection between two lines, or null if there is no |
1567 |
* intersection. |
* intersection. |
1568 |
|
* This is package-private to avoid an accessor method. |
1569 |
*/ |
*/ |
1570 |
private Intersection linesIntersect(LineSegment a, LineSegment b) |
Intersection linesIntersect(LineSegment a, LineSegment b) |
1571 |
{ |
{ |
1572 |
Point2D P1 = a.P1; |
Point2D P1 = a.P1; |
1573 |
Point2D P2 = a.P2; |
Point2D P2 = a.P2; |
1611 |
/** |
/** |
1612 |
* Determines if two points are equal, within an error margin |
* Determines if two points are equal, within an error margin |
1613 |
* 'snap distance' |
* 'snap distance' |
1614 |
|
* This is package-private to avoid an accessor method. |
1615 |
*/ |
*/ |
1616 |
private boolean pointEquals(Point2D a, Point2D b) |
boolean pointEquals(Point2D a, Point2D b) |
1617 |
{ |
{ |
1618 |
return (a.equals(b) || a.distance(b) < PE_EPSILON); |
return (a.equals(b) || a.distance(b) < PE_EPSILON); |
1619 |
} |
} |