Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added new shape families for Archimedean, Catalan, Johnson, and other solids. #177

Merged
merged 23 commits into from
Mar 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
f0b8598
test: Fix assumption on quaternions.
b-butler Jan 25, 2023
ab21279
Added new classes to return the edges of polyhedra
janbridley Feb 6, 2023
547f512
Added json files for new shape families as well as accompanying impor…
janbridley Feb 10, 2023
b55c4a7
Added new pytest marks and a few test functions.
janbridley Feb 10, 2023
0bdae86
Tightnened tolerance for test_insphere and increased deadline
janbridley Feb 10, 2023
64b8097
Applied test_bounding_sphere to archimedean solids
janbridley Feb 10, 2023
780b116
Tightened tolerance for test_bounding_sphere
janbridley Feb 10, 2023
d904e97
Added marks for prism/antiprism and pyramid/dipyramid families
janbridley Feb 10, 2023
449f674
Applied test_get_set_minimal_centered_bounding_sphere_radius to all n…
janbridley Feb 10, 2023
986da72
Applied test_volume and test_surface_area to prism/antiprism and pyra…
janbridley Feb 10, 2023
292e52f
Formatted code with black.
janbridley Feb 12, 2023
67dfc39
Revert commit "Added new classes to return the edges of polyhedra"
janbridley Feb 13, 2023
5b5fa41
Fixed docstring for common.py
janbridley Feb 13, 2023
145de7b
Merge branch 'master' into release-recalculate_renormalize_platonic
janbridley Feb 13, 2023
73e175a
Split test_insphere into multiple functions based on input data compl…
janbridley Feb 13, 2023
2df65c0
Merge branch 'release-recalculate_renormalize_platonic' of https://gi…
janbridley Feb 13, 2023
40f500c
Increased resilience of minimal_bounding_sphere method
janbridley Feb 13, 2023
9b70d27
Revert "Increased resilience of minimal_bounding_sphere method"
janbridley Feb 27, 2023
f8e69db
Removed unnecessary print statement in the combine_mark function
janbridley Feb 27, 2023
0de4714
Updated Credits.rst to not conflict with master
janbridley Feb 27, 2023
56912b4
Fixed missing space in archimedean.json "Truncated Cuboctahedron"
janbridley Feb 28, 2023
232e403
Added additional pytest for json data and new families
janbridley Mar 23, 2023
e950097
Merge branch 'master' into release-recalculate_renormalize_platonic
vyasr Mar 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Credits.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,13 @@ Tobias Dwyer
* Added examples for the shape classes.

Jen Bradley

* Bug fixes for ``gsd_shape_spec`` to correctly comply with GSD specifications.
* Fixed error where ``__repr__`` would fail for polyhedra with multiple face types.
* Increased accuracy of stored data for PlatonicFamily solids
* Added shape families for Archimedean, Catalan, and Johnson solids.
* Added shape family for prisms and antiprisms.
* Added shape family for equilateral pyramids and dipyramids.

Source code
-----------
Expand Down
15 changes: 14 additions & 1 deletion coxeter/families/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,15 @@
reproducing the exact set of shapes from publications.
"""

from .common import PlatonicFamily, RegularNGonFamily
from .common import (
ArchimedeanFamily,
CatalanFamily,
JohnsonFamily,
PlatonicFamily,
PrismAntiprismFamily,
PyramidDipyramidFamily,
RegularNGonFamily,
)
from .doi_data_repositories import _doi_shape_collection_factory, _KeyedDefaultDict
from .plane_shape_families import (
Family323Plus,
Expand Down Expand Up @@ -53,6 +61,11 @@
"Family423",
"Family523",
"PlatonicFamily",
"ArchimedeanFamily",
"CatalanFamily",
"JohnsonFamily",
"PrismAntiprismFamily",
"PyramidDipyramidFamily",
"RegularNGonFamily",
"ShapeFamily",
"TabulatedShapeFamily",
Expand Down
71 changes: 71 additions & 0 deletions coxeter/families/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,74 @@ def make_vertices(cls, n):
"Icosahedron", "Octahedron", and "Tetrahedron".
""",
)

