Trouble with the curve January 22, 2018 03:32PM |
Registered: 10 years ago Posts: 24 |
Re: Trouble with the curve January 23, 2018 03:13AM |
Registered: 10 years ago Posts: 590 |
module cylbezel( l, // length h, // height w, // thickness a // arch rise (y-offset in center, >0) ){ //compute radius from arch rise r=l*l/(8*a)+a/2; intersection(){ translate([-l/2,0,0])cube([l,a+w,h]); translate([0,r,-1])difference(){ cylinder(r=r,h=h+2); cylinder(r=r-w,h=h+2); } } } cylbezel(l=100,h=50,w=0.8,a=15,$fn=360);
Re: Trouble with the curve January 23, 2018 08:01AM |
Registered: 10 years ago Posts: 24 |
Quote
enif
I tried to understand what exactly you are trying to build... Is it something like this?
If so, I built it as the intersection of a cube with the difference of 2 cylinders as follows:
module cylbezel( l, // length h, // height w, // thickness a // arch rise (y-offset in center, >0) ){ //compute radius from arch rise r=l*l/(8*a)+a/2; intersection(){ translate([-l/2,0,0])cube([l,a+w,h]); translate([0,r,-1])difference(){ cylinder(r=r,h=h+2); cylinder(r=r-w,h=h+2); } } } cylbezel(l=100,h=50,w=0.8,a=15,$fn=360);