diff options
author | Stan Seibert <stan@mtrr.org> | 2011-10-05 13:44:04 -0400 |
---|---|---|
committer | Stan Seibert <stan@mtrr.org> | 2011-10-05 13:44:04 -0400 |
commit | 7293920b234dd7c20dc698bee65d5e9e359380c9 (patch) | |
tree | 141b520313fec14dc1d22a1ffc4e60c5d7c2b27f | |
parent | af1ba15919bbc4534980b31d896e173673370aaa (diff) | |
download | chroma-7293920b234dd7c20dc698bee65d5e9e359380c9.tar.gz chroma-7293920b234dd7c20dc698bee65d5e9e359380c9.tar.bz2 chroma-7293920b234dd7c20dc698bee65d5e9e359380c9.zip |
Default values for required arguments in the make.* functions creates confusion.
-rw-r--r-- | chroma/make.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/chroma/make.py b/chroma/make.py index 0623b2b..2c3155a 100644 --- a/chroma/make.py +++ b/chroma/make.py @@ -76,14 +76,14 @@ def box(dx, dy, dz, center=(0,0,0)): "Return a box with linear dimensions `dx`, `dy`, and `dz`." return linear_extrude([-dx/2.0,dx/2.0,dx/2.0,-dx/2.0],[-dy/2.0,-dy/2.0,dy/2.0,dy/2.0],height=dz,center=center) -def cube(size=1, height=None, center=(0,0,0)): +def cube(size, height=None, center=(0,0,0)): "Return a cube mesh whose sides have length `size`." if height is None: height = size return linear_extrude([-size/2.0,size/2.0,size/2.0,-size/2.0],[-size/2.0,-size/2.0,size/2.0,size/2.0], height=size, center=center) -def cylinder(radius=1, height=2, radius2=None, nsteps=64): +def cylinder(radius, height, radius2=None, nsteps=64): """ Return a cylinder mesh with a radius of length `radius`, and a height of length `height`. If `radius2` is specified, return a cone shaped cylinder @@ -94,7 +94,7 @@ def cylinder(radius=1, height=2, radius2=None, nsteps=64): return rotate_extrude([0,radius,radius2,0], [-height/2.0, -height/2.0, height/2.0, height/2.0], nsteps) -def segmented_cylinder(radius, height=2, nsteps=64, nsegments=100): +def segmented_cylinder(radius, height, nsteps=64, nsegments=100): """ Return a cylinder mesh segmented into `nsegments` points along its profile. """ @@ -104,12 +104,12 @@ def segmented_cylinder(radius, height=2, nsteps=64, nsegments=100): y = np.concatenate([[-height/2.0]*nsegments_radius,np.linspace(-height/2.0,height/2.0,nsegments_height,endpoint=False),[height/2.0]*(nsegments_radius+1)]) return rotate_extrude(x, y, nsteps) -def sphere(radius=1, nsteps=64): +def sphere(radius, nsteps=64): "Return a sphere mesh." profile_angles = np.linspace(-np.pi/2, np.pi/2, nsteps) return rotate_extrude(radius*np.cos(profile_angles), radius*np.sin(profile_angles), nsteps) -def torus(radius=1, offset=3, nsteps=64, circle_steps=None): +def torus(radius, offset, nsteps=64, circle_steps=None): """ Return a torus mesh. `offset` is the distance from the center of the torus to the center of the torus barrel. `radius` is the radius of the torus |