@@ -73,10 +73,10 @@ public class RCommand extends RGeomElem {
7373 public static int segmentType = UNIFORMLENGTH ;
7474
7575 /* Parameters for ADAPTATIVE (dependent of the PGraphics on which drawing) */
76- static final int segmentRecursionLimit = 32 ;
77- static final float segmentDistanceEpsilon = 1.192092896e-07F ;
78- static final float segmentCollinearityEpsilon = 1.192092896e-07F ;
79- static final float segmentAngleTolEpsilon = 0.01F ;
76+ static final int SEGMENT_RECURSION_LIMIT = 32 ;
77+ static final float SEGMENT_DISTANCE_EPSILON = 1.192092896e-07F ;
78+ static final float SEGMENT_COLLINEARITY_EPSILON = 1.192092896e-07F ;
79+ static final float SEGMENT_ANGLE_TOL_EPSILON = 0.01F ;
8080
8181 static float segmentGfxStrokeWeight = 1.0F ;
8282 static float segmentGfxScale = 1.0F ;
@@ -1057,7 +1057,7 @@ private void quadBezierAdaptative() {
10571057
10581058 private void quadBezierAdaptativeRecursive (float x1 , float y1 , float x2 , float y2 , float x3 , float y3 , int level ) {
10591059
1060- if (level > segmentRecursionLimit ) {
1060+ if (level > SEGMENT_RECURSION_LIMIT ) {
10611061 return ;
10621062 }
10631063
@@ -1074,14 +1074,14 @@ private void quadBezierAdaptativeRecursive(float x1, float y1, float x2, float y
10741074 float dy = y3 - y1 ;
10751075 float d = Math .abs (((x2 - x3 ) * dy - (y2 - y3 ) * dx ));
10761076
1077- if (d > segmentCollinearityEpsilon ) {
1077+ if (d > SEGMENT_COLLINEARITY_EPSILON ) {
10781078 // Regular care
10791079 //-----------------
10801080 if (d * d <= segmentDistTolSqr * (dx * dx + dy * dy )) {
10811081 // If the curvature doesn't exceed the distance_tolerance value
10821082 // we tend to finish subdivisions.
10831083 //----------------------
1084- if (segmentAngleTol < segmentAngleTolEpsilon ) {
1084+ if (segmentAngleTol < SEGMENT_ANGLE_TOL_EPSILON ) {
10851085 addCurvePoint (new RPoint (x123 , y123 ));
10861086 return ;
10871087 }
@@ -1120,7 +1120,7 @@ private void cubicBezierAdaptative() {
11201120 }
11211121
11221122 private void cubicBezierAdaptativeRecursive (float x1 , float y1 , float x2 , float y2 , float x3 , float y3 , float x4 , float y4 , int level ) {
1123- if (level > segmentRecursionLimit ) {
1123+ if (level > SEGMENT_RECURSION_LIMIT ) {
11241124 return ;
11251125 }
11261126
@@ -1148,8 +1148,8 @@ private void cubicBezierAdaptativeRecursive(float x1, float y1, float x2, float
11481148 float d3 = Math .abs (((x3 - x4 ) * dy - (y3 - y4 ) * dx ));
11491149 float da1 , da2 ;
11501150
1151- int d2b = (d2 > segmentCollinearityEpsilon ) ? 1 : 0 ;
1152- int d3b = (d3 > segmentCollinearityEpsilon ) ? 1 : 0 ;
1151+ int d2b = (d2 > SEGMENT_COLLINEARITY_EPSILON ) ? 1 : 0 ;
1152+ int d3b = (d3 > SEGMENT_COLLINEARITY_EPSILON ) ? 1 : 0 ;
11531153 switch ((d2b << 1 ) + d3b ) {
11541154 case 0 :
11551155 // All collinear OR p1==p4
@@ -1167,7 +1167,7 @@ private void cubicBezierAdaptativeRecursive(float x1, float y1, float x2, float
11671167 // p1,p2,p4 are collinear, p3 is considerable
11681168 //----------------------
11691169 if (d3 * d3 <= segmentDistTolSqr * (dx * dx + dy * dy )) {
1170- if (segmentAngleTol < segmentAngleTolEpsilon ) {
1170+ if (segmentAngleTol < SEGMENT_ANGLE_TOL_EPSILON ) {
11711171 addCurvePoint (new RPoint (x23 , y23 ));
11721172 return ;
11731173 }
@@ -1198,7 +1198,7 @@ private void cubicBezierAdaptativeRecursive(float x1, float y1, float x2, float
11981198 // p1,p3,p4 are collinear, p2 is considerable
11991199 //----------------------
12001200 if (d2 * d2 <= segmentDistTolSqr * (dx * dx + dy * dy )) {
1201- if (segmentAngleTol < segmentAngleTolEpsilon ) {
1201+ if (segmentAngleTol < SEGMENT_ANGLE_TOL_EPSILON ) {
12021202 addCurvePoint (new RPoint (x23 , y23 ));
12031203 return ;
12041204 }
@@ -1232,7 +1232,7 @@ private void cubicBezierAdaptativeRecursive(float x1, float y1, float x2, float
12321232 // If the curvature doesn't exceed the distance_tolerance value
12331233 // we tend to finish subdivisions.
12341234 //----------------------
1235- if (segmentAngleTol < segmentAngleTolEpsilon ) {
1235+ if (segmentAngleTol < SEGMENT_ANGLE_TOL_EPSILON ) {
12361236 addCurvePoint (new RPoint (x23 , y23 ));
12371237 return ;
12381238 }
0 commit comments