diff --git a/README.textile b/README.textile index e4f4dac6bb5..9780b97fd81 100644 --- a/README.textile +++ b/README.textile @@ -150,8 +150,8 @@ h4. Import * Surface @surface(file=filename, convexity=5, center=False)@
#surface.dat
-10 9 8 7 6 5 5 5 5 5 
-9 8 7 6 6 4 3 2 1 0 
+10 9 8 7 6 5 5 5 5 5
+9 8 7 6 6 4 3 2 1 0
 8 7 6 6 4 3 2 1 0 0
 7 6 6 4 3 2 1 0 0 0
 6 6 4 3 2 1 1 0 0 0
diff --git a/cgal.pri b/cgal.pri
index ce452f17b0b..cd61c0e0f20 100644
--- a/cgal.pri
+++ b/cgal.pri
@@ -2,7 +2,7 @@ cgal {
   DEFINES += ENABLE_CGAL
 
   isEmpty(DEPLOYDIR) {
-    # Optionally specify location of CGAL using the 
+    # Optionally specify location of CGAL using the
     # CGALDIR env. variable
     CGAL_DIR = $$(CGALDIR)
     !isEmpty(CGAL_DIR) {
diff --git a/contrib/scad.el b/contrib/scad.el
index 1e5c9b5fed9..396b75b0944 100644
--- a/contrib/scad.el
+++ b/contrib/scad.el
@@ -10,12 +10,12 @@
 ;; it under the terms of the GNU General Public License as published by
 ;; the Free Software Foundation; either version 2 of the License, or
 ;; (at your option) any later version.
-;; 
+;;
 ;; This program is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 ;; GNU General Public License for more details.
-;; 
+;;
 ;; You should have received a copy of the GNU General Public License
 ;; along with this program; see the file COPYING.  If not, write to
 ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
@@ -45,10 +45,10 @@
   :group 'scad-font-lock)
 
 (defcustom scad-functions
-  '("cos" "acos" "sin" "asin" "tan" "atan" 
+  '("cos" "acos" "sin" "asin" "tan" "atan"
     "pow" "log" "ln"
-    "abs" "min" "max" "sqrt" "round" "ceil" "floor" "lookup" 
-    "str" 
+    "abs" "min" "max" "sqrt" "round" "ceil" "floor" "lookup"
+    "str"
     "dxf_dim" "dxf_cross"
     )
   "SCAD functions."
@@ -58,7 +58,7 @@
 (defcustom scad-modules
   '("for" "if" "assign" "intersection_for"
     "echo"
-    "cube" "sphere" "cylinder" "polyhedron" 
+    "cube" "sphere" "cylinder" "polyhedron"
     "scale" "rotate" "translate" "mirror" "multmatrix" "color"
     "union" "difference" "intersection" "render" "surface"
     "square" "circle" "polygon" "dxf_linear_extrude" "linear_extrude" "dxf_rotate_extrude" "rotate_extrude"
@@ -70,8 +70,8 @@
   :group 'scad-font-lock)
 
 (defcustom scad-operators
-  '("+" "-" "*" "/" "%" 
-    "&&" "||" "!" 
+  '("+" "-" "*" "/" "%"
+    "&&" "||" "!"
     "<" "<=" "==" "!=" ">" ">="
     "?" ":" "=")
   "SCAD operators."
@@ -81,14 +81,14 @@
 (defvar scad-mode-map
   (let ((map (make-sparse-keymap)))
     (define-key map "\t" 'scad-indent-line)
-    (define-key map [return] 'newline-and-indent) 
+    (define-key map [return] 'newline-and-indent)
     map)
   "Keymap for `scad-mode'.")
 
 (defvar scad-mode-syntax-table
   (let ((st (make-syntax-table)))
-    ;; support comment style: “// ...” 
-    ;; support comment style: “/* ... */” 
+    ;; support comment style: “// ...”
+    ;; support comment style: “/* ... */”
     (modify-syntax-entry ?\/ ". 124b" st)
     (modify-syntax-entry ?\n "> b" st)
     (modify-syntax-entry ?* ". 23" st)
diff --git a/doc/TODO.txt b/doc/TODO.txt
index 45660de2f40..4268d97d577 100644
--- a/doc/TODO.txt
+++ b/doc/TODO.txt
@@ -17,14 +17,14 @@ Using STL-imported models is tricky and triggers multiple issues:
 1) null-faces causes F6 rendering to fail while F5 rendering succeeds.
    (null-faces are exported by OpenSCAD). Example: adns2610_dev_circuit_inv.stl
    by Andrew Plumb
-2) Even very simple imported STL models don't render correctly with F5 when taking 
+2) Even very simple imported STL models don't render correctly with F5 when taking
    a difference(), though F6 looks correct. Example: test_cube.stl by Andrew Plumb
    with this scad file:
    difference() {
      import_stl("test_cube.stl");
      translate([2,2,2]) cylinder(h=10);
    }
-3) More complex STL models with something simple unioned or subtracted fails rendering 
+3) More complex STL models with something simple unioned or subtracted fails rendering
    using F6 even though F5 works. Example: adns2610_dev_circuit_inv.stl
    by Andrew Plumb with the three null-faces removed by MeshLab with this scad file:
    union() {
@@ -32,7 +32,7 @@ Using STL-imported models is tricky and triggers multiple issues:
      sphere(r=5);
    }
 4) More complex STL models cannot be projected (both F5 and F6).
-   Example: adns2610_dev_circuit_inv.stl by Andrew Plumb with the three 
+   Example: adns2610_dev_circuit_inv.stl by Andrew Plumb with the three
    null-faces removed by MeshLab and this scad file:
    projection(cut=true) {
      import_stl("adns2610_dev_circuit_inv.stl");
@@ -82,7 +82,7 @@ o 3D View
   - Allow specifying viewpoint in the scad file
   - overlay indicator displaying current view mode
   - OpenCSG rendering: Coincident surfaces causes z-buffer fighting. Is this somehow
-    avoidable tuning the depth tests in OpenCSG? 
+    avoidable tuning the depth tests in OpenCSG?
   - Use OpenGL picking to facilitate ray-tracing like features like measuring
     thicknesses, distances, slot thicknesses etc.
 o Editor wishlist
@@ -104,7 +104,7 @@ o Editor wishlist
   - C-c/C-v should work on the focused widget, not always in the editor
 o Error reporting/debugging
   - Provide better error messages when polygon ordering causes CGAL errors:
-    o Supply syntax highlighting of the exact polygon indices which are 
+    o Supply syntax highlighting of the exact polygon indices which are
       reported to be wrong
     o Provide some interaction for debug walk-through?
   - Provide visual highlighting of geometry corresponding to code
@@ -169,7 +169,7 @@ o Misc
   - When specifying a transparency with the color() statement,
     the object is not sorted and will be rendered wrongly
   - Go through default values of parameters (e.g. cube() has x,y,z=1 while linear_extrude() has height=100)
-  - Add support for symbolic names to child() statement 
+  - Add support for symbolic names to child() statement
   - Add 'lines' object type for non-solid 2d drawings
   - Is there a reason why modules like echo, empty if, empty for loop returns an
     empty AbstractNode instead of being ignored?
@@ -179,7 +179,7 @@ o Grammar
   - dim->name -> dim->label
   - A random(seed) function
   - import_*() -> *_import() (consistent prefix vs. postfix)
-  - linear_extrude()/rotate_extrude(): Cumbersome names? -> (extrude, revolve, lathe, sweep ?) 
+  - linear_extrude()/rotate_extrude(): Cumbersome names? -> (extrude, revolve, lathe, sweep ?)
 
 IDEAS FOR LANGUAGE CHANGES
 --------------------------
diff --git a/doc/checklist-macosx.txt b/doc/checklist-macosx.txt
index ff1c7ea164e..818613bc176 100644
--- a/doc/checklist-macosx.txt
+++ b/doc/checklist-macosx.txt
@@ -13,7 +13,7 @@ o Qt4
 o Build dependencies from source
 
   scripts/macosx-build-dependencies.sh
-  
+
 o Build and Deploy OpenSCAD
 
 # Update VERSION in publish-macosx.sh
diff --git a/eigen2.pri b/eigen2.pri
index 8344f00690d..40ed9487a2f 100644
--- a/eigen2.pri
+++ b/eigen2.pri
@@ -1,4 +1,4 @@
-# Optionally specify location of Eigen2 using the 
+# Optionally specify location of Eigen2 using the
 # EIGEN2DIR env. variable
 EIGEN2_DIR = $$(EIGEN2DIR)
 !isEmpty(EIGEN2_DIR) {
diff --git a/examples/example001.py b/examples/example001.py
index eac0a786ee5..c06199cc65c 100644
--- a/examples/example001.py
+++ b/examples/example001.py
@@ -12,9 +12,9 @@ def r_from_dia(d):
 	cy_r = r_from_dia(hole)
 	cy_h = r_from_dia(size * 2.5)
 
-	return (openscad.sphere(r_from_dia(size)) 
-		- rotcy([0,0,0], cy_r, cy_h) 
-		- rotcy([1,0,0], cy_r, cy_h) 
+	return (openscad.sphere(r_from_dia(size))
+		- rotcy([0,0,0], cy_r, cy_h)
+		- rotcy([1,0,0], cy_r, cy_h)
 		- rotcy([0,1,0], cy_r, cy_h))
 
 openscad.assemble( example001() )
diff --git a/examples/example005.py b/examples/example005.py
index a8b4f048ea6..bb869491490 100644
--- a/examples/example005.py
+++ b/examples/example005.py
@@ -9,7 +9,7 @@ def example005():
 			translate([100, 0, 35], cube(50, True))
 		])]
 		+ map(lambda i:
-			translate([sin(pi*i/3)*80, 
+			translate([sin(pi*i/3)*80,
 				cos(pi*i/3)*80, 0 ],
 				cylinder(r=10,h=200)), range(0,6))
 		+ [translate([0, 0, 200],
diff --git a/examples/example006.py b/examples/example006.py
index ca9501d6adf..e22624763b5 100644
--- a/examples/example006.py
+++ b/examples/example006.py
@@ -18,9 +18,9 @@ def edgeprofile():
 		+map(lambda rot: rotate(ang=pi/2, vec=rot, children=
 			map(lambda p: translate([ p[0]*50, p[1]*50, 0 ],
 				rotate(ang=p[2], vec=[0,0,1], child=edgeprofile())
-				), [	[+1, +1, 0], 
-					[-1, +1, pi/2], 
-					[-1, -1, pi], 
+				), [	[+1, +1, 0],
+					[-1, +1, pi/2],
+					[-1, -1, pi],
 					[+1, -1, 3*pi/2]])
 			)
 			,[ [0, 0, 0], [1, 0, 0], [0, 1, 0] ])
@@ -32,7 +32,7 @@ def edgeprofile():
 						)
 					)
 				)
-			), 
+			),
 			[
 				[ 0, 0, [ [0, 0] ] ],
 				[ pi/2, 0, [ [-20, -20], [+20, +20] ] ],
diff --git a/examples/example007.py b/examples/example007.py
index baaf9bc7041..c71d24d6065 100644
--- a/examples/example007.py
+++ b/examples/example007.py
@@ -11,7 +11,7 @@ def clip():
 		)
 
 def cutout():
-	ext = map(lambda lay: translate([0, 0, -50], 
+	ext = map(lambda lay: translate([0, 0, -50],
 					dxf_linear_extrude(
 						file="example007.dxf",
 						layer=lay,
@@ -19,7 +19,7 @@ def cutout():
 						convexity=2)), ["cutout1", "cutout2"])
 	return intersection([
 		rotate(pi/2, [1, 0, 0], child=ext[0]),
-		rotate(pi/2, [0, 0, 1], 
+		rotate(pi/2, [0, 0, 1],
 			rotate(pi/2, [1, 0, 0], child=ext[1])
 		)
 	])
diff --git a/examples/example008.py b/examples/example008.py
index 836a571fe66..4b522791b2b 100644
--- a/examples/example008.py
+++ b/examples/example008.py
@@ -12,7 +12,7 @@ def ext(lay):
 
 		rotate(pi/2,[1, 0, 0], child=
 			translate([ -25, -125, -25], ext("E"))),
-		
+
 		rotate(pi/2, [0, 1, 0], child=
 			translate([ -125, -125, -25], ext("B")))
 	]),
diff --git a/examples/example009.py b/examples/example009.py
index e1fcd83e3f4..cf7a1e9bab5 100644
--- a/examples/example009.py
+++ b/examples/example009.py
@@ -10,7 +10,7 @@
 frame = union( [
 	dxf_linear_extrude(dxf, "body",
 		bodywidth, convexity=10, center=True)]
-	+map(lambda z: 
+	+map(lambda z:
 		translate([0, 0, z],
 			dxf_linear_extrude(dxf, "plate",
 				platewidth, convexity = 10, center=True)),
diff --git a/examples/example012.py b/examples/example012.py
index fc8f2789f80..6307b0953de 100644
--- a/examples/example012.py
+++ b/examples/example012.py
@@ -7,7 +7,7 @@
 
 openscad.result = difference([
 	sphere(20),
-	
+
 	translate([ -2.92, 0.5, +20 ], rotate([pi, 0, pi],
 			import_stl("example012.stl", 5)
 	))])
diff --git a/examples/example015.py b/examples/example015.py
index c8355159071..88bbb3a3409 100644
--- a/examples/example015.py
+++ b/examples/example015.py
@@ -22,7 +22,7 @@ def shape():
 			rotate(-pi/4, child=scale([ 0.7, 1.3 ], circle(5)))
 		]),
  		import_dxf( "example009.dxf",
-			"body",scale=2.0, convexity=10)	
+			"body",scale=2.0, convexity=10)
 	])
 
 
diff --git a/examples/example017.py b/examples/example017.py
index 3b07edb7f1a..617ca91298c 100644
--- a/examples/example017.py
+++ b/examples/example017.py
@@ -28,7 +28,7 @@ def shape_tripod():
 	x8 = x7 - thickness
 	x9 = x8 - thickness
 	x10 = x9 - thickness
-	
+
 	y1 = 0
 	y2 = y1 + thickness
 	y3 = y2 + thickness
@@ -58,12 +58,12 @@ def shape_tripod():
 		]),
 		translate([ x5, y1 ],
 			square([ boltlen - thickness, thickness*2 ])),
-	
+
 		translate([ x5 + boltlen - thickness, y2 ],
 			circle(thickness)),
 
 		translate([ x2, y2 ],roundedCorner),
-	
+
 		translate([ x8, y5 ],roundedCorner)
 	])
 
@@ -91,7 +91,7 @@ def shape_outer_disc():
 		midhole + boltlen + inner1_to_inner2 + thickness + locklen1/2,
 		locklen1,
 		midhole + boltlen + inner1_to_inner2)
-		
+
 
 def parts():
 	tripod_x_off = locklen1 - locklen2 + inner1_to_inner2;
diff --git a/examples/example018.py b/examples/example018.py
index 7512ea182ac..5b3add2e745 100644
--- a/examples/example018.py
+++ b/examples/example018.py
@@ -2,8 +2,8 @@
 from math import pi
 
 def thing(type):
-	return [sphere(30), 
-		cube(60, True), 
+	return [sphere(30),
+		cube(60, True),
 		cylinder(50, 30, center=True),
 		union([cube(45, True)]+
 			[rotate([0,0,pi/4][i:i+3], cube(50, True)) for i in [0,1,2]]
@@ -12,6 +12,6 @@ def thing(type):
 
 
 openscad.result = union(
-	[translate([x*100-150,y*100-150], thing(x+y)) 
+	[translate([x*100-150,y*100-150], thing(x+y))
 		for x in range(0,4) for y in range(0,4)]
 	)
diff --git a/examples/example020.py b/examples/example020.py
index 00d7f362e81..575b0bb3ba6 100644
--- a/examples/example020.py
+++ b/examples/example020.py
@@ -39,7 +39,7 @@ def pointFromWirealpha(wirealpha):
 		points1.append(pointFromWirealpha(wirealpha))
 		points2.append(pointFromWirealpha(wirealpha-pi))
 	return linear_extrude(child=polygon(points1+points2),h=height, twist=pi*height/hr, convexity=5).fn( steps*hr/r2 )
-	
+
 openscad.result = union([
 
 	translate([ -30, 0, 0 ],
@@ -47,6 +47,6 @@ def pointFromWirealpha(wirealpha):
 
 	translate([ 30, 0, 0 ],
 		nut()),
-	
+
 	spring()
 	])
diff --git a/examples/example022.py b/examples/example022.py
index d9b2c2732e4..011bf4c1772 100644
--- a/examples/example022.py
+++ b/examples/example022.py
@@ -7,7 +7,7 @@ def roundedBox(size, radius, sidesonly):
 	res = []
 	def r(x):
 		res.append(x)
-	if sidesonly: 
+	if sidesonly:
 		r(cube([size[0]-2*radius, size[1], size[2]], True))
 		r(cube([size[0], size[1]-2*radius, size[2]], True))
 
diff --git a/examples/sierpinsky.scad.py b/examples/sierpinsky.scad.py
index 82cafa8dfd1..63eb032d93f 100644
--- a/examples/sierpinsky.scad.py
+++ b/examples/sierpinsky.scad.py
@@ -82,7 +82,7 @@ def sierpinski_rec(iters, size, inverse, square):
 					[0, -size+tiny, 0],
 					[size-tiny, 0, 0],
 					[-size+tiny, 0, 0],
-					[0, size-tiny, 0], 
+					[0, size-tiny, 0],
 					[0, 0, height-tiny]
 				]
 		else:
@@ -95,7 +95,7 @@ def sierpinski_rec(iters, size, inverse, square):
 					[-sval+tiny, -cval+tiny, 0],
 					[0, 0, height-tiny]
 				]
-	
+
 		pyramids = []
 		for t in trans:
 			pyramids.append(
@@ -105,7 +105,7 @@ def sierpinski_rec(iters, size, inverse, square):
 			pyramids.append(
 				translate([0, 0, 0], sierpinski(iters-1, size*2, True, square))
 			)
-		
+
 		return union(pyramids)
 
 def sierpinski(iters=4, size=35, inverse=False, square=True):
diff --git a/examples/sponge.scad.py b/examples/sponge.scad.py
index 9a27001ee5e..2a21ea4c344 100644
--- a/examples/sponge.scad.py
+++ b/examples/sponge.scad.py
@@ -7,12 +7,12 @@
 def bars(maxIter = 1, offx=0,offy=0,iter=1):
 	s3 = cubesize / pow(3, iter)
 	res = [
-		translate([s3+offx,s3+offy,-1], 
+		translate([s3+offx,s3+offy,-1],
 			cube([s3, s3, cubesize+2]))]
 	if iter < maxIter:
 		iter+=1
 		res += [
-			bars(maxIter,offx+x*s3,offy+y*s3,iter) 
+			bars(maxIter,offx+x*s3,offy+y*s3,iter)
 				for x in range(0,3) for y in range (0,3)]
 	return union(res)
 
diff --git a/glew.pri b/glew.pri
index f2aca4e4ee7..72572533ded 100644
--- a/glew.pri
+++ b/glew.pri
@@ -1,6 +1,6 @@
 glew {
   isEmpty(DEPLOYDIR) {
-    # Optionally specify location of GLEW using the 
+    # Optionally specify location of GLEW using the
     # GLEWDIR env. variable
     GLEW_DIR = $$(GLEWDIR)
     isEmpty(GLEW_DIR) {
diff --git a/libraries/boxes.scad b/libraries/boxes.scad
index 86bc09958d9..d9cb1eebe48 100644
--- a/libraries/boxes.scad
+++ b/libraries/boxes.scad
@@ -29,8 +29,8 @@ module roundedBox(size, radius, sidesonly)
     for (axis = [0:2]) {
       for (x = [radius-size[axis]/2, -radius+size[axis]/2],
              y = [radius-size[(axis+1)%3]/2, -radius+size[(axis+1)%3]/2]) {
-        rotate(rot[axis]) 
-          translate([x,y,0]) 
+        rotate(rot[axis])
+          translate([x,y,0])
           cylinder(h=size[(axis+2)%3]-2*radius, r=radius, center=true);
       }
     }
diff --git a/patches/CGAL-OGL-Tess-Combine-Fix.patch b/patches/CGAL-OGL-Tess-Combine-Fix.patch
index 2a4ad1aad1d..eff2ec994aa 100644
--- a/patches/CGAL-OGL-Tess-Combine-Fix.patch
+++ b/patches/CGAL-OGL-Tess-Combine-Fix.patch
@@ -1,9 +1,9 @@
 --- CGAL-3.4/include/CGAL/Nef_3/OGL_helper.h
 +++ CGAL-3.4/include/CGAL/Nef_3/OGL_helper.h
 @@ -243,6 +243,23 @@
-     glVertex3dv(pc); 
+     glVertex3dv(pc);
    }
- 
+
 +  inline void CGAL_GLU_TESS_CALLBACK combineCallback(GLdouble coords[3], GLvoid *d[4], GLfloat w[4], GLvoid **dataOut)
 +  {
 +    static std::list pcache;
@@ -21,7 +21,7 @@
 +    }
 +  }
 +
- 
+
   enum { SNC_AXES};
   enum { SNC_BOUNDARY, SNC_SKELETON };
 @@ -376,6 +393,8 @@
@@ -39,5 +39,5 @@
        gluDeleteTess(tess_);
 +      combineCallback(NULL, NULL, NULL, NULL);
      }
- 
+
      void construct_axes() const
diff --git a/patches/CGAL-Valgrind-Enable-Hack.patch b/patches/CGAL-Valgrind-Enable-Hack.patch
index 90733fc6984..a77025a782c 100644
--- a/patches/CGAL-Valgrind-Enable-Hack.patch
+++ b/patches/CGAL-Valgrind-Enable-Hack.patch
@@ -13,4 +13,4 @@
 +#endif
      }
    };
- 
+
diff --git a/patches/OpenCSG-1.1.1-MacOSX-port.patch b/patches/OpenCSG-1.1.1-MacOSX-port.patch
index 592cdf960e1..0f463f122d8 100644
--- a/patches/OpenCSG-1.1.1-MacOSX-port.patch
+++ b/patches/OpenCSG-1.1.1-MacOSX-port.patch
@@ -3,32 +3,32 @@ diff -ru OpenCSG-1.1.1/RenderTexture/RenderTexture.h OpenCSG-1.1.1-mac/RenderTex
 +++ OpenCSG-1.1.1-mac/RenderTexture/RenderTexture.h	2009-12-09 03:15:26.000000000 +0100
 @@ -294,8 +294,8 @@
      bool _BindDepthBuffer( ) const;
- 
+
  protected: // data
 -    int          _iWidth;     // width of the pbuffer
 -    int          _iHeight;    // height of the pbuffer
 +    GLint          _iWidth;     // width of the pbuffer
 +    GLint          _iHeight;    // height of the pbuffer
-     
+
      bool         _bIsTexture;
      bool         _bIsDepthTexture;
 @@ -342,8 +342,8 @@
-     
+
      // Texture stuff
      GLenum       _iTextureTarget;
 -    unsigned int _iTextureID;
 -    unsigned int _iDepthTextureID;
 +    GLuint _iTextureID;
 +    GLuint _iDepthTextureID;
-     
+
      unsigned short* _pPoorDepthTexture; // [Redge]
- 
+
 diff -ru OpenCSG-1.1.1/example/example.pro OpenCSG-1.1.1-mac/example/example.pro
 --- OpenCSG-1.1.1/example/example.pro	2009-07-19 21:05:09.000000000 +0200
 +++ OpenCSG-1.1.1-mac/example/example.pro	2009-12-09 03:15:26.000000000 +0100
 @@ -2,9 +2,16 @@
  TARGET		= opencsgexample
- 
+
  CONFIG	 	+= opengl warn_on release
 -INCLUDEPATH += ../glew/include ../include
 -
@@ -43,7 +43,7 @@ diff -ru OpenCSG-1.1.1/example/example.pro OpenCSG-1.1.1-mac/example/example.pro
 +  INCLUDEPATH   += ../glew/include
 +  LIBS          += -lglut -L../glew/lib
 +}
- 
+
  HEADERS		= displaylistPrimitive.h
  SOURCES		= displaylistPrimitive.cpp main.cpp
 diff -ru OpenCSG-1.1.1/example/main.cpp OpenCSG-1.1.1-mac/example/main.cpp
@@ -51,7 +51,7 @@ diff -ru OpenCSG-1.1.1/example/main.cpp OpenCSG-1.1.1-mac/example/main.cpp
 +++ OpenCSG-1.1.1-mac/example/main.cpp	2009-12-09 03:15:26.000000000 +0100
 @@ -22,7 +22,11 @@
  //
- 
+
  #include 
 +#ifdef __APPLE__
 +#include 
@@ -80,7 +80,7 @@ diff -ru OpenCSG-1.1.1/src/channelManager.cpp OpenCSG-1.1.1-mac/src/channelManag
 +#elif !defined(__APPLE__)
  #include 
  #endif
- 
+
 @@ -160,9 +160,11 @@
  #ifdef WIN32
                  if (   WGLEW_ARB_pbuffer
@@ -89,7 +89,7 @@ diff -ru OpenCSG-1.1.1/src/channelManager.cpp OpenCSG-1.1.1-mac/src/channelManag
 +#elif !defined(__APPLE__)
                  if (   GLXEW_SGIX_pbuffer
                      && GLXEW_SGIX_fbconfig
-+#else 
++#else
 +                if ( false
  #endif
                  ) {
@@ -98,17 +98,17 @@ diff -ru OpenCSG-1.1.1/src/frameBufferObject.h OpenCSG-1.1.1-mac/src/frameBuffer
 --- OpenCSG-1.1.1/src/frameBufferObject.h	2009-07-19 21:05:09.000000000 +0200
 +++ OpenCSG-1.1.1-mac/src/frameBufferObject.h	2009-12-09 03:15:26.000000000 +0100
 @@ -77,10 +77,10 @@
- 
+
              /// Texture stuff
              GLenum       textureTarget;
 -            unsigned int textureID;
 -            unsigned int depthID;
 +            GLuint textureID;
 +            GLuint depthID;
- 
+
 -            unsigned int framebufferID;
 +            GLuint framebufferID;
- 
+
              bool initialized;
          };
 diff -ru OpenCSG-1.1.1/src/occlusionQuery.cpp OpenCSG-1.1.1-mac/src/occlusionQuery.cpp
@@ -116,7 +116,7 @@ diff -ru OpenCSG-1.1.1/src/occlusionQuery.cpp OpenCSG-1.1.1-mac/src/occlusionQue
 +++ OpenCSG-1.1.1-mac/src/occlusionQuery.cpp	2009-12-09 03:15:26.000000000 +0100
 @@ -57,7 +57,7 @@
          }
- 
+
          unsigned int OcclusionQueryARB::getQueryResult() {
 -            unsigned int fragmentCount;
 +            GLuint fragmentCount;
@@ -125,7 +125,7 @@ diff -ru OpenCSG-1.1.1/src/occlusionQuery.cpp OpenCSG-1.1.1-mac/src/occlusionQue
          }
 @@ -94,7 +94,7 @@
          }
- 
+
          unsigned int OcclusionQueryNV::getQueryResult() {
 -            unsigned int fragmentCount;
 +            GLuint fragmentCount;
@@ -136,20 +136,20 @@ diff -ru OpenCSG-1.1.1/src/openglHelper.cpp OpenCSG-1.1.1-mac/src/openglHelper.c
 --- OpenCSG-1.1.1/src/openglHelper.cpp	2009-07-19 21:05:09.000000000 +0200
 +++ OpenCSG-1.1.1-mac/src/openglHelper.cpp	2009-12-09 03:15:26.000000000 +0100
 @@ -29,13 +29,13 @@
- 
+
          GLfloat projection[16];
          GLfloat modelview[16];
 -        int canvasPos[4];
 +        GLint canvasPos[4];
- 
+
 -        int stencilBits = 0;
 +        GLint stencilBits = 0;
          int stencilMax = 0;
          int stencilMask = 0;
- 
+
 -        int scissorPos[4];
 +        GLint scissorPos[4];
- 
+
          void scissor(const PCArea& area) {
              const int dx = area.maxx - area.minx;
 diff -ru OpenCSG-1.1.1/src/openglHelper.h OpenCSG-1.1.1-mac/src/openglHelper.h
@@ -162,7 +162,7 @@ diff -ru OpenCSG-1.1.1/src/openglHelper.h OpenCSG-1.1.1-mac/src/openglHelper.h
 -        extern int canvasPos[4];
 +        extern GLint canvasPos[4];
              // copy of the viewport size during CSG computation
- 
+
 -        extern int stencilBits;
 +        extern GLint stencilBits;
              // number of stencil bits in the pbuffer
@@ -170,27 +170,27 @@ diff -ru OpenCSG-1.1.1/src/openglHelper.h OpenCSG-1.1.1-mac/src/openglHelper.h
              // the number where the stencil value would "wrap around" to zero
          extern int stencilMask;
              // stencilMax - 1
- 
+
 -        extern int scissorPos[4];
 +        extern GLint scissorPos[4];
              // copy of the scissor settings for CSG computation
- 
+
          void scissor(const PCArea& area);
 diff -ru OpenCSG-1.1.1/src/pBufferTexture.h OpenCSG-1.1.1-mac/src/pBufferTexture.h
 --- OpenCSG-1.1.1/src/pBufferTexture.h	2009-07-19 21:05:09.000000000 +0200
 +++ OpenCSG-1.1.1-mac/src/pBufferTexture.h	2009-12-09 03:15:34.000000000 +0100
 @@ -22,7 +22,7 @@
- 
+
  #ifndef __OpenCSG__pbuffer_texture_h__
  #define __OpenCSG__pbuffer_texture_h__
 -
 +#ifndef __APPLE__
  #include "opencsgConfig.h"
  #include "offscreenBuffer.h"
- 
+
 @@ -81,5 +81,26 @@
      } // namespace OpenGL
- 
+
  } // namespace OpenCSG
 +#else
 +
@@ -212,7 +212,7 @@ diff -ru OpenCSG-1.1.1/src/pBufferTexture.h OpenCSG-1.1.1-mac/src/pBufferTexture
 +    };
 +  }
 +}
- 
+
 +#endif // __APPLE__
  #endif // __OpenCSG__frame_buffer_object_h__
 Only in OpenCSG-1.1.1-mac/src: pBufferTexture.h~
@@ -221,7 +221,7 @@ diff -ru OpenCSG-1.1.1/src/src.pro OpenCSG-1.1.1-mac/src/src.pro
 +++ OpenCSG-1.1.1-mac/src/src.pro	2009-12-09 03:15:26.000000000 +0100
 @@ -4,7 +4,15 @@
  DESTDIR     = ../lib
- 
+
  CONFIG		+= opengl warn_on release
 -INCLUDEPATH += ../include ../glew/include ../
 +INCLUDEPATH += ../include ../
@@ -233,7 +233,7 @@ diff -ru OpenCSG-1.1.1/src/src.pro OpenCSG-1.1.1-mac/src/src.pro
 +else {
 +INCLUDEPATH += ../glew/include
 +}
- 
+
  HEADERS		= ../include/opencsg.h \
  		  opencsgConfig.h \
 @@ -16,12 +24,11 @@
diff --git a/patches/OpenCSG-1.2.0-MacOSX-port.patch b/patches/OpenCSG-1.2.0-MacOSX-port.patch
index 3f1bdc434b0..da1faf78988 100644
--- a/patches/OpenCSG-1.2.0-MacOSX-port.patch
+++ b/patches/OpenCSG-1.2.0-MacOSX-port.patch
@@ -3,32 +3,32 @@ diff -ru OpenCSG-1.2.0/RenderTexture/RenderTexture.h OpenCSG-1.2.0-mac/RenderTex
 +++ OpenCSG-1.2.0-mac/RenderTexture/RenderTexture.h	2010-01-24 23:30:24.000000000 +0100
 @@ -294,8 +294,8 @@
      bool _BindDepthBuffer( ) const;
- 
+
  protected: // data
 -    int          _iWidth;     // width of the pbuffer
 -    int          _iHeight;    // height of the pbuffer
 +    GLint          _iWidth;     // width of the pbuffer
 +    GLint          _iHeight;    // height of the pbuffer
-     
+
      bool         _bIsTexture;
      bool         _bIsDepthTexture;
 @@ -342,8 +342,8 @@
-     
+
      // Texture stuff
      GLenum       _iTextureTarget;
 -    unsigned int _iTextureID;
 -    unsigned int _iDepthTextureID;
 +    GLuint _iTextureID;
 +    GLuint _iDepthTextureID;
-     
+
      unsigned short* _pPoorDepthTexture; // [Redge]
- 
+
 diff -ru OpenCSG-1.2.0/example/example.pro OpenCSG-1.2.0-mac/example/example.pro
 --- OpenCSG-1.2.0/example/example.pro	2010-01-02 20:56:12.000000000 +0100
 +++ OpenCSG-1.2.0-mac/example/example.pro	2010-01-24 23:30:24.000000000 +0100
 @@ -2,9 +2,16 @@
  TARGET		= opencsgexample
- 
+
  CONFIG	 	+= opengl warn_on release
 -INCLUDEPATH += ../glew/include ../include
 -
@@ -43,7 +43,7 @@ diff -ru OpenCSG-1.2.0/example/example.pro OpenCSG-1.2.0-mac/example/example.pro
 +  INCLUDEPATH   += ../glew/include
 +  LIBS          += -lglut -L../glew/lib
 +}
- 
+
  HEADERS		= displaylistPrimitive.h
  SOURCES		= displaylistPrimitive.cpp main.cpp
 diff -ru OpenCSG-1.2.0/example/main.cpp OpenCSG-1.2.0-mac/example/main.cpp
@@ -51,7 +51,7 @@ diff -ru OpenCSG-1.2.0/example/main.cpp OpenCSG-1.2.0-mac/example/main.cpp
 +++ OpenCSG-1.2.0-mac/example/main.cpp	2010-01-24 23:30:24.000000000 +0100
 @@ -22,7 +22,11 @@
  //
- 
+
  #include 
 +#ifdef __APPLE__
 +#include 
@@ -80,7 +80,7 @@ diff -ru OpenCSG-1.2.0/src/channelManager.cpp OpenCSG-1.2.0-mac/src/channelManag
 +#elif !defined(__APPLE__)
  #include 
  #endif
- 
+
 @@ -170,9 +170,11 @@
  #ifdef WIN32
                  if (   WGLEW_ARB_pbuffer
@@ -89,7 +89,7 @@ diff -ru OpenCSG-1.2.0/src/channelManager.cpp OpenCSG-1.2.0-mac/src/channelManag
 +#elif !defined(__APPLE__)
                  if (   GLXEW_SGIX_pbuffer
                      && GLXEW_SGIX_fbconfig
-+#else 
++#else
 +                if ( false
  #endif
                  ) {
@@ -99,17 +99,17 @@ diff -ru OpenCSG-1.2.0/src/frameBufferObject.h OpenCSG-1.2.0-mac/src/frameBuffer
 --- OpenCSG-1.2.0/src/frameBufferObject.h	2010-01-02 21:03:01.000000000 +0100
 +++ OpenCSG-1.2.0-mac/src/frameBufferObject.h	2010-01-24 23:30:24.000000000 +0100
 @@ -77,10 +77,10 @@
- 
+
              /// Texture stuff
              GLenum       textureTarget;
 -            unsigned int textureID;
 -            unsigned int depthID;
 +            GLuint textureID;
 +            GLuint depthID;
- 
+
 -            unsigned int framebufferID;
 +            GLuint framebufferID;
- 
+
              bool         initialized;
          };
 Only in OpenCSG-1.2.0-mac/src: frameBufferObject.h.orig
@@ -118,7 +118,7 @@ diff -ru OpenCSG-1.2.0/src/occlusionQuery.cpp OpenCSG-1.2.0-mac/src/occlusionQue
 +++ OpenCSG-1.2.0-mac/src/occlusionQuery.cpp	2010-01-24 23:30:24.000000000 +0100
 @@ -57,7 +57,7 @@
          }
- 
+
          unsigned int OcclusionQueryARB::getQueryResult() {
 -            unsigned int fragmentCount;
 +            GLuint fragmentCount;
@@ -127,7 +127,7 @@ diff -ru OpenCSG-1.2.0/src/occlusionQuery.cpp OpenCSG-1.2.0-mac/src/occlusionQue
          }
 @@ -94,7 +94,7 @@
          }
- 
+
          unsigned int OcclusionQueryNV::getQueryResult() {
 -            unsigned int fragmentCount;
 +            GLuint fragmentCount;
@@ -138,20 +138,20 @@ diff -ru OpenCSG-1.2.0/src/openglHelper.cpp OpenCSG-1.2.0-mac/src/openglHelper.c
 --- OpenCSG-1.2.0/src/openglHelper.cpp	2010-01-02 21:03:04.000000000 +0100
 +++ OpenCSG-1.2.0-mac/src/openglHelper.cpp	2010-01-24 23:30:24.000000000 +0100
 @@ -29,13 +29,13 @@
- 
+
          GLfloat projection[16];
          GLfloat modelview[16];
 -        int canvasPos[4];
 +        GLint canvasPos[4];
- 
+
 -        int stencilBits = 0;
 +        GLint stencilBits = 0;
          int stencilMax = 0;
          int stencilMask = 0;
- 
+
 -        int scissorPos[4];
 +        GLint scissorPos[4];
- 
+
          void scissor(const PCArea& area) {
              const int dx = area.maxx - area.minx;
 diff -ru OpenCSG-1.2.0/src/openglHelper.h OpenCSG-1.2.0-mac/src/openglHelper.h
@@ -164,7 +164,7 @@ diff -ru OpenCSG-1.2.0/src/openglHelper.h OpenCSG-1.2.0-mac/src/openglHelper.h
 -        extern int canvasPos[4];
 +        extern GLint canvasPos[4];
              // copy of the viewport size during CSG computation
- 
+
 -        extern int stencilBits;
 +        extern GLint stencilBits;
              // number of stencil bits in the pbuffer
@@ -172,27 +172,27 @@ diff -ru OpenCSG-1.2.0/src/openglHelper.h OpenCSG-1.2.0-mac/src/openglHelper.h
              // the number where the stencil value would "wrap around" to zero
          extern int stencilMask;
              // stencilMax - 1
- 
+
 -        extern int scissorPos[4];
 +        extern GLint scissorPos[4];
              // copy of the scissor settings for CSG computation
- 
+
          void scissor(const PCArea& area);
 diff -ru OpenCSG-1.2.0/src/pBufferTexture.h OpenCSG-1.2.0-mac/src/pBufferTexture.h
 --- OpenCSG-1.2.0/src/pBufferTexture.h	2010-01-02 21:03:01.000000000 +0100
 +++ OpenCSG-1.2.0-mac/src/pBufferTexture.h	2010-01-24 23:30:24.000000000 +0100
 @@ -22,7 +22,7 @@
- 
+
  #ifndef __OpenCSG__pbuffer_texture_h__
  #define __OpenCSG__pbuffer_texture_h__
 -
 +#ifndef __APPLE__
  #include "opencsgConfig.h"
  #include "offscreenBuffer.h"
- 
+
 @@ -81,5 +81,26 @@
      } // namespace OpenGL
- 
+
  } // namespace OpenCSG
 +#else
 +
@@ -214,7 +214,7 @@ diff -ru OpenCSG-1.2.0/src/pBufferTexture.h OpenCSG-1.2.0-mac/src/pBufferTexture
 +    };
 +  }
 +}
- 
+
 +#endif // __APPLE__
  #endif // __OpenCSG__frame_buffer_object_h__
 diff -ru OpenCSG-1.2.0/src/src.pro OpenCSG-1.2.0-mac/src/src.pro
@@ -226,7 +226,7 @@ diff -ru OpenCSG-1.2.0/src/src.pro OpenCSG-1.2.0-mac/src/src.pro
  VERSION     = 1.2.0
 -DESTDIR     = ../lib
 +DESTDIR     = $$(PWD)/lib
- 
+
  CONFIG		+= opengl warn_on release
 -INCLUDEPATH += ../include ../glew/include ../
 +INCLUDEPATH += ../include ../
@@ -239,7 +239,7 @@ diff -ru OpenCSG-1.2.0/src/src.pro OpenCSG-1.2.0-mac/src/src.pro
 +else {
 +INCLUDEPATH += ../glew/include
 +}
- 
+
  HEADERS		= ../include/opencsg.h \
  		  opencsgConfig.h \
 @@ -17,12 +26,11 @@
diff --git a/patches/OpenCSG-1.3.0-MacOSX-port.patch b/patches/OpenCSG-1.3.0-MacOSX-port.patch
index bb551659e29..14343f3383f 100644
--- a/patches/OpenCSG-1.3.0-MacOSX-port.patch
+++ b/patches/OpenCSG-1.3.0-MacOSX-port.patch
@@ -10,7 +10,7 @@ diff -ru OpenCSG-1.3.0/Makefile OpenCSG-1.3.0-mac/Makefile
 +# Template: subdirs
 +# Command: /usr/bin/qmake -macx CONFIG+=x86\ x86_64 -o Makefile opencsg.pro
 +#############################################################################
- 
+
 -all:
 -	for X in $(SUBDIRS); do make -C $$X ; done
 +first: make_default
@@ -33,19 +33,19 @@ diff -ru OpenCSG-1.3.0/Makefile OpenCSG-1.3.0-mac/Makefile
 +MKDIR         = mkdir -p
 +SUBTARGETS    =  \
 +		sub-src
- 
+
 -clean:
 -	for X in $(SUBDIRS); do make -C $$X clean; done
-+src/$(MAKEFILE): 
-+	@$(CHK_DIR_EXISTS) src/ || $(MKDIR) src/ 
++src/$(MAKEFILE):
++	@$(CHK_DIR_EXISTS) src/ || $(MKDIR) src/
 +	cd src/ && $(QMAKE) /Users/kintel/code/metalab/checkout/OpenSCAD/libraries-tmp/src/OpenCSG-1.3.0-patched/src/src.pro -macx CONFIG+=x86\ x86_64 -o $(MAKEFILE)
 +sub-src-qmake_all:  FORCE
-+	@$(CHK_DIR_EXISTS) src/ || $(MKDIR) src/ 
++	@$(CHK_DIR_EXISTS) src/ || $(MKDIR) src/
 +	cd src/ && $(QMAKE) /Users/kintel/code/metalab/checkout/OpenSCAD/libraries-tmp/src/OpenCSG-1.3.0-patched/src/src.pro -macx CONFIG+=x86\ x86_64 -o $(MAKEFILE)
 +sub-src: src/$(MAKEFILE) FORCE
 +	cd src/ && $(MAKE) -f $(MAKEFILE)
 +sub-src-make_default: src/$(MAKEFILE) FORCE
-+	cd src/ && $(MAKE) -f $(MAKEFILE) 
++	cd src/ && $(MAKE) -f $(MAKEFILE)
 +sub-src-make_first: src/$(MAKEFILE) FORCE
 +	cd src/ && $(MAKE) -f $(MAKEFILE) first
 +sub-src-all: src/$(MAKEFILE) FORCE
@@ -136,7 +136,7 @@ diff -ru OpenCSG-1.3.0/Makefile OpenCSG-1.3.0-mac/Makefile
 +uninstall:  uninstall_subtargets FORCE
 +
 +FORCE:
- 
+
 -distclean:
 -	for X in $(SUBDIRS); do make -C $$X distclean; done
 diff -ru OpenCSG-1.3.0/RenderTexture/RenderTexture.h OpenCSG-1.3.0-mac/RenderTexture/RenderTexture.h
@@ -144,26 +144,26 @@ diff -ru OpenCSG-1.3.0/RenderTexture/RenderTexture.h OpenCSG-1.3.0-mac/RenderTex
 +++ OpenCSG-1.3.0-mac/RenderTexture/RenderTexture.h	2010-05-09 02:51:07.000000000 +0200
 @@ -294,8 +294,8 @@
      bool _BindDepthBuffer( ) const;
- 
+
  protected: // data
 -    int          _iWidth;     // width of the pbuffer
 -    int          _iHeight;    // height of the pbuffer
 +    GLint          _iWidth;     // width of the pbuffer
 +    GLint          _iHeight;    // height of the pbuffer
-     
+
      bool         _bIsTexture;
      bool         _bIsDepthTexture;
 @@ -342,8 +342,8 @@
-     
+
      // Texture stuff
      GLenum       _iTextureTarget;
 -    unsigned int _iTextureID;
 -    unsigned int _iDepthTextureID;
 +    GLuint _iTextureID;
 +    GLuint _iDepthTextureID;
-     
+
      unsigned short* _pPoorDepthTexture; // [Redge]
- 
+
 diff -ru OpenCSG-1.3.0/example/Makefile OpenCSG-1.3.0-mac/example/Makefile
 --- OpenCSG-1.3.0/example/Makefile	2010-02-06 21:35:10.000000000 +0100
 +++ OpenCSG-1.3.0-mac/example/Makefile	2010-05-09 02:51:11.000000000 +0200
@@ -178,23 +178,23 @@ diff -ru OpenCSG-1.3.0/example/Makefile OpenCSG-1.3.0-mac/example/Makefile
 -# Command: $(QMAKE) -o Makefile example.pro
 +# Command: /usr/bin/qmake -macx CONFIG+=x86\ x86_64 -o Makefile example.pro
  #############################################################################
- 
+
  ####### Compiler, tools and options
- 
+
 -CC       = gcc
 -CXX      = g++
 -LEX      = flex
 -YACC     = yacc
 -CFLAGS   = -pipe -Wall -W -O2
 -CXXFLAGS = -pipe -Wall -W -O2
--LEXFLAGS = 
+-LEXFLAGS =
 -YACCFLAGS= -d
 -INCPATH  = -I. -I../glew/include -I../include -I/usr/X11R6/include -I/usr/X11R6/include
 -LINK     = g++
--LFLAGS   = 
+-LFLAGS   =
 -LIBS     = $(SUBLIBS) -L/usr/X11R6/lib -L/usr/X11R6/lib -L../lib -lopencsg -lglut -L../glew/lib -lGLEW -lGLU -lGL -lXmu -lXext -lX11 -lm
 -AR       = ar cqs
--RANLIB   = 
+-RANLIB   =
 -MOC      = $(QTDIR)/bin/moc
 -UIC      = $(QTDIR)/bin/uic
 -QMAKE    = qmake
@@ -215,7 +215,7 @@ diff -ru OpenCSG-1.3.0/example/Makefile OpenCSG-1.3.0-mac/example/Makefile
 +INCPATH       = -I/usr/local/Qt4.6/mkspecs/macx-g++ -I. -I/Library/Frameworks/QtCore.framework/Versions/4/Headers -I/usr/include/QtCore -I/Library/Frameworks/QtGui.framework/Versions/4/Headers -I/usr/include/QtGui -I/usr/include -I../include -I/opt/local/include -I/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers -I/System/Library/Frameworks/AGL.framework/Headers -I. -F/Library/Frameworks
 +LINK          = g++
 +LFLAGS        = -headerpad_max_install_names -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 -arch i386
-+LIBS          = $(SUBLIBS) -F/Library/Frameworks -L/Library/Frameworks -L../lib -lopencsg -lGLEW -framework GLUT -L/opt/local/lib -framework OpenGL -framework AGL -framework QtGui -framework QtCore 
++LIBS          = $(SUBLIBS) -F/Library/Frameworks -L/Library/Frameworks -L../lib -lopencsg -lGLEW -framework GLUT -L/opt/local/lib -framework OpenGL -framework AGL -framework QtGui -framework QtCore
 +AR            = ar cq
 +RANLIB        = ranlib -s
 +QMAKE         = /usr/bin/qmake
@@ -225,7 +225,7 @@ diff -ru OpenCSG-1.3.0/example/Makefile OpenCSG-1.3.0-mac/example/Makefile
 +SED           = sed
 +COPY_FILE     = cp -f
 +COPY_DIR      = cp -f -R
-+STRIP         = 
++STRIP         =
 +INSTALL_FILE  = $(COPY_FILE)
 +INSTALL_DIR   = $(COPY_DIR)
 +INSTALL_PROGRAM = $(COPY_FILE)
@@ -237,30 +237,30 @@ diff -ru OpenCSG-1.3.0/example/Makefile OpenCSG-1.3.0-mac/example/Makefile
 -MKDIR    = mkdir -p
 +MKDIR         = mkdir -p
 +export MACOSX_DEPLOYMENT_TARGET = 10.4
- 
+
  ####### Output directory
- 
+
 -OBJECTS_DIR = ./
 +OBJECTS_DIR   = ./
- 
+
  ####### Files
- 
+
 -HEADERS = displaylistPrimitive.h
 -SOURCES = displaylistPrimitive.cpp \
 -		main.cpp
 -OBJECTS = displaylistPrimitive.o \
 +SOURCES       = displaylistPrimitive.cpp \
-+		main.cpp 
++		main.cpp
 +OBJECTS       = displaylistPrimitive.o \
  		main.o
--FORMS = 
--UICDECLS = 
--UICIMPLS = 
--SRCMOC   = 
--OBJMOC = 
+-FORMS =
+-UICDECLS =
+-UICIMPLS =
+-SRCMOC   =
+-OBJMOC =
 -DIST	   = example.pro
 -QMAKE_TARGET = opencsgexample
--DESTDIR  = 
+-DESTDIR  =
 -TARGET   = opencsgexample
 +DIST          = /usr/local/Qt4.6/mkspecs/common/unix.conf \
 +		/usr/local/Qt4.6/mkspecs/common/mac.conf \
@@ -291,7 +291,7 @@ diff -ru OpenCSG-1.3.0/example/Makefile OpenCSG-1.3.0-mac/example/Makefile
 +		/usr/local/Qt4.6/mkspecs/features/include_source_dir.prf \
 +		example.pro
 +QMAKE_TARGET  = opencsgexample
-+DESTDIR       = 
++DESTDIR       =
 +TARGET        = opencsgexample.app/Contents/MacOS/opencsgexample
 +
 +####### Custom Compiler Variables
@@ -306,49 +306,49 @@ diff -ru OpenCSG-1.3.0/example/Makefile OpenCSG-1.3.0-mac/example/Makefile
 +		-arch \
 +		i386
 +
- 
+
  first: all
  ####### Implicit rules
- 
+
 -.SUFFIXES: .c .o .cpp .cc .cxx .C
 +.SUFFIXES: .o .c .cpp .cc .cxx .C
- 
+
  .cpp.o:
 -	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
 +	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
- 
+
  .cc.o:
 -	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
 +	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
- 
+
  .cxx.o:
 -	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
 +	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
- 
+
  .C.o:
 -	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
 +	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
