summaryrefslogtreecommitdiff
path: root/src/cgal.h
diff options
context:
space:
mode:
authorclifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c>2010-02-20 14:37:20 (GMT)
committerclifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c>2010-02-20 14:37:20 (GMT)
commit332e835f878d477102228a0659fd15c6700b36fe (patch)
tree3ea7073e824fc44402a5ff1eb134d2db4b4495f0 /src/cgal.h
parent0b0aa7b9b3ba8d75e97f249750b3eb1c61d52c38 (diff)
Clifford Wolf:
Added cgaladv.cc with advanced transformations via CGAL (as of now only 3d minkowksi sum is implemented but more is planned) git-svn-id: http://svn.clifford.at/openscad/trunk@446 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'src/cgal.h')
-rw-r--r--src/cgal.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/cgal.h b/src/cgal.h
index de942e7..6cbb251 100644
--- a/src/cgal.h
+++ b/src/cgal.h
@@ -45,6 +45,42 @@ struct CGAL_Nef_polyhedron
p3 = p;
}
+ CGAL_Nef_polyhedron& operator+=(const CGAL_Nef_polyhedron &other) {
+ if (other.dim == 2) {
+ this->p2 += other.p2;
+ this->dim = 2;
+ }
+ if (other.dim == 3) {
+ this->p3 += other.p3;
+ this->dim = 3;
+ }
+ return *this;
+ }
+
+ CGAL_Nef_polyhedron& operator*=(const CGAL_Nef_polyhedron &other) {
+ if (other.dim == 2) {
+ this->p2 *= other.p2;
+ this->dim = 2;
+ }
+ if (other.dim == 3) {
+ this->p3 *= other.p3;
+ this->dim = 3;
+ }
+ return *this;
+ }
+
+ CGAL_Nef_polyhedron& operator-=(const CGAL_Nef_polyhedron &other) {
+ if (other.dim == 2) {
+ this->p2 -= other.p2;
+ this->dim = 2;
+ }
+ if (other.dim == 3) {
+ this->p3 -= other.p3;
+ this->dim = 3;
+ }
+ return *this;
+ }
+
int weight() {
if (dim == 2)
return p2.explorer().number_of_vertices();
contact: Jan Huwald // Impressum