Skip to content

polar

4 motifs. Import them from geomotif.motifs, or build one by name with registry.create("points.phyllotaxis").

points.phyllotaxis

points.phyllotaxis

The sunflower head: r = c*sqrt(n) at n golden angles.

from geomotif import save_svg
from geomotif.motifs import Phyllotaxis

motif = Phyllotaxis()
save_svg(motif.build(), "points.phyllotaxis.svg", width=320, height=320)
geomotif render points.phyllotaxis --out points.phyllotaxis.svg
{
  "geomotif": "1.3.1",
  "motif": "points.phyllotaxis",
  "params": {
    "count": 500,
    "spacing": 8.0,
    "angle": 2.399963229728653,
    "center": [
      0.0,
      0.0
    ]
  }
}
Parameters
Name Type Default
count int 500
spacing float 8.0
angle float 2.399963229728653
center Point (0.0, 0.0)

polar.expression

polar.expression

Any radius function you like, wrapped as a motif.

from geomotif import save_svg
from geomotif.motifs import PolarExpression

motif = PolarExpression()
save_svg(motif.build(), "polar.expression.svg", width=320, height=320)
geomotif render polar.expression --out polar.expression.svg

This motif has no spec:

cannot write polar.expression.formula to a spec: a function is not data. A motif parameterized by a Python function is defined by code, and can only be rebuilt in Python -- pass the motif itself rather than a spec
Parameters
Name Type Default Notes
formula Callable[[float], float] a function
center Point (0.0, 0.0)
theta_start float 0.0
theta_span float 6.283185307179586
resolution int | None None Segments per strand -- a strand gets one more point than that, so both ends are included. None (default) scales density with the winding.

rose

rose

The rhodonea r = cos(n/d * theta), with the petal count right.

from geomotif import save_svg
from geomotif.motifs import Rose

motif = Rose()
save_svg(motif.build(), "rose.svg", width=320, height=320)
geomotif render rose --out rose.svg
{
  "geomotif": "1.3.1",
  "motif": "rose",
  "params": {
    "resolution": null,
    "n": 5,
    "d": 1,
    "size": 100.0,
    "center": [
      0.0,
      0.0
    ]
  }
}
Parameters
Name Type Default Notes
n int 5
d int 1
size float 100.0
center Point (0.0, 0.0)
resolution int | None None Segments per strand -- a strand gets one more point than that, so both ends are included. None (default) scales density with the winding.

rose.maurer

rose.maurer

A rose walked in whole-degree steps and joined by straight chords.

from geomotif import save_svg
from geomotif.motifs import MaurerRose

motif = MaurerRose()
save_svg(motif.build(), "rose.maurer.svg", width=320, height=320)
geomotif render rose.maurer --out rose.maurer.svg
{
  "geomotif": "1.3.1",
  "motif": "rose.maurer",
  "params": {
    "n": 6,
    "degrees": 71,
    "size": 100.0,
    "center": [
      0.0,
      0.0
    ]
  }
}
Parameters
Name Type Default
n int 6
degrees int 71
size float 100.0
center Point (0.0, 0.0)