From db04f4ee722a6de068b7b77b9464fcc10470a468 Mon Sep 17 00:00:00 2001 From: xengineering Date: Sat, 23 Dec 2023 21:16:24 +0100 Subject: mech: pcb_case: Set $fn variables for cylinders This special variable decides on the level of detail these cylinders are rendered with. Since this depends also on the size and thus on the individual cylinder it is also set per cylinder individually. --- mech/pcb_case/rounded_cube.scad | 3 ++- mech/pcb_case/shell.scad | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'mech') diff --git a/mech/pcb_case/rounded_cube.scad b/mech/pcb_case/rounded_cube.scad index 5f1dcee..acd50e7 100644 --- a/mech/pcb_case/rounded_cube.scad +++ b/mech/pcb_case/rounded_cube.scad @@ -5,7 +5,8 @@ module rounded_cube(dim, radius) { hull() { for (y=range_y, z=range_z) { - translate([0,y,z]) rotate([0,90,0]) cylinder(r=radius, h=height); + translate([0,y,z]) rotate([0,90,0]) + cylinder(r=radius, h=height, $fn=30); } } } diff --git a/mech/pcb_case/shell.scad b/mech/pcb_case/shell.scad index ff34061..e7fe345 100644 --- a/mech/pcb_case/shell.scad +++ b/mech/pcb_case/shell.scad @@ -20,7 +20,7 @@ module shell_base(dim, t) { for (x = [dim[0]/4, dim[0]-dim[0]/4]) { translate([x,0,dim[2]/2-1.5*bolt_d]) rotate([-90,0,0]) - cylinder(r=bolt_r, h=1.1*t); + cylinder(r=bolt_r, h=1.1*t, $fn=30); } } } @@ -39,14 +39,14 @@ module shell_connector(dim, t) { for (x = [dim[0]/4, dim[0]-dim[0]/4]) { translate([x,dim[1]-t,dim[2]/2+1.5*bolt_d]) rotate([90,0,0]) - cylinder(r=bolt_r, h=size_y); + cylinder(r=bolt_r, h=size_y, $fn=30); } // nut holes for (x = [dim[0]/4, dim[0]-dim[0]/4]) { translate([x,dim[1]-t-size_y,dim[2]/2+1.5*bolt_d]) rotate([-90,0,0]) - cylinder(r=nut_r, h=nut_h); + cylinder(r=nut_r, h=nut_h, $fn=30); } } @@ -61,13 +61,13 @@ module pcb_case_shell(dim, t, h, sockets) { for (socket = sockets) { echo(socket=socket); translate([socket[0], socket[1], 0]) - cylinder(d=nut_d+2, h=h); + cylinder(d=nut_d+2, h=h, $fn=30); } } for (socket = sockets) { translate([socket[0], socket[1], 0]) { - cylinder(d=bolt_d, h=h); - cylinder(d=0.9*nut_d, h=nut_h); + cylinder(d=bolt_d, h=h, $fn=30); + cylinder(d=0.9*nut_d, h=nut_h, $fn=30); } } } -- cgit v1.2.3-70-g09d2