Generate Your Own Splendid Spirographical Designs

Generate Your Own Splendid Spirographical Designs

Tutorial Details
Download Source Files

Today, we’re going to resurrect a classic drawing toy in After Effects using an expression tied into a few custom sliders. I used Trapcode Particular 2.0 to display the resulting animated patterns but CC Particle World could be used almost as easily and the results can be used in a myriad of ways for your projects. Or you can just experiment and see what kind of unique shapes you can generate just by changing a few numbers.


Preview

Want access to the full AE project files and assets for every tutorial on Aetuts+, including this one? Join Ae Plus for just $19/month. You can view the final effect preview video below.


Tutorial

Download Tutorial .flv

File size 135MB

Add Comment

Discussion 16 Comments

  1. Teminator says:

    hurrey i am the first

  2. Jonas says:

    While expressions are great, you can do the same spirographing with three parented null objects (simulating physical spirograph) and a single toWorld function. I prefer this way because it provides better visual understanding.

  3. Terminator says:

    hurrey i am the first to download the video

  4. Nathanael says:

    I understand that it’s good to help beginners, and yes, this is a good tutorial for ‘beginners’, but what i want to say is, it’s been a LONG TIME since we’ve seen an actual tutorial for non-beginners who actually not their way around After Effects.

    I would die for an EPIC tutorial from someone again…Seriously…its been AGES!

  5. Max says:

    I really like the effect, but the patterns after they’ve been drawn/generated look kinda static? But I’m not sure myself what would give it a bit more life?

  6. kamal98 says:

    Hey this not a bad idea i can see some use for this thanks men.

  7. Marv Gilbert says:

    Just now have a client with a spiro shape in their logo. Good Timing! Thanks.

  8. jakz says:

    DIDNT WORK!!!!
    what did I do wrong?

    Fr = thisComp.layer(“control”).effect(“Fixed radius”)(“Slider”);
    Mr = thisComp.layer(“control”).effect(“Moving radius”)(“Slider”);
    O = thisComp.layer(“control”).effect(“Point offset”)(“Slider”);
    Sp = thisComp.layer(“control”).effect(“speed”)(“Slider”)*time;
    Sc = thisComp.layer(“control”).effect(“scale”)(“Slider”);

    if(Mr==0)Mr = 1;
    if(Fr==0)Fr = 1;

    x = (Fr+Mr)*math.cos(Sp) – ( Mr+O)*math.cos(((Fr+Mr)/Mr)*Sp);
    y = (Fr+Mr)*math.sin(Sp) – ( Mr+O)*math.sin(((Fr+Mr)/Mr)*Sp);

    [thisComp.width/2,thisComp.height/2] + [x,y]*Sc;

    • Hi jakz,

      AE functions are case sensitive and when referencing a math function, the M has to be capitalized. Just caps-up those four instances in the last lines of the expression and you should be fine. Here’s the whole thing for anyone who wants to copy/paste (note, your layers and slider names might be different, so change as necessary):

      Fr = thisComp.layer(“control”).effect(“Fixed Radius”)(“Slider”);
      Mr = thisComp.layer(“control”).effect(“Moving Radius”)(“Slider”);
      O = thisComp.layer(“control”).effect(“Pen Offset”)(“Slider”);
      Sp = thisComp.layer(“control”).effect(“Speed”)(“Slider”)*time;
      Sc = thisComp.layer(“control”).effect(“Scale”)(“Slider”);

      if(Fr==0) Fr=1;
      if(Mr==0)Mr=1;

      x=(Fr+Mr)*Math.cos(Sp) – (Mr+O)*Math.cos(((Fr+Mr)/Mr)*Sp);
      y=(Fr+Mr)*Math.sin(Sp) – (Mr+O)*Math.sin(((Fr+Mr)/Mr)*Sp);

      [thisComp.width/2,thisComp.height/2] + [x,y]*Sc;

  9. jNothing says:

    uhm… I can’t dload source files but I’m logged in…
    ideas?

  10. yogafish says:

    The tutorial video says it’s having playback error – can someone please fix this?

  11. Imray says:

    Can someone explain the expression? Seems you just completely ran over that, even though it was the main part

  12. skyvat says:

    Great tutorial – however I am getting an error in line 10 and not quite clear why. Says it is a syntax error, but I copied the expression from directly above. Anyone able to see the error?

    Fr = thisComp.layer(“control”).effect(“Fixed Radius”)(“Slider”)
    Mr = thisComp.layer(“control”).effect(“Moving Radius”)(“Slider”)
    O = thisComp.layer(“control”).effect(“Point Offset”)(“Slider”);
    Sp = thisComp.layer(“control”).effect(“Speed”)(“Slider”)*time;
    Sc = thisComp.layer(“control”).effect(“Scale”)(“Slider”)

    if(Fr==0) Fr=1;
    if(Mr==0)Mr=1;

    x=(Fr+Mr)*Math.cos(Sp) – (Mr+O)*Math.cos(((Fr+Mr)/Mr)*Sp);
    y=(Fr+Mr)*Math.sin(Sp) – (Mr+O)*Math.sin(((Fr+Mr)/Mr)*Sp);

    [thisComp.width/2,thisComp.height/2] + [x,y]*Sc;

    Thank you

Add a Comment

To add a code snippet to your comment, please wrap your code like so: <pre name="code" class="html">YOUR CODE</pre>. You can replace the class name with "js," "css," "sql," or "php." If there are any "<" or ">" within your code, please search and replace them with: &lt; and &gt; respectively.