Overview
Introduction
The Koch curve is one of the earliest fractals ever described, and its defining rule, replace the middle third of a segment with two sides of an equilateral triangle, is usually taught by closing it into a snowflake. This tool shows the rule at its simplest: applied once along a single straight line, left open.
Enter an iteration count and the tool renders the resulting zigzag as an SVG line drawing, with buttons to download it as SVG or PNG.
What Is Generate a Koch Triangle?
A generator for the open Koch curve, the same self-similar triangular-bump rule used in the Koch Snowflake, but applied to one line segment rather than a closed triangle.
The output is pure line art, a single connected path with no fill, so it reads as a jagged, self-similar edge rather than a filled shape.
How Generate a Koch Triangle Works
Construction starts from one straight segment. At each iteration, every existing segment is replaced with four shorter segments: forward a third, turn 60 degrees, forward a third, turn -120 degrees, forward a third, turn 60 degrees, forward the final third, tracing the two exposed sides of an equilateral triangle bump.
Because the starting shape is a single line rather than a closed triangle, the bumps never wrap around to meet each other, the curve stays open with a clear start and end point no matter how many iterations you apply.
The rendered path is normalized to fit the SVG viewbox, then drawn as a single stroked polyline with no fill, and the same coordinates back the SVG and PNG downloads.
When To Use Generate a Koch Triangle
Use it when you specifically want the open Koch curve on its own, as a design element, a teaching diagram of the base Koch rule, or a decorative jagged line.
If you want the closed snowflake or triangle outline instead, use Koch Star (three sides at once) rather than this tool.
Often used alongside Generate a Cesaro Fractal, Generate a Triflake Curve and Generate a Quadratic Koch Island.
Features
Advantages
- Isolates the Koch rule from the closed-polygon setup, useful for teaching the construction step by step.
- Renders instantly at any supported iteration count, with no server round trip.
- Downloadable as clean vector SVG or a rasterized PNG.
Limitations
- Capped at 7 iterations to keep segment counts and download sizes reasonable, deeper zooms aren't available.
- Stroke only, there is no fill option since the curve is open and doesn't enclose an area.
Examples
Best Practices & Notes
Best Practices
- Start at iteration 2 or 3 to see the bump pattern clearly before jumping to the denser default of 5.
- Download as SVG if you plan to recolor, scale, or place the curve into other vector artwork, use PNG for a quick raster embed.
Developer Notes
The curve comes from the shared L-system engine with axiom `F` and rule `F -> F-F++F-F` at a 60 degree turn angle, the same rule string used by the Koch Star preset but starting from a single segment instead of a closed triangle axiom. Segment count grows as 4^n, matched to the 0-7 iteration bound.
Generate a Koch Triangle Use Cases
- Teaching the base Koch curve construction before introducing the closed snowflake variant
- Generating a jagged decorative line or border for design work
- Producing a downloadable SVG asset of a classic fractal curve
Common Mistakes
- Expecting a closed shape or fillable area, this curve never meets itself, use Koch Star for the closed snowflake instead.
- Jumping straight to the maximum iteration count, the bump structure is easier to read at lower iterations.
Tips
- Compare this tool side by side with Koch Star at the same iteration count to see exactly how closing the base shape changes the result.
- Rotate or mirror the downloaded SVG in a vector editor to use the curve as a border on any edge of a design.