Cesaro Polyflake Generator
Generate stunning Cesaro polyflake fractals with customizable polygon sides, recursion depth, scale factor, and colors. Export as PNG or SVG.
About
Cesaro polyflakes belong to a family of self-similar fractals constructed by recursive edge subdivision. The generation process starts with a regular n-gon and applies the Cesaro curve transformation to each edge: every straight segment is replaced by a bent polyline with a controlled "bump" whose height is determined by the scale factor s. After d iterations, the boundary explodes into 3d segments per original edge, creating intricate snowflake-like patterns. The fractal dimension D depends on the subdivision ratio and lies between 1 and 2 for most configurations. Incorrect parameter choices produce either visually uninteresting blobs (scale too low) or computationally intractable vertex counts (depth too high). This generator computes vertex coordinates using affine transformations in a Web Worker, preventing browser freezes even at depth 7 with 10,000+ vertices.
Real-world applications include procedural texture generation for games, laser-cut artwork templates, and educational demonstrations of iterated function systems. The classic Koch snowflake is a special case: a 3-sided polyflake with scale factor 1/3 and bump angle 60°. Cesaro variants generalize this by allowing arbitrary bump angles and polygon bases. Note: at depth 8 with a hexagon base, the generator produces over 1.5 million line segments - expect render times of several seconds.
Formulas
The Cesaro polyflake is generated by recursively applying an edge-replacement rule to a regular polygon. Each line segment AB is replaced by a three-segment polyline A→P→Q→B, where P and Q lie at fractional positions along the segment and the midpoint is displaced perpendicular to the original line.
The bump point C is computed by rotating the vector from M perpendicular to segment AB and scaling by factor s:
where n is the unit normal to segment AB. The perpendicular direction is computed via 90° rotation:
For the classic Cesaro curve with bump angle θ, the intermediate points P and Q are positioned at fractions along AB:
where t = 12 ⋅ (1 + cosθ). The fractal dimension D of the resulting curve is:
where D = fractal dimension, θ = bump angle in radians. For Koch snowflake (θ = π/3), this yields D ≈ 1.2619. Vertex count after d iterations starting from an n-gon:
Reference Data
| Configuration Name | Polygon Sides (n) | Scale Factor (s) | Bump Angle (θ) | Fractal Dimension | Visual Character |
|---|---|---|---|---|---|
| Koch Snowflake | 3 | 0.333 | 60° | 1.2619 | Classic triangular snowflake |
| Cesaro Triangle | 3 | 0.5 | 85° | 1.7848 | Spiky, aggressive peaks |
| Quadratic Koch | 4 | 0.333 | 90° | 1.5 | Square-based snowflake |
| Cesaro Square | 4 | 0.4 | 70° | 1.6309 | Rounded square pattern |
| Pentagon Flake | 5 | 0.382 | 72° | 1.4404 | Golden ratio harmony |
| Hexagonal Flake | 6 | 0.333 | 60° | 1.2619 | Honeycomb snowflake |
| Cesaro Hexagon | 6 | 0.45 | 55° | 1.5812 | Dense organic pattern |
| Heptagonal Flake | 7 | 0.35 | 51.43° | 1.3562 | Seven-fold symmetry |
| Octagonal Flake | 8 | 0.333 | 45° | 1.2619 | Eight-pointed star |
| Cesaro Octagon | 8 | 0.5 | 67.5° | 1.7712 | Highly intricate rosette |
| Nonagonal Flake | 9 | 0.3 | 40° | 1.1949 | Nine-fold subtle pattern |
| Decagonal Flake | 10 | 0.35 | 36° | 1.3219 | Ten-pointed complexity |
| Anti-Snowflake | 3 | 0.333 | -60° | 1.2619 | Inward-facing bumps |
| Shallow Cesaro | 4 | 0.15 | 80° | 1.0875 | Nearly smooth polygon |
| Deep Cesaro | 5 | 0.6 | 50° | 1.8617 | Maximum complexity |
| Minimal Triangle | 3 | 0.1 | 30° | 1.0269 | Barely perturbed triangle |
| Dodecagonal Flake | 12 | 0.333 | 30° | 1.2619 | Twelve-fold mandala |
| Asymmetric Cesaro | 6 | 0.4 | 75° | 1.6781 | Irregular organic feel |
| Low-Depth Sharp | 4 | 0.5 | 90° | 1.5 | Bold angular at depth 2 |
| High-Depth Smooth | 8 | 0.2 | 45° | 1.1292 | Subtle detail at depth 6 |