diff --git a/Kinetic_shape_reconstruction/examples/Kinetic_shape_reconstruction/stress-test-4/test-3-rnd-polygons-4-4.off b/Kinetic_shape_reconstruction/examples/Kinetic_shape_reconstruction/polygon-splitter-test/test-3-rnd-polygons-4-4.off similarity index 100% rename from Kinetic_shape_reconstruction/examples/Kinetic_shape_reconstruction/stress-test-4/test-3-rnd-polygons-4-4.off rename to Kinetic_shape_reconstruction/examples/Kinetic_shape_reconstruction/polygon-splitter-test/test-3-rnd-polygons-4-4.off diff --git a/Kinetic_shape_reconstruction/examples/Kinetic_shape_reconstruction/data/test_2_polygons_ad.off b/Kinetic_shape_reconstruction/examples/Kinetic_shape_reconstruction/polygon-splitter-test/test_2_polygons_ad.off similarity index 100% rename from Kinetic_shape_reconstruction/examples/Kinetic_shape_reconstruction/data/test_2_polygons_ad.off rename to Kinetic_shape_reconstruction/examples/Kinetic_shape_reconstruction/polygon-splitter-test/test_2_polygons_ad.off diff --git a/Kinetic_shape_reconstruction/examples/Kinetic_shape_reconstruction/data/test_2_polygons_bc.off b/Kinetic_shape_reconstruction/examples/Kinetic_shape_reconstruction/polygon-splitter-test/test_2_polygons_bc.off similarity index 100% rename from Kinetic_shape_reconstruction/examples/Kinetic_shape_reconstruction/data/test_2_polygons_bc.off rename to Kinetic_shape_reconstruction/examples/Kinetic_shape_reconstruction/polygon-splitter-test/test_2_polygons_bc.off diff --git a/Kinetic_shape_reconstruction/examples/Kinetic_shape_reconstruction/data/test_3_polygons_bcd.off b/Kinetic_shape_reconstruction/examples/Kinetic_shape_reconstruction/polygon-splitter-test/test_3_polygons_bcd.off similarity index 100% rename from Kinetic_shape_reconstruction/examples/Kinetic_shape_reconstruction/data/test_3_polygons_bcd.off rename to Kinetic_shape_reconstruction/examples/Kinetic_shape_reconstruction/polygon-splitter-test/test_3_polygons_bcd.off diff --git a/Kinetic_shape_reconstruction/include/CGAL/KSR_3/Data_structure.h b/Kinetic_shape_reconstruction/include/CGAL/KSR_3/Data_structure.h index e9dd1092358..23eb0b1c8e8 100644 --- a/Kinetic_shape_reconstruction/include/CGAL/KSR_3/Data_structure.h +++ b/Kinetic_shape_reconstruction/include/CGAL/KSR_3/Data_structure.h @@ -863,6 +863,8 @@ public: std::deque vertices; vertices.push_back (pvertex); + // std::cout << "came from: " << segment_3(iedge(pvertex)) << std::endl; + std::queue todo; PVertex prev, next; std::tie (prev, next) = border_prev_and_next (pvertex); @@ -1342,8 +1344,9 @@ public: IEdge prev_iedge = null_iedge(), next_iedge = null_iedge(); - std::ofstream("came_from.polylines.txt") - << "2 " << segment_3(iedge(pvertices[1])) << std::endl; + // std::ofstream("came_from.polylines.txt") + // << "2 " << segment_3(iedge(pvertices[1])) << std::endl; + std::cout << "came from: " << segment_3(iedge(pvertices[1])) << std::endl; // Copy front/back to remember position/direction. PVertex front, back; @@ -1470,6 +1473,7 @@ public: { return a.second < b.second; }); + CGAL_assertion(iedges.size() != 0); std::cout.precision(20); std::cout << "Prev = " << point_3 (prev) << " / " << direction (prev) << std::endl @@ -1573,6 +1577,7 @@ public: ++iter; } + CGAL_assertion(crossed.size() != 0); std::cerr << "IEdges crossed = " << crossed.size() << std::endl; for (const auto& iedge : crossed) std::cout << segment_3(iedge) << std::endl; @@ -1755,6 +1760,7 @@ public: ++iter; } + CGAL_assertion(crossed.size() != 0); std::cerr << "IEdges crossed = " << crossed.size() << std::endl; for (const auto& iedge : crossed) std::cout << segment_3(iedge) << std::endl; @@ -1877,6 +1883,7 @@ public: } } + CGAL_assertion(first_idx != KSR::no_element()); crossed.clear(); // std::ofstream("first.polylines.txt") @@ -1904,6 +1911,7 @@ public: ++iter; } + CGAL_assertion(crossed.size() != 0); std::cerr << "IEdges crossed = " << crossed.size() << std::endl; for (const auto& iedge : crossed) std::cout << segment_3(iedge) << std::endl; @@ -2071,17 +2079,20 @@ public: support_plane(support_plane_idx).remove_vertex(front.second); support_plane(support_plane_idx).remove_vertex(back.second); - std::cout << "*** New vertices:"; - for (const PVertex& pv : new_vertices) - std::cout << " " << str(pv); - std::cout << std::endl; - // push also remaining vertex so that its events are recomputed // std::cout << "pushing new pv: " << str(pvertex) << std::endl; // std::cout << "pv direction: " << direction(pvertex) << std::endl; new_vertices.push_back(pvertex); crossed.push_back(iedge(pvertex)); + std::cout << "*** New vertices:"; + for (const PVertex& pv : new_vertices) + std::cout << " " << str(pv); + std::cout << std::endl; + + // for (const PVertex& pv : new_vertices) + // std::cout << point_3(pv) << std::endl; + // if (has_iedge(prev) && !is_frozen(prev)) { // // if (iedge(prev) != iedge(pvertex)) { // std::cout << "pushing new prev: " << str(prev) << std::endl; @@ -2274,14 +2285,14 @@ private: Point_2& future_point, Vector_2& direction) const { bool is_parallel = false; - if (this->iedge(pvertex) != null_iedge() - && line_idx(pvertex) == line_idx(iedge)) - { - // std::cerr << "found limit" << std::endl; - future_point = point_2(pvertex, FT(0)); - direction = this->direction(pvertex); - return is_parallel; - } + // if (this->iedge(pvertex) != null_iedge() + // && line_idx(pvertex) == line_idx(iedge)) + // { + // std::cerr << "found limit" << std::endl; + // future_point = point_2(pvertex, FT(0)); + // direction = this->direction(pvertex); + // return is_parallel; + // } const Line_2 iedge_line = segment_2(pvertex.first, iedge).supporting_line(); const Point_2 pinit = iedge_line.projection(point_2(pvertex)); diff --git a/Kinetic_shape_reconstruction/include/CGAL/Kinetic_shape_reconstruction_3.h b/Kinetic_shape_reconstruction/include/CGAL/Kinetic_shape_reconstruction_3.h index 9c3312171bb..c9272c05d6d 100644 --- a/Kinetic_shape_reconstruction/include/CGAL/Kinetic_shape_reconstruction_3.h +++ b/Kinetic_shape_reconstruction/include/CGAL/Kinetic_shape_reconstruction_3.h @@ -585,9 +585,9 @@ private: ++ iter; - // if (iter == 10) { - // exit(0); - // } + if (iter == 7) { + exit(0); + } apply(k, ev);