Skip to content

Commit

Permalink
update docs on sharp corner weighting
Browse files Browse the repository at this point in the history
  • Loading branch information
msbarry committed Nov 22, 2024
1 parent 3476a10 commit d234b2e
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ public VWSimplifier setTolerance(double tolerance) {
}

/**
* Apply a penalty to filter-out sharp corners: {@code k=0} means no penalty, {@code k=0.5} makes the effective area
* of shallow corners 50% larger than sharp corners, and {@code k=1} makes the effective area of shallow corners
* double that of sharp corners.
* Apply a penalty from {@code k=0} to {@code k=1} to drop more sharp corners from the resulting geometry.
* <p>
* {@code k=0} is the default to apply no penalty for corner sharpness and just drop based on effective triangle area
* at the vertex. {@code k=0.7} is the recommended setting to drop corners based on weighted effective area.
*/
public VWSimplifier setWeight(double k) {
this.k = k;
Expand Down Expand Up @@ -79,6 +80,7 @@ protected CoordinateSequence transformCoordinates(CoordinateSequence coords, Geo

DoubleMinHeap heap = DoubleMinHeap.newArrayHeap(num, Integer::compare);
Vertex[] points = new Vertex[num];
// TODO
// Stack<Vertex> intersecting = new Stack<>();
Vertex prev = null;
for (int i = 0; i < num; i++) {
Expand All @@ -103,6 +105,7 @@ protected CoordinateSequence transformCoordinates(CoordinateSequence coords, Geo
if (point.area > tolerance || left <= min) {
break;
}
// TODO
// // Check that the new segment doesn’t intersect with
// // any existing segments, except for the point’s
// // immediate neighbours.
Expand Down

0 comments on commit d234b2e

Please sign in to comment.