Allow rhinoscriptsyntax SurfaceVolume (+ other methods) to accept SubD's

The rs.SurfaceVolume() relies on the helper function __GetMassProperties which looks like this:

def __GetMassProperties(object_id, area):
    surface = rhutil.coercebrep(object_id)  # <--  fails if object is a subd
    if surface is None:
        surface = rhutil.coercesurface(object_id)  # <--  also fails if subd
        if surface is None: return None  # <-- so if object a subd - returns None
    if area==True: return Rhino.Geometry.AreaMassProperties.Compute(surface)
    if not surface.IsSolid: return None
    return Rhino.Geometry.VolumeMassProperties.Compute(surface)

This fails because rs.coercebrep() does not currently work with SubD’s. So, it would need the method to be able accept and convert them to Breps.

Existing:

def coercebrep(id, raise_if_missing=False):
    """attempt to get polysurface geometry from the document with a given id
    Parameters:
      id = id to be coerced into a brep
      raise_if_missing [opt] = True or False
    Returns:
      a Rhino.Geometry.Brep
    Example:
    See Also:
    """
    geom = coercegeometry(id, False)
    if isinstance(geom, Rhino.Geometry.Brep): return geom
    if isinstance(geom, Rhino.Geometry.Extrusion): return geom.ToBrep(True)
    if raise_if_missing: raise ValueError("unable to convert %s into Brep geometry"%id)

To be modified to something like this:

def coercebrep(id, raise_if_missing=False):
    """attempt to get polysurface geometry from the document with a given id
    Parameters:
      id = id to be coerced into a brep
      raise_if_missing [opt] = True or False
    Returns:
      a Rhino.Geometry.Brep
    Example:
    See Also:
    """
    geom = coercegeometry(id, False)
    if isinstance(geom, Rhino.Geometry.Brep): return geom
    if isinstance(geom, Rhino.Geometry.Extrusion): return geom.ToBrep(True)
    if isinstance(geom, Rhino.Geometry.SubD): return geom.ToBrep(True) # add this line
    if raise_if_missing: raise ValueError("unable to convert %s into Brep geometry"%id)

This would then also apply to a bunch of other rhinoscriptsyntax methods that use rs.coercebrep() internally - I don’t see any real downsides to this, but maybe I’m being naive…