summaryrefslogtreecommitdiff
path: root/make.py
diff options
context:
space:
mode:
Diffstat (limited to 'make.py')
-rw-r--r--make.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/make.py b/make.py
index 29f0a04..f30042a 100644
--- a/make.py
+++ b/make.py
@@ -2,7 +2,7 @@ import numpy as np
from geometry import Mesh
from transform import rotate
-def rotate_extrude(x, y, theta=np.pi/32):
+def rotate_extrude(x, y, theta=np.pi/32, remove_duplicate_vertices=True):
x, y, = np.asarray(x), np.asarray(y)
if len(x.shape) != 1 or len(y.shape) != 1 or x.size != y.size:
@@ -34,7 +34,7 @@ def rotate_extrude(x, y, theta=np.pi/32):
triangles[start+step:start+2*step,2] = np.arange(this_slice+1, this_slice+len(points))
triangles[start+step:start+2*step,1] = np.arange(next_slice+1, next_slice+len(points))
- return Mesh(vertices, triangles, remove_duplicate_vertices=True)
+ return Mesh(vertices, triangles, remove_duplicate_vertices=remove_duplicate_vertices)
def cube(size=1):
a = np.sqrt(size**2/2.0)
@@ -49,7 +49,7 @@ def cylinder(radius1=1, radius2=1, height=2, theta=np.pi/32):
def sphere(radius=1, theta=np.pi/32):
profile_angles = np.arange(-np.pi/2, np.pi/2+theta, theta)
- return rotate_extrude(np.cos(profile_angles), np.sin(profile_angles), theta)
+ return rotate_extrude(radius*np.cos(profile_angles), radius*np.sin(profile_angles), theta)
def torus(radius=1, offset=3, phi=np.pi/32, theta=np.pi/32):
profile_angles = np.arange(0, 2*np.pi+phi, phi)