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

  if (!areAllShapesTheSameType(geometries)) {
    throw new Error('only hulls of the same type are supported')
  }

  const geometry = geometries[0]
  if (path2.isA(geometry)) return hullPath2(geometries)
  if (geom2.isA(geometry)) return hullGeom2(geometries)
  if (geom3.isA(geometry)) return hullGeom3(geometries)

  // FIXME should this throw an error for unknown geometries?
  return geometry
}
Create a convex hull of the given geometries.
The given geometries should be of the same type, either geom2 or geom3 or path2.
@param {...Objects} geometries - list of geometries from which to create a hull
@returns {geom2|geom3} new geometry
@alias module:modeling/hulls.hull

@example
let myshape = hull(rectangle({center: [-5,-5]}), ellipse({center: [5,5]}))

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