diff options
author | don bright <hugh.m.bright@gmail.com> | 2013-03-11 02:35:30 (GMT) |
---|---|---|
committer | don bright <hugh.m.bright@gmail.com> | 2013-03-11 02:35:30 (GMT) |
commit | 5559ae9a6af459021c5b7ab4a823f491dce822a0 (patch) | |
tree | ccea074154b71c24ab0aee3150d4b07eef896a05 /src/cgalutils.h | |
parent | 33a54b52f2c54c4ac66881d63b852b472f5589f1 (diff) |
move transform from CGALEvaluator to Nef_polyhedron - reuse in resize(). also
move ZRemover code to cgalutils, also cleanup SVG code
Diffstat (limited to 'src/cgalutils.h')
-rw-r--r-- | src/cgalutils.h | 50 |
1 files changed, 1 insertions, 49 deletions
diff --git a/src/cgalutils.h b/src/cgalutils.h index 8f10519..6ea7711 100644 --- a/src/cgalutils.h +++ b/src/cgalutils.h @@ -57,55 +57,7 @@ public: void visit( CGAL_Nef_polyhedron3::SHalfedge_const_handle ) {} void visit( CGAL_Nef_polyhedron3::SHalfloop_const_handle ) {} void visit( CGAL_Nef_polyhedron3::SFace_const_handle ) {} - void visit( CGAL_Nef_polyhedron3::Halffacet_const_handle hfacet ) { - log << " <!-- Halffacet visit. Mark: " << hfacet->mark() << " -->\n"; - if ( hfacet->plane().orthogonal_direction() != this->up ) { - log << " <!-- down-facing half-facet. skipping -->\n"; - log << " <!-- Halffacet visit end-->\n"; - return; - } - - // possible optimization - throw out facets that are 'side facets' between - // the top & bottom of the big thin box. (i.e. mixture of z=-eps and z=eps) - - CGAL_Nef_polyhedron3::Halffacet_cycle_const_iterator fci; - int contour_counter = 0; - CGAL_forall_facet_cycles_of( fci, hfacet ) { - if ( fci.is_shalfedge() ) { - CGAL_Nef_polyhedron3::SHalfedge_around_facet_const_circulator c1(fci), cend(c1); - std::vector<CGAL_Nef_polyhedron2::Explorer::Point> contour; - CGAL_For_all( c1, cend ) { - CGAL_Nef_polyhedron3::Point_3 point3d = c1->source()->target()->point(); - CGAL_Nef_polyhedron2::Explorer::Point point2d( point3d.x(), point3d.y() ); - contour.push_back( point2d ); - } - - if (contour.size()==0) continue; - - log << " <!-- is_simple_2:" << CGAL::is_simple_2( contour.begin(), contour.end() ) << " --> \n"; - - tmpnef2d.reset( new CGAL_Nef_polyhedron2( contour.begin(), contour.end(), boundary ) ); - - if ( contour_counter == 0 ) { - log << " <!-- contour is a body. make union(). " << contour.size() << " points. -->\n" ; - *(output_nefpoly2d) += *(tmpnef2d); - } else { - log << " <!-- contour is a hole. make intersection(). " << contour.size() << " points. -->\n"; - *(output_nefpoly2d) *= *(tmpnef2d); - } - - log << "\n<!-- ======== output tmp nef: ==== -->\n" - << OpenSCAD::dump_svg( *tmpnef2d ) << "\n" - << "\n<!-- ======== output accumulator: ==== -->\n" - << OpenSCAD::dump_svg( *output_nefpoly2d ) << "\n"; - - contour_counter++; - } else { - log << " <!-- trivial facet cycle skipped -->\n"; - } - } // next facet cycle (i.e. next contour) - log << " <!-- Halffacet visit end -->\n"; - } // visit() + void visit( CGAL_Nef_polyhedron3::Halffacet_const_handle hfacet ); }; |