From 1b071f5e5cf849f975947f81c7c56aa48f5dfb28 Mon Sep 17 00:00:00 2001 From: Timothy Schmidt Date: Tue, 18 Jan 2011 06:38:26 -0500 Subject: [PATCH] moved ellipse and egg_outline to regular_shapes.scad --- metric_fastners.scad | 2 +- regular_shapes.scad | 16 +++++++++++++++- shapes.scad | 16 ---------------- 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/metric_fastners.scad b/metric_fastners.scad index bafebd2..2849fea 100644 --- a/metric_fastners.scad +++ b/metric_fastners.scad @@ -107,5 +107,5 @@ union() //flat_nut(3); //bolt(4,14); //cylinder_chamfer(8,1); -//chamfer(5,1); +//chamfer(10,2); } diff --git a/regular_shapes.scad b/regular_shapes.scad index b13b86b..0f97169 100644 --- a/regular_shapes.scad +++ b/regular_shapes.scad @@ -76,6 +76,20 @@ module dodecagon(radius) reg_polygon(12,radius); } +module ellipse(width, height) { + scale([1, height/width, 1]) circle(r=width/2); +} + +module egg_outline(width, length){ + union(){ + difference(){ + ellipse(width, 2*length-width); + translate([-length/2, 0, 0]) square(length); + } + circle(r=width/2); + } +} + //3D regular shapes module cone(height, radius, center = false) @@ -185,4 +199,4 @@ module square_pyramid(width,height,depth) w=width/2; h=height/2; polyhedron(points=[[-w,-h,0],[-w,h,0],[w,h,0],[w,-h,0],[0,0,depth]],triangles=[[0,1,2],[0,1,4],[0,1,3],[0,2,3]]); -} \ No newline at end of file +} diff --git a/shapes.scad b/shapes.scad index ae8eac6..9f6b108 100644 --- a/shapes.scad +++ b/shapes.scad @@ -7,8 +7,6 @@ */ // 2D Shapes -//ellipse(width, height); -//egg_outline(width=5, length=7); //ngon(sides, radius, center=false); // 3D Shapes @@ -54,24 +52,10 @@ module ellipticalCylinder(w,h, height, center = false) { scale([1, h/w, 1]) cylinder(h=height, 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, center = false) { scale([1, h/w, 1]) sphere(r=w/2, center=center); } -module egg_outline(width=5, length=7){ - union(){ - difference(){ - ellipse(width, 2*length-width, center=true); - translate([0, length/2, 0]) square(length, center=true); - } - circle(r=width/2, center=true); - } -} - // wall is wall thickness module tube(height, radius, wall, center = false) { difference() {