Computes the signed distance from the given point towards the polygon border.
The absolute distance from a point to the polygon border can be computed by using the Geometric.DistancePointToLineSegment2 method or by using a spatial quadtree of line segments (see SpatialQuadtree).
The weights in parameter is assumed to satisfy these assumptions:
weights.X >= weights.Y >= 0 weights.X + weights.Y = 1 weights.Z = 0
The vertices in parameter is interpreted as follows:
Distance to polygon vertex (weights.X = 1): vertices.X := vertex index of point. vertices.Y/Z := index of previous/next contour vertex or negative if not existent (if both are non-existent, use edge parity sign for distance) Distance to polygon edge (weights.X < 1): vertices.X/Y := index of nearest / farthest edge vertex vertices.Z := The polygon edge direction, expressed with X and Y: +1 : X->Y -1 : Y->X 0 : X<>X (use edge parity sign for distance)