I am trying to create a spirograph in Illustrator, as per attachment. How do I do this? Where do I start?
Ok, so a spirograph is just a function and I have made a function drawing script called jooGraphFunction. With this tool at hand we can go and plot
cos(2*t)*(10*cos(12*t)) -sin(2*t)*(26*sin(12*t)) sin(2*t)*(10* cos(12*t)) +cos(2*t)*(26*sin(12*t))
PI with stepping
PI/24 and you get. Where 12 is the number of lobes.
Image 2: Screenshot of jooGraphFunction GUI and a few alternate versions with different number of lobes.
Image 2: And drawing with same number of lobes as yours (36) made with same technique.
You can also dissect the script for a starting point for your own learning.
I know the OP asks for Illustrator, but if you don't mind spending zero €/$ on a piece of software, this is a native feature in Inkscape.
True spirographs are not easily achieved, for they are continuous lines, as opposed to your example. You could try Illustrator scripting to achieve that, or look at Luciano's answer.
For a very similar effect, you'd take an ellipse or-ellipse-like shape and rotate and copy that a number of times. The rotation angle should be a number of degrees that 360° is divisible by.
A typical way to make your example would be:
- Draw your ellipse using the
Ellipsetool (shortcut L);
- Make sure the ellipse has a stroke and no fill;
- With the ellipse still selected, switch to the
- With your Left Alt pressed, click the ellipse's centre--a registration mark should already be visible there. Your cursor should be a precision cross with three dots on the side;
- In the dialogue that pops up, choose an angle (θ) that, when multiplied with a whole number (n), yields 360°;
- Click Copy;
- Choose Object > Transform > Transform Again or press Cmd / Ctrl+D for a number of times (n-2) until your figure is complete.
Alternatively, you could use a dynamic Transform effect for this and keep both the shape and the number of copies editable:
- Draw a non-fill ellipse as above;
- With the shape selected, choose Effect > Distort & Transform > Transform...;
- Choose your angle θ under the 'Rotate' heading. Don't touch the 'Scale' or 'Move' settings (yet);
- Enter a number of copies n-1 in the bottom of the dialogue;
- Press OK.
This effect is dynamically applied to the base shape, you can edit the shape and the effect will follow suit. You can also double click on the effect in the
Appearance palette to edit it. This way, you can create multiple different shapes in a jiffy.
You can experiment with all the other settings to make the most amazing art this way. Checking the Preview box allows you to peek at what you are achieving.
For added fun & giggles, you could do this trick with a filled shape that has any non-'normal' blend mode and/or an opacity lower than 100%.
There's this excellent video tutorial that is far too long to explain here, but there are different ways to create continous-line spirographs in Illustrator.
TL/DR; create ellipses, rotate-duplicate them and clean up the extra points.
Make sure you have smart guides enabled (View > Smart Guides)
- create an ellipse that is taller than wider (stroke only, no fill)
- with the Rotate r tool, option+click on the top anchor and type an angle that when multiplied with a whole number (n), yields 360°. Click Copy
- Now do the option+click on the newly created ellipse, on the opposite point.
- keep duplicating the shape until you have (n) shapes.
- Use the a tool to select all points in the center of your spirograph, and delete them.
- Join the paths (cmd+j)
- Shift+ drag around the last created point in the last duplicated shape to deselect it
- Convert the selected anchor points to smooth clicking on the button in the Anchor Point menu
- select the remaining un-smooth points and cmd+shift+option+j to join the points, choose "Smooth"
Note that Im using Illustrator CS 6 Differences in shortcut or appearance of the highlighted tool in other versions may occur :-)
Rotate the Petal by 5 Repeat based on your desired artwork (360/5=72) (Press R or Use Rotate Tool + type the angle then Press COPY) Repeat the Copying (Do it 3 Times) by Pressing Ctrl D while the copy is highlighted.
Adjust Your First Petal shape if you need the perfect star inside.