- 
+
  .c.o:
 -	$(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<
 +	$(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"
- 
+
  ####### Build rules
- 
+
 -all: Makefile $(TARGET)
 -
--$(TARGET):  $(UICDECLS) $(OBJECTS) $(OBJMOC)  
+-$(TARGET):  $(UICDECLS) $(OBJECTS) $(OBJMOC)
 -	$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) $(OBJCOMP)
 -
 -mocables: $(SRCMOC)
 -uicables: $(UICDECLS) $(UICIMPLS)
 -
--$(MOC): 
+-$(MOC):
 -	( cd $(QTDIR)/src/moc ; $(MAKE) )
 +all: Makefile opencsgexample.app/Contents/PkgInfo opencsgexample.app/Contents/Resources/empty.lproj opencsgexample.app/Contents/Info.plist $(TARGET)
- 
-+$(TARGET):  $(OBJECTS)  
-+	@$(CHK_DIR_EXISTS) opencsgexample.app/Contents/MacOS/ || $(MKDIR) opencsgexample.app/Contents/MacOS/ 
+
++$(TARGET):  $(OBJECTS)
++	@$(CHK_DIR_EXISTS) opencsgexample.app/Contents/MacOS/ || $(MKDIR) opencsgexample.app/Contents/MacOS/
 +	$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
 +
 +Makefile: example.pro  /usr/local/Qt4.6/mkspecs/macx-g++/qmake.conf /usr/local/Qt4.6/mkspecs/common/unix.conf \
@@ -413,43 +413,43 @@ diff -ru OpenCSG-1.3.0/example/Makefile OpenCSG-1.3.0-mac/example/Makefile
 +qmake:  FORCE
 +	@$(QMAKE) -macx CONFIG+=x86\ x86_64 -o Makefile example.pro
 +
-+opencsgexample.app/Contents/PkgInfo: 
-+	@$(CHK_DIR_EXISTS) opencsgexample.app/Contents || $(MKDIR) opencsgexample.app/Contents 
++opencsgexample.app/Contents/PkgInfo:
++	@$(CHK_DIR_EXISTS) opencsgexample.app/Contents || $(MKDIR) opencsgexample.app/Contents
 +	@$(DEL_FILE) opencsgexample.app/Contents/PkgInfo
 +	@echo "APPL????" >opencsgexample.app/Contents/PkgInfo
-+opencsgexample.app/Contents/Resources/empty.lproj: 
-+	@$(CHK_DIR_EXISTS) opencsgexample.app/Contents/Resources || $(MKDIR) opencsgexample.app/Contents/Resources 
++opencsgexample.app/Contents/Resources/empty.lproj:
++	@$(CHK_DIR_EXISTS) opencsgexample.app/Contents/Resources || $(MKDIR) opencsgexample.app/Contents/Resources
 +	@touch opencsgexample.app/Contents/Resources/empty.lproj
-+	
-+opencsgexample.app/Contents/Info.plist: 
-+	@$(CHK_DIR_EXISTS) opencsgexample.app/Contents || $(MKDIR) opencsgexample.app/Contents 
++
++opencsgexample.app/Contents/Info.plist:
++	@$(CHK_DIR_EXISTS) opencsgexample.app/Contents || $(MKDIR) opencsgexample.app/Contents
 +	@$(DEL_FILE) opencsgexample.app/Contents/Info.plist
 +	@sed -e "s,@ICON@,,g" -e "s,@EXECUTABLE@,opencsgexample,g" -e "s,@TYPEINFO@,????,g" /usr/local/Qt4.6/mkspecs/macx-g++/Info.plist.app >opencsgexample.app/Contents/Info.plist
- dist: 
+ dist:
 -	@mkdir -p .tmp/opencsgexample && $(COPY_FILE) --parents $(SOURCES) $(HEADERS) $(FORMS) $(DIST) .tmp/opencsgexample/ && ( cd `dirname .tmp/opencsgexample` && $(TAR) opencsgexample.tar opencsgexample && $(GZIP) opencsgexample.tar ) && $(MOVE) `dirname .tmp/opencsgexample`/opencsgexample.tar.gz . && $(DEL_FILE) -r .tmp/opencsgexample
 -
 -mocclean:
-+	@$(CHK_DIR_EXISTS) .tmp/opencsgexample1.0.0 || $(MKDIR) .tmp/opencsgexample1.0.0 
++	@$(CHK_DIR_EXISTS) .tmp/opencsgexample1.0.0 || $(MKDIR) .tmp/opencsgexample1.0.0
 +	$(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/opencsgexample1.0.0/ && $(COPY_FILE) --parents displaylistPrimitive.h .tmp/opencsgexample1.0.0/ && $(COPY_FILE) --parents displaylistPrimitive.cpp main.cpp .tmp/opencsgexample1.0.0/ && (cd `dirname .tmp/opencsgexample1.0.0` && $(TAR) opencsgexample1.0.0.tar opencsgexample1.0.0 && $(COMPRESS) opencsgexample1.0.0.tar) && $(MOVE) `dirname .tmp/opencsgexample1.0.0`/opencsgexample1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/opencsgexample1.0.0
- 
+
 -uiclean:
- 
+
 -yaccclean:
 -lexclean:
 -clean:
-+clean:compiler_clean 
++clean:compiler_clean
  	-$(DEL_FILE) $(OBJECTS)
  	-$(DEL_FILE) *~ core *.core
- 
+
 @@ -108,20 +208,50 @@
  ####### Sub-libraries
- 
+
  distclean: clean
 -	-$(DEL_FILE) $(TARGET) $(TARGET)
 +	-$(DEL_FILE) -r opencsgexample.app
 +	-$(DEL_FILE) Makefile
- 
- 
+
+
 -FORCE:
 +mocclean: compiler_moc_header_clean compiler_moc_source_clean
 +
@@ -476,32 +476,32 @@ diff -ru OpenCSG-1.3.0/example/Makefile OpenCSG-1.3.0-mac/example/Makefile
 +compiler_yacc_impl_clean:
 +compiler_lex_make_all:
 +compiler_lex_clean:
-+compiler_clean: 
- 
++compiler_clean:
+
  ####### Compile
- 
+
  displaylistPrimitive.o: displaylistPrimitive.cpp displaylistPrimitive.h
 +	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o displaylistPrimitive.o displaylistPrimitive.cpp
- 
+
  main.o: main.cpp displaylistPrimitive.h
 +	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp
- 
+
  ####### Install
- 
--install: all 
+
+-install: all
 +install:   FORCE
- 
--uninstall: 
+
+-uninstall:
 +uninstall:   FORCE
 +
 +FORCE:
- 
+
 diff -ru OpenCSG-1.3.0/example/example.pro OpenCSG-1.3.0-mac/example/example.pro
 --- OpenCSG-1.3.0/example/example.pro	2010-02-06 21:35:10.000000000 +0100
 +++ OpenCSG-1.3.0-mac/example/example.pro	2010-05-09 02:51:14.000000000 +0200
 @@ -2,9 +2,16 @@
  TARGET		= opencsgexample
- 
+
  CONFIG	 	+= opengl warn_on release
 -INCLUDEPATH += ../glew/include ../include
 -
@@ -516,7 +516,7 @@ diff -ru OpenCSG-1.3.0/example/example.pro OpenCSG-1.3.0-mac/example/example.pro
 +  INCLUDEPATH   += ../glew/include
 +  LIBS          += -lglut -L../glew/lib
 +}
- 
+
  HEADERS		= displaylistPrimitive.h
  SOURCES		= displaylistPrimitive.cpp main.cpp
 diff -ru OpenCSG-1.3.0/example/main.cpp OpenCSG-1.3.0-mac/example/main.cpp
@@ -524,7 +524,7 @@ diff -ru OpenCSG-1.3.0/example/main.cpp OpenCSG-1.3.0-mac/example/main.cpp
 +++ OpenCSG-1.3.0-mac/example/main.cpp	2010-05-09 02:51:20.000000000 +0200
 @@ -22,7 +22,11 @@
  //
- 
+
  #include 
 +#ifdef __APPLE__
 +#include 
@@ -555,23 +555,23 @@ diff -ru OpenCSG-1.3.0/src/Makefile OpenCSG-1.3.0-mac/src/Makefile
 -# Command: $(QMAKE) -o Makefile src.pro
 +# Command: /usr/bin/qmake -macx CONFIG+=x86\ x86_64 -o Makefile src.pro
  #############################################################################
- 
+
  ####### Compiler, tools and options
- 
+
 -CC       = gcc
 -CXX      = g++
 -LEX      = flex
 -YACC     = yacc
--CFLAGS   = -pipe -Wall -W -O2 -fPIC 
+-CFLAGS   = -pipe -Wall -W -O2 -fPIC
 -CXXFLAGS = -pipe -Wall -W -O2 -fPIC
--LEXFLAGS = 
+-LEXFLAGS =
 -YACCFLAGS= -d
 -INCPATH  = -I. -I../include -I../glew/include -I.. -I/usr/X11R6/include
 -LINK     = g++
 -LFLAGS   =  -shared -Wl,-soname,libopencsg.so.1 -Wl,-rpath,../lib
 -LIBS     = $(SUBLIBS) -L/usr/X11R6/lib -lGLU -lGL -lXmu
 -AR       = ar cqs
--RANLIB   = 
+-RANLIB   =
 -QMAKE    = qmake
 -TAR      = tar -cf
 -GZIP     = gzip -9f
@@ -590,7 +590,7 @@ diff -ru OpenCSG-1.3.0/src/Makefile OpenCSG-1.3.0-mac/src/Makefile
 +INCPATH       = -I/usr/local/Qt4.6/mkspecs/macx-g++ -I. -I/Library/Frameworks/QtCore.framework/Versions/4/Headers -I/usr/include/QtCore -I/Library/Frameworks/QtGui.framework/Versions/4/Headers -I/usr/include/QtGui -I/usr/include -I../include -I.. -I../../../deploy/include -I/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers -I/System/Library/Frameworks/AGL.framework/Headers -I. -F/Library/Frameworks
 +LINK          = g++
 +LFLAGS        = -headerpad_max_install_names -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 -arch i386 -single_module -dynamiclib -compatibility_version	1.3 -current_version	1.3.0 -install_name	/Users/kintel/code/metalab/checkout/OpenSCAD/libraries-tmp/deploy/lib/libopencsg.1.dylib
-+LIBS          = $(SUBLIBS) -F/Library/Frameworks -L/Library/Frameworks -L/Users/kintel/code/metalab/checkout/OpenSCAD/libraries-tmp/deploy/lib -lGLEW -framework OpenGL -framework AGL -framework QtGui -framework QtCore 
++LIBS          = $(SUBLIBS) -F/Library/Frameworks -L/Library/Frameworks -L/Users/kintel/code/metalab/checkout/OpenSCAD/libraries-tmp/deploy/lib -lGLEW -framework OpenGL -framework AGL -framework QtGui -framework QtCore
 +AR            = ar cq
 +RANLIB        = ranlib -s
 +QMAKE         = /usr/bin/qmake
@@ -600,7 +600,7 @@ diff -ru OpenCSG-1.3.0/src/Makefile OpenCSG-1.3.0-mac/src/Makefile
 +SED           = sed
 +COPY_FILE     = cp -f
 +COPY_DIR      = cp -f -R
-+STRIP         = 
++STRIP         =
 +INSTALL_FILE  = $(COPY_FILE)
 +INSTALL_DIR   = $(COPY_DIR)
 +INSTALL_PROGRAM = $(COPY_FILE)
@@ -612,14 +612,14 @@ diff -ru OpenCSG-1.3.0/src/Makefile OpenCSG-1.3.0-mac/src/Makefile
 -MKDIR    = mkdir -p
 +MKDIR         = mkdir -p
 +export MACOSX_DEPLOYMENT_TARGET = 10.4
- 
+
  ####### Output directory
- 
+
 -OBJECTS_DIR = ./
 +OBJECTS_DIR   = ./
- 
+
  ####### Files
- 
+
 -HEADERS = ../include/opencsg.h \
 -		opencsgConfig.h \
 -		area.h \
@@ -657,7 +657,7 @@ diff -ru OpenCSG-1.3.0/src/Makefile OpenCSG-1.3.0-mac/src/Makefile
 -		stencilManager.cpp \
 -		../RenderTexture/RenderTexture.cpp
 -OBJECTS = area.o \
-+		stencilManager.cpp 
++		stencilManager.cpp
 +OBJECTS       = area.o \
  		batch.o \
  		context.o \
@@ -675,11 +675,11 @@ diff -ru OpenCSG-1.3.0/src/Makefile OpenCSG-1.3.0-mac/src/Makefile
  		settings.o \
 -		stencilManager.o \
 -		RenderTexture.o
--FORMS = 
--UICDECLS = 
--UICIMPLS = 
--SRCMOC   = 
--OBJMOC = 
+-FORMS =
+-UICDECLS =
+-UICIMPLS =
+-SRCMOC   =
+-OBJMOC =
 -DIST	   = src.pro
 -QMAKE_TARGET = opencsg
 -DESTDIR  = ../lib/
@@ -719,7 +719,7 @@ diff -ru OpenCSG-1.3.0/src/Makefile OpenCSG-1.3.0-mac/src/Makefile
 +		/usr/local/Qt4.6/mkspecs/features/include_source_dir.prf \
 +		src.pro
 +QMAKE_TARGET  = opencsg
-+DESTDIR       = 
++DESTDIR       =
 +TARGET        = libopencsg.1.3.0.dylib
 +TARGETA       = libopencsg.a
 +TARGETD       = libopencsg.1.3.0.dylib
@@ -739,41 +739,41 @@ diff -ru OpenCSG-1.3.0/src/Makefile OpenCSG-1.3.0-mac/src/Makefile
 +		-arch \
 +		i386
 +
- 
+
  first: all
  ####### Implicit rules
- 
+
 -.SUFFIXES: .c .o .cpp .cc .cxx .C
 +.SUFFIXES: .o .c .cpp .cc .cxx .C
- 
+
  .cpp.o:
 -	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
 +	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
- 
+
  .cc.o:
 -	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
 +	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
- 
+
  .cxx.o:
 -	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
 +	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
- 
+
  .C.o:
 -	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
 +	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
- 
+
  .c.o:
 -	$(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<
 +	$(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"
- 
+
  ####### Build rules
- 
+
 -all: Makefile  ../lib/$(TARGET)
 +all: Makefile  $(TARGET)
- 
--../lib/$(TARGET):  $(UICDECLS) $(OBJECTS) $(OBJMOC) $(SUBLIBS) $(OBJCOMP)  
+
+-../lib/$(TARGET):  $(UICDECLS) $(OBJECTS) $(OBJMOC) $(SUBLIBS) $(OBJCOMP)
 -	test -d ../lib/ || mkdir -p ../lib/
-+$(TARGET):  $(OBJECTS) $(SUBLIBS) $(OBJCOMP)  
++$(TARGET):  $(OBJECTS) $(SUBLIBS) $(OBJCOMP)
  	-$(DEL_FILE) $(TARGET) $(TARGET0) $(TARGET1) $(TARGET2)
 -	$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) $(OBJCOMP)
 +	$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS) $(OBJCOMP)
@@ -785,14 +785,14 @@ diff -ru OpenCSG-1.3.0/src/Makefile OpenCSG-1.3.0-mac/src/Makefile
 -	-$(DEL_FILE) ../lib/$(TARGET1)
 -	-$(DEL_FILE) ../lib/$(TARGET2)
 -	-$(MOVE) $(TARGET) $(TARGET0) $(TARGET1) $(TARGET2) ../lib/
- 
- 
- 
+
+
+
  staticlib: $(TARGETA)
- 
+
 -$(TARGETA):  $(UICDECLS) $(OBJECTS) $(OBJMOC) $(OBJCOMP)
-+$(TARGETA):  $(OBJECTS) $(OBJCOMP) 
- 	-$(DEL_FILE) $(TARGETA) 
++$(TARGETA):  $(OBJECTS) $(OBJCOMP)
+ 	-$(DEL_FILE) $(TARGETA)
 -	$(AR) $(TARGETA) $(OBJECTS) $(OBJMOC)
 +	$(AR) $(TARGETA) $(OBJECTS)
 +	$(RANLIB) $(TARGETA)
@@ -858,30 +858,30 @@ diff -ru OpenCSG-1.3.0/src/Makefile OpenCSG-1.3.0-mac/src/Makefile
 +/Library/Frameworks/QtCore.framework/QtCore.prl:
 +qmake:  FORCE
 +	@$(QMAKE) -macx CONFIG+=x86\ x86_64 -o Makefile src.pro
- 
- dist: 
+
+ dist:
 -	@mkdir -p .tmp/opencsg && $(COPY_FILE) --parents $(SOURCES) $(HEADERS) $(FORMS) $(DIST) .tmp/opencsg/ && ( cd `dirname .tmp/opencsg` && $(TAR) opencsg.tar opencsg && $(GZIP) opencsg.tar ) && $(MOVE) `dirname .tmp/opencsg`/opencsg.tar.gz . && $(DEL_FILE) -r .tmp/opencsg
-+	@$(CHK_DIR_EXISTS) .tmp/opencsg1.3.0 || $(MKDIR) .tmp/opencsg1.3.0 
++	@$(CHK_DIR_EXISTS) .tmp/opencsg1.3.0 || $(MKDIR) .tmp/opencsg1.3.0
 +	$(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/opencsg1.3.0/ && $(COPY_FILE) --parents ../include/opencsg.h opencsgConfig.h area.h batch.h context.h channelManager.h frameBufferObject.h frameBufferObjectExt.h occlusionQuery.h offscreenBuffer.h opencsgRender.h openglHelper.h primitiveHelper.h scissorMemo.h settings.h stencilManager.h .tmp/opencsg1.3.0/ && $(COPY_FILE) --parents area.cpp batch.cpp context.cpp channelManager.cpp frameBufferObject.cpp frameBufferObjectExt.cpp occlusionQuery.cpp offscreenBuffer.cpp opencsgRender.cpp openglHelper.cpp primitive.cpp primitiveHelper.cpp renderGoldfeather.cpp renderSCS.cpp scissorMemo.cpp settings.cpp stencilManager.cpp .tmp/opencsg1.3.0/ && (cd `dirname .tmp/opencsg1.3.0` && $(TAR) opencsg1.3.0.tar opencsg1.3.0 && $(COMPRESS) opencsg1.3.0.tar) && $(MOVE) `dirname .tmp/opencsg1.3.0`/opencsg1.3.0.tar.gz . && $(DEL_FILE) -r .tmp/opencsg1.3.0
 +
- 
+
 -yaccclean:
 -lexclean:
 -clean:
-+clean:compiler_clean 
++clean:compiler_clean
  	-$(DEL_FILE) $(OBJECTS)
  	-$(DEL_FILE) *~ core *.core
- 
+
 @@ -170,44 +243,77 @@
  ####### Sub-libraries
- 
+
  distclean: clean
 -	-$(DEL_FILE) ../lib/$(TARGET) $(TARGET)
 -	-$(DEL_FILE) ../lib/$(TARGET0) ../lib/$(TARGET1) ../lib/$(TARGET2) $(TARGETA)
 -
 -
 -FORCE:
-+	-$(DEL_FILE) $(TARGET) 
++	-$(DEL_FILE) $(TARGET)
 +	-$(DEL_FILE) $(TARGET0) $(TARGET1) $(TARGET2) $(TARGETA)
 +	-$(DEL_FILE) Makefile
 +
@@ -911,26 +911,26 @@ diff -ru OpenCSG-1.3.0/src/Makefile OpenCSG-1.3.0-mac/src/Makefile
 +compiler_yacc_impl_clean:
 +compiler_lex_make_all:
 +compiler_lex_clean:
-+compiler_clean: 
- 
++compiler_clean:
+
  ####### Compile
- 
+
  area.o: area.cpp opencsgConfig.h \
  		area.h \
  		openglHelper.h
 +	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o area.o area.cpp
- 
+
  batch.o: batch.cpp opencsgConfig.h \
  		batch.h \
  		primitiveHelper.h \
  		area.h
 +	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o batch.o batch.cpp
- 
+
  context.o: context.cpp opencsgConfig.h \
  		context.h \
  		offscreenBuffer.h
 +	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o context.o context.cpp
- 
+
  channelManager.o: channelManager.cpp opencsgConfig.h \
  		channelManager.h \
  		offscreenBuffer.h \
@@ -940,21 +940,21 @@ diff -ru OpenCSG-1.3.0/src/Makefile OpenCSG-1.3.0-mac/src/Makefile
 +		area.h \
 +		settings.h
 +	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o channelManager.o channelManager.cpp
- 
+
  frameBufferObject.o: frameBufferObject.cpp opencsgConfig.h \
  		frameBufferObject.h \
  		offscreenBuffer.h
 +	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o frameBufferObject.o frameBufferObject.cpp
- 
+
  frameBufferObjectExt.o: frameBufferObjectExt.cpp opencsgConfig.h \
  		frameBufferObjectExt.h \
  		offscreenBuffer.h
 +	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o frameBufferObjectExt.o frameBufferObjectExt.cpp
- 
+
  occlusionQuery.o: occlusionQuery.cpp opencsgConfig.h \
  		occlusionQuery.h
 +	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o occlusionQuery.o occlusionQuery.cpp
- 
+
  offscreenBuffer.o: offscreenBuffer.cpp opencsgConfig.h \
  		context.h \
 @@ -215,27 +321,28 @@
@@ -962,7 +962,7 @@ diff -ru OpenCSG-1.3.0/src/Makefile OpenCSG-1.3.0-mac/src/Makefile
  		frameBufferObjectExt.h \
  		pBufferTexture.h
 +	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o offscreenBuffer.o offscreenBuffer.cpp
- 
+
  opencsgRender.o: opencsgRender.cpp opencsgConfig.h \
  		opencsgRender.h \
  		primitiveHelper.h \
@@ -971,7 +971,7 @@ diff -ru OpenCSG-1.3.0/src/Makefile OpenCSG-1.3.0-mac/src/Makefile
 +		area.h \
 +		settings.h
 +	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o opencsgRender.o opencsgRender.cpp
- 
+
  openglHelper.o: openglHelper.cpp opencsgConfig.h \
  		openglHelper.h \
  		area.h
@@ -980,10 +980,10 @@ diff -ru OpenCSG-1.3.0/src/Makefile OpenCSG-1.3.0-mac/src/Makefile
 -		pBufferTexture.h \
 -		offscreenBuffer.h
 +	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o openglHelper.o openglHelper.cpp
- 
+
  primitive.o: primitive.cpp opencsgConfig.h
 +	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o primitive.o primitive.cpp
- 
+
  primitiveHelper.o: primitiveHelper.cpp opencsgConfig.h \
  		openglHelper.h \
 -		primitiveHelper.h \
@@ -991,7 +991,7 @@ diff -ru OpenCSG-1.3.0/src/Makefile OpenCSG-1.3.0-mac/src/Makefile
 +		area.h \
 +		primitiveHelper.h
 +	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o primitiveHelper.o primitiveHelper.cpp
- 
+
  renderGoldfeather.o: renderGoldfeather.cpp opencsgConfig.h \
  		opencsgRender.h \
 @@ -243,10 +350,11 @@
@@ -1005,7 +1005,7 @@ diff -ru OpenCSG-1.3.0/src/Makefile OpenCSG-1.3.0-mac/src/Makefile
 -		area.h
 +		stencilManager.h
 +	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o renderGoldfeather.o renderGoldfeather.cpp
- 
+
  renderSCS.o: renderSCS.cpp opencsgConfig.h \
  		opencsgRender.h \
 @@ -254,29 +362,57 @@
@@ -1018,7 +1018,7 @@ diff -ru OpenCSG-1.3.0/src/Makefile OpenCSG-1.3.0-mac/src/Makefile
 -		area.h
 +		scissorMemo.h
 +	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o renderSCS.o renderSCS.cpp
- 
+
  scissorMemo.o: scissorMemo.cpp opencsgConfig.h \
  		openglHelper.h \
 -		scissorMemo.h \
@@ -1026,10 +1026,10 @@ diff -ru OpenCSG-1.3.0/src/Makefile OpenCSG-1.3.0-mac/src/Makefile
 +		scissorMemo.h \
  		channelManager.h
 +	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o scissorMemo.o scissorMemo.cpp
- 
+
  settings.o: settings.cpp opencsgConfig.h
 +	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o settings.o settings.cpp
- 
+
  stencilManager.o: stencilManager.cpp opencsgConfig.h \
  		area.h \
  		openglHelper.h \
@@ -1038,34 +1038,34 @@ diff -ru OpenCSG-1.3.0/src/Makefile OpenCSG-1.3.0-mac/src/Makefile
 -RenderTexture.o: ../RenderTexture/RenderTexture.cpp ../RenderTexture/RenderTexture.h
 -	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o RenderTexture.o ../RenderTexture/RenderTexture.cpp
 +	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o stencilManager.o stencilManager.cpp
- 
+
  ####### Install
- 
--install: all 
+
+-install: all
 +install_target: first FORCE
-+	@$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/Users/kintel/code/metalab/checkout/OpenSCAD/libraries-tmp/deploy/lib/ || $(MKDIR) $(INSTALL_ROOT)/Users/kintel/code/metalab/checkout/OpenSCAD/libraries-tmp/deploy/lib/ 
++	@$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/Users/kintel/code/metalab/checkout/OpenSCAD/libraries-tmp/deploy/lib/ || $(MKDIR) $(INSTALL_ROOT)/Users/kintel/code/metalab/checkout/OpenSCAD/libraries-tmp/deploy/lib/
 +	-$(INSTALL_PROGRAM) "$(TARGET)" "$(INSTALL_ROOT)/Users/kintel/code/metalab/checkout/OpenSCAD/libraries-tmp/deploy/lib/$(TARGET)"
 +	-$(SYMLINK) "$(TARGET)" "$(INSTALL_ROOT)/Users/kintel/code/metalab/checkout/OpenSCAD/libraries-tmp/deploy/lib/$(TARGET0)"
 +	-$(SYMLINK) "$(TARGET)" "$(INSTALL_ROOT)/Users/kintel/code/metalab/checkout/OpenSCAD/libraries-tmp/deploy/lib/$(TARGET1)"
 +	-$(SYMLINK) "$(TARGET)" "$(INSTALL_ROOT)/Users/kintel/code/metalab/checkout/OpenSCAD/libraries-tmp/deploy/lib/$(TARGET2)"
 +
 +uninstall_target:  FORCE
-+	-$(DEL_FILE) "$(INSTALL_ROOT)/Users/kintel/code/metalab/checkout/OpenSCAD/libraries-tmp/deploy/lib/$(TARGET)" 
-+	 -$(DEL_FILE) "$(INSTALL_ROOT)/Users/kintel/code/metalab/checkout/OpenSCAD/libraries-tmp/deploy/lib/$(TARGET0)" 
-+	 -$(DEL_FILE) "$(INSTALL_ROOT)/Users/kintel/code/metalab/checkout/OpenSCAD/libraries-tmp/deploy/lib/$(TARGET1)" 
++	-$(DEL_FILE) "$(INSTALL_ROOT)/Users/kintel/code/metalab/checkout/OpenSCAD/libraries-tmp/deploy/lib/$(TARGET)"
++	 -$(DEL_FILE) "$(INSTALL_ROOT)/Users/kintel/code/metalab/checkout/OpenSCAD/libraries-tmp/deploy/lib/$(TARGET0)"
++	 -$(DEL_FILE) "$(INSTALL_ROOT)/Users/kintel/code/metalab/checkout/OpenSCAD/libraries-tmp/deploy/lib/$(TARGET1)"
 +	 -$(DEL_FILE) "$(INSTALL_ROOT)/Users/kintel/code/metalab/checkout/OpenSCAD/libraries-tmp/deploy/lib/$(TARGET2)"
-+	-$(DEL_DIR) $(INSTALL_ROOT)/Users/kintel/code/metalab/checkout/OpenSCAD/libraries-tmp/deploy/lib/ 
++	-$(DEL_DIR) $(INSTALL_ROOT)/Users/kintel/code/metalab/checkout/OpenSCAD/libraries-tmp/deploy/lib/
 +
 +
 +install_headers: first FORCE
-+	@$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/Users/kintel/code/metalab/checkout/OpenSCAD/libraries-tmp/deploy/include/ || $(MKDIR) $(INSTALL_ROOT)/Users/kintel/code/metalab/checkout/OpenSCAD/libraries-tmp/deploy/include/ 
++	@$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/Users/kintel/code/metalab/checkout/OpenSCAD/libraries-tmp/deploy/include/ || $(MKDIR) $(INSTALL_ROOT)/Users/kintel/code/metalab/checkout/OpenSCAD/libraries-tmp/deploy/include/
 +	-$(INSTALL_FILE) /Users/kintel/code/metalab/checkout/OpenSCAD/libraries-tmp/src/OpenCSG-1.3.0-patched/include/opencsg.h $(INSTALL_ROOT)/Users/kintel/code/metalab/checkout/OpenSCAD/libraries-tmp/deploy/include/
 +
- 
--uninstall: 
+
+-uninstall:
 +uninstall_headers:  FORCE
 +	-$(DEL_FILE) -r $(INSTALL_ROOT)/Users/kintel/code/metalab/checkout/OpenSCAD/libraries-tmp/deploy/include/opencsg.h
-+	-$(DEL_DIR) $(INSTALL_ROOT)/Users/kintel/code/metalab/checkout/OpenSCAD/libraries-tmp/deploy/include/ 
++	-$(DEL_DIR) $(INSTALL_ROOT)/Users/kintel/code/metalab/checkout/OpenSCAD/libraries-tmp/deploy/include/
 +
 +
 +install:  install_target install_headers  FORCE
@@ -1073,7 +1073,7 @@ diff -ru OpenCSG-1.3.0/src/Makefile OpenCSG-1.3.0-mac/src/Makefile
 +uninstall: uninstall_target uninstall_headers   FORCE
 +
 +FORCE:
- 
+
 diff -ru OpenCSG-1.3.0/src/channelManager.cpp OpenCSG-1.3.0-mac/src/channelManager.cpp
 --- OpenCSG-1.3.0/src/channelManager.cpp	2010-02-06 21:35:10.000000000 +0100
 +++ OpenCSG-1.3.0-mac/src/channelManager.cpp	2010-05-09 02:51:32.000000000 +0200
@@ -1085,7 +1085,7 @@ diff -ru OpenCSG-1.3.0/src/channelManager.cpp OpenCSG-1.3.0-mac/src/channelManag
 +#elif !defined(__APPLE__)
  #include 
  #endif
- 
+
 @@ -170,9 +170,11 @@
  #ifdef WIN32
                  && WGLEW_ARB_pbuffer
@@ -1103,17 +1103,17 @@ diff -ru OpenCSG-1.3.0/src/frameBufferObject.h OpenCSG-1.3.0-mac/src/frameBuffer
 --- OpenCSG-1.3.0/src/frameBufferObject.h	2010-02-06 21:35:10.000000000 +0100
 +++ OpenCSG-1.3.0-mac/src/frameBufferObject.h	2010-05-09 02:51:36.000000000 +0200
 @@ -79,10 +79,10 @@
- 
+
              /// Texture stuff
              GLenum       textureTarget;
 -            unsigned int textureID;
 -            unsigned int depthID;
 +            GLuint textureID;
 +            GLuint depthID;
- 
+
 -            unsigned int framebufferID;
 +            GLuint framebufferID;
- 
+
              bool         initialized;
          };
 diff -ru OpenCSG-1.3.0/src/occlusionQuery.cpp OpenCSG-1.3.0-mac/src/occlusionQuery.cpp
@@ -1121,7 +1121,7 @@ diff -ru OpenCSG-1.3.0/src/occlusionQuery.cpp OpenCSG-1.3.0-mac/src/occlusionQue
 +++ OpenCSG-1.3.0-mac/src/occlusionQuery.cpp	2010-05-09 02:51:40.000000000 +0200
 @@ -57,7 +57,7 @@
          }
