Generate Terdragon Curve

The Terdragon Curve Generator lets you render the terdragon fractal — a self-similar curve built entirely from 120° turns that produces striking triangular motifs with each iteration. Unlike the more familiar dragon curve (which relies on 90° right-angle turns), the terdragon uses trisection logic, meaning every line segment is replaced by three new segments oriented at 120° to one another. This mathematical property gives the terdragon its distinctive hexagonal character and makes it a fascinating object of study in fractal geometry. With this tool, you can control the iteration depth to watch the curve evolve from a simple zigzag into an intricate space-filling pattern, adjust the canvas dimensions to suit your display or export needs, and customize colors and stroke thickness to produce publication-ready or artwork-quality output. Whether you're a student learning about L-systems, a mathematics educator preparing visual demonstrations, a generative artist seeking geometric textures, or a developer experimenting with recursive drawing algorithms, this tool gives you immediate, browser-based access to one of geometry's most elegant constructions. No software installation, no coding required — just configure your parameters and generate beautiful fractal art in seconds.

Options
Terdragon Dimensions and Iterations
Terdragon curve width.
Terdragon curve height.
The order of the terdragon curve.
Terdragon Colors
Background color for the terdragon curve.
Color of the first terdragon segment.
Color of the second terdragon segment.
Color of the third terdragon segment.
Line, Space, Orientation
Draw terdragons with this width.
Space around terdragons.
Set the orientation of the third dragon's tail.
Output (Terdragon Curve)

What It Does

The Terdragon Curve Generator lets you render the terdragon fractal — a self-similar curve built entirely from 120° turns that produces striking triangular motifs with each iteration. Unlike the more familiar dragon curve (which relies on 90° right-angle turns), the terdragon uses trisection logic, meaning every line segment is replaced by three new segments oriented at 120° to one another. This mathematical property gives the terdragon its distinctive hexagonal character and makes it a fascinating object of study in fractal geometry. With this tool, you can control the iteration depth to watch the curve evolve from a simple zigzag into an intricate space-filling pattern, adjust the canvas dimensions to suit your display or export needs, and customize colors and stroke thickness to produce publication-ready or artwork-quality output. Whether you're a student learning about L-systems, a mathematics educator preparing visual demonstrations, a generative artist seeking geometric textures, or a developer experimenting with recursive drawing algorithms, this tool gives you immediate, browser-based access to one of geometry's most elegant constructions. No software installation, no coding required — just configure your parameters and generate beautiful fractal art in seconds.

How It Works

Generate Terdragon Curve produces new output from rules, parameters, or patterns instead of editing an existing document. That makes input settings more important than input text, because the settings are what define the shape of the result.

Generators are only as useful as the settings behind them. When the output seems off, check the count, range, delimiter, seed values, or pattern options before judging the result itself.

All processing happens in your browser, so your input stays on your device during the transformation.

Common Use Cases

  • Visualizing how L-system grammar rules produce complex geometric structures from simple recursive substitutions.
  • Creating unique triangular fractal artwork for print, digital wallpapers, or design projects that require mathematically precise patterns.
  • Teaching students about fractal iteration, self-similarity, and non-orthogonal turn grammars in a hands-on, visual way.
  • Generating reference images for research papers or presentations covering fractal geometry and space-filling curves.
  • Exploring how iteration depth affects curve complexity, useful for understanding computational growth and rendering trade-offs.
  • Producing SVG or canvas-based visuals for generative art projects that incorporate mathematical curves as design elements.
  • Comparing the terdragon's triangular structure with the dragon curve's right-angle structure to illustrate how turn angle affects fractal shape.

How to Use

  1. Set the iteration depth using the slider or input field — start with a low value (2–4) to understand the basic structure before increasing to 7–9 for full detail.
  2. Adjust the canvas width and height to match your intended output size; larger canvases reveal more fine-grained detail at higher iteration depths.
  3. Choose a stroke color that contrasts well against your background — dark lines on a light background work best for educational use, while inverted schemes suit artistic output.
  4. Set the line thickness; thinner strokes (0.5–1px) are ideal for high-iteration renders, while thicker strokes (2–4px) make lower-iteration curves easier to study.
  5. Click the Generate button to render the curve; the tool redraws the fractal in real time whenever parameters change.
  6. Use the Copy or Download option to save your output as an image or copy it to your clipboard for use in documents, presentations, or design tools.

