array of interlaced x and y coordinates of vertices
const { polygonCloudShapes } = Fig.morph;
const cloud1 = polygonCloudShapes({
num: 2000,
radius: 0.5,
sides: 5,
});
const cloud2 = polygonCloudShapes({
num: 2000,
radius: 0.5,
sides: 100,
});
const m = figure.add({
make: 'morph',
points: [cloud1, cloud2],
color: [1, 0, 0, 1],
});
m.animations.new()
.morph({ start: 0, target: 1, duration: 2 })
.start();
Generate random points within a polygon.