- 
+
          unsigned int OcclusionQueryARB::getQueryResult() {
 -            unsigned int fragmentCount;
 +            GLuint fragmentCount;
@@ -1130,7 +1130,7 @@ diff -ru OpenCSG-1.3.0/src/occlusionQuery.cpp OpenCSG-1.3.0-mac/src/occlusionQue
          }
 @@ -94,7 +94,7 @@
          }
- 
+
          unsigned int OcclusionQueryNV::getQueryResult() {
 -            unsigned int fragmentCount;
 +            GLuint fragmentCount;
@@ -1141,20 +1141,20 @@ diff -ru OpenCSG-1.3.0/src/openglHelper.cpp OpenCSG-1.3.0-mac/src/openglHelper.c
 --- OpenCSG-1.3.0/src/openglHelper.cpp	2010-02-06 21:35:10.000000000 +0100
 +++ OpenCSG-1.3.0-mac/src/openglHelper.cpp	2010-05-09 02:51:44.000000000 +0200
 @@ -29,13 +29,13 @@
- 
+
          GLfloat projection[16];
          GLfloat modelview[16];
 -        int canvasPos[4];
 +        GLint canvasPos[4];
- 
+
 -        int stencilBits = 0;
 +        GLint stencilBits = 0;
          int stencilMax = 0;
          int stencilMask = 0;
- 
+
 -        int scissorPos[4];
 +        GLint scissorPos[4];
- 
+
          void scissor(const PCArea& area) {
              const int dx = area.maxx - area.minx;
 diff -ru OpenCSG-1.3.0/src/openglHelper.h OpenCSG-1.3.0-mac/src/openglHelper.h
@@ -1167,7 +1167,7 @@ diff -ru OpenCSG-1.3.0/src/openglHelper.h OpenCSG-1.3.0-mac/src/openglHelper.h
 -        extern int canvasPos[4];
 +        extern GLint canvasPos[4];
              // copy of the viewport size during CSG computation
- 
+
 -        extern int stencilBits;
 +        extern GLint stencilBits;
              // number of stencil bits in the pbuffer
@@ -1175,27 +1175,27 @@ diff -ru OpenCSG-1.3.0/src/openglHelper.h OpenCSG-1.3.0-mac/src/openglHelper.h
              // the number where the stencil value would "wrap around" to zero
          extern int stencilMask;
              // stencilMax - 1
- 
+
 -        extern int scissorPos[4];
 +        extern GLint scissorPos[4];
              // copy of the scissor settings for CSG computation
- 
+
          void scissor(const PCArea& area);
 diff -ru OpenCSG-1.3.0/src/pBufferTexture.h OpenCSG-1.3.0-mac/src/pBufferTexture.h
 --- OpenCSG-1.3.0/src/pBufferTexture.h	2010-02-06 21:35:10.000000000 +0100
 +++ OpenCSG-1.3.0-mac/src/pBufferTexture.h	2010-05-09 02:51:53.000000000 +0200
 @@ -22,7 +22,7 @@
- 
+
  #ifndef __OpenCSG__pbuffer_texture_h__
  #define __OpenCSG__pbuffer_texture_h__
 -
 +#ifndef __APPLE__
  #include "opencsgConfig.h"
  #include "offscreenBuffer.h"
- 
+
 @@ -84,5 +84,27 @@
      } // namespace OpenGL
- 
+
  } // namespace OpenCSG
 +#else
 +
@@ -1218,7 +1218,7 @@ diff -ru OpenCSG-1.3.0/src/pBufferTexture.h OpenCSG-1.3.0-mac/src/pBufferTexture
 +    };
 +  }
 +}
- 
+
 +#endif // __APPLE__
  #endif // __OpenCSG__frame_buffer_object_h__
 diff -ru OpenCSG-1.3.0/src/src.pro OpenCSG-1.3.0-mac/src/src.pro
@@ -1229,12 +1229,12 @@ diff -ru OpenCSG-1.3.0/src/src.pro OpenCSG-1.3.0-mac/src/src.pro
  TARGET		= opencsg
  VERSION     = 1.3.0
 -DESTDIR     = ../lib
- 
+
  CONFIG		+= opengl warn_on release
 -INCLUDEPATH += ../include ../glew/include ../
 +INCLUDEPATH += ../include ../
 +
-+# Optionally specify deployment location using the 
++# Optionally specify deployment location using the
 +# MACOSX_DEPLOY_DIR env. variable
 +DEPLOYDIR = $$(MACOSX_DEPLOY_DIR)
 +
@@ -1255,7 +1255,7 @@ diff -ru OpenCSG-1.3.0/src/src.pro OpenCSG-1.3.0-mac/src/src.pro
 +  INSTALLS += target
 +  target.path = $$DESTDIR
 +}
- 
+
  HEADERS		= ../include/opencsg.h \
  		  opencsgConfig.h \
 @@ -18,12 +39,11 @@
diff --git a/qxs/openscad.qnfa b/qxs/openscad.qnfa
index bdd64f2e1db..cd2a2e17e8b 100644
--- a/qxs/openscad.qnfa
+++ b/qxs/openscad.qnfa
@@ -5,18 +5,18 @@
 		/\*
 		\*/
 	
-	
+
 	
 		//
 		\n
-		
+
 		
 			\\\n
 			\n
 			\\
 		
 	
-	
+
 	
 		"
 		"
@@ -48,7 +48,7 @@
 	}
 	\[
 	\]
-	
+
 	
 		module
 		function
@@ -59,13 +59,13 @@
 		if
 		else
 	
-	
+
 	
 		false
 		true
 		undef
 	
-	
+
 	-?[0-9]*.[0-9]+f?
 	-?[0-9]+[ulUL]*
 
diff --git a/scripts/macosx-build-dependencies.sh b/scripts/macosx-build-dependencies.sh
index b03b2b2f9d9..99c441f897b 100755
--- a/scripts/macosx-build-dependencies.sh
+++ b/scripts/macosx-build-dependencies.sh
@@ -1,9 +1,9 @@
 #!/bin/sh
 #
 # This script builds all library dependencies of OpenSCAD for Mac OS X.
-# The libraries will be build in 32- and 64-bit mode and backwards compatible with 
+# The libraries will be build in 32- and 64-bit mode and backwards compatible with
 # 10.5 "Leopard".
-# 
+#
 # Usage:
 # - Edit the BASEDIR variable. This is where libraries will be built and installed
 # - Edit the OPENSCADDIR variable. This is where patches are fetched from
@@ -110,8 +110,8 @@ build_boost()
   ./bootstrap.sh --prefix=$DEPLOYDIR --with-libraries=thread,program_options
   ./bjam cflags="-mmacosx-version-min=10.5 -arch i386 -arch x86_64" linkflags="-mmacosx-version-min=10.5 -arch i386 -arch x86_64"
   ./bjam install
-  install_name_tool -id $DEPLOYDIR/lib/libboost_thread.dylib $DEPLOYDIR/lib/libboost_thread.dylib 
-  install_name_tool -id $DEPLOYDIR/lib/libboost_program_options.dylib $DEPLOYDIR/lib/libboost_program_options.dylib 
+  install_name_tool -id $DEPLOYDIR/lib/libboost_thread.dylib $DEPLOYDIR/lib/libboost_thread.dylib
+  install_name_tool -id $DEPLOYDIR/lib/libboost_program_options.dylib $DEPLOYDIR/lib/libboost_program_options.dylib
 }
 
 build_cgal()
@@ -138,7 +138,7 @@ build_glew()
   cd glew-$version
   mkdir -p $DEPLOYDIR/lib/pkgconfig
   # To avoid running strip on a fat archive as this is not supported by strip
-  sed -i bak -e "s/\$(STRIP) -x lib\/\$(LIB.STATIC)//" Makefile 
+  sed -i bak -e "s/\$(STRIP) -x lib\/\$(LIB.STATIC)//" Makefile
   make GLEW_DEST=$DEPLOYDIR CFLAGS.EXTRA="-no-cpp-precomp -dynamic -fno-common -mmacosx-version-min=10.5 -arch i386 -arch x86_64" LDFLAGS.EXTRA="-mmacosx-version-min=10.5 -arch i386 -arch x86_64" install
 }
 
diff --git a/scripts/macosx-sanity-check.py b/scripts/macosx-sanity-check.py
index 3938d745b55..d1982efee5f 100755
--- a/scripts/macosx-sanity-check.py
+++ b/scripts/macosx-sanity-check.py
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 
 #
-# This is be used to verify that all the dependant libraries of a  Mac OS X executable 
+# This is be used to verify that all the dependant libraries of a  Mac OS X executable
 # are present and that they are backwards compatible with at least 10.5.
 # Run with an executable as parameter
 # Will return 0 if the executable an all libraries are OK
@@ -56,7 +56,7 @@ def find_dependencies(file):
     if DEBUG: print "Executing " + " ".join(args)
     p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
     output,err = p.communicate()
-    if p.returncode != 0: 
+    if p.returncode != 0:
         print "Failed with return code " + str(p.returncode) + ":"
         print err
         return None
@@ -80,13 +80,13 @@ def validate_lib(lib):
 
     p  = subprocess.Popen(["lipo", lib, "-verify_arch", "x86_64"], stdout=subprocess.PIPE)
     output = p.communicate()[0]
-    if p.returncode != 0: 
+    if p.returncode != 0:
         print "Error: x86_64 architecture not supported: " + lib
         return False
 
     p  = subprocess.Popen(["lipo", lib, "-verify_arch", "i386"], stdout=subprocess.PIPE)
     output = p.communicate()[0]
-    if p.returncode != 0: 
+    if p.returncode != 0:
         print "Error: i386 architecture not supported: " + lib
         return False
     return True
@@ -115,7 +115,7 @@ def validate_lib(lib):
                 continue
             if absfile in processed:
                 processed[absfile].append(dep)
-            else: 
+            else:
                 processed[absfile] = [dep]
                 if DEBUG: print "Pending: " + absfile
                 pending.append(absfile)
diff --git a/scripts/release-common.sh b/scripts/release-common.sh
index 340266dd6eb..fdf869dab8e 100755
--- a/scripts/release-common.sh
+++ b/scripts/release-common.sh
@@ -4,7 +4,7 @@
 # This should work under Mac OS X and Windows (msys). Linux support pending.
 # The script will create a file called openscad-.zip
 # in the current directory.
-# 
+#
 # Usage: release-common.sh [-v ]
 #  -v   Version string (e.g. -v 2010.01)
 #
@@ -41,11 +41,11 @@ fi
 echo "Building openscad-$VERSION $CONFIGURATION..."
 
 case $OS in
-    MACOSX) 
+    MACOSX)
         CONFIG=deploy
         TARGET=
         ;;
-    WIN) 
+    WIN)
         unset CONFIG
         export QTDIR=/c/devmingw/qt2009.03
         export QTMAKESPEC=win32-g++
@@ -59,7 +59,7 @@ esac
 qmake VERSION=$VERSION CONFIG+=$CONFIG CONFIG-=debug openscad.pro
 make -s clean
 case $OS in
-    MACOSX) 
+    MACOSX)
         rm -rf OpenSCAD.app
         ;;
     WIN)
diff --git a/scripts/release-macosx.sh b/scripts/release-macosx.sh
index 18174d6eb88..8c20c89c616 100755
--- a/scripts/release-macosx.sh
+++ b/scripts/release-macosx.sh
@@ -7,7 +7,7 @@
 # This script creates a binary release of OpenSCAD for Mac OS X.
 # The script will create a file called openscad-.zip
 # in the current directory.
-# 
+#
 # Usage: makedmg.sh [-v ]
 #  -v   Version string (e.g. -v 2010.01)
 #
@@ -47,8 +47,8 @@ install_name_tool -change libopencsg.1.dylib @executable_path/../Frameworks/libo
 install_name_tool -change QtOpenGL.framework/Versions/4/QtOpenGL @executable_path/../Frameworks/QtOpenGL OpenSCAD.app/Contents/MacOS/openscad
 install_name_tool -change QtGui.framework/Versions/4/QtGui @executable_path/../Frameworks/QtGui OpenSCAD.app/Contents/MacOS/openscad
 install_name_tool -change QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore OpenSCAD.app/Contents/MacOS/openscad
