This is a showcase of a custom block I made. It can generate a regular polygon for a given number of sides, between 3 to 100. Regular N-Sided Polygon Generator
For example, this is what it generates if you tell it to make a 5 sided shape:
It inherits the properties of the pen, similar to the text to costume library blocks. It also has a unique mode, which makes each side of the shape a different color. Here's what that looks like:
It's called "turtle geometry" because you're supposed to imagine that the sprite is a turtle, and the picture is described from its position and direction rather than by reference to an absolute (Cartesian) coordinate system. It makes drawing shapes much easier. (For example, experiment with 720 instead of 360 in the above code...)
Huh. I suppose that is easier, but wouldn't it be super difficult to calculate the overall size of the shape?
Like, if I wanted a 50 sided shape with a overall radius of 140 so it doesn't go off screen, that would be a ton of trial and error with that script to get the size correct.
Well, the perimeter is the product of the two inputs, SIDES and SIZE. So consider that a polygon, especially one with a large number of sides, is basically a circle, so just divide by 𝜋 to get the approximate diameter. (Or of course you could do it backwards if you start with the diameter of the shape you want.) I guess if you need a precise diameter it's harder.