5.0

5.0 | 3 ratings Rate this file 28 Downloads (last 30 days) File Size: 243 KB File ID: #42173
image thumbnail

Spirograph GUI

by

 

A MATLAB GUI for generating customizable multilayer spirographs

Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

| Watch this File

File Information
Description

  Syntax: SpirographGUI;
                SpirographGUI();
                
  Dependencies: Make sure you add the folder "./HelperFcns/" to your MATLAB
                path before running SpirographGUI(). This folder contains
                helper functions that are called during execution
                
  Description: This function generates a GUI in a MATLAB figure window
                that allows the user to draw customizable multi-layer
                spirographs
                
  Controls: Controls are broken into three button groups: Shapes,
                Figure, and Spirograph
                
                The Shapes button group allows the user to select from a
                list of available inner/outer shapes and customize their
                parameters, including the ability to 1) modify the
                positions of the holes in the inner shape, 2) change the
                active hole, and 3) show/hide the shapes (e.g., you may
                want to hide the shapes to view your finished spirograph!)
                
                The Figure button group allows the user to 1) rotate
                layer(s) of the existing spirograph, 2) delete layer(s) of
                the existing spirograph, and 3) change the current axis
                range
                
                The Spirograph button group allows the user to customize
                the 1) initial angle, 2) number of revolutions, 3) graph
                resolution, and 4) plotting style (e.g., line color, line
                width, etc.) of the next spirograph layer. After
                customizing the layer, simply push the "Draw" button to
                watch your spirograph draw itself (you can then push "Stop"
                to terminate the drawing early, if desired)
                
  Author: Brian Moore
                brimoor@umich.edu

Required Products MATLAB
MATLAB release MATLAB 7.13 (R2011b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (4)
01 Jul 2013 Adam Filion

This is great! I had totally forgotten about spirograph, had one when I was a kid. Nice implementation in MATLAB and fun to play around with :)

27 Jun 2013 Brian Moore

@Jean Bilheux: The algorithm is pretty simple: move a small arc length, say ds, along the border of each shape and then rotate/translate the inner shape as necessary to align the tangent vectors of the inner/outer shapes at their current border positions

I.e., all one needs is an expression for the derivative of each shape's border, from which one can compute arc length (via numerical integration, if necessary) and tangent vectors

27 Jun 2013 Jean Bilheux

Nice application. Will also use it to learn the way you designed the algorithm.

25 Jun 2013 Mohan

Cool!

Contact us