Skip to content

Commit

Permalink
moved ellipse and egg_outline to regular_shapes.scad
Browse files Browse the repository at this point in the history
  • Loading branch information
timschmidt committed Jan 18, 2011
1 parent 0eab6f1 commit 1b071f5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 18 deletions.
2 changes: 1 addition & 1 deletion metric_fastners.scad
Expand Up @@ -107,5 +107,5 @@ union()
//flat_nut(3);
//bolt(4,14);
//cylinder_chamfer(8,1);
//chamfer(5,1);
//chamfer(10,2);
}
16 changes: 15 additions & 1 deletion regular_shapes.scad
Expand Up @@ -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)
Expand Down Expand Up @@ -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]]);
}
}
16 changes: 0 additions & 16 deletions shapes.scad
Expand Up @@ -7,8 +7,6 @@
*/

// 2D Shapes
//ellipse(width, height);
//egg_outline(width=5, length=7);
//ngon(sides, radius, center=false);

// 3D Shapes
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit 1b071f5

Please sign in to comment.