moved ellipse and egg_outline to regular_shapes.scad

This commit is contained in:
Timothy Schmidt 2011-01-18 06:38:26 -05:00
parent 0eab6f1c5a
commit 1b071f5e5c
3 changed files with 16 additions and 18 deletions

View file

@ -107,5 +107,5 @@ union()
//flat_nut(3); //flat_nut(3);
//bolt(4,14); //bolt(4,14);
//cylinder_chamfer(8,1); //cylinder_chamfer(8,1);
//chamfer(5,1); //chamfer(10,2);
} }

View file

@ -76,6 +76,20 @@ module dodecagon(radius)
reg_polygon(12,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 //3D regular shapes
module cone(height, radius, center = false) module cone(height, radius, center = false)
@ -185,4 +199,4 @@ module square_pyramid(width,height,depth)
w=width/2; w=width/2;
h=height/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]]); 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]]);
} }

View file

@ -7,8 +7,6 @@
*/ */
// 2D Shapes // 2D Shapes
//ellipse(width, height);
//egg_outline(width=5, length=7);
//ngon(sides, radius, center=false); //ngon(sides, radius, center=false);
// 3D Shapes // 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); 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) { module ellipsoid(w, h, center = false) {
scale([1, h/w, 1]) sphere(r=w/2, center=center); 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 // wall is wall thickness
module tube(height, radius, wall, center = false) { module tube(height, radius, wall, center = false) {
difference() { difference() {