Last updated
Last updated
General path manipulation can be performed on the type. We can construct a Polygon
from any type implementing Iterator<Item=P2>
, which Ngon
does.
Further, we can iteratively subdivide and apply this same distortion to make more interesting shapes:
Polygon
provides an iterator over its vertices we can use to manipulate them, and build a new polygon. In this code we use that to distort the polygon by sampling noise with time as the z
position: