From a95c75faeaf31cb907ca451201e387f966ae4b69 Mon Sep 17 00:00:00 2001 From: Elmom Date: Sat, 8 Jan 2011 11:46:57 +0200 Subject: [PATCH] Fixed a missing argument, tests for it, and made the API saner --- shapes.scad | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/shapes.scad b/shapes.scad index bd10730..047a38f 100644 --- a/shapes.scad +++ b/shapes.scad @@ -13,7 +13,7 @@ //roundedBox(width, height, depth, factor); //cone(height, radius); //ellipticalCylinder(width, height, depth); -//ellipsoid(width, height); +//ellipsoid(width, height); //tube(height, radius, wall); //ovalTube(width, height, depth, wall); //hexagon(height, depth); @@ -49,12 +49,12 @@ module ellipticalCylinder(w,h, height, center = false) { scale([1, h/w, 1]) cylinder(h=height, r=w, center=center); } -module ellipse(w, h) { - scale([1, h/w, 1]) circle(r=w, center=center); +module ellipse(w, h, center = false) { + scale([1, h/w, 1]) circle(r=w/2, center=center); } -module ellipsoid(w, h) { - scale([1, h/w, 1]) sphere(r=w, center=center); +module ellipsoid(w, h, center = false) { + scale([1, h/w, 1]) sphere(r=w/2, center=center); } // wall is wall thickness @@ -137,4 +137,9 @@ module 12ptStar(size, height) { //MOVES THE ROTATION AXIS OF A BOX FROM ITS CENTER TO THE BOTTOM LEFT CORNER module dislocateBox(w, h, d) { translate([0,0,-d/2]) cube([w,h,d]); -} \ No newline at end of file +} + +//----------------------- +// Tests +//module test2D_ellipse(){ellipse(10, 5);} +module test_ellipsoid(){ellipsoid(10, 5);}