* The default value for miterLimit
is 2
- * (i.e. twice group_delta). This is also the smallest
+ * (i.e. twice groupDelta). This is also the smallest
* MiterLimit that's allowed. If mitering was
* unrestricted (ie without any squaring), then offsets
* at very acute angles would generate unacceptably
@@ -110,8 +110,8 @@ public ClipperOffset() {
* during offsetting.
*
* It's important to make arcTolerance a sensible
- * fraction of the offset group_delta (arc radius).
- * Large tolerances relative to the offset group_delta
+ * fraction of the offset groupDelta (arc radius).
+ * Large tolerances relative to the offset groupDelta
* will produce poor arc approximations but, just as
* importantly, very small tolerances will slow
* offsetting performance without noticeably improving
@@ -145,7 +145,7 @@ public ClipperOffset(double miterLimit, double arcTolerance, boolean preserveCol
}
public final void Clear() {
- _groupList.clear();
+ groupList.clear();
}
public final void AddPath(Path64 path, JoinType joinType, EndType endType) {
@@ -162,17 +162,17 @@ public final void AddPaths(Paths64 paths, JoinType joinType, EndType endType) {
if (cnt == 0) {
return;
}
- _groupList.add(new Group(paths, joinType, endType));
+ groupList.add(new Group(paths, joinType, endType));
}
private void ExecuteInternal(double delta) {
solution.clear();
- if (_groupList.isEmpty()) {
+ if (groupList.isEmpty()) {
return;
}
if (Math.abs(delta) < 0.5) {
- for (Group group : _groupList) {
+ for (Group group : groupList) {
for (Path64 path : group.inPaths) {
solution.add(path);
}
@@ -181,7 +181,7 @@ private void ExecuteInternal(double delta) {
this.delta = delta;
this.mitLimSqr = (getMiterLimit() <= 1 ? 2.0 : 2.0 / Clipper.Sqr(getMiterLimit()));
- for (Group group : _groupList) {
+ for (Group group : groupList) {
DoGroupOffset(group);
}
}
@@ -194,9 +194,9 @@ public final void Execute(double delta, Paths64 solution) {
// clean up self-intersections ...
Clipper64 c = new Clipper64();
c.setPreserveCollinear(getPreserveCollinear());
- c.setReverseSolution(getReverseSolution() != _groupList.get(0).pathsReversed);
+ c.setReverseSolution(getReverseSolution() != groupList.get(0).pathsReversed);
c.AddSubject(solution);
- if (_groupList.get(0).pathsReversed) {
+ if (groupList.get(0).pathsReversed) {
c.Execute(ClipType.Union, FillRule.Negative, solution);
} else {
c.Execute(ClipType.Union, FillRule.Positive, solution);
@@ -211,9 +211,9 @@ public void Execute(double delta, PolyTree64 polytree) {
Clipper64 c = new Clipper64();
c.setPreserveCollinear(getPreserveCollinear());
// the solution should retain the orientation of the input
- c.setReverseSolution(getReverseSolution() != _groupList.get(0).pathsReversed);
+ c.setReverseSolution(getReverseSolution() != groupList.get(0).pathsReversed);
c.AddSubject(solution);
- if (_groupList.get(0).pathsReversed) {
+ if (groupList.get(0).pathsReversed) {
c.Execute(ClipType.Union, FillRule.Negative, polytree);
} else {
c.Execute(ClipType.Union, FillRule.Positive, polytree);
@@ -360,11 +360,11 @@ private static PointD IntersectPoint(PointD pt1a, PointD pt1b, PointD pt2a, Poin
}
private Point64 GetPerpendic(Point64 pt, PointD norm) {
- return new Point64(pt.x + norm.x * group_delta, pt.y + norm.y * group_delta);
+ return new Point64(pt.x + norm.x * groupDelta, pt.y + norm.y * groupDelta);
}
private PointD GetPerpendicD(Point64 pt, PointD norm) {
- return new PointD(pt.x + norm.x * group_delta, pt.y + norm.y * group_delta);
+ return new PointD(pt.x + norm.x * groupDelta, pt.y + norm.y * groupDelta);
}
private void DoSquare(Group group, Path64 path, int j, int k) {
@@ -377,16 +377,16 @@ private void DoSquare(Group group, Path64 path, int j, int k) {
// now offset the original vertex delta units along unit vector
PointD ptQ = new PointD(path.get(j));
- ptQ = TranslatePoint(ptQ, abs_group_delta * vec.x, abs_group_delta * vec.y);
+ ptQ = TranslatePoint(ptQ, absGroupDelta * vec.x, absGroupDelta * vec.y);
// get perpendicular vertices
- PointD pt1 = TranslatePoint(ptQ, group_delta * vec.y, group_delta * -vec.x);
- PointD pt2 = TranslatePoint(ptQ, group_delta * -vec.y, group_delta * vec.x);
+ PointD pt1 = TranslatePoint(ptQ, groupDelta * vec.y, groupDelta * -vec.x);
+ PointD pt2 = TranslatePoint(ptQ, groupDelta * -vec.y, groupDelta * vec.x);
// get 2 vertices along one edge offset
PointD pt3 = GetPerpendicD(path.get(k), normals.get(k));
if (j == k) {
- PointD pt4 = new PointD(pt3.x + vec.x * group_delta, pt3.y + vec.y * group_delta);
+ PointD pt4 = new PointD(pt3.x + vec.x * groupDelta, pt3.y + vec.y * groupDelta);
PointD pt = IntersectPoint(pt1, pt2, pt3, pt4);
// get the second intersect point through reflecion
group.outPath.add(new Point64(ReflectPoint(pt, ptQ)));
@@ -401,14 +401,14 @@ private void DoSquare(Group group, Path64 path, int j, int k) {
}
private void DoMiter(Group group, Path64 path, int j, int k, double cosA) {
- double q = group_delta / (cosA + 1);
+ double q = groupDelta / (cosA + 1);
group.outPath.add(new Point64(path.get(j).x + (normals.get(k).x + normals.get(j).x) * q,
path.get(j).y + (normals.get(k).y + normals.get(j).y) * q));
}
private void DoRound(Group group, Path64 path, int j, int k, double angle) {
Point64 pt = path.get(j);
- PointD offsetVec = new PointD(normals.get(k).x * group_delta, normals.get(k).y * group_delta);
+ PointD offsetVec = new PointD(normals.get(k).x * groupDelta, normals.get(k).y * groupDelta);
if (j == k) {
offsetVec.Negate();
}
@@ -418,10 +418,7 @@ private void DoRound(Group group, Path64 path, int j, int k, double angle) {
int steps = (int) Math.ceil(stepsPerRad * Math.abs(angle));
for (int i = 1; i < steps; i++) // ie 1 less than steps
{
- offsetVec = new PointD(
- offsetVec.x * stepCos - stepSin * offsetVec.y,
- offsetVec.x * stepSin + offsetVec.y * stepCos
- );
+ offsetVec = new PointD(offsetVec.x * stepCos - stepSin * offsetVec.y, offsetVec.x * stepSin + offsetVec.y * stepCos);
group.outPath.add(new Point64(pt.x + offsetVec.x, pt.y + offsetVec.y));
}
}
@@ -455,9 +452,10 @@ private void OffsetPoint(Group group, Path64 path, int j, RefObject
* This function is extremely fast when compared to the Library's general
* purpose Intersect clipper. Where Intersect has roughly O(n³) performance,
- * ExecuteRectClipLines has O(n) performance.
+ * RectClip has O(n) performance.
*
* @since 1.0.6
*/
@@ -31,7 +31,7 @@ protected static class OutPt2 {
OutPt2 next;
@Nullable
OutPt2 prev;
-
+
Point64 pt;
int ownerIdx;
@Nullable
@@ -775,9 +775,9 @@ private void TidyEdgePair(int idx, List<@Nullable OutPt2> cw, List<@Nullable Out
}
if (!isRejoining) {
- int new_idx = results.size();
+ int newIdx = results.size();
results.add(p1a);
- SetNewOwner(p1a, new_idx);
+ SetNewOwner(p1a, newIdx);
}
if (cwIsTowardLarger) {
diff --git a/src/main/java/clipper2/rectclip/RectClipLines.java b/src/main/java/clipper2/rectclip/RectClipLines.java
index 21c3a09..a8040bd 100644
--- a/src/main/java/clipper2/rectclip/RectClipLines.java
+++ b/src/main/java/clipper2/rectclip/RectClipLines.java
@@ -9,12 +9,12 @@
import tangible.RefObject;
/**
- * ExecuteRectClipLines intersects subject open paths (polylines) with the specified
+ * RectClipLines intersects subject open paths (polylines) with the specified
* rectangular clipping region.
*
* This function is extremely fast when compared to the Library's general
* purpose Intersect clipper. Where Intersect has roughly O(n³) performance,
- * ExecuteRectClipLines has O(n) performance.
+ * RectClipLines has O(n) performance.
*
* @since 1.0.6
*/