ArchimedeanFamily = TabulatedGSDShapeFamily.from_json_file(
os.path.join(_DATA_FOLDER, "archimedean.json"),
classname="ArchimedeanFamily",
docstring="""The family of Archimedean solids (13 total).
The following parameters are required by this class:
- name: The name of the ArchimedeanFamily solid. Options are "Cuboctahedron", \
"Icosidodecahedron", "Truncated Tetrahedron", "Truncated Octahedron", \
"Truncated Cube", "Truncated Icosahedron", "Truncated Dodecahedron", \
"Rhombicuboctahedron", "Rhombicosidodecahedron", "Truncated \
Cuboctahedron", "Truncated Icosidodecahedron", "Snub Cuboctahedron", \
and "Snub Icosidodecahedron".
""",
)

CatalanFamily = TabulatedGSDShapeFamily.from_json_file(
os.path.join(_DATA_FOLDER, "catalan.json"),
classname="CatalanFamily",
docstring="""The family of Catalan solids, also known as Archimedean duals
(13 total).
The following parameters are required by this class:
- name: The name of the CatalanFamily solid. Options are "Deltoidal \
Hexecontahedron", "DeltoidalIcositetrahedron", "Disdyakis \
Dodecahedron", "Disdyakis Triacontahedron", "Pentagonal \
Hexecontahedron", "Pentagonal Icositetrahedron", "Pentakis \
Dodecahedron", "Rhombic Dodecahedron", "Rhombic \
Triacontahedron", "Triakis Octahedron", "Tetrakis \
Hexahedron", "Triakis Icosahedron", and "Triakis Tetrahedron".
""",
)

JohnsonFamily = TabulatedGSDShapeFamily.from_json_file(
os.path.join(_DATA_FOLDER, "johnson.json"),
classname="JohnsonFamily",
docstring="""The family of Johnson solids (92 total).
The following parameters are required by this class:
- name: The name of the JohnsonFamily solid. A full list is available in \
10.1126/science.1220869: :cite:`Damasceno2012`. In general, shape names \
should have the first character of each word capitalized, with spaces \
between words (e.g. "Elongated Triangular Cupola"). Pyramids and \
dipyramids are named from their base polygon (e.g. "Square Pyramid" \
or "Elongated Pentagonal Dipyramid").
""",
)


PyramidDipyramidFamily = TabulatedGSDShapeFamily.from_json_file(
os.path.join(_DATA_FOLDER, "pyramid_dipyramid.json"),
classname="PyramidDipyramidFamily",
docstring="""The family of regular equilateral pyramids and dipyramids (6 total).
The following parameters are required by this class:
- name: The name of the pyramid or dipyramid. Options are "Triangular Pyramid", \
"Square Pyramid", "Pentagonal Pyramid", "Triangular Dipyramid", \
"Square Dipyramid", and "Pentagonal Dipyramid".
""",
)

PrismAntiprismFamily = TabulatedGSDShapeFamily.from_json_file(
os.path.join(_DATA_FOLDER, "prism_antiprism.json"),
classname="PrismAntiprismFamily",
docstring="""The family of n-gonal prisms and antiprisms with n∈[3,10] (16 total).
The following parameters are required by this class:
- name: The name of the prism or antiprism. Options for prisms are \
"Triangular Prism", "Square Prism", "Pentagonal Prism", "Hexagonal Prism", \
"Heptagonal Prism", "Octagonal Prism", "Nonagonal Prism", and \
"Decagonal Prism". Options for antiprisms are "Triangular Antiprism", \
"Square Antiprism", "Pentagonal Antiprism", "Hexagonal Antiprism", \
"Heptagonal Antiprism", "Octagonal Antiprism","Nonagonal Antiprism", \
and "Decagonal Antiprism".
""",
)
Loading