solid¶
7 motifs. Import them from geomotif.motifs, or build one by name
with registry.create("solid.cube").
solid.cube¶
Six squares. Dual to the octahedron, and the one everybody can check.
Parameters
| Name | Type | Default |
|---|---|---|
size |
float |
200.0 |
projection |
Projection |
a Projection |
center |
Point |
(0.0, 0.0) |
merge |
bool |
False |
show_nodes |
bool |
False |
solid.dodecahedron¶
Twelve pentagons, built on a cube and the golden ratio.
Parameters
| Name | Type | Default |
|---|---|---|
size |
float |
200.0 |
projection |
Projection |
a Projection |
center |
Point |
(0.0, 0.0) |
merge |
bool |
False |
show_nodes |
bool |
False |
solid.icosahedron¶
Twenty triangles: three golden rectangles at right angles to each other.
Parameters
| Name | Type | Default |
|---|---|---|
size |
float |
200.0 |
projection |
Projection |
a Projection |
center |
Point |
(0.0, 0.0) |
merge |
bool |
False |
show_nodes |
bool |
False |
solid.octahedron¶
Eight triangles: a corner of the cube's every face, joined up.
Parameters
| Name | Type | Default |
|---|---|---|
size |
float |
200.0 |
projection |
Projection |
a Projection |
center |
Point |
(0.0, 0.0) |
merge |
bool |
False |
show_nodes |
bool |
False |
solid.polyhedron¶
Any solid you like: your corners, your edges.
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("solid.polyhedron", **registry.describe("solid.polyhedron").example)
save_svg(motif.build(), "solid.polyhedron.svg", width=320, height=320)
{
"geomotif": "1.3.1",
"motif": "solid.polyhedron",
"params": {
"merge": false,
"show_nodes": false,
"size": 200.0,
"projection": {
"$type": "geomotif.motifs.solids.Projection",
"kind": "isometric",
"yaw": 0.0,
"pitch": 0.0,
"roll": 0.0,
"distance": 3.0
},
"center": [
0.0,
0.0
],
"corners": [
[
1.0,
0.0,
-0.5
],
[
0.0,
1.0,
-0.5
],
[
-1.0,
0.0,
-0.5
],
[
0.0,
-1.0,
-0.5
],
[
0.0,
0.0,
1.1
]
],
"links": [
[
0,
1
],
[
1,
2
],
[
2,
3
],
[
3,
0
],
[
0,
4
],
[
1,
4
],
[
2,
4
],
[
3,
4
]
]
}
}
Parameters
| Name | Type | Default |
|---|---|---|
corners |
tuple[Vertex, ...] |
required |
links |
tuple[tuple[int, int], ...] |
() |
size |
float |
200.0 |
projection |
Projection |
a Projection |
center |
Point |
(0.0, 0.0) |
merge |
bool |
False |
show_nodes |
bool |
False |
solid.tetrahedron¶
Four triangles: the simplest solid there is, and its own dual.
Parameters
| Name | Type | Default |
|---|---|---|
size |
float |
200.0 |
projection |
Projection |
a Projection |
center |
Point |
(0.0, 0.0) |
merge |
bool |
False |
show_nodes |
bool |
False |
solid.truncated-icosahedron¶
The football: twelve pentagons and twenty hexagons.
Parameters
| Name | Type | Default |
|---|---|---|
size |
float |
200.0 |
projection |
Projection |
a Projection |
center |
Point |
(0.0, 0.0) |
merge |
bool |
False |
show_nodes |
bool |
False |