Features

  • 120° turn-based L-system grammar that faithfully implements the terdragon's trisection substitution rule, producing mathematically accurate output at every iteration.
  • Adjustable iteration depth from 1 to 10+, allowing you to observe the curve's evolution from a simple three-segment path to a dense, near-space-filling fractal.
  • Full canvas size control so you can generate small thumbnails or large high-resolution renders without reloading or reconfiguring the tool.
  • Customizable stroke color and line thickness to support both technical/educational use cases and artistic/generative design workflows.
  • Real-time rendering that redraws the curve instantly as you change parameters, enabling rapid visual experimentation.
  • Clean, minimal output with no watermarks or overlays, making it suitable for direct use in presentations, publications, or artwork.
  • Browser-based execution with no dependencies or installation required — works on any modern desktop or mobile browser.

Examples

Below is a representative input and output so you can see the transformation clearly.

Input
Order: 0
Size: 100
Angle: 90
Output
Path:
(0,0)
(100,0)

Edge Cases

  • Very large inputs can still stress the browser, especially when the tool is working across many numbers. Split huge jobs into smaller batches if the page becomes sluggish.
  • Empty or whitespace-only input is technically valid but may produce unchanged output, which can look like a failure at first glance.
  • If the output looks wrong, compare the exact input and option values first, because Generate Terdragon Curve should be repeatable with the same settings.

Troubleshooting

  • Unexpected output often means the input is being split or interpreted at the wrong unit. For Generate Terdragon Curve, that unit is usually numbers.
  • If a previous run looked different, check for hidden whitespace, changed separators, or a setting that was toggled accidentally.
  • If nothing changes, confirm that the input actually contains the pattern or structure this tool operates on.
  • If the page feels slow, reduce the input size and test a smaller sample first.

Tips

For the most visually impressive results, pair a high iteration depth (8–10) with a thin stroke (0.5px) and a large canvas — this reveals the terdragon's near-space-filling density without the lines merging into solid blocks. If you're using the output for educational purposes, render three or four progressively deeper iterations side by side to clearly illustrate how self-similarity works. When creating artwork, try layering two terdragon renders at different rotations (0° and 60°) with semi-transparent strokes — the triangular symmetry means they tile together beautifully. Keep in mind that rendering time increases significantly beyond iteration depth 10, so test your color and size settings at a lower depth before committing to a high-resolution final render.

The terdragon curve belongs to a family of fractals known as L-system curves, or Lindenmayer system curves, named after the biologist Aristid Lindenmayer who formalized the grammar-based approach to describing recursive geometric structures in 1968. While Lindenmayer originally used these systems to model plant growth, mathematicians quickly recognized their power for generating self-similar curves of great complexity from remarkably simple rules. The terdragon's defining rule is straightforward: take every line segment and replace it with three segments of equal length arranged at 120° angles to each other. The name itself encodes this logic — 'ter' is Latin for 'three,' echoing the trisection at the heart of the construction, and 'dragon' references its kinship with the well-known Heighway dragon curve. Where the classic dragon curve uses 90° turns and produces a shape that tiles the plane in fourfold symmetry, the terdragon's 120° turns produce threefold (triangular) symmetry — aligning naturally with the geometry of equilateral triangles and regular hexagons. At low iteration depths, the terdragon looks like a simple angular path. By iteration 3 or 4, recognizable triangular motifs begin to emerge. By iteration 7 or 8, the curve becomes so dense that it nearly fills its bounding triangular region, a property that mathematicians describe as 'approaching a space-filling curve.' In the theoretical limit of infinite iterations, the curve's length grows without bound while it remains confined to a bounded area — a hallmark of fractal geometry and a direct consequence of its Hausdorff dimension, which is greater than 1 but less than 2. The terdragon also has deep connections to complex number arithmetic. Each iteration of the curve can be modeled by multiplication in the complex plane by a specific constant, making it a useful teaching example for connecting visual geometry with algebraic operations. This relationship means the terdragon can be derived not just through L-system grammar but also through iterated function systems (IFS) and complex dynamics. Compared to other triangle-based fractals, the terdragon is distinct from the Koch snowflake (which adds triangular bumps outward from a base triangle rather than replacing segments with three-segment paths) and from the Sierpiński triangle (which removes area rather than tracing a path). The terdragon is a curve — a one-dimensional object that winds through two-dimensional space — while the Sierpiński triangle is an area-based construction. This makes the terdragon particularly interesting for pen-plotter art, CNC routing, and any application where a continuous path must be traced. In modern generative art and creative coding communities, the terdragon has gained popularity precisely because its 120° geometry produces outputs that look organic and crystalline at the same time. The curve's output fits naturally within hexagonal grid systems, making it a popular element in game design assets, textile patterns, and architectural tile designs. Many artists combine the terdragon with its own rotated copies — since three terdragon curves rotated 120° apart tile together without overlap — to produce seamlessly repeating geometric patterns.

