Skip to content

Commit

Permalink
Remove debug spew
Browse files Browse the repository at this point in the history
  • Loading branch information
e-n-f committed Nov 14, 2023
1 parent 624c2b6 commit b22d6c8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions polygon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,7 @@ drawvec scale_poly(drawvec const &geom, int z, int detail) {
// to avoid excessive fiddling with the geometry
if ((scaled_area_orig > 1 && area_scaled < -1) ||
(scaled_area_orig < -1 && area_scaled > 1)) {
#if 0
fprintf(stderr, "z%d winding reversed: %f,%f, %f,%f, %f,%f (%f) vs %lld,%lld %lld,%lld %lld,%lld (%f)\n",
z,
geom[i + (k + 0) % ring.size()].x / scale, geom[i + (k + 0) % ring.size()].y / scale,
Expand All @@ -761,6 +762,7 @@ drawvec scale_poly(drawvec const &geom, int z, int detail) {
ring[0 + (k + 1) % ring.size()].x, ring[0 + (k + 1) % ring.size()].y,
ring[0 + (k + 2) % ring.size()].x, ring[0 + (k + 2) % ring.size()].y,
area_scaled);
#endif

// jitter one of the coordinates to try to fix it,
// on the theory that a slightly-wrong ring is
Expand All @@ -777,11 +779,13 @@ drawvec scale_poly(drawvec const &geom, int z, int detail) {

if ((scaled_area_orig > 1 && area_altered >= 0) ||
(scaled_area_orig < -1 && area_altered <= 0)) {
#if 0
fprintf(stderr, "fixed it: %lld,%lld %lld,%lld %lld,%lld (%f)\n",
altered[0 + (k + 0) % altered.size()].x, altered[0 + (k + 0) % altered.size()].y,
altered[0 + (k + 1) % altered.size()].x, altered[0 + (k + 1) % altered.size()].y,
altered[0 + (k + 2) % altered.size()].x, altered[0 + (k + 2) % altered.size()].y,
area_altered);
#endif
ring = altered;

dx = dy = INT_MAX; // break from both loops
Expand Down

0 comments on commit b22d6c8

Please sign in to comment.