How do you make an ellipse with a rounded base? February 06, 2015 04:12PM |
Registered: 11 years ago Posts: 14,686 |
Re: How do you make an ellipse with a rounded base? February 07, 2015 02:14AM |
Registered: 10 years ago Posts: 590 |
// elliptic cylinder with rounded top module elrdcyl( w, // width of cylinder d, // depth of cylinder h1,// straight height of cylinder h2 // height of rounded top ) { intersection(){ union(){ scale([w/2,d/2,1])cylinder(r=1,h=h1,$fn=36); // cylinder translate([0,0,h1])scale([w/2,d/2,h2])sphere(r=1,$fn=36); // top } scale([w/2,d/2,1])cylinder(r=1,h=h1+h2,$fn=36); // only needed if h2>h1 } } elrdcyl(50,25,10,20);
Re: How do you make an ellipse with a rounded base? February 07, 2015 02:27AM |
Registered: 10 years ago Posts: 590 |
// elliptic cylinder with rounded base *and* top module elrdcyl2( w, // width of cylinder d, // depth of cylinder h1,// straight height of cylinder h2 // height of rounded base and top ) { hull() for(z=[0,h1]) translate([0,0,z])scale([w/2,d/2,h2])sphere(r=1,$fn=36); // top } elrdcyl2(50,25,10,20);
Re: How do you make an ellipse with a rounded base? February 07, 2015 04:01AM |
Registered: 11 years ago Posts: 14,686 |
Re: How do you make an ellipse with a rounded base? February 07, 2015 04:41AM |
Registered: 11 years ago Posts: 14,686 |
initialRadius = 50; height = 10; rounding = 2; module roundedCylinder(cRadius, cHeight, cRounding) { translate ([0, 0, cRounding]) rotate_extrude (convexity = 10, $fn = 256) translate ([cRadius - cRounding, 0, 0]) circle (r = cRounding); translate ([0, 0, cHeight - cRounding]) rotate_extrude (convexity = 10, $fn = 256) translate ([cRadius - cRounding, 0, 0]) circle (r = cRounding); cylinder(r=cRadius - cRounding, h = cHeight, $fn=256); translate([0, 0, cRounding]) cylinder(r=cRadius, h = cHeight - 2 * cRounding, $fn=256); } scale([0.7,1,1]) roundedCylinder(initialRadius, height, rounding);