Frequently Asked Questions

What is the terdragon curve?

The terdragon curve is a self-similar fractal curve constructed by repeatedly replacing each line segment with three segments oriented at 120° angles to one another. Its name comes from the Latin 'ter' (three) and its relationship to the Heighway dragon curve. Each iteration triples the total number of segments, and the resulting shape exhibits triangular symmetry. In the mathematical limit of infinite iterations, the curve approaches a space-filling fractal confined within a triangular region.

How is the terdragon curve different from the dragon curve?

The primary difference is the angle used in each substitution step. The Heighway (or 'classic') dragon curve uses 90° turns, which gives it fourfold rotational symmetry and a blocky, right-angled appearance. The terdragon uses 120° turns, producing threefold symmetry and a triangular, crystalline aesthetic. Both are L-system fractals and both are space-filling in the limit, but they tile the plane differently — the dragon curve tiles in rectangular arrangements while the terdragon tiles in triangular and hexagonal patterns.

What does 'iteration depth' mean for the terdragon curve?

Iteration depth refers to how many times the substitution rule has been applied. At depth 1, you have a simple three-segment path. At depth 2, each of those three segments has been replaced by three more, giving nine segments total. Because the number of segments triples with each iteration, depth 8 produces 3⁸ = 6,561 segments. Higher iteration depths reveal more fine-grained detail but require more processing time and may cause lines to overlap visually at lower resolutions.

What is an L-system and how does it apply to the terdragon?

An L-system (Lindenmayer system) is a formal grammar that defines how symbols in a string are replaced according to fixed rules. For the terdragon, the core rule is: replace every forward-draw command F with the sequence F+F−F, where + means turn left 120° and − means turn right 120°. Starting from a single F and applying this rule repeatedly produces the string that, when interpreted as drawing commands, renders the terdragon curve. L-systems are used to model a huge variety of fractals, plant structures, and self-similar patterns.

Can I use the generated terdragon image for commercial projects?

The terdragon curve is a mathematical construction and is not protected by copyright — the geometry itself is in the public domain. The images generated by this tool are your own to use freely. However, always verify any platform-specific terms of service if you intend to publish or sell artwork incorporating these images. Since the output is purely algorithmic and original to your parameter choices, it is generally considered your own creative work.

Why does the terdragon curve have triangular symmetry?

The 120° turn angle is exactly one-third of a full 360° rotation, which naturally encodes threefold (triangular) symmetry into every step of the construction. Equilateral triangles have interior angles of 60° and exterior angles of 120°, so the terdragon's substitution rule is geometrically compatible with triangular tiling. This is why the curve tends to form and fill triangular bounding regions, and why three copies of the terdragon rotated 120° apart fit together seamlessly.

What iteration depth should I use for the best visual result?

For a clear educational display where individual segments are visible, iteration depths of 3–5 work well. For dense, artwork-quality renders that showcase the fractal's near-space-filling nature, depths of 7–9 are ideal when paired with a thin stroke (0.5–1px) and a large canvas. Going beyond depth 10 significantly increases rendering time and can make the output appear as a solid filled triangle rather than a distinct curve, so it is rarely necessary for practical purposes.

Is the terdragon curve related to the Koch snowflake?

Both the terdragon and the Koch snowflake use 60°/120° geometry and share a triangular symmetry, but they are constructed very differently. The Koch snowflake is built by adding outward-pointing equilateral triangles to each segment of a shape, producing a closed boundary. The terdragon, by contrast, is an open curve — a continuous path through space that never closes on itself. The Koch snowflake approaches infinite perimeter around a finite area, while the terdragon approaches infinite length while densely filling a triangular region.