-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
a_pyramid.py
35 lines (29 loc) · 912 Bytes
/
a_pyramid.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from .a_cone import cone
def pyramid(verticies, r1=1, r2=0, depth=1, name='pyramid'):
"""
Create a pyramid with the specified parameters.
:param r1: radius of the base
:param r2: radius of the top
:param depth: height of the pyramid
:param verticies: number of verticies
:param name: name of the pyramid
:return: pyramid
"""
return cone(verticies=verticies, r1=r1, r2=r2, depth=depth, name=name)
def populate():
# populate the scenes with pyramids
# since pyramids are cones n vertices, we can reuse the cone function
m = 2
opt_r2 = [(0, None), (m / 100, f'r2={m / 100}', 'fillet')]
opt_depth = [
(m, f'z-r:{1}'),
(m / 2, f'z-r:{2}')
]
opt_verticies = [
(3, 'triangular', 'tetrahedron'),
(4, 'quadrilateral'),
(5, 'pentagonal'),
(5, 'pentagonal'),
]
if __name__ == "__main__":
pass