-install_name_tool -change QtGui.framework/Versions/4/QtGui @executable_path/../Frameworks/QtGui OpenSCAD.app/Contents/Frameworks/QtOpenGL 
-install_name_tool -change QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore OpenSCAD.app/Contents/Frameworks/QtOpenGL 
+install_name_tool -change QtGui.framework/Versions/4/QtGui @executable_path/../Frameworks/QtGui OpenSCAD.app/Contents/Frameworks/QtOpenGL
+install_name_tool -change QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore OpenSCAD.app/Contents/Frameworks/QtOpenGL
 install_name_tool -change QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore OpenSCAD.app/Contents/Frameworks/QtGui
 install_name_tool -change /opt/local/lib/libGLEW.1.5.1.dylib @executable_path/../Frameworks/libGLEW.1.5.1.dylib OpenSCAD.app/Contents/MacOS/openscad
 install_name_tool -id libopencsg.dylib OpenSCAD.app/Contents/Frameworks/libopencsg.dylib
diff --git a/src/CGAL_renderer.h b/src/CGAL_renderer.h
index 07583392dab..32da5efd12e 100644
--- a/src/CGAL_renderer.h
+++ b/src/CGAL_renderer.h
@@ -13,7 +13,7 @@
 //
 // $URL: svn+ssh://scm.gforge.inria.fr/svn/cgal/branches/CGAL-3.5-branch/Nef_3/include/CGAL/Nef_3/OGL_helper.h $
 // $Id: OGL_helper.h 44713 2008-08-01 15:38:58Z hachenb $
-// 
+//
 //
 // Author(s)     : Peter Hachenberger 
 
@@ -29,7 +29,7 @@
 #ifdef _WIN32
 #define CGAL_GLU_TESS_CALLBACK CALLBACK
 #else
-#define CGAL_GLU_TESS_CALLBACK 
+#define CGAL_GLU_TESS_CALLBACK
 #endif
 
 #ifdef __APPLE__
