Create a variety of wonderful fractals and curves in Typst.
Examples
![]() | ![]() | ![]() |
Dragon Curve | Koch Snowflake | Sierpiński Triangle |
![]() | ![]() | ![]() |
Hypotrochoid | Random Fractal Tree | Pythagorean Tree |
Click on the example image to jump to the code.
Features
- Generate fractals using L-system. The grammar, number of iterations, drawing styles, etc. could be customized.
- Over 30 preset parameters are provided for the L-system to facilitate the drawing of fractals.
- Generate fractals using iterative methods, including Fibonacci word fractal and Z-order curve.
- Generate fractals using recursive methods, including various fractal trees and Sierpiński carpet.
- Generate parametric curves, such as spirographs and Lissajous curves.
Usage
Import the latest version of this package with:
#import "@preview/fractusist:0.3.1": *
Each drawing function generates a type of fractal or curve, with a variety of configurable parameters.
For more information, see the manual.
This package comes with some unit tests under the tests directory.