Rotate extrude help needed April 28, 2022 08:19PM |
Registered: 10 years ago Posts: 24 |
Re: Rotate extrude help needed April 28, 2022 09:37PM |
Admin Registered: 13 years ago Posts: 7,102 |
// chamfercyl - create a cylinder with round chamfered ends module chamfercyl( r, // cylinder radius h, // cylinder height b=0, // bottom chamfer radius (=0 none, >0 outside, <0 inside) t=0, // top chamfer radius (=0 none, >0 outside, <0 inside) offset=[[0,0]], // optional offsets in X and Y to create // convex hulls at slice level slices=10, // number of slices used for chamfering eps=0.01, // tiny overlap of slices ){ astep=90/slices; hull()for(o = offset) translate([o[0],o[1],abs(b)-eps])cylinder(r=r,h=h-abs(b)-abs(t)+2*eps); if(b)for(a=[0:astep:89.999])hull()for(o = offset) translate([o[0],o[1],abs(b)-abs(b)*sin(a+astep)-eps]) cylinder(r2=r+(1-cos(a))*b,r1=r+(1-cos(a+astep))*b,h=(sin(a+astep)-sin(a))*abs(b)+2*eps); if(t)for(a=[0:astep:89.999])hull()for(o = offset) translate([o[0],o[1],h-abs(t)+abs(t)*sin(a)-eps]) cylinder(r1=r+(1-cos(a))*t,r2=r+(1-cos(a+astep))*t,h=(sin(a+astep)-sin(a))*abs(t)+2*eps); } $fn=60; chamfercyl(35/2,3,-0.5,-0.5); // chamfer both edges color("red") translate ([-36,0,0]) chamfercyl(35/2,3,-0.0,-0.5); // chamfer top edge color("blue") translate ([36,0,0]) chamfercyl(35/2,3,-0.5,-0.0); // chamfer bottom edge
Re: Rotate extrude help needed April 28, 2022 10:06PM |
Registered: 10 years ago Posts: 24 |
Re: Rotate extrude help needed April 29, 2022 01:21PM |
Registered: 10 years ago Posts: 24 |
$fn=100; union() { rotate_extrude(convexity = 10) translate([27, 0, 0]) circle(r = 1.5, $fn = 100); } translate([0,0,-1.5]) cylinder(3,27,27);
Re: Rotate extrude help needed July 25, 2022 11:06AM |
Registered: 2 years ago Posts: 4 |
Re: Rotate extrude help needed July 26, 2022 09:22AM |
Registered: 2 years ago Posts: 4 |
Re: Rotate extrude help needed July 27, 2022 03:22PM |
Registered: 10 years ago Posts: 24 |