@@ -53,7 +53,7 @@ namespace OpenSCAD {
 // Drawable double types:
 // ----------------------------------------------------------------------------
 
-		typedef CGAL::Simple_cartesian DKernel;  
+		typedef CGAL::Simple_cartesian DKernel;
 		typedef DKernel::Point_3               Double_point;
 		typedef DKernel::Vector_3              Double_vector;
 		typedef DKernel::Segment_3             Double_segment;
@@ -91,7 +91,7 @@ namespace OpenSCAD {
 			typedef const double* const_double_ptr;
 			double coords_[3];
 		public:
-			Double_triple() 
+			Double_triple()
 				{ coords_[0]=coords_[1]=coords_[2]=0.0; }
 			Double_triple(double x, double y, double z)
 				{ coords_[0]=x; coords_[1]=y; coords_[2]=z; }
@@ -105,9 +105,9 @@ namespace OpenSCAD {
 					coords_[1]=t.coords_[1];
 					coords_[2]=t.coords_[2];
 					return *this; }
-			operator double_ptr() const 
+			operator double_ptr() const
 				{ return const_cast(*this).coords_; }
-			double operator[](unsigned i) 
+			double operator[](unsigned i)
 				{ CGAL_assertion(i<3); return coords_[i]; }
 		}; // Double_triple
 
@@ -137,19 +137,19 @@ namespace OpenSCAD {
 			void push_back_vertex(double x, double y, double z)
 				{ coords_.push_back(Double_triple(x,y,z)); }
 
-			DFacet(const DFacet& f) 
+			DFacet(const DFacet& f)
 				{ coords_  = f.coords_;
 					fc_ends_ = f.fc_ends_;
 					normal_  = f.normal_;
 					mark_    = f.mark_;
 				}
 
-			DFacet& operator=(const DFacet& f) 
+			DFacet& operator=(const DFacet& f)
 				{ coords_ =  f.coords_;
 					fc_ends_ = f.fc_ends_;
 					normal_ =  f.normal_;
 					mark_    = f.mark_;
-					return *this; 
+					return *this;
 				}
 
 			~DFacet()
@@ -157,7 +157,7 @@ namespace OpenSCAD {
 
 			void push_back_vertex(const Double_point& p)
 				{ push_back_vertex(p.x(),p.y(),p.z()); }
-   
+
 			void set_normal(double x, double y, double z, bool m)
 				{ double l = sqrt(x*x + y*y + z*z);
 					normal_ = Double_triple(x/l,y/l,z/l); mark_ = m; }
@@ -166,21 +166,21 @@ namespace OpenSCAD {
 			double dy() const { return normal_[1]; }
 			double dz() const { return normal_[2]; }
 			bool mark() const { return mark_; }
-			double* normal() const 
+			double* normal() const
 				{ return static_cast(normal_); }
 
 			void new_facet_cycle()
 				{ fc_ends_.push_back(coords_.size()); }
-    
+
 			unsigned number_of_facet_cycles() const
 				{ return fc_ends_.size(); }
 
-			Coord_iterator facet_cycle_begin(unsigned i) 
+			Coord_iterator facet_cycle_begin(unsigned i)
 				{ CGAL_assertion(imark() ? colors[CGAL_NEF3_UNMARKED_VERTEX_COLOR] : colors[CGAL_NEF3_MARKED_VERTEX_COLOR];
 				glPointSize(10);
@@ -332,7 +332,7 @@ namespace OpenSCAD {
 				glEnd();
 			}
 
-			void draw(Edge_iterator e) const { 
+			void draw(Edge_iterator e) const {
 				//      CGAL_NEF_TRACEN("drawing edge "<<*e);
 				Double_point p = e->source(), q = e->target();
 				unsigned char *c = e->mark() ? colors[CGAL_NEF3_UNMARKED_EDGE_COLOR] : colors[CGAL_NEF3_MARKED_EDGE_COLOR];
@@ -344,7 +344,7 @@ namespace OpenSCAD {
 				glEnd();
 			}
 
-			void draw(Halffacet_iterator f) const { 
+			void draw(Halffacet_iterator f) const {
 				//      CGAL_NEF_TRACEN("drawing facet "<<(f->debug(),""));
 				GLUtesselator* tess_ = gluNewTess();
 				gluTessCallback(tess_, GLenum(GLU_TESS_VERTEX_DATA),
@@ -372,7 +372,7 @@ namespace OpenSCAD {
 					gluTessBeginContour(tess_);
 					//	CGAL_NEF_TRACEN("  Begin Contour");
 					// put all vertices in facet cycle into contour:
-					for(cit = f->facet_cycle_begin(i); 
+					for(cit = f->facet_cycle_begin(i);
 							cit != f->facet_cycle_end(i); ++cit) {
 						gluTessVertex(tess_, *cit, *cit);
 						//	  CGAL_NEF_TRACEN("    add Vertex");
@@ -387,7 +387,7 @@ namespace OpenSCAD {
 			}
 
 			void construct_axes() const
-				{ 
+				{
 					glLineWidth(2.0);
 					// red x-axis
 					glColor3f(1.0,0.0,0.0);
@@ -395,7 +395,7 @@ namespace OpenSCAD {
 					glVertex3f(0.0,0.0,0.0);
 					glVertex3f(5000.0,0.0,0.0);
 					glEnd();
-					// green y-axis 
+					// green y-axis
 					glColor3f(0.0,1.0,0.0);
 					glBegin(GL_LINES);
 					glVertex3f(0.0,0.0,0.0);
@@ -423,15 +423,15 @@ namespace OpenSCAD {
 			void fill_display_lists() {
 				glNewList(object_list_, GL_COMPILE);
 				Vertex_iterator v;
-				for(v=vertices_.begin();v!=vertices_.end();++v) 
+				for(v=vertices_.begin();v!=vertices_.end();++v)
 					draw(v);
-				glEndList();     
+				glEndList();
 
 				glNewList(object_list_+1, GL_COMPILE);
 				Edge_iterator e;
 				for(e=edges_.begin();e!=edges_.end();++e)
 					draw(e);
-				glEndList();     
+				glEndList();
 
 				glNewList(object_list_+2, GL_COMPILE);
 				Halffacet_iterator f;
@@ -445,19 +445,19 @@ namespace OpenSCAD {
 
 			}
 
-			void init() { 
+			void init() {
 				if (init_) return;
 				init_ = true;
 				switches[SNC_AXES] = false;
 				style = SNC_BOUNDARY;
-				object_list_ = glGenLists(4); 
-				CGAL_assertion(object_list_); 
+				object_list_ = glGenLists(4);
+				CGAL_assertion(object_list_);
 				fill_display_lists();
 			}
 
 
 			void draw() const
-				{ 
+				{
 					if (!is_initialized()) const_cast(*this).init();
 					double l = (std::max)( (std::max)( bbox().xmax() - bbox().xmin(),
 																						 bbox().ymax() - bbox().ymin()),
@@ -469,11 +469,11 @@ namespace OpenSCAD {
 												-(bbox().ymax() + bbox().ymin()) / 2.0,
 												-(bbox().zmax() + bbox().zmin()) / 2.0);
 					if (style == SNC_BOUNDARY) {
-						//glEnable(GL_LIGHTING); 
+						//glEnable(GL_LIGHTING);
 						glCallList(object_list_+2); // facets
 						//glDisable(GL_LIGHTING);
 					}
-					// move edges and vertices a bit towards the view-point, 
+					// move edges and vertices a bit towards the view-point,
 					// i.e., 1/100th of the unit vector in camera space
 					//      double f = l / 4.0 / 100.0;
 					//      glTranslated( z_vec[0] * f, z_vec[1] * f, z_vec[2] * f);
@@ -487,7 +487,7 @@ namespace OpenSCAD {
 					os << "OGL::Polyhedron" << std::endl;
 					os << "Vertices:" << std::endl;
 					Vertex_iterator v;
-					for(v=vertices_.begin();v!=vertices_.end();++v) 
+					for(v=vertices_.begin();v!=vertices_.end();++v)
 						os << "  "<<*v<<", mark="<mark()<
-		class Nef3_Converter { 
+		class Nef3_Converter {
 			typedef typename Nef_polyhedron::SNC_structure           SNC_structure;
 			typedef CGAL::SNC_decorator               Base;
 			typedef CGAL::SNC_FM_decorator            FM_decorator;
-    
+
     public:
-			typedef typename SNC_structure::Vertex_const_iterator Vertex_const_iterator; 
-			typedef typename SNC_structure::Halfedge_const_iterator Halfedge_const_iterator; 
-			typedef typename SNC_structure::Halffacet_const_iterator Halffacet_const_iterator; 
+			typedef typename SNC_structure::Vertex_const_iterator Vertex_const_iterator;
+			typedef typename SNC_structure::Halfedge_const_iterator Halfedge_const_iterator;
+			typedef typename SNC_structure::Halffacet_const_iterator Halffacet_const_iterator;
 			typedef typename SNC_structure::Halffacet_cycle_const_iterator Halffacet_cycle_const_iterator;
-    
+
 			typedef typename SNC_structure::Object_const_handle Object_const_handle;
-			typedef typename SNC_structure::SHalfedge_const_handle SHalfedge_const_handle; 
-			typedef typename SNC_structure::SHalfloop_const_handle SHalfloop_const_handle; 
-    
-			typedef typename SNC_structure::Vertex_const_handle Vertex_const_handle; 
-			typedef typename SNC_structure::Halfedge_const_handle Halfedge_const_handle; 
+			typedef typename SNC_structure::SHalfedge_const_handle SHalfedge_const_handle;
+			typedef typename SNC_structure::SHalfloop_const_handle SHalfloop_const_handle;
+
+			typedef typename SNC_structure::Vertex_const_handle Vertex_const_handle;
+			typedef typename SNC_structure::Halfedge_const_handle Halfedge_const_handle;
 			typedef typename SNC_structure::Halffacet_const_handle Halffacet_const_handle;
-    
+
 			typedef typename SNC_structure::Point_3 Point_3;
 			typedef typename SNC_structure::Vector_3 Vector_3;
 			typedef typename SNC_structure::Segment_3 Segment_3;
 			typedef typename SNC_structure::Plane_3 Plane_3;
 			typedef typename SNC_structure::Mark Mark;
-			typedef typename SNC_structure::SHalfedge_around_facet_const_circulator 
+			typedef typename SNC_structure::SHalfedge_around_facet_const_circulator
       SHalfedge_around_facet_const_circulator;
-    
+
 		private:
 			static OGL::Double_point double_point(const Point_3& p)
 				{ return OGL::Double_point(CGAL::to_double(p.x()),
 																	 CGAL::to_double(p.y()),
 																	 CGAL::to_double(p.z())); }
-    
+
 			static OGL::Double_segment double_segment(const Segment_3& s)
 				{ return OGL::Double_segment(double_point(s.source()),
 																		 double_point(s.target())); }
-    
-			static void draw(Vertex_const_handle v, const Nef_polyhedron& , 
-											 Polyhedron& P) { 
+
+			static void draw(Vertex_const_handle v, const Nef_polyhedron& ,
+											 Polyhedron& P) {
 				Point_3 bp = v->point();
 				//    CGAL_NEF_TRACEN("vertex " << bp);
-				P.push_back(double_point(bp), v->mark()); 
+				P.push_back(double_point(bp), v->mark());
 			}
-    
+
 			static void draw(Halfedge_const_handle e, const Nef_polyhedron& ,
-											 Polyhedron& P) { 
+											 Polyhedron& P) {
 				Vertex_const_handle s = e->source();
 				Vertex_const_handle t = e->twin()->source();
 				Segment_3 seg(s->point(),t->point());
 				//    CGAL_NEF_TRACEN("edge " << seg);
-				P.push_back(double_segment(seg), e->mark()); 
+				P.push_back(double_segment(seg), e->mark());
 			}
-    
+
 			static void draw(Halffacet_const_handle f, const Nef_polyhedron& ,
-											 Polyhedron& P) { 
+											 Polyhedron& P) {
 				OGL::DFacet g;
 				Halffacet_cycle_const_iterator fc; // all facet cycles:
 				CGAL_forall_facet_cycles_of(fc,f)
@@ -580,16 +580,16 @@ namespace OpenSCAD {
 						}
 					}
 				Vector_3 v = f->plane().orthogonal_vector();
-				g.set_normal(CGAL::to_double(v.x()), 
-										 CGAL::to_double(v.y()), 
-										 CGAL::to_double(v.z()), 
+				g.set_normal(CGAL::to_double(v.x()),
+										 CGAL::to_double(v.y()),
+										 CGAL::to_double(v.z()),
 										 f->mark());
 				P.push_back(g);
 			}
-    
+
 			// Returns the bounding box of the finite vertices of the polyhedron.
 			// Returns $[-1,+1]^3$ as bounding box if no finite vertex exists.
-    
+
 			static Bbox_3  bounded_bbox(const Nef_polyhedron& N) {
 				bool first_vertex = true;
 				Bbox_3 bbox( -1.0, -1.0, -1.0, 1.0, 1.0, 1.0);
@@ -611,8 +611,8 @@ namespace OpenSCAD {
 					}
 				}
 				return bbox;
-			}  
-    
+			}
+
 			static void set_R(Bbox_3& bbox, const Nef_polyhedron& N) {
 				if(N.is_standard_kernel()) return;
 				double size = abs(bbox.xmin());
@@ -631,7 +631,7 @@ namespace OpenSCAD {
 											bbox.xmax()*10,bbox.ymax()*10,bbox.zmax()*10);
 			}
 		public:
-			static void setColor(Polyhedron::RenderColor color_index, 
+			static void setColor(Polyhedron::RenderColor color_index,
 													 unsigned char r, unsigned char g, unsigned char b) {
 				assert(color_index < Polyhedron::NUM_COLORS);
 				Polyhedron::colors[color_index][0] = r;
@@ -639,10 +639,10 @@ namespace OpenSCAD {
 				Polyhedron::colors[color_index][2] = b;
 			}
 
-			static void convert_to_OGLPolyhedron(const Nef_polyhedron& N, Polyhedron* P) { 
+			static void convert_to_OGLPolyhedron(const Nef_polyhedron& N, Polyhedron* P) {
 				Bbox_3 bbox(bounded_bbox(N));
 				set_R(bbox,N);
-				P->bbox() = bbox;    
+				P->bbox() = bbox;
 				Vertex_const_iterator v;
 				CGAL_forall_vertices(v,*N.sncp()) draw(v,N,*P);
 				Halfedge_const_iterator e;
@@ -650,7 +650,7 @@ namespace OpenSCAD {
 				Halffacet_const_iterator f;
 				CGAL_forall_facets(f,*N.sncp()) draw(f,N,*P);
 			}
-    
+
 		}; // Nef3_Converter
 
 	} // namespace OGL
diff --git a/src/EventFilter.h b/src/EventFilter.h
index c3942b5059a..6265d5993c6 100644
--- a/src/EventFilter.h
+++ b/src/EventFilter.h
@@ -8,7 +8,7 @@
 class EventFilter : public QObject
 {
 	Q_OBJECT;
-	
+
 public:
 	EventFilter(QObject *parent) : QObject(parent) {}
 protected:
diff --git a/src/Preferences.cc b/src/Preferences.cc
index 6419944ed5f..10ab80f6f0c 100644
--- a/src/Preferences.cc
+++ b/src/Preferences.cc
@@ -185,7 +185,7 @@ QVariant Preferences::getValue(const QString &key) const
 
 void Preferences::updateGUI()
 {
-	QList found = 
+	QList found =
 		this->colorSchemeChooser->findItems(getValue("3dview/colorscheme").toString(),
 																				Qt::MatchExactly);
 	if (!found.isEmpty()) this->colorSchemeChooser->setCurrentItem(found.first());
diff --git a/src/cgaladv.h b/src/cgaladv.h
index 2816b3fdd8e..11b31c28203 100644
--- a/src/cgaladv.h
+++ b/src/cgaladv.h
@@ -43,7 +43,7 @@ class CgaladvNode : public AbstractNode {
 };
 
 class CgaladvMinkowskiNode : public CgaladvNode {
-public:	
+public:
   CgaladvMinkowskiNode(const AbstractNode::NodeList &children, int convexity, const Props p=Props())
     :CgaladvNode(children, convexity, p) {}
 #ifdef ENABLE_CGAL
@@ -54,7 +54,7 @@ class CgaladvMinkowskiNode : public CgaladvNode {
 };
 
 class CgaladvGlideNode : public CgaladvNode {
-public:	
+public:
   CgaladvGlideNode(const AbstractNode::NodeList &children, const void * /*path*/, int convexity, const Props p=Props())
     :CgaladvNode(children, convexity, p) {}
 #ifdef ENABLE_CGAL
@@ -67,7 +67,7 @@ class CgaladvGlideNode : public CgaladvNode {
 class CgaladvSubdivNode : public CgaladvNode {
   QString subdiv_type;
   int level;
-public:	
+public:
   CgaladvSubdivNode(const AbstractNode::NodeList &children, QString subdiv_type, int level, int convexity, const Props p=Props())
     :CgaladvNode(children, convexity, p), subdiv_type(subdiv_type), level(level) {}
 #ifdef ENABLE_CGAL
@@ -78,7 +78,7 @@ class CgaladvSubdivNode : public CgaladvNode {
 };
 
 class CgaladvHullNode : public CgaladvNode {
-public:	
+public:
   CgaladvHullNode(const AbstractNode::NodeList &children, int convexity, const Props p=Props())
     :CgaladvNode(children, convexity, p) {}
 #ifdef ENABLE_CGAL
diff --git a/src/cgaladv_minkowski2.cc b/src/cgaladv_minkowski2.cc
index c9fa05c950b..2a38dcb7e05 100644
--- a/src/cgaladv_minkowski2.cc
+++ b/src/cgaladv_minkowski2.cc
@@ -55,8 +55,8 @@ void print_polygon (const CGAL::Polygon_2& P)
 // Pretty-print a polygon with holes.
 //
 template
-void print_polygon_with_holes (const CGAL::Polygon_with_holes_2& pwh) { 
-  if (! pwh.is_unbounded()) { 
+void print_polygon_with_holes (const CGAL::Polygon_with_holes_2& pwh) {
+  if (! pwh.is_unbounded()) {
 		std::cout << "{ Outer boundary = ";
 		print_polygon (pwh.outer_boundary());
 	} else
@@ -66,7 +66,7 @@ void print_polygon_with_holes (const CGAL::Polygon_with_holes_2paths[i].points.first()->x / scale + origin[0],
-				dxf->paths[i].points.first()->y / scale + origin[1], 
+				dxf->paths[i].points.first()->y / scale + origin[1],
 				dxf->paths[i].points.last()->x / scale + origin[0],
 				dxf->paths[i].points.last()->y / scale + origin[1]);
 	}
@@ -230,8 +230,8 @@ QString DxfLinearExtrudeNode::dump(QString indent) const
 		QFileInfo fileInfo(filename);
 		text.sprintf("linear_extrude(file = \"%s\", cache = \"%x.%x\", layer = \"%s\", "
 				"height = %g, origin = [ %g %g ], scale = %g, center = %s, convexity = %d",
-				filename.toAscii().data(), (int)fileInfo.lastModified().toTime_t(), 
-				(int)fileInfo.size(), layername.toAscii().data(), height, origin[0], 
+				filename.toAscii().data(), (int)fileInfo.lastModified().toTime_t(),
+				(int)fileInfo.size(), layername.toAscii().data(), height, origin[0],
 				origin[1], scale, center ? "true" : "false", convexity);
 		if (has_twist) {
 			QString t2;
diff --git a/src/dxflinextrude.h b/src/dxflinextrude.h
index f0f51052741..1b06cc917ca 100644
--- a/src/dxflinextrude.h
+++ b/src/dxflinextrude.h
@@ -36,12 +36,12 @@ class DxfLinearExtrudeNode : public AbstractPolyNode, public Accuracy
 	typedef shared_ptr Pointer;
 	int convexity, slices;
 	double height, twist;
-	Float2 origin; 
+	Float2 origin;
 	double scale;
 	QString filename, layername;
 	bool center, has_twist;
 	DxfLinearExtrudeNode(const AbstractNode::NodeList &children, const QString &filename, const QString &layer,
-			     double height, double twist, Float2 origin, double scale, 
+			     double height, double twist, Float2 origin, double scale,
 			     int convexity, int slices=-1, bool center=false, const Accuracy &acc=Accuracy(), const Props p=Props());
 	virtual PolySet *render_polyset(render_mode_e mode) const;
 	virtual QString dump(QString indent) const;
diff --git a/src/dxfrotextrude.cc b/src/dxfrotextrude.cc
index 0168f915b3b..a7eff90aab4 100644
--- a/src/dxfrotextrude.cc
+++ b/src/dxfrotextrude.cc
@@ -157,7 +157,7 @@ QString DxfRotateExtrudeNode::dump(QString indent) const
 				"origin = [ %g %g ], scale = %g, convexity = %d, "
 				"$fn = %g, $fa = %g, $fs = %g) {\n",
 				filename.toAscii().data(), (int)fileInfo.lastModified().toTime_t(),
-				(int)fileInfo.size(),layername.toAscii().data(), origin[0], origin[1], 
+				(int)fileInfo.size(),layername.toAscii().data(), origin[0], origin[1],
 				scale, convexity, fn, fa, fs);
 		foreach (AbstractNode::Pointer v, children)
 			text += v->dump(indent + QString("\t"));
diff --git a/src/dxfrotextrude.h b/src/dxfrotextrude.h
index 7ef0ca4398b..e8f0ad8e3a1 100644
--- a/src/dxfrotextrude.h
+++ b/src/dxfrotextrude.h
@@ -39,7 +39,7 @@ class DxfRotateExtrudeNode : public AbstractPolyNode, public Accuracy
 	double scale;
 	QString filename, layername;
 	DxfRotateExtrudeNode(const AbstractNode::NodeList &children, const QString &filename, const QString &layer,
-	  Float2 origin, double scale, 
+	  Float2 origin, double scale,
 	  int convexity, const Accuracy &acc=Accuracy(), const Props p=Props())
 	    :AbstractPolyNode(p,children), Accuracy(acc), convexity(convexity),
 	    origin(origin), scale(scale), filename(filename), layername(layer) {}
diff --git a/src/dxftess-cgal.cc b/src/dxftess-cgal.cc
index 2e80feaec6e..0874167ed62 100644
--- a/src/dxftess-cgal.cc
+++ b/src/dxftess-cgal.cc
@@ -136,8 +136,8 @@ void dxf_tesselate(PolySet *ps, DxfData *dxf, double rot, bool up, bool /* do_tr
 			} else {
 				prev_pi->neigh_next = pi;
 				pi->neigh_prev = prev_pi;
-				edge_to_path[edge_t(prev_pi, pi)] = 1; 
-				edge_to_path[edge_t(pi, prev_pi)] = 1; 
+				edge_to_path[edge_t(prev_pi, pi)] = 1;
+				edge_to_path[edge_t(pi, prev_pi)] = 1;
 				cdt.insert_constraint(prev, vh);
 			}
 			prev_pi = pi;
@@ -149,8 +149,8 @@ void dxf_tesselate(PolySet *ps, DxfData *dxf, double rot, bool up, bool /* do_tr
 			prev_pi->neigh_next = first_pi;
 			first_pi->neigh_prev = prev_pi;
 
-			edge_to_path[edge_t(first_pi, prev_pi)] = 1; 
-			edge_to_path[edge_t(prev_pi, first_pi)] = 1; 
+			edge_to_path[edge_t(first_pi, prev_pi)] = 1;
+			edge_to_path[edge_t(prev_pi, first_pi)] = 1;
 
 			cdt.insert_constraint(prev, first);
 		}
diff --git a/src/editor.h b/src/editor.h
index c2f3333c680..77eacce1a4f 100644
--- a/src/editor.h
+++ b/src/editor.h
@@ -19,8 +19,8 @@ class Editor : public QTextEdit
 public slots:
 	//void zoomIn() { zoom(1); }
 	void zoomIn(int n = 1) { zoom(n); }
-	//void zoomOut() { zoom(-1); } 
-	void zoomOut(int n = 1) { zoom(-n); } 
+	//void zoomOut() { zoom(-1); }
+	void zoomOut(int n = 1) { zoom(-n); }
 #else
 	Editor(QWidget *parent) : QTextEdit(parent) {}
 public slots:
diff --git a/src/export.cc b/src/export.cc
index 884e139b31f..3e823ee5102 100644
--- a/src/export.cc
+++ b/src/export.cc
@@ -88,7 +88,7 @@ void export_stl(CGAL_Nef_polyhedron *root_N, QString filename, QProgressDialog *
 
 	FILE *f = fopen(filename.toUtf8().data(), "w");
 	if (!f) {
-		PRINTA("Can't open STL file \"%1\" for STL export: %2", 
+		PRINTA("Can't open STL file \"%1\" for STL export: %2",
 					 filename, QString(strerror(errno)));
 		set_output_handler(NULL, NULL);
 		return;
@@ -119,7 +119,7 @@ void export_stl(CGAL_Nef_polyhedron *root_N, QString filename, QProgressDialog *
 			vs2.sprintf("%f %f %f", x2, y2, z2);
 			vs3.sprintf("%f %f %f", x3, y3, z3);
 			if (vs1 != vs2 && vs1 != vs3 && vs2 != vs3) {
-				
+
 				double nx = (y1-y2)*(z1-z3) - (z1-z2)*(y1-y3);
 				double ny = (z1-z2)*(x1-x3) - (x1-x2)*(z1-z3);
 				double nz = (x1-x2)*(y1-y3) - (y1-y2)*(x1-x3);
@@ -160,7 +160,7 @@ void export_dxf(CGAL_Nef_polyhedron *root_N, QString filename, QProgressDialog *
 {
 	FILE *f = fopen(filename.toUtf8().data(), "w");
 	if (!f) {
-		PRINTA("Can't open DXF file \"%1\" for DXF export: %2", 
+		PRINTA("Can't open DXF file \"%1\" for DXF export: %2",
 					 filename, QString(strerror(errno)));
 		set_output_handler(NULL, NULL);
 		return;
@@ -168,7 +168,7 @@ void export_dxf(CGAL_Nef_polyhedron *root_N, QString filename, QProgressDialog *
 
 	setlocale(LC_NUMERIC, "C"); // Ensure radix is . (not ,) in output
 
-	// Some importers (e.g. QCAD) needs a HEADER section specifying AutoCAD 2000 as 
+	// Some importers (e.g. QCAD) needs a HEADER section specifying AutoCAD 2000 as
 	// the file format for LWPOLYLINE entities to work
 	fprintf(f, "  0\n"
 					"SECTION\n"
diff --git a/src/glview.cc b/src/glview.cc
index 870a1c91034..e14a840b600 100644
--- a/src/glview.cc
+++ b/src/glview.cc
@@ -199,7 +199,7 @@ void GLView::display_opengl20_warning()
 	QMessageBox::warning(NULL, "GLEW: GL_VERSION_2_0 is not supported!",
 			QString("Warning: No support for OpenGL 2.0 found! OpenCSG View has been disabled.\n\n"
 			"It is highly recommended to use OpenSCAD on a system with OpenGL 2.0 "
-			"support. Please check if OpenGL 2.0 drivers are available for your "	
+			"support. Please check if OpenGL 2.0 drivers are available for your "
 			"graphics hardware.\n\n%1").arg(rendererinfo));
 }
 #endif
diff --git a/src/grid.h b/src/grid.h
index 703e006d796..b0c3aa3e64f 100644
--- a/src/grid.h
+++ b/src/grid.h
@@ -27,7 +27,7 @@ class Grid2d
 		Aligns x,y to the grid or to existing point if one close enough exists.
 		Returns the value stored if a point already existing or an uninitialized new value
 		if not.
-	*/ 
+	*/
 	T &align(double &x, double &y) {
 		int64_t ix = (int64_t)round(x / res);
 		int64_t iy = (int64_t)round(y / res);
@@ -124,7 +124,7 @@ class Grid3d
 				return true;
 		}
 		return false;
-		
+
 	}
 	bool eq(double x1, double y1, double z1, double x2, double y2, double z2) {
 		align(x1, y1, z1);
diff --git a/src/highlighter.cc b/src/highlighter.cc
index e6d50a92150..5f1834b21cf 100644
--- a/src/highlighter.cc
+++ b/src/highlighter.cc
@@ -53,6 +53,6 @@ void Highlighter::highlightBlock(const QString &text)
 		setFormat(parser_error_pos - n, 1, style);
 #endif
 	}
-*/	
+*/
 }
 
diff --git a/src/import.cc b/src/import.cc
index 37bfb6bab19..c41ffb59589 100644
--- a/src/import.cc
+++ b/src/import.cc
@@ -147,7 +147,7 @@ QString ImportSTLNode::dump(QString indent) const {
 		    filename.toAscii().data(), (int)st.st_mtime, (int)st.st_size, convexity);
     ((AbstractNode*)this)->dump_cache = indent + QString("n%1: ").arg(idx) + text;
   }
-  return dump_cache;  
+  return dump_cache;
 }
 
 QString ImportOFFNode::dump(QString indent) const {
diff --git a/src/import.h b/src/import.h
index d896feaa04e..d081f60bcd2 100644
--- a/src/import.h
+++ b/src/import.h
@@ -37,12 +37,12 @@ class ImportNode : public AbstractPolyNode
 	typedef shared_ptr< ImportNode > Pointer;
 	QString filename;
 	int convexity;
-	ImportNode(const QString &filename, int convexity, const Props p=Props()) 
+	ImportNode(const QString &filename, int convexity, const Props p=Props())
 	  :AbstractPolyNode(p), filename(filename), convexity(convexity) { }
 };
 
 class ImportSTLNode : public ImportNode {
-public:	
+public:
   ImportSTLNode(const QString &filename, int convexity, const Props p=Props()):ImportNode(filename, convexity, p) {}
   virtual PolySet *render_polyset(render_mode_e mode) const;
   virtual QString dump(QString indent) const;
@@ -52,7 +52,7 @@ class ImportDXFNode : public ImportNode, public Accuracy {
   QString layername;
   Float2 origin;
   double scale;
-public:	
+public:
   typedef shared_ptr Pointer;
   ImportDXFNode(const QString &filename,const QString &layername, Float2 origin, int convexity=5, double scale=1.0, const Accuracy &acc=Accuracy(), const Props p=Props())
     :ImportNode(filename, convexity, p), Accuracy(acc), layername(layername), origin(origin), scale(scale) {}
@@ -61,7 +61,7 @@ class ImportDXFNode : public ImportNode, public Accuracy {
 };
 
 class ImportOFFNode : public ImportNode {
-public:	
+public:
   ImportOFFNode(const QString &filename, int convexity, const Props p=Props()):ImportNode(filename, convexity, p) {}
   virtual PolySet *render_polyset(render_mode_e mode) const;
   virtual QString dump(QString indent) const;
diff --git a/src/mainwin.cc b/src/mainwin.cc
index 9c943c0bcd7..650387e76d9 100644
--- a/src/mainwin.cc
+++ b/src/mainwin.cc
@@ -212,7 +212,7 @@ MainWindow::MainWindow(const QString &filename)
 
 	if (!examplesdir.isEmpty()) {
 		bool found_example = false;
-		QStringList examples = QDir(examplesdir).entryList(QStringList("*.py"), 
+		QStringList examples = QDir(examplesdir).entryList(QStringList("*.py"),
 		QDir::Files | QDir::Readable, QDir::Name);
 		foreach (const QString &ex, examples) {
 			this->menuExamples->addAction(ex, this, SLOT(actionOpenExample()));
@@ -334,7 +334,7 @@ MainWindow::MainWindow(const QString &filename)
 	connect(screen, SIGNAL(doAnimateUpdate()), this, SLOT(animateUpdate()));
 
 	connect(Preferences::inst(), SIGNAL(requestRedraw()), this->screen, SLOT(updateGL()));
-	connect(Preferences::inst(), SIGNAL(fontChanged(const QString&,uint)), 
+	connect(Preferences::inst(), SIGNAL(fontChanged(const QString&,uint)),
 					this, SLOT(setFont(const QString&,uint)));
 	Preferences::inst()->apply();
 
@@ -674,9 +674,9 @@ void MainWindow::compileCSG(bool procevents)
 		PRINT("Compiling design (CSG Products normalization)...");
 		if (procevents)
 			QApplication::processEvents();
-		
+
 		root_norm_term = root_raw_term->link();
-		
+
 		// CSG normalization
 		while (1) {
 			CSGTerm *n = root_norm_term->normalize();
@@ -685,25 +685,25 @@ void MainWindow::compileCSG(bool procevents)
 				break;
 			root_norm_term = n;
 		}
-		
+
 		assert(root_norm_term);
 
 		root_chain = new CSGChain();
 		root_chain->import(root_norm_term);
-		
+
 		if (root_chain->polysets.size() > 1000) {
 			PRINTF("WARNING: Normalized tree has %d elements!", root_chain->polysets.size());
 			PRINTF("WARNING: OpenCSG rendering has been disabled.");
 		} else {
 			enableOpenCSG = true;
 		}
-		
+
 		if (highlight_terms.size() > 0)
 		{
 			PRINTF("Compiling highlights (%d CSG Trees)...", highlight_terms.size());
 			if (procevents)
 				QApplication::processEvents();
-			
+
 			highlights_chain = new CSGChain();
 			for (int i = 0; i < highlight_terms.size(); i++) {
 				while (1) {
@@ -716,13 +716,13 @@ void MainWindow::compileCSG(bool procevents)
 				highlights_chain->import(highlight_terms[i]);
 			}
 		}
-		
+
 		if (background_terms.size() > 0)
 		{
 			PRINTF("Compiling background (%d CSG Trees)...", background_terms.size());
 			if (procevents)
 				QApplication::processEvents();
-			
+
 			background_chain = new CSGChain();
 			for (int i = 0; i < background_terms.size(); i++) {
 				while (1) {
@@ -735,7 +735,7 @@ void MainWindow::compileCSG(bool procevents)
 				background_chain->import(background_terms[i]);
 			}
 		}
-		
+
 		PRINT("CSG generation finished.");
 		int s = t.elapsed() / 1000;
 		PRINTF("Total rendering time: %d hours, %d minutes, %d seconds", s / (60*60), (s / 60) % 60, s % 60);
@@ -766,7 +766,7 @@ void MainWindow::actionOpen()
 	if (!new_filename.isEmpty()) {
 		if (!maybeSave())
 			return;
-		
+
 		setCurrentOutput();
 		openFile(new_filename);
 		clearCurrentOutput();
@@ -1015,7 +1015,7 @@ void MainWindow::actionCompile()
 		filename.sprintf("frame%05d.png", int(round(s*t)));
 		img.save(filename, "PNG");
 	}
-	
+
 	clearCurrentOutput();
 }
 
@@ -1393,7 +1393,7 @@ static void renderGLviaCGAL(void *vp)
 		typedef Explorer::Halfedge_around_face_const_circulator heafcc_t;
 		typedef Explorer::Point Point;
 		Explorer E = m->root_N->p2.explorer();
-		
+
 		// Draw 2D edges
 		glDisable(GL_DEPTH_TEST);
 		glDisable(GL_LIGHTING);
diff --git a/src/matrix.h b/src/matrix.h
index 9ecec711b02..1eb6b9ec278 100644
--- a/src/matrix.h
+++ b/src/matrix.h
@@ -28,7 +28,7 @@ std::ostream& operator<<(std::ostream &out, const std::vector &rhs){
   if (it != rhs.end())
 	out << *it++;
   while(it != rhs.end())
-    out << ", " << *it++; 
+    out << ", " << *it++;
   out << "]";
   return out;
 }
@@ -37,10 +37,10 @@ template
 std::ostream& operator<<(std::ostream &out, const boost::array &rhs){
   out << "[";
   typename boost::array::const_iterator it = rhs.begin();
-  if (it != rhs.end()) 
+  if (it != rhs.end())
 	out << *it++;
   while(it != rhs.end())
-    out << ", " << *it++; 
+    out << ", " << *it++;
   out << "]";
   return out;
 }
diff --git a/src/node.cc b/src/node.cc
index df70d22caec..b965f887662 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -202,7 +202,7 @@ CGAL_Nef_polyhedron AbstractPolyNode::render_cgal_nef_polyhedron() const
 		cgal_nef_cache.insert(cache_id, new cgal_nef_cache_entry(N), N.weight());
 		print_messages_pop();
 		progress_report();
-		
+
 		ps->unlink();
 		return N;
 	}
diff --git a/src/openscad.cc b/src/openscad.cc
index 4a6b5721430..a29d5daaae2 100644
--- a/src/openscad.cc
+++ b/src/openscad.cc
@@ -155,7 +155,7 @@ int main(int argc, char **argv)
 	po::variables_map vm;
 	po::store(po::command_line_parser(argc, argv).options(all_options).positional(p).run(), vm);
 //	po::notify(vm);
-	
+
 	if (vm.count("help")) help(argv[0]);
 	if (vm.count("version")) version();
 
@@ -169,7 +169,7 @@ int main(int argc, char **argv)
 			help(argv[0]);
 		off_output_file = vm["o"].as().c_str();
 	}
-	if (vm.count("x")) { 
+	if (vm.count("x")) {
 		if (stl_output_file || off_output_file || dxf_output_file)
 			help(argv[0]);
 		dxf_output_file = vm["x"].as().c_str();
@@ -314,7 +314,7 @@ int main(int argc, char **argv)
 	{
 #ifdef Q_WS_MAC
 		installAppleEventHandlers();
-#endif		
+#endif
 
 		QString qfilename;
 		if (filename) qfilename = QFileInfo(original_path, filename).absoluteFilePath();
diff --git a/src/polyset.cc b/src/polyset.cc
index c193b3299ca..6647dd2f14e 100644
--- a/src/polyset.cc
+++ b/src/polyset.cc
@@ -376,7 +376,7 @@ class CGAL_Build_PolySet : public CGAL::Modifier_base
 				if (fc[v]++ > 0)
 					facet_is_degenerated = true;
 			}
-			
+
 			if (!facet_is_degenerated)
 				B.begin_facet();
 #ifdef GEN_SURFACE_DEBUG
@@ -640,7 +640,7 @@ CGAL_Nef_polyhedron PolySet::render_cgal_nef_polyhedron() const
 					p = CGAL_Nef_polyhedron2::Point(x, y);
 					grid.data(x, y) = p;
 				}
-				plist.push_back(p);		
+				plist.push_back(p);
 			}
 			// FIXME: If a border (path) has a duplicate vertex in dxf,
 			// the CGAL_Nef_polyhedron2 constructor will crash.
diff --git a/src/primitives.cc b/src/primitives.cc
index 784c9665a7d..9a854d875de 100644
--- a/src/primitives.cc
+++ b/src/primitives.cc
@@ -204,7 +204,7 @@ PolySet *CylinderNode::render_polyset(render_mode_e) const {
 
     generate_circle(circle1, r1);
     generate_circle(circle2, r2);
-    
+
     for (int i=0; i Pointer;
 	int convexity;
 	bool cut_mode;
-	ProjectionNode(const AbstractNode::NodeList &children, bool cut_mode, int convexity, const Props p=Props()) 
+	ProjectionNode(const AbstractNode::NodeList &children, bool cut_mode, int convexity, const Props p=Props())
 	  : AbstractPolyNode(p, children), convexity(convexity), cut_mode(cut_mode) {}
 	virtual PolySet *render_polyset(render_mode_e mode) const;
 	virtual QString dump(QString indent) const;
diff --git a/src/pythonscripting.cc b/src/pythonscripting.cc
index a02d745c54a..30f85e25975 100644
--- a/src/pythonscripting.cc
+++ b/src/pythonscripting.cc
@@ -57,7 +57,7 @@ class PyContext {
   Accuracy acc;
   object main_module;
   object openscad_namespace;
-  
+
   public:
   static const std::string nsresult;
   static const std::string nsopenscad;
@@ -70,8 +70,8 @@ class PyContext {
       if (openscad_namespace.contains(nsresult)) openscad_namespace[nsresult].del();
       openscad_namespace["_fn"] = acc.fn;
       openscad_namespace["_fs"] = acc.fs;
-      openscad_namespace["_fa"] = acc.fa;     
-      openscad_namespace["_t"] = time;     
+      openscad_namespace["_fa"] = acc.fa;
+      openscad_namespace["_t"] = time;
     }
     object getResult() {
       if (openscad_namespace.contains(nsresult))
@@ -131,7 +131,7 @@ ArrayVec list2ArrayVec(const list &l) {
   for(int i=0;i x(l[i]);
     if (x.check()) v.push_back(list2StdArray(x()));
-  }  
+  }
   return v;
 }
 
@@ -141,7 +141,7 @@ Vec list2Vec(const list &l) {
   for(int i=0;i x(l[i]);
     if (x.check()) v.push_back(x());
-  }  
+  }
   return v;
 }
 
@@ -151,7 +151,7 @@ VecVec list2VecVec(const list &l) {
   for(int i=0;i x(l[i]);
     if (x.check()) v.push_back(list2Vec(x()));
-  }  
+  }
   return v;
 }
 
@@ -167,10 +167,10 @@ class PyAbstractNode {
   AbstractNode::Pointer getNode() const { return node; }
   void setHighlight(bool set=true) {
     node->props.highlight = set;
-  }  
+  }
   bool getHighlight(void) const {
     return node->props.highlight;
-  }  
+  }
   void setBackground(bool set=true) {
     node->props.background = set;
   }
@@ -203,7 +203,7 @@ class PyNodeAccuracy {
   virtual double getfa(void) const {return accp->fa;}
 };
 
-template 
+template
 class PyCSGNode: public PyAbstractNode {
 public:
   PyCSGNode(const list &l) {
@@ -239,7 +239,7 @@ class PyRotateNodeBase: public PyAbstractNode {
       const list &lchildren = args[children|empty_list];
       if (len(lchildren) > 0) childlist = list2NodeList(lchildren);
       else childlist.append(args[child|PyAbstractNode()].getNode());
-      
+
       double a = args[ang|std::numeric_limits::quiet_NaN()];
       if (myIsNaN( a )) {
 	const list &lvec = args[vec|empty_list];
@@ -335,7 +335,7 @@ class PyCylinderNodeBase: public PyAbstractNode, public PyNodeAccuracy {
       } else rad1 = rad2 = rad;
       CylinderNode::Pointer p = make_shared(rad1, rad2, height, args[center|false], ctx.getAcc());
       node = p;
-      initAcc(p);      
+      initAcc(p);
     }
 };
 
@@ -354,7 +354,7 @@ class PyPolyhedronNode: public PyAbstractNode {
 public:
   PyPolyhedronNode(const list &points, const list &triangles, unsigned int convexity=5) {
     node = make_shared(
-      list2ArrayVec(points), 
+      list2ArrayVec(points),
       list2VecVec(triangles), convexity);
   }
 };
@@ -363,11 +363,11 @@ class PyPolyhedronNode: public PyAbstractNode {
 class PySquareNode: public PyAbstractNode {
 public:
   PySquareNode(const list &dim, bool center=false) {
-    node = make_shared(list2StdArray(dim), center);  
+    node = make_shared(list2StdArray(dim), center);
   }
   PySquareNode(double l, bool center=false) {
     Float2 dim = {{ l,l }};
-    node = make_shared(dim, center);  
+    node = make_shared(dim, center);
   }
 };
 
@@ -384,7 +384,7 @@ class PyPolygonNode: public PyAbstractNode {
 public:
   PyPolygonNode(const list &points, const list &paths=list(), unsigned int convexity=5) {
     node = make_shared(
-      list2ArrayVec(points), 
+      list2ArrayVec(points),
       list2VecVec(paths), convexity);
   }
 };
@@ -404,13 +404,13 @@ class PyDxfLinearExtrudeNodeBase: public PyAbstractNode, public PyNodeAccuracy {
     template 
     PyDxfLinearExtrudeNodeBase(ArgumentPack const& args) {
       DxfLinearExtrudeNode::Pointer p(new DxfLinearExtrudeNode(
-	AbstractNode::NodeList(), QString::fromStdString(args[file]), 
+	AbstractNode::NodeList(), QString::fromStdString(args[file]),
 	QString::fromStdString(args[layer|std::string()]),
 	args[h], args[twist|.0], list2StdArray(args[origin|empty_list]), args[scale|1.0],
 	args[convexity|5], args[slices|-1], args[center|false], ctx.getAcc()
       ));
       initAcc(p);
-      node = p;     
+      node = p;
     }
 };
 
@@ -437,14 +437,14 @@ class PyLinearExtrudeNodeBase: public PyAbstractNode, public PyNodeAccuracy {
       const list &lchildren = args[children|empty_list];
       if (len(lchildren) > 0) childlist = list2NodeList(lchildren);
       else childlist.append(args[child|PyAbstractNode()].getNode());
-      
+
       DxfLinearExtrudeNode::Pointer p(new DxfLinearExtrudeNode(
 	childlist, QString(), QString(),
 	args[h], args[twist|.0], Float2(), 0,
 	args[convexity|5], args[slices|-1], args[center|false], ctx.getAcc()
       ));
       initAcc(p);
-      node = p;     
+      node = p;
     }
 };
 
@@ -466,13 +466,13 @@ class PyDxfRotateExtrudeNodeBase: public PyAbstractNode, public PyNodeAccuracy {
     template 
     PyDxfRotateExtrudeNodeBase(ArgumentPack const& args) {
       DxfRotateExtrudeNode::Pointer p = make_shared(
-	AbstractNode::NodeList(), QString::fromStdString(args[file]), 
+	AbstractNode::NodeList(), QString::fromStdString(args[file]),
 	QString::fromStdString(args[layer|std::string()]),
 	list2StdArray(args[origin|empty_list]), args[scale|1.0],
 	args[convexity|5], ctx.getAcc()
       );
       initAcc(p);
-      node = p;     
+      node = p;
     }
 };
 
@@ -497,12 +497,12 @@ class PyRotateExtrudeNodeBase: public PyAbstractNode, public PyNodeAccuracy {
       else childlist.append(args[child|PyAbstractNode()].getNode());
 
       DxfRotateExtrudeNode::Pointer p = make_shared(
-	childlist, 
+	childlist,
 	QString(), QString(), Float2(), 1.0,
 	args[convexity|5], ctx.getAcc()
       );
       initAcc(p);
-      node = p;     
+      node = p;
     }
 };
 
@@ -519,7 +519,7 @@ class PySurfaceNodeBase: public PyAbstractNode {
 public:
     template 
     PySurfaceNodeBase(ArgumentPack const& args) {
-      node = make_shared(QString::fromStdString(args[file]), args[convexity|5], args[center|false]);    
+      node = make_shared(QString::fromStdString(args[file]), args[convexity|5], args[center|false]);
     }
 };
 
@@ -544,10 +544,10 @@ class PyImportDXFNodeBase: public PyAbstractNode, public PyNodeAccuracy {
     template 
     PyImportDXFNodeBase(ArgumentPack const& args) {
       ImportDXFNode::Pointer p = make_shared(QString::fromStdString(args[file]),
-	QString::fromStdString(args[layer|std::string()]), 
-	list2StdArray(args[origin|empty_list]), args[convexity|5], args[scale|1.0], ctx.getAcc());      
+	QString::fromStdString(args[layer|std::string()]),
+	list2StdArray(args[origin|empty_list]), args[convexity|5], args[scale|1.0], ctx.getAcc());
       initAcc(p);
-      node = p;     
+      node = p;
     }
 };
 
@@ -570,7 +570,7 @@ class PyProjectionNodeBase: public PyAbstractNode {
       const list &lchildren = args[children|empty_list];
       if (len(lchildren) > 0) childlist = list2NodeList(lchildren);
       else childlist.append(args[child|PyAbstractNode()].getNode());
-      node = make_shared(childlist, args[cut_mode|false], args[convexity|5]);    
+      node = make_shared(childlist, args[cut_mode|false], args[convexity|5]);
     }
 };
 
@@ -600,7 +600,7 @@ BOOST_PARAMETER_FUNCTION((double), pyDxfDim, tag,
       (origin, *, empty_list)
       (scale, *, 1.0))
 ){
-*/  
+*/
 double pyDxfDim(const std::string &file, const std::string &layer=std::string(), const std::string &name=std::string(), list origin=empty_list, double scale=1.0) {
   return dxf_dim(QString::fromStdString(file), QString::fromStdString(layer), QString::fromStdString(name), list2StdArray(origin), scale);
 }
@@ -628,7 +628,7 @@ list pyDxfCross(const std::string &filename, const std::string &layername=std::s
 BOOST_PYTHON_FUNCTION_OVERLOADS(pyDxfCross_overloads, pyDxfCross, 1, 4)
 
 void assemble(const PyAbstractNode &n) {
-	ctx.setResult(n);	
+	ctx.setResult(n);
 }
 
 double fn(double val=-1) {
@@ -654,7 +654,7 @@ BOOST_PYTHON_MODULE(openscad) {
   namespace mpl = boost::mpl;
   class_("AbstractNode")
     .add_property("highlight", &PyAbstractNode::getHighlight, &PyAbstractNode::setHighlight)
-    .add_property("background", &PyAbstractNode::getBackground, &PyAbstractNode::setBackground);    
+    .add_property("background", &PyAbstractNode::getBackground, &PyAbstractNode::setBackground);
   class_("NodeAccuracy")
     .add_property("_fn", &PyNodeAccuracy::getfn, &PyNodeAccuracy::setfn)
     .add_property("_fs", &PyNodeAccuracy::getfs, &PyNodeAccuracy::setfs)
@@ -671,7 +671,7 @@ BOOST_PYTHON_MODULE(openscad) {
     .def(py::init< mpl::vector< tag::ang(double), tag::vec*(list), tag::children(list)> >())
     .def(py::init< mpl::vector< tag::vec(list), tag::child(PyAbstractNode)> >())
     .def(py::init< mpl::vector< tag::vec(list), tag::children(list)> >());
-  
+
   class_ >("mirror", init()).def(init());
   class_ >("matrix", init()).def(init());
   class_ >("color", init()).def(init());
@@ -684,7 +684,7 @@ BOOST_PYTHON_MODULE(openscad) {
   class_ >("cylinder", no_init)
     .def(py::init< mpl::vector< tag::h(double), tag::r(double), tag::center*(bool)> >())
     .def(py::init< mpl::vector< tag::h(double), tag::r1(double), tag::r2(double), tag::center*(bool)> >());
-  
+
   class_ >("polyhedron", init >());
   class_ >("square", init >()).def(init >());
   class_ >("circle", init());
@@ -704,12 +704,12 @@ BOOST_PYTHON_MODULE(openscad) {
     .def(py::init< mpl::vector< tag::h(double), tag::twist*(double),
 	 tag::convexity*(unsigned int), tag::slices*(int), tag::center*(bool), tag::children(list) > >());
 
-    
+
   class_ >("_DXFRotateExtrudeBase", no_init);
   class_ >("dxf_rotate_extrude", no_init)
     .def(py::init< mpl::vector< tag::file(std::string), tag::layer*(std::string),
 	 tag::origin*(list), tag::scale*(double), tag::convexity*(unsigned int)> >());
-    
+
   class_ >("_RotateExtrudeBase", no_init);
   class_ >("rotate_extrude", no_init)
     .def(py::init< mpl::vector< tag::convexity*(unsigned int), tag::child(PyAbstractNode) > >())
@@ -731,18 +731,18 @@ BOOST_PYTHON_MODULE(openscad) {
   class_ >("projection", no_init)
     .def(py::init< mpl::vector< tag::convexity*(unsigned int), tag::cut_mode*(bool), tag::child(PyAbstractNode) > >())
     .def(py::init< mpl::vector< tag::convexity*(unsigned int), tag::cut_mode*(bool), tag::children(list) > >());
-  
+
   class_ >("minkowski", init >());
-    
-    
+
+
 /* doesn't work: error: no matching function for call to ´def(const char [7])´
   def< pyDxfDim_fwd
       , mpl::vector<
             double, tag::file(std::string), tag::layer*(std::string), tag::name*(std::string),
             tag::origin*(list), tag::scale*(double)
         >
-    >("dxfdim");   
-*/    
+    >("dxfdim");
+*/
   def("DxfDim", pyDxfDim, pyDxfDim_overloads());
   def("DxfCross", pyDxfCross, pyDxfCross_overloads());
   def("assemble", assemble);
@@ -825,11 +825,11 @@ AbstractNode::Pointer PythonScript::evaluate(const std::string &code, const std:
   try {
     str dir(path);
     if (len(dir)==0) dir =".";
-    object sys = import("sys"); 
-    sys.attr("path").attr("insert")(0, dir); 
+    object sys = import("sys");
+    sys.attr("path").attr("insert")(0, dir);
     exec(code.c_str(), ctx.main_namespace);
     PyAbstractNode &resNode = extract(ctx.getResult());
-    sys.attr("path").attr("remove")(dir); 
+    sys.attr("path").attr("remove")(dir);
     return resNode.getNode();
   } catch(error_already_set) {
 //    PyErr_Print();
@@ -851,7 +851,7 @@ std::string PythonScript::error() {
     {
       object traceback(py::import("traceback"));
       object format_exception(traceback.attr("format_exception"));
-      object formatted_list(format_exception(hexc,hval,htb));    
+      object formatted_list(format_exception(hexc,hval,htb));
       object formatted(str("\n").join(formatted_list));
       return extract(formatted);
     }
diff --git a/src/render.cc b/src/render.cc
index f8adf14f40e..0699bd321ad 100644
--- a/src/render.cc
+++ b/src/render.cc
@@ -129,7 +129,7 @@ CSGTerm *AbstractNode::render_csg_term_from_nef(const Float20 &m, QVector
 
 //Test that a non existent path/file doesn't screw things up
 include 
 
-//Test with empty path 
+//Test with empty path
 include 
 
 //Test without preceeding space
diff --git a/testdata/scad/polygon-illegal-winding.scad b/testdata/scad/polygon-illegal-winding.scad
index 612154a7b85..da63526b645 100644
--- a/testdata/scad/polygon-illegal-winding.scad
+++ b/testdata/scad/polygon-illegal-winding.scad
@@ -1,15 +1,15 @@
 polyhedron
   (points = [
-         [0, -10, 60], [0, 10, 60], [0, 10, 0], [0, -10, 0], [60, -10, 
+         [0, -10, 60], [0, 10, 60], [0, 10, 0], [0, -10, 0], [60, -10,
 60], [60, 10, 60],
-         [10, -10, 50], [10, 10, 50], [10, 10, 30], [10, -10, 30], [30, 
+         [10, -10, 50], [10, 10, 50], [10, 10, 30], [10, -10, 30], [30,
 -10, 50], [30, 10, 50]
          ],
    triangles = [
         [0,2,3],   [0,1,2],  [0,4,5],  [0,5,1],   [5,4,2],  [2,4,3],
                 [6,8,9],  [6,7,8],  [6,10,11], [6,11,7], [10,8,11],
         [10,9,8], [0,3,9],  [9,0,6], [10,6, 0],  [0,4,10],
-                [3,9,10], [3,10,4], [1,7,11],  [1,11,5], [1,7,8], 
+                [3,9,10], [3,10,4], [1,7,11],  [1,11,5], [1,7,8],
                 [1,8,2],  [2,8,11], [2,11,5]
         ]
    );