# Spirograph3D

Name:spirograph3D
Type: 3D shape
Author: Rick Sidwell (based on spirograph by Jed Kelsey)

## Overview

Spirograph3D is a 3D version of the spirograph variation. It generates a spirograph pattern (an epitrochoid or a hypotrochoid) just as the original spirograph variation, but also sets a z value to make it three dimensional. See the spirograph variation description for additional information.

## Parameters

 variation amount Sets the overall size of the figure; 1 is a typical value. a Radius of the fixed circle. It should be positive and relatively small. As a rule of thumb, the sum of a and b should be around 1. Use the variation value to control the exact size. b Radius of the rotating circle. Make it positive for an epitrochoid (rotating around the outside) or negative for a hypotrochoid (rotating around the inside). The absolute value is generally smaller than a, though this is not required. It must not be 0. c The distance from the center of the rotating circle where the pen is located. It should be positive; using 0 will result in a circle. tmin, tmax The minimum and maximum values for t, the parametric equation parameter. The default values of 0 and 1000 are suitable for most uses. width The width of the line used to draw the figure. Keep it small, like 0.03. mode The pen mode, only effective if width is non-zero.   0 – ribbon   1 – twisted ribbon   2 – wire   3 – gaussian   4 – double pen (two lines width apart) direct_color 0 for normal or 1 to use direct color

## Details

The description of the spirograph variation describes the a, b, c, tmin, and tmax parameters; refer to it for details. (Ignore the case when c1 and c2 are different; spirograph3D has only a single parameter c.) The basic design of the generated figure is the same in spirograph and spirograph3D, but spirograph3D sets the z value for each of the points to give it some height, visible if the pitch is non-zero. There are no parameters to control just how this is done. Spirograph3D designs generally look better when there are lots of loops, which better reveal the three dimensional shape.

The width parameter replaces the ymin and ymax parameters of spirograph. When 0, the figure is drawn with a thin line. When larger, the figure is drawn with a three dimensional material (controlled by the mode parameter) of the given width. The width is normally kept small to prevent the loops from overlapping each other, though larger values can be used (usually with a small number of loops) for special effects. Solid rendering works well with modes 0-3 when width is not 0 (mode 4 or a width of 0 draws the figure with lines, which don’t render well as a solid).

## Special considerations

Spirograph3D is currently available only in JWildfire.

## Uses

• Adding textures or design elements
• Base for 3D constructions

## Mathematics

Describe the math behind the variation. For example, the equations for spirograph:

$x=(a+b)\cos t - c\cos((a+b)/b t)$
$y=(a+b)\sin t - c\sin((a+b)/b t)$
$z=c\sin((a+b)/b t)$

spirograph