Lesson goal: True 3D printing: helices, springs, and 3D knots

Previous: Parametric 3D print designs (clovers and more) | Home | Next: 3D printing cups, vases, and bowls with revolve

In our previous lessons, we printed flat 2D graphs and parametric loops lying flat on the print bed. But real-world 3D printing is truly three-dimensional! What if you want to print a working mechanical compression spring, a DNA double helix, a conical spiral funnel, or an intricate 3D knot?

To move from flat 2D profiles into full three-dimensional space, we introduce a third coordinate array: the $z$-axis.

A space curve in mathematics is defined by three parametric equations that calculate $x$, $y$, and $z$ simultaneously from a parameter $t$ (such as an angle in radians or degrees): $$x = x(t)$$ $$y = y(t)$$ $$z = z(t)$$ While $x(t)$ and $y(t)$ revolve around the central axis, $z(t)$ continuously increases, winding the curve upward into a genuine three-dimensional helix!

Our 3D engine supports space curves directly through print3d(x, y, z, R). It sweeps a circular cross-section of radius R along the 3D curve using a rotation-minimizing Bishop frame, automatically grounds the bottom of your model flush to the print bed at $Z = 0$, and caps both ends for a 100% watertight, print-ready STL file.

Here is how to call print3d with three coordinate arrays:
id=print3d(x,y,z,R)
Move the mouse over a dotted box for more information.

  • Automatic Bed Grounding: No matter what mathematical formula you use for $z$, our STL generator automatically detects the lowest point and grounds your model at $Z = 0$ so it rests flat and stable on your printer's build plate.

  • Pitch and Frequency: In a helical spring $x = r \cos\theta, y = r \sin\theta, z = c \cdot \theta$, each full turn ($360^\circ$ or $2\pi$ radians) climbs vertically by $2\pi \cdot c$ millimeters. This vertical rise per revolution is called the pitch of the spring.

  • Full 3D WebGL Viewer: Drag with your mouse to orbit around your 3D spring, scroll to zoom, and right-drag to pan. The viewer automatically centers vertically on tall 3D objects, and you can click Spin to watch it rotate or Wire to inspect its triangle mesh.

  • Ready for Slicing: Click the Download STL button below the output to save your .stl file. It can be opened directly in Cura, PrusaSlicer, Bambu Studio, or Tinkercad to slice and print on any standard FDM or resin 3D printer!

Now you try. Run the code above to generate your first 3D helical spring. Try changing 18 to 12 for a slimmer spring, or alter 3.5 to increase or decrease the pitch between coils!

Type your code here:


See your results here: