code: function intersection (...inputs) {
    const shapes = flatten(toArray(inputs))
    const allIdenticalType = areAllShapesTheSameType(shapes)
    if (!allIdenticalType) {
      throw new Error('you cannot do intersections of 2d & 3d shapes, please extrude the 2d shapes or flatten the 3d shapes')
    }
    const is3d = isShape3(shapes[0])
    const intersectFn = is3d ? intersect3d : intersect2d
    return shapes.length > 1 ? intersectFn(shapes[0], shapes.slice(1)) : shapes[0]
  }
docs: intersection of the given shapes: ie keep only the common parts between the given shapes
  @param {Object(s)|Array} objects - objects to intersect
  can be given
  - one by one: intersection(a,b,c) or
  - as an array: intersection([a,b,c])
  @returns {CSG} new CSG object, the intersection of all input shapes
  
  @example
  let intersectionOfSpherAndCube = intersection(sphere(), cube())