voronoi¶
4 motifs. Import them from geomotif.motifs, or build one by name
with registry.create("voronoi.cells").
voronoi.cells¶
The same map, drawn one closed region at a time.
from geomotif import save_svg
from geomotif.core import registry
# This motif's example takes values that are themselves objects, so it
# reads better through the registry than as a constructor call.
motif = registry.create("voronoi.cells", **registry.describe("voronoi.cells").example)
save_svg(motif.build(), "voronoi.cells.svg", width=320, height=320)
{
"geomotif": "1.3.1",
"motif": "voronoi.cells",
"params": {
"points": [
[
-112.04668940667351,
-118.96603304301992
],
[
-56.962621078405846,
-122.10254853329829
],
[
-19.564719827732432,
-110.37244332349658
],
[
3.319956990988274,
-104.70257067242319
],
[
44.499826337679394,
-107.65417265350456
],
[
87.79421694298476,
-121.3714794662454
],
[
-108.01923243429944,
-49.92591501311848
],
[
-78.04792155401418,
-74.07044141571942
],
[
-15.902671103776427,
-45.09164230171977
],
[
24.084117944699948,
-67.1327810139688
],
[
82.0502042237168,
-81.13669277528975
],
[
119.33873836194718,
-71.41562854673295
],
[
-119.2297966657025,
-36.28831047686526
],
[
-70.66072703592263,
-8.354945635198746
],
[
-33.7709448030425,
-17.73599345350135
],
[
26.556538757047363,
-26.10409829097075
],
[
64.90977862838231,
-38.48844100106707
],
[
87.38404679864931,
-32.76165148722694
],
[
-97.78400107272856,
18.103692226776115
],
[
-70.43411318492834,
24.42247454030555
],
[
-22.872624945168987,
12.990679874547293
],
[
32.77517926089965,
28.95977734918285
],
[
52.76386042888612,
23.97694841034684
],
[
106.00786015245805,
36.00549982293715
],
[
-95.8221884224313,
54.51751059560746
],
[
-43.793006100296715,
47.72263113019849
],
[
-24.27508712859091,
73.28563718260997
],
[
7.0793813864201915,
62.55852401903222
],
[
44.568290281897504,
69.72863426137582
],
[
115.58283464851252,
65.92103761109536
],
[
-89.98088752676446,
97.54990051392387
],
[
-55.188185349053626,
108.77479508420073
],
[
-17.80419182870031,
103.24821325205653
],
[
34.598711220501656,
122.7872438043175
],
[
61.96393349678578,
111.56608821898698
],
[
87.42677710388878,
113.05968085217695
]
],
"region": null,
"inset": 0.12
}
}
Parameters
| Name | Type | Default |
|---|---|---|
points |
Sequence[Point] |
required |
region |
Bounds | None |
None |
inset |
float |
0.0 |
voronoi.delaunay¶
The triangulation that joins points whose Voronoi cells touch.
from geomotif import save_svg
from geomotif.core import registry
# This motif's example takes values that are themselves objects, so it
# reads better through the registry than as a constructor call.
motif = registry.create("voronoi.delaunay", **registry.describe("voronoi.delaunay").example)
save_svg(motif.build(), "voronoi.delaunay.svg", width=320, height=320)
{
"geomotif": "1.3.1",
"motif": "voronoi.delaunay",
"params": {
"merge": false,
"show_nodes": false,
"points": [
[
-112.04668940667351,
-118.96603304301992
],
[
-56.962621078405846,
-122.10254853329829
],
[
-19.564719827732432,
-110.37244332349658
],
[
3.319956990988274,
-104.70257067242319
],
[
44.499826337679394,
-107.65417265350456
],
[
87.79421694298476,
-121.3714794662454
],
[
-108.01923243429944,
-49.92591501311848
],
[
-78.04792155401418,
-74.07044141571942
],
[
-15.902671103776427,
-45.09164230171977
],
[
24.084117944699948,
-67.1327810139688
],
[
82.0502042237168,
-81.13669277528975
],
[
119.33873836194718,
-71.41562854673295
],
[
-119.2297966657025,
-36.28831047686526
],
[
-70.66072703592263,
-8.354945635198746
],
[
-33.7709448030425,
-17.73599345350135
],
[
26.556538757047363,
-26.10409829097075
],
[
64.90977862838231,
-38.48844100106707
],
[
87.38404679864931,
-32.76165148722694
],
[
-97.78400107272856,
18.103692226776115
],
[
-70.43411318492834,
24.42247454030555
],
[
-22.872624945168987,
12.990679874547293
],
[
32.77517926089965,
28.95977734918285
],
[
52.76386042888612,
23.97694841034684
],
[
106.00786015245805,
36.00549982293715
],
[
-95.8221884224313,
54.51751059560746
],
[
-43.793006100296715,
47.72263113019849
],
[
-24.27508712859091,
73.28563718260997
],
[
7.0793813864201915,
62.55852401903222
],
[
44.568290281897504,
69.72863426137582
],
[
115.58283464851252,
65.92103761109536
],
[
-89.98088752676446,
97.54990051392387
],
[
-55.188185349053626,
108.77479508420073
],
[
-17.80419182870031,
103.24821325205653
],
[
34.598711220501656,
122.7872438043175
],
[
61.96393349678578,
111.56608821898698
],
[
87.42677710388878,
113.05968085217695
]
]
}
}
Parameters
| Name | Type | Default |
|---|---|---|
points |
Sequence[Point] |
required |
merge |
bool |
False |
show_nodes |
bool |
False |
voronoi.diagram¶
The map of which point is nearest, drawn as its borders.
from geomotif import save_svg
from geomotif.core import registry
# This motif's example takes values that are themselves objects, so it
# reads better through the registry than as a constructor call.
motif = registry.create("voronoi.diagram", **registry.describe("voronoi.diagram").example)
save_svg(motif.build(), "voronoi.diagram.svg", width=320, height=320)
{
"geomotif": "1.3.1",
"motif": "voronoi.diagram",
"params": {
"merge": false,
"show_nodes": false,
"points": [
[
-112.04668940667351,
-118.96603304301992
],
[
-56.962621078405846,
-122.10254853329829
],
[
-19.564719827732432,
-110.37244332349658
],
[
3.319956990988274,
-104.70257067242319
],
[
44.499826337679394,
-107.65417265350456
],
[
87.79421694298476,
-121.3714794662454
],
[
-108.01923243429944,
-49.92591501311848
],
[
-78.04792155401418,
-74.07044141571942
],
[
-15.902671103776427,
-45.09164230171977
],
[
24.084117944699948,
-67.1327810139688
],
[
82.0502042237168,
-81.13669277528975
],
[
119.33873836194718,
-71.41562854673295
],
[
-119.2297966657025,
-36.28831047686526
],
[
-70.66072703592263,
-8.354945635198746
],
[
-33.7709448030425,
-17.73599345350135
],
[
26.556538757047363,
-26.10409829097075
],
[
64.90977862838231,
-38.48844100106707
],
[
87.38404679864931,
-32.76165148722694
],
[
-97.78400107272856,
18.103692226776115
],
[
-70.43411318492834,
24.42247454030555
],
[
-22.872624945168987,
12.990679874547293
],
[
32.77517926089965,
28.95977734918285
],
[
52.76386042888612,
23.97694841034684
],
[
106.00786015245805,
36.00549982293715
],
[
-95.8221884224313,
54.51751059560746
],
[
-43.793006100296715,
47.72263113019849
],
[
-24.27508712859091,
73.28563718260997
],
[
7.0793813864201915,
62.55852401903222
],
[
44.568290281897504,
69.72863426137582
],
[
115.58283464851252,
65.92103761109536
],
[
-89.98088752676446,
97.54990051392387
],
[
-55.188185349053626,
108.77479508420073
],
[
-17.80419182870031,
103.24821325205653
],
[
34.598711220501656,
122.7872438043175
],
[
61.96393349678578,
111.56608821898698
],
[
87.42677710388878,
113.05968085217695
]
],
"region": null
}
}
Parameters
| Name | Type | Default |
|---|---|---|
points |
Sequence[Point] |
required |
region |
Bounds | None |
None |
merge |
bool |
False |
show_nodes |
bool |
False |
voronoi.lloyd¶
Points nudged toward the middle of their own cells, over and over.
from geomotif import save_svg
from geomotif.core import registry
# This motif's example takes values that are themselves objects, so it
# reads better through the registry than as a constructor call.
motif = registry.create("voronoi.lloyd", **registry.describe("voronoi.lloyd").example)
save_svg(motif.build(), "voronoi.lloyd.svg", width=320, height=320)
{
"geomotif": "1.3.1",
"motif": "voronoi.lloyd",
"params": {
"points": [
[
-108.61915393325378,
-100.4572986578823
],
[
-30.75999561419657,
-107.61059467241722
],
[
-20.404063247267395,
-98.35875300740784
],
[
-2.965813867029375,
-104.09494343282279
],
[
72.87108673647694,
-82.73375768848359
],
[
74.1533826734206,
-119.94150404053606
],
[
-136.10903915062022,
-39.46701538809451
],
[
-48.29867532686583,
-97.8170944358917
],
[
15.64669998070714,
-27.67840863445693
],
[
32.69811254857187,
-54.21723445202862
],
[
36.96955123065234,
-99.85994399183002
],
[
107.15697622895638,
-96.47411600716703
],
[
-128.54417202735738,
-40.612330961443675
],
[
-98.71372321891607,
-23.74098094703038
],
[
-25.519635134094088,
5.024461767408425
],
[
22.453432722069827,
-10.337830198142541
],
[
62.982759567716165,
-8.653835576332021
],
[
101.75707100156637,
-37.859619625544674
],
[
-67.17812876480559,
58.67256476587113
],
[
-37.1436182385425,
36.793531233844156
],
[
-35.03893150681821,
0.4546085222008216
],
[
4.96703599587936,
-11.663014033445634
],
[
83.23787936719094,
13.43038517380532
],
[
131.34035526296958,
12.375028409651023
],
[
-70.18877886769417,
89.39554277101314
],
[
-100.95858478377664,
40.93852351945045
],
[
10.180666535917794,
60.719032977038644
],
[
57.507279529246205,
55.204253494025366
],
[
30.55091413136104,
72.83857332978585
],
[
126.16682525942547,
45.502944600610846
],
[
-136.37704092523506,
92.27650753521445
],
[
-27.730207538873927,
124.61107929152567
],
[
-50.032632364114136,
85.72548411587788
],
[
-9.320480519290413,
71.55189862352182
],
[
85.57363490014203,
80.50353774307582
],
[
109.50643076239001,
101.00429069007764
]
],
"iterations": 6,
"region": null
}
}
Parameters
| Name | Type | Default |
|---|---|---|
points |
Sequence[Point] |
required |
iterations |
int |
3 |
region |
Bounds | None |
None |