Function: resamplePolygon()
ts
function resamplePolygon(
poly,
n,
box
): Polygon;poly with points added along its edges to make exactly n, keeping every original vertex, so any two shapes can be morphed point by point (CSS transitions only interpolate polygon() values with the same number of points). The points run the same way round for every shape and start at the corner nearest the top left of box, so a shape morphs into another without twisting. A polygon with more than n points is returned as it is.
Parameters
| Parameter | Type |
|---|---|
poly | Polygon |
n | number |
box | Rect |