mermaid.outline.polygon

mermaid.outline

polygon(points) -> dist

Build the signed distance to a convex polygon

points are { x, y } pairs in either turn. The distance is the greatest distance to one of the sides' lines. It is exact inside and along a side, and gives a mitred corner outside.