summaryrefslogtreecommitdiff
path: root/module.cc
diff options
context:
space:
mode:
authorclifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c>2009-12-27 23:49:27 (GMT)
committerclifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c>2009-12-27 23:49:27 (GMT)
commitf7799a8e4ea0c31bd284dc4cf5e2d23b13029a4c (patch)
tree608ae6c2f862db9d60ad3d9310645d8ef4fb319b /module.cc
parent612f04dfdf6378dcae3ca3de4d445ffbe53e1c75 (diff)
Clifford Wolf:
Added CGAL Nef Polyhedron 2D/3D abstraction git-svn-id: http://svn.clifford.at/openscad/trunk@187 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'module.cc')
-rw-r--r--module.cc17
1 files changed, 12 insertions, 5 deletions
diff --git a/module.cc b/module.cc
index 6e89e18..4a0b703 100644
--- a/module.cc
+++ b/module.cc
@@ -248,14 +248,21 @@ static CGAL_Nef_polyhedron render_cgal_nef_polyhedron_backend(const AbstractNode
continue;
if (is_first)
N = v->render_cgal_nef_polyhedron();
- else if (intersect)
- N *= v->render_cgal_nef_polyhedron();
- else
- N += v->render_cgal_nef_polyhedron();
+ else if (N.dim == 2) {
+ if (intersect)
+ N.p2 *= v->render_cgal_nef_polyhedron().p2;
+ else
+ N.p2 += v->render_cgal_nef_polyhedron().p2;
+ } else {
+ if (intersect)
+ N.p3 *= v->render_cgal_nef_polyhedron().p3;
+ else
+ N.p3 += v->render_cgal_nef_polyhedron().p3;
+ }
is_first = false;
}
- that->cgal_nef_cache.insert(cache_id, new CGAL_Nef_polyhedron(N), N.number_of_vertices());
+ that->cgal_nef_cache.insert(cache_id, new CGAL_Nef_polyhedron(N), N.weight());
that->progress_report();
return N;
}
contact: Jan Huwald // Impressum