Skip to content

Instantly share code, notes, and snippets.

@gazzar
Created April 9, 2023 00:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gazzar/3a1c2e1ccfb05f773de2bf987151a9ef to your computer and use it in GitHub Desktop.
Save gazzar/3a1c2e1ccfb05f773de2bf987151a9ef to your computer and use it in GitHub Desktop.
stl of solid Smith hat monotile
"""
Generates an stl of the Smith aperiodic monotile
https://cs.uwaterloo.ca/~csk/hat/
https://www.sciencenews.org/article/mathematicians-discovered-einstein-tile
"""
import cadquery as cq
from cadquery import exporters
vertices = [
(0, 0),
(-1, -1),
(0, -2),
(2, -2),
(2, -1),
(4, -2),
(5, -1),
(4, 0),
(3, 0),
(2, 2),
(0, 3),
(0, 2),
(-1, 2),
]
monotile_solid = cq.Workplane("XY").polyline(vertices).close().extrude(1)
# Export the solid to an STL file
exporters.export(monotile_solid, "smith_monotile.stl")
exporters.export(monotile_solid, "smith_monotile.svg")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment