subtract = (...geometries) => {
  geometries = flatten(geometries)
  if (geometries.length === 0) throw new Error('wrong number of arguments')

  if (!areAllShapesTheSameType(geometries)) {
    throw new Error('only subtract of the types are supported')
  }

  const geometry = geometries[0]
  // if (path.isA(geometry)) return pathsubtract(matrix, geometries)
  if (geom2.isA(geometry)) return subtractGeom2(geometries)
  if (geom3.isA(geometry)) return subtractGeom3(geometries)
  return geometry
}
Return a new geometry representing space in the first geometry but
not in all subsequent geometries.
The given geometries should be of the same type, either geom2 or geom3.

@param {...Object} geometries - list of geometries
@returns {geom2|geom3} a new geometry
@alias module:modeling/booleans.subtract

@example
let myshape = subtract(cuboid({size: 5}), cuboid({size: 5, center: [3,3,3]}))

@example
+-------+            +-------+
|       |            |       |
|   A   |            |       |
|    +--+----+   =   |    +--+
+----+--+    |       +----+
     |   B   |
     |       |
     +-------+