// Takes a 2d or 3d point list as input (a path or the points of a polygon) and rounds each corner
// by a specified amount. The rounding at each point can be different and some points can have zero
// rounding. The `round_corners()` function supports two types of rounding, circular rounding and
// continuous curvature rounding using 4th order bezier curves. Circular rounding can produce a
// tactile "bump" where the curvature changes from flat to circular.
// See https://hackernoon.com/apples-icons-have-that-shape-for-a-very-good-reason-720d4e7c8a14
//
// You select the type of rounding using the `curve` option, which should be either `"smooth"` to get
// continuous curvature rounding or `"circle"` to get circular rounding. Each rounding method has two
// options for how you specify the amount of rounding, which you select using the `type` argument.
// Both rounding methods accept `type="cut"`. This mode specifies the amount of rounding as the
// distance from the corner to the curve. This can be easier to understand than setting a circular
// radius, which can be unexpectedly extreme when the corner is very sharp. It also allows a
// systematic specification of curves that is the same for both `"circle"` and `"smooth"`.
//
// The second `type` setting for circular rounding is `"radius"`, which sets a circular rounding
// radius. The second `type` setting for smooth rounding is `"joint"` which specifies the distance
// away from the corner where the roundover should start. The `"smooth"` type rounding also has a
// parameter that specifies how smooth the curvature match is. This parameter ranges from 0 to 1,
// with a default of 0.5. Larger values give a more abrupt transition and smaller ones a more
// gradual transition. If you set the value much higher than 0.8 the curvature changes abruptly
// enough that though it is theoretically continuous, it may not be continous in practice. If you
// set it very small then the transition is so gradual that the length of the roundover may be
// extremely long.
//
// If you select curves that are too large to fit the function will fail with an error. It displays
// a set of scale factors that you can apply to the (first) smoothing parameter that will reduce the
// size of the curves so that they will fit on your path. If the scale factors are larger than one
// then they indicate how much you can increase the curve sizes before collisions will occur.
//
// To specify rounding parameters you can use the `all` option to round every point in a path.
// Examples:
// * `curve="circle", type="radius", all=2`: Rounds every point with circular, radius 2 roundover
// * `curve="smooth", type="cut", all=2`: Rounds every point with continuous curvature rounding with a cut of 2, and a default 0.5 smoothing parameter
// * `curve="smooth", type="cut", all=[2,.3]`: Rounds every point with continuous curvature rounding with a cut of 2, and a very gentle 0.3 smooth setting
//
// The path is a list of 2d or 3d points, possibly with an extra coordinate giving smoothing
// parameters. It is important to specify if the path is a closed path or not using the `closed`
// parameter. The default is a closed path for making polygons.
// * `[[0,0],[0,1],[1,1],[0,1]]`: 2d point list (a square), `all` was given to set rounding
// * `[[0,0,0], [0,1,1], [1,1,2], [0,1,3]]`: 3d point list, `all` was given to set rounding
// * `[[0,0,0.2],[0,1,0.1],[1,1,0],[0,1,0.3]]`: 2d point list with smoothing parameters different at every corner, `all` not given
// * `[[0,0,0,.2], [0,1,1,.1], [1,1,2,0], [0,1,3,.3]]`: 3d point list with smoothing parameters, `all` not given
// * `[[0,0,[.3,.7], [4,0,[.2,.6]], [4,4,0], [0,4,1]]`: 3d point list with smoothing parameters for the `"smooth"` type roundover, `all` not given. Note the third entry is sometimes a pair giving both smoothing parameters, sometimes it's zero specifying no smoothing, and sometimes a single number, specifying the amount of smoothing but using the default smoothness parameter.
// When doing continuous curvature rounding be sure to use lots of segments or the effect will be
// hidden by the discretization.
//
// Arguments:
// path = list of points defining the path to be rounded. Can be 2d or 3d, and may have an extra coordinate giving rounding parameters. If you specify rounding parameters you must do so on every point.
// curve = rounding method to use. Set to "circle" for circular rounding and "smooth" for continuous curvature 4th order bezier rounding
// type = rounding parameter type. Set to "cut" to specify the cut back with either "smooth" or "circle" rounding methods. Set to "radius" with `curve="circle"` to set circular radius rounding. Set to "joint" with `curve="smooth"` for joint type rounding. (See above for details on these rounding options.)
// all = curvature parameter(s). Set this to the curvature parameter or parameters to apply to all points on the list. If you set this then all values given in the path are treated as geometrical coordinates. If you don't set this then the last value of each entry in `path` is treated as a smoothing parameter.
// closed = if true treat the path as a closed polygon, otherwise treat it as open. Default: true.
//
// Example(Med2D): Standard circular roundover with radius the same at every point. Compare results at the different corners.
// Example(Med2D): Continous curvature roundover using "cut", still the same at every corner. The default smoothness parameter of 0.5 was too gradual for these roundovers to fit, but 0.7 works.
// Example(Med3D): 3d printing test pieces to display different curvature shapes. You can see the discontinuity in the curvature on the "C" piece in the rendered image.