The Polygon(xpoints,ypoints,npoints) constructor is not for giving it a hint how big to initialise the arrays. It is used when you already have an array of actual data points you want copied into your Polygon to get it started.
Graphics.drawPolygon and Graphics.fillPolygon don’t mind if a polygon is closed or not. They don’t seem to care if you define the points in clockwise or counter-clockwise order. I have written code part of the demonstration Screw package the generates regular polygons. Here is how to generate a regular polygon.
This page is posted
Optional Replicator mirror
Please read the feedback from other visitors, or send your own feedback about the site.
Contact Roedy. Please feel free to link to this page without explicit permission.
Your face IP:[18.104.22.168]
You are visitor number|