code: function union (...inputs) {
    const shapes = flatten(toArray(inputs))
    const allIdenticalType = areAllShapesTheSameType(shapes)
    if (!allIdenticalType) {
      throw new Error('you cannot do unions of 2d & 3d shapes, please extrude the 2d shapes or flatten the 3d shapes')
    }
    const is3d = isShape3(shapes[0])
    const unionFn = is3d ? union3d : union2d
    return shapes.length > 1 ? unionFn(shapes) : shapes[0]
  }
docs: FIXME should this be lazy ? in which case, how do we deal with 2D/3D combined TODO we should have an option to set behaviour as first parameter union/ combine the given shapes
  @param {Object(s)|Array} objects - objects to combine : can be given
  - one by one: union(a,b,c) or
  - as an array: union([a,b,c])
  @returns {CSG} new CSG object, the union of all input shapes
  
  @example
  let unionOfSpherAndCube = union(sphere(), cube())
   
  Return a new CSG solid representing the space in either this solid or
  in the given solids. Neither this solid nor the given solids are modified.
  @param {CSG[]} csg - list of CSG objects
  @returns {CSG} new CSG object
  @example
  let C = union(A, B)
  @example
  +-------+            +-------+
  |       |            |       |
  |   A   |            |       |
  |    +--+----+   =   |       +----+
  +----+--+    |       +----+       |
  |   B   |            |       |
  |       |            |       |
  +-------+            +-------+