-
Beta Was this translation helpful? Give feedback.
Answered by
cduck
Sep 3, 2021
Replies: 1 comment 2 replies
-
Yes. The tilings are generated by placing the center polygon then placing the rest adjacent to earlier tiles. You can translate the first polygon off-center to get what you want. It is easy to do this if you already use p1 = 4
p2 = 3
q = 3
theta1, theta2 = math.pi*2/p1, math.pi*2/p2
phiSum = math.pi*2/q
r1 = triangleSideForAngles(theta1/2, phiSum/2, theta2/2)
r2 = triangleSideForAngles(theta2/2, phiSum/2, theta1/2)
tGen1 = htiles.TileGen.makeRegular(p1, hr=r1, skip=1)
tGen2 = htiles.TileGen.makeRegular(p2, hr=r2, skip=1)
tLayout = htiles.TileLayout()
tLayout.addGenerator(tGen1, (1,)*p1)
tLayout.addGenerator(tGen2, (0,)*p2)
# centerCorner=True places the vertex at the center instead of the face
startTile = tLayout.defaultStartTile(rotateDeg=90, centerCorner=True) # <- This line
tiles = tLayout.tilePlane(startTile, depth=4)
d = Drawing(2, 2, origin='center')
d.draw(euclid.shapes.Circle(0, 0, 1), fill='silver')
drawTiles(d, tiles)
d.setRenderSize(w=400)
d.saveSvg('example.svg')
d If you need more customization, you can move the start tile: startTile = startTile.makeTransformed(Transform....()) |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
cduck
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes. The tilings are generated by placing the center polygon then placing the rest adjacent to earlier tiles. You can translate the first polygon off-center to get what you want.
It is easy to do this if you already use
layout.defaultStartTile
to generate the first tile. See the example below (adapted from tiles.ipynb).