moved ellipse and egg_outline to regular_shapes.scad
This commit is contained in:
parent
0eab6f1c5a
commit
1b071f5e5c
|
@ -107,5 +107,5 @@ union()
|
|||
//flat_nut(3);
|
||||
//bolt(4,14);
|
||||
//cylinder_chamfer(8,1);
|
||||
//chamfer(5,1);
|
||||
//chamfer(10,2);
|
||||
}
|
||||
|
|
|
@ -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]]);
|
||||
}
|
||||
}
|
||||
|
|
16
shapes.scad
16
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() {
|
||||
|
|
Loading…
Reference in a new issue