How to fix rendering problem February 22, 2021 04:05AM |
Registered: 11 years ago Posts: 782 |
Re: How to fix rendering problem February 22, 2021 04:34AM |
Admin Registered: 14 years ago Posts: 7,178 |
height = 10; //height radius = 35; angles = [40, 360]; fn = 9; tol = 0.2; a = 180 / fn; r = radius / cos(a); module round(){ difference(){ cylinder(h=height,r=radius+1); translate([0,0,-tol]) cylinder (h=height+2*tol,r=radius-1,$fn=100); } } module sector(radius, angles, fn = 9) { r = radius / cos(180 / fn); step = -360 / fn; //points = concat([[0, 0]], //[for(a = [angles[0] : step : angles[1] - 360]) //[r * cos(a), r * sin(a)] //], //[[r * cos(angles[1]), r * sin(angles[1])]] //); cylinder(h=height, r = radius, $fn = fn); } module cutout(){ difference(){ translate([0,0,-height]) scale([1,1,height])sector(radius, angles, fn); translate([0,0,-height/2]) round(); } } module combine(){ difference(){ cube([80,80,height],center=true); translate ([-2,radius-3,-2])cube([4,10,8]);//cable slot } } difference(){ combine(); rotate([0,0,30]) cutout(); }
Re: How to fix rendering problem February 22, 2021 04:45AM |
Registered: 11 years ago Posts: 782 |