Staaarter

Generate a Sierpinski Arrowhead Curve

Generates the classic Sierpinski arrowhead curve, a one-stroke turtle-graphics path that traces the same triangular pattern as the Sierpinski triangle, and renders it as SVG line art you can download. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-08-05
By Staaarter Team
fractalgeneratorsvgl-system

Overview

Introduction

The Sierpinski arrowhead curve is a classic L-system fractal, a single unbroken path that, as it zigzags back and forth, traces out the same triangular pattern as the famous Sierpinski triangle. This tool renders its standard construction as SVG line art.

Enter an iteration count and the tool expands the arrowhead curve's A/B production rules that many times, then draws the resulting one-stroke path so you can see the triangular pattern emerge from pure zigzagging.

What Is Generate a Sierpinski Arrowhead Curve?

A real, named fractal curve closely related to the Sierpinski triangle, but constructed by turtle graphics rather than by recursively subdividing and removing triangles. It's a unicursal (one-stroke, never-lifting-the-pen) approximation of the same triangular gasket shape.

Because it's drawn as one continuous zigzag rather than a set of separately-placed filled shapes, it renders here as line art only, no fill, distinguishing it visually from the filled Sierpinski Triangle Generator even though both approximate the same limiting pattern.

How Generate a Sierpinski Arrowhead Curve Works

The generator starts from the axiom "A" and repeatedly applies the rules A becomes "B-A-B" and B becomes "A+B+A" for as many iterations as you enter, where + and - are 60-degree turns.

Both A and B are draw-forward letters in this L-system, so every A and B in the expanded string moves the turtle forward and draws a segment, with the alternating +/- turns between them producing the characteristic zigzag.

The expanded instruction string is walked by a turtle to produce line segments, which are then rescaled to fit the SVG viewbox and drawn as one continuous unbroken path.

When To Use Generate a Sierpinski Arrowhead Curve

Use it whenever you want the Sierpinski triangle's shape rendered as a single continuous line, for generative art, plotter-friendly line art, or teaching how the same fractal pattern can arise from two very different construction methods.

It's a useful comparison piece next to the Sierpinski Triangle Generator, both approximate the same underlying gasket shape, but one is filled polygons and the other is an unbroken zigzag line.

If you want the filled, recursively-subdivided version instead of a traced outline, use the Sierpinski Triangle Generator.

Features

Advantages

  • A well-documented, classic fractal curve with a single, unambiguous construction, not an invented variant.
  • Renders as one continuous unbroken path, which makes it well suited to pen-plotter or single-stroke line-art use cases where a filled shape wouldn't work.
  • Downloadable as both SVG (for further vector editing) and PNG (for quick use anywhere).

Limitations

  • It only traces an approximation of the Sierpinski triangle's outline; the interior removal pattern that defines the classic gasket isn't directly visible the way it is in a filled, subdivided rendering.
  • At higher iteration counts near the maximum of 9, the dense zigzagging can make individual segments difficult to distinguish without zooming into the downloaded SVG.

Examples

Low iteration count

Input

Iterations: 2

Output

A simple zigzag of short segments, faintly suggesting a row of triangular arrowhead points.

At low iterations the individual zigzag segments are large enough to see the arrowhead-shaped points that give the curve its name.

Default iteration count

Input

Iterations: 6

Output

A dense, triangular zigzag pattern that closely approximates the Sierpinski triangle's outline.

The default of 6 shows a recognizable Sierpinski-triangle silhouette while staying quick to render and download.

Best Practices & Notes

Best Practices

  • Start at iteration 2 or 3 to see the individual arrowhead-shaped zigzag points clearly before increasing toward the higher end of the range, where the overall triangular pattern dominates.
  • Download the SVG rather than the PNG if you plan to recolor, scale, or further edit the curve, vector output has no resolution limit.

Developer Notes

Implemented as the standard L-system preset ("sierpinski-arrowhead-curve" in l-system-presets.ts): axiom "A", rules A: "B-A-B" and B: "A+B+A", 60-degree turn angle, with both A and B registered as draw letters (drawLetters: ["A", "B"]) rather than the default F-only convention, capped at 9 iterations. Expansion and turtle interpretation both go through the shared generateLSystemCurve/drawLSystem engine used by every other L-system tool in this category, before geometry normalization and SVG rendering.

Generate a Sierpinski Arrowhead Curve Use Cases

  • Teaching how the same fractal pattern can emerge from both filled recursive subdivision and unicursal turtle-graphics curves
  • Pen-plotter or single-stroke generative art referencing the Sierpinski triangle shape
  • Downloadable SVG line art for design projects wanting a triangular fractal zigzag motif

Common Mistakes

  • Expecting a filled triangle; this tool renders line art only, for the filled, recursively-subdivided version use the Sierpinski Triangle Generator instead.
  • Setting iterations to the maximum right away; past 6 or 7 the zigzag becomes dense enough to make individual segments hard to distinguish visually.

Tips

  • Compare directly against the Sierpinski Triangle Generator at a similar depth to see how the filled-subdivision and traced-curve methods converge on the same overall shape.
  • Zoom into the downloaded SVG in a vector editor to trace the individual arrowhead-shaped zigzag turns at higher iteration counts.

References

Frequently Asked Questions