Remove debug spew

This commit is contained in:
Erica Fischer
2023-11-10 12:35:56 -08:00
parent 5e14b68560
commit c59202788a
-30
View File
@@ -286,11 +286,6 @@ struct scan_transition {
}; };
void snap_round(std::vector<segment> &segs) { void snap_round(std::vector<segment> &segs) {
for (auto const &seg : segs) {
printf("before snap round %f,%f to %f,%f\n", seg.first.x, seg.first.y,
seg.second.x, seg.second.y);
}
bool again = true; bool again = true;
while (again) { while (again) {
@@ -387,17 +382,9 @@ drawvec reassemble(std::vector<segment> const &segs) {
for (auto const &seg : segs) { for (auto const &seg : segs) {
connections.emplace(seg.first, seg); connections.emplace(seg.first, seg);
printf("initial %f,%f to %f,%f\n", seg.first.x, seg.first.y,
seg.second.x, seg.second.y);
} }
while (connections.size() > 0) { while (connections.size() > 0) {
for (auto const &s : connections) {
printf("starting from %f,%f to %f,%f\n", s.second.first.x, s.second.first.y,
s.second.second.x, s.second.second.y);
}
// arbitrarily choose a starting point, // arbitrarily choose a starting point,
// and walk the connections from there until // and walk the connections from there until
// we find a point that we have already visited. // we find a point that we have already visited.
@@ -449,24 +436,12 @@ drawvec reassemble(std::vector<segment> const &segs) {
examined.emplace(here.first, here); examined.emplace(here.first, here);
ring.push_back(here.first); ring.push_back(here.first);
printf("looking for %f,%f to %f,%f\n",
here.first.x, here.first.y,
here.second.x, here.second.y);
for (auto const &s : connections) {
printf("in %f,%f to %f,%f\n", s.second.first.x, s.second.first.y,
s.second.second.x, s.second.second.y);
}
// find the initial segment in `connections` so we can remove it // find the initial segment in `connections` so we can remove it
auto initial = connections.equal_range(here.first); auto initial = connections.equal_range(here.first);
bool found = false; bool found = false;
for (; initial.first != initial.second; ++initial.first) { for (; initial.first != initial.second; ++initial.first) {
printf("looking at %f,%f to %f,%f\n",
initial.first->second.first.x, initial.first->second.first.y,
initial.first->second.second.x, initial.first->second.second.y);
if (initial.first->second == here) { if (initial.first->second == here) {
connections.erase(initial.first); connections.erase(initial.first);
printf("there it is\n");
found = true; found = true;
break; break;
} }
@@ -476,11 +451,6 @@ drawvec reassemble(std::vector<segment> const &segs) {
exit(EXIT_IMPOSSIBLE); exit(EXIT_IMPOSSIBLE);
} }
for (auto const &s : connections) {
printf("now looking in %f,%f to %f,%f\n", s.second.first.x, s.second.first.y,
s.second.second.x, s.second.second.y);
}
while (examined.find(here.second) == examined.end()) { while (examined.find(here.second) == examined.end()) {
auto options = connections.equal_range(here.second); auto options = connections.equal_range(here.second);
if (options.first == options.second) { if (options.first == options.second) {