fractal¶
23 motifs. Import them from geomotif.motifs, or build one by name
with registry.create("fractal.apollonian").
fractal.apollonian¶
Circles packed into circles, filling every gap they leave.
Parameters
| Name | Type | Default |
|---|---|---|
depth |
int |
5 |
radius |
float |
150.0 |
min_radius |
float |
0.004 |
center |
Point |
(0.0, 0.0) |
fractal.cantor¶
Take out the middle third. Repeat. Stack the rounds to see it happen.
Parameters
| Name | Type | Default |
|---|---|---|
depth |
int |
6 |
width |
float |
240.0 |
gap |
float |
14.0 |
center |
Point |
(0.0, 0.0) |
fractal.dragon¶
The Heighway dragon: fold a strip of paper in half, repeatedly, unfold.
Parameters
| Name | Type | Default |
|---|---|---|
depth |
int |
10 |
step |
float |
1.0 |
start_angle |
float |
0.0 |
fractal.gosper¶
The flowsnake: a space-filling curve on a hexagonal grid.
Parameters
| Name | Type | Default |
|---|---|---|
depth |
int |
4 |
step |
float |
1.0 |
start_angle |
float |
0.0 |
fractal.h-tree¶
An H whose serifs are smaller H's, and so on down.
Parameters
| Name | Type | Default |
|---|---|---|
depth |
int |
6 |
size |
float |
220.0 |
center |
Point |
(0.0, 0.0) |
fractal.hilbert¶
The space-filling curve that keeps neighbours together.
Parameters
| Name | Type | Default |
|---|---|---|
depth |
int |
5 |
step |
float |
1.0 |
start_angle |
float |
0.0 |
fractal.koch¶
The original: replace the middle third of every segment with a spike.
Parameters
| Name | Type | Default |
|---|---|---|
depth |
int |
4 |
step |
float |
1.0 |
start_angle |
float |
0.0 |
fractal.koch-antisnowflake¶
The snowflake with its spikes turned inward, which is a different shape.
Parameters
| Name | Type | Default |
|---|---|---|
depth |
int |
4 |
step |
float |
1.0 |
start_angle |
float |
0.0 |
fractal.koch-snowflake¶
Three Koch curves around a triangle: finite area, infinite perimeter.
Parameters
| Name | Type | Default |
|---|---|---|
depth |
int |
4 |
step |
float |
1.0 |
start_angle |
float |
0.0 |
fractal.levy-c¶
Paul Levy's C curve: two half-size copies at right angles, forever.
Parameters
| Name | Type | Default |
|---|---|---|
depth |
int |
10 |
step |
float |
1.0 |
start_angle |
float |
0.0 |
fractal.minkowski¶
Koch's idea on a square grid: a battlement instead of a spike.
Parameters
| Name | Type | Default |
|---|---|---|
depth |
int |
3 |
step |
float |
1.0 |
start_angle |
float |
0.0 |
fractal.minkowski-island¶
Four Minkowski sausages around a square: the quadratic Koch island.
Parameters
| Name | Type | Default |
|---|---|---|
depth |
int |
3 |
step |
float |
1.0 |
start_angle |
float |
0.0 |
fractal.moore¶
Hilbert's curve closed into a loop.
Parameters
| Name | Type | Default |
|---|---|---|
depth |
int |
4 |
step |
float |
1.0 |
start_angle |
float |
0.0 |
fractal.peano¶
The first space-filling curve ever published, from 1890.
Parameters
| Name | Type | Default |
|---|---|---|
depth |
int |
3 |
step |
float |
1.0 |
start_angle |
float |
0.0 |
fractal.pythagoras-tree¶
Squares on the legs of right triangles, all the way up.
Parameters
| Name | Type | Default |
|---|---|---|
depth |
int |
8 |
size |
float |
60.0 |
lean |
float |
0.7853981633974483 |
base |
Point |
(0.0, 0.0) |
fractal.sierpinski-arrowhead¶
The gasket approached along a curve instead of through a triangle.
Parameters
| Name | Type | Default |
|---|---|---|
depth |
int |
6 |
step |
float |
1.0 |
start_angle |
float |
0.0 |
fractal.sierpinski-carpet¶
A square with its middle ninth removed, then again in each ninth.
Parameters
| Name | Type | Default |
|---|---|---|
depth |
int |
4 |
size |
float |
200.0 |
center |
Point |
(0.0, 0.0) |
fractal.sierpinski-triangle¶
The gasket, drawn as one unbroken stroke that closes on itself.
Parameters
| Name | Type | Default |
|---|---|---|
depth |
int |
5 |
step |
float |
1.0 |
start_angle |
float |
0.0 |
fractal.terdragon¶
The dragon done in thirds: one segment becomes three at 120 degrees.
Parameters
| Name | Type | Default |
|---|---|---|
depth |
int |
6 |
step |
float |
1.0 |
start_angle |
float |
0.0 |
fractal.twindragon¶
Two Heighway dragons back to back, enclosing a region that tiles.
Parameters
| Name | Type | Default |
|---|---|---|
depth |
int |
9 |
step |
float |
1.0 |
start_angle |
float |
0.0 |
fractal.vicsek¶
The box fractal: a plus sign made of plus signs.
Parameters
| Name | Type | Default |
|---|---|---|
depth |
int |
3 |
step |
float |
1.0 |
start_angle |
float |
0.0 |
points.barnsley-fern¶
Four affine maps and a coin, producing a fern.
Parameters
| Name | Type | Default |
|---|---|---|
count |
int |
40000 |
size |
float |
300.0 |
seed |
int |
0 |
center |
Point |
(0.0, 0.0) |
points.ifs¶
The chaos game: pick a map at random, apply it, plot the point, repeat.
{
"geomotif": "1.3.1",
"motif": "points.ifs",
"params": {
"maps": [
{
"$type": "geomotif.motifs.fractals.IFSMap",
"transform": {
"$type": "geomotif.core.transform.Affine",
"a": 0.5,
"b": 0.0,
"c": 0.0,
"d": 0.5,
"e": 0.0,
"f": 0.0
},
"weight": 1.0
},
{
"$type": "geomotif.motifs.fractals.IFSMap",
"transform": {
"$type": "geomotif.core.transform.Affine",
"a": 0.5,
"b": 0.0,
"c": 0.0,
"d": 0.5,
"e": 0.5,
"f": 0.0
},
"weight": 1.0
},
{
"$type": "geomotif.motifs.fractals.IFSMap",
"transform": {
"$type": "geomotif.core.transform.Affine",
"a": 0.5,
"b": 0.0,
"c": 0.0,
"d": 0.5,
"e": 0.25,
"f": 0.4330127018922193
},
"weight": 1.0
}
],
"count": 4000,
"size": 240.0,
"seed": 0,
"center": [
0.0,
0.0
]
}
}
Parameters
| Name | Type | Default |
|---|---|---|
maps |
tuple[IFSMap, ...] |
a tuple |
count |
int |
20000 |
size |
float |
240.0 |
seed |
int |
0 |
center |
Point |
(0.0, 0.0) |