summaryrefslogtreecommitdiff
path: root/src/cgaladv.cc
diff options
context:
space:
mode:
authorGiles Bathgate <gilesbathgate@gmail.com>2011-04-09 19:27:08 (GMT)
committerGiles Bathgate <gilesbathgate@gmail.com>2011-04-09 19:27:08 (GMT)
commitded6d3b1b45c965ec5da81befe1b0d2c7ae31209 (patch)
treea10e84c0ab71c3d8395b05a8102c324f389482f8 /src/cgaladv.cc
parent5d5c745fdecd2580b5254cc1fd758bdc31ff88ba (diff)
Convex hull now works properly with multiple children that do not neccecerily need to be touching.
Diffstat (limited to 'src/cgaladv.cc')
-rw-r--r--src/cgaladv.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/cgaladv.cc b/src/cgaladv.cc
index 45a3bdd..6301cd3 100644
--- a/src/cgaladv.cc
+++ b/src/cgaladv.cc
@@ -34,7 +34,7 @@
#ifdef ENABLE_CGAL
extern CGAL_Nef_polyhedron3 minkowski3(CGAL_Nef_polyhedron3 a, CGAL_Nef_polyhedron3 b);
extern CGAL_Nef_polyhedron2 minkowski2(CGAL_Nef_polyhedron2 a, CGAL_Nef_polyhedron2 b);
-extern CGAL_Nef_polyhedron2 convexhull2(CGAL_Nef_polyhedron2 a);
+extern CGAL_Nef_polyhedron2 convexhull2(std::list<CGAL_Nef_polyhedron2> a);
#endif
enum cgaladv_type_e {
@@ -184,19 +184,24 @@ CGAL_Nef_polyhedron CgaladvNode::render_cgal_nef_polyhedron() const
if (type == HULL)
{
+ std::list<CGAL_Nef_polyhedron2> polys;
+ bool all2d = true;
foreach(AbstractNode * v, children) {
if (v->modinst->tag_background)
continue;
N = v->render_cgal_nef_polyhedron();
if (N.dim == 3) {
-
+ //polys.push_back(tmp.p3);
+ all2d=false;
}
if (N.dim == 2) {
- N.p2 = convexhull2(N.p2);
+ polys.push_back(N.p2);
}
v->progress_report();
- break;
}
+
+ if(all2d)
+ N.p2 = convexhull2(polys);
}
cgal_nef_cache.insert(cache_id, new cgal_nef_cache_entry(N), N.weight());
contact: Jan Huwald // Impressum