Created
October 26, 2015 18:28
-
-
Save zeffii/212446b987a0d0aa7dfe to your computer and use it in GitHub Desktop.
pentagonal_trapezohedron
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
def sv_main(radius=0.3, height=1.43, offsetter=0.3): | |
verts_out = [] | |
in_sockets = [ | |
['s', 'radius', radius], | |
['s', 'height', height], | |
['s', 'offsetter', offsetter] | |
] | |
# offsetter = math.sin(height / radius) / 2 | |
theta = math.pi * 2 / 10 | |
sin, cos = math.sin, math.cos | |
for i in range(10): | |
z = -1 if i%2 else 1 | |
z *= offsetter | |
xyz = [sin(theta*i)*radius, cos(theta*i)*radius, z] | |
verts_out.append(xyz) | |
verts_out.append((0, 0, height)) | |
verts_out.append((0, 0, -height)) | |
print(offsetter, height, radius) | |
out_sockets = [ | |
['v', 'verts', [verts_out]] | |
] | |
return in_sockets, out_sockets |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment