diff options
author | don bright <hugh.m.bright@gmail.com> | 2012-10-16 01:17:12 (GMT) |
---|---|---|
committer | don bright <hugh.m.bright@gmail.com> | 2012-10-16 01:17:12 (GMT) |
commit | 56def4aef228564ea4abcc06d4873c961921cf7d (patch) | |
tree | 5374210ab104604af37eae51af1341b5d7792b02 /src/CGAL_Nef_polyhedron_DxfData.cc | |
parent | 65fc1d6b01ade5e76fe712f93e2e108194c3291b (diff) |
projection: fallback to 'large thin box' if intersection with plane fails.
also implement SVG debugging output for 2d + 3d Nef Polyhedrons.
Diffstat (limited to 'src/CGAL_Nef_polyhedron_DxfData.cc')
-rw-r--r-- | src/CGAL_Nef_polyhedron_DxfData.cc | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/src/CGAL_Nef_polyhedron_DxfData.cc b/src/CGAL_Nef_polyhedron_DxfData.cc index 411a340..922a7ec 100644 --- a/src/CGAL_Nef_polyhedron_DxfData.cc +++ b/src/CGAL_Nef_polyhedron_DxfData.cc @@ -28,6 +28,7 @@ #include "grid.h" #include "CGAL_Nef_polyhedron.h" #include "cgal.h" +#include "cgalutils.h" #ifdef ENABLE_CGAL @@ -77,29 +78,24 @@ DxfData *CGAL_Nef_polyhedron::convertToDxfData() const return dxfdata; } -// dump the 2 dimensional nef_poly. -std::string CGAL_Nef_polyhedron::dump_p2() const +std::string CGAL_Nef_polyhedron::dump() const { - std::stringstream out; - CGAL_Nef_polyhedron2::Explorer explorer = this->p2->explorer(); - CGAL_Nef_polyhedron2::Explorer::Vertex_const_iterator i; - out << "CGAL_Nef_polyhedron::p2 Vertices"; - for (i = explorer.vertices_begin(); i != explorer.vertices_end(); ++i) { - if ( explorer.is_standard( i ) ) { - CGAL_Nef_polyhedron2::Explorer::Point point = explorer.point( i ); - out << "\n Point x y: " - << CGAL::to_double(point.x()) << " " - << CGAL::to_double(point.y()); - } else { - CGAL_Nef_polyhedron2::Explorer::Ray ray = explorer.ray( i ); - CGAL_Nef_polyhedron2::Explorer::Point point = ray.point( 0 ); - out << "\n Ray x y dx dy: " - << CGAL::to_double(point.x()) << " " << CGAL::to_double(point.y()) << " " - << CGAL::to_double(ray.direction().dx()) << " " << CGAL::to_double(ray.direction().dy()); - } - } - out << "\nCGAL_Nef_polyhedron::p2 Vertices end"; - return out.str(); + if (this->dim==2) + return dump_cgal_nef_polyhedron2( *this->p2 ); + else if (this->dim==3) + return dump_cgal_nef_polyhedron3( *this->p3 ); + else + return std::string("Nef Polyhedron with dimension != 2 or 3"); +} + +std::string CGAL_Nef_polyhedron::dump_svg() const +{ + if (this->dim==2) + return dump_cgal_nef_polyhedron2_svg( *this->p2 ); + else if (this->dim==3) + return dump_cgal_nef_polyhedron3_svg( *this->p3 ); + else + return std::string("<svg><!--Nef Polyhedron with dimension != 2 or 3--></svg>"); } #endif // ENABLE_CGAL |