 FRONT = 1
 BACK = 2
 SPANNING = 3
+
+# Call the callback with no arguments
+# then return the first value.
+# Used to construct chainable
+# callbacks
+returning = (value, fn) ->
+  fn()
+  value
 
 ##
 ## ThreBSP Driver

  clone: ->
    new ThreeBSP.Vertex @x, @y, @z, @normal.clone(), @uv.clone()

  lerp: (v, alpha) =>
    # @uv is a V2 instead of V3, so we perform the lerp by hand
    @uv.add v.uv.clone().sub(@uv).multiplyScalar alpha
    @normal.lerp v, alpha
    super

  interpolate: (args...) =>
    @clone().lerp args...

      if polys.length
        @[side] ?= new ThreeBSP.Node()
        @[side].build polys

  isConvex: (polys) =>
    for inner in polys
