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/PolySetCGALEvaluator.cc | |
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/PolySetCGALEvaluator.cc')
-rw-r--r-- | src/PolySetCGALEvaluator.cc | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/PolySetCGALEvaluator.cc b/src/PolySetCGALEvaluator.cc index 0aa9e9e..5976daf 100644 --- a/src/PolySetCGALEvaluator.cc +++ b/src/PolySetCGALEvaluator.cc @@ -90,8 +90,21 @@ PolySet *PolySetCGALEvaluator::evaluatePolySet(const ProjectionNode &node) log << OpenSCAD::svg_header( 480, 100000 ) << "\n"; try { - sum.convertTo2d(); - nef_poly.p2 = sum.p2; + ZRemover zremover; + CGAL_Nef_polyhedron3::Volume_const_iterator i; + CGAL_Nef_polyhedron3::Shell_entry_const_iterator j; + CGAL_Nef_polyhedron3::SFace_const_handle sface_handle; + for ( i = sum.p3->volumes_begin(); i != sum.p3->volumes_end(); ++i ) { + log << "<!-- volume. mark: " << i->mark() << " -->\n"; + for ( j = i->shells_begin(); j != i->shells_end(); ++j ) { + log << "<!-- shell. mark: " << i->mark() << " -->\n"; + sface_handle = CGAL_Nef_polyhedron3::SFace_const_handle( j ); + sum.p3->visit_shell_objects( sface_handle , zremover ); + log << "<!-- shell. end. -->\n"; + } + log << "<!-- volume end. -->\n"; + } + nef_poly.p2 = zremover.output_nefpoly2d; } catch (const CGAL::Failure_exception &e) { PRINTB("CGAL error in projection node while flattening: %s", e.what()); } |