Star Polygon drawing script

Star Polygon Filter

The Star Polygon Script-Fu script draws a star polygon on the current layer.

Star Polygon

A Star Polygon is a figure formed by firstly defining a set of P points evenly spaced on a circle, then drawing a straight line from the point to the point Q steps away. The highest value of Q is P/2.

The shape of a star polygon is referenced as { P / Q }.

When Q is 1, the Star Polygons are regular polygons.

A triangle is a {3,1} star polygon, a square is {4, 1}, a pentagon is {5, 1} and a hexagon is {6, 1}.

The shapes become more interesting when Q has values greater than 1.

Dialog Box

P - The number of points on the circle.

Q - Draw lines from each point to this number of points away.

The circle used to contruct the Star Polygon is centered horizontally and vertically in the image. The following parameters are used to define this circle.

Radius - The radius of the circle in pixels

Offset - The first point of the circle is at the very top. Changing this value will move this point in a clockwise direction in the specified number of degrees.

X Offset - The centre of the circle can be movied horizontally, left or right using this value in pixels.

Y Offset - The centre of the circle can be moved vertically, up or down, using this value in pixels.

The following parameters are used to draw the Star Polygon.

Draw Points Only - Selecting this option will cause the script to simulate clicking the brush on each of the P points. Useful for drawing with large brushes.

Brush - Display the brush dialog box to choose a brush for drawing the lines.

Color - Display the color dialog box for choosing the line color.

Sample images

Draw a {6/2} polygon then draw it again with a 30 degree offset.

Draw a series of all possible star polygons for a given number of points (P). Firstly, with an even number for P:

Now with an odd number for P:

You will notice that the first series finished with lines crossing the centre of the circle. This is because a Star Polygon of {P, P/2} is a series of radial lines when P is even.

Varying the Radius value can be useful for drawing several scaled star polygons:

Varying the X and Y offsets can create a shadow effect:

More interesting effects can be gained when using much larger values of P and values of Q approaching P/2. Use bucket fill to apply color to patterns of areas.

Please send me examples of how you have used the Star Polygon Script-Fu.


Download the filter here .

Go to my GIMP home page.


Weisstein, Eric W. "Star Polygon." From MathWorld - A Wolfram Web Resource.

"Star Polygons" from The Wolfram Demonstrations Project

Author: Charles Cave <>

Date: 2008/05/17 6:30:04 PM