Another round corner cube library
thingiverse
I wrote this library while I was working on an OpenSCAD project and thought it might be useful for someone else. It utilizes the built-in $fn functionality of spheres and cylinders to smooth out cube corners. Version: 2014-10-05 Performance updates Another Round Corner Cube Library by Towa Version: 2014-10-05 Instructions: rcorn_cube(size, r, f, center) size : Size of the object like in cube-function r as scalar : Corner radius of a sphere r[r, h] : Corner radius of a sphere and height of an additional, overlayed cylinder r[r, h, t] : Corner radius of a sphere, height of an additional cylinder and vertical translation of the cylinder f : Number of facets of sphere and cylinder center : False if the object should not be centered Examples: translate([0, -60, 0]) rcorn_cube([50, 40, 30], 10, 8); translate([0, 0, 0]) rcorn_cube([50, 40, 30], [8, 4], 24); translate([0, 60, 0]) rcorn_cube([50, 40, 30], [10, 5, -5], 64); // Include in your project with "use "; for (i = [0:2]) { translate([i*70, -60, 0]) rcorn_cube([50, 40 - 2*i, 25 - 4*i], 10, fn = 8, center = false); translate([i*70, 0, 0]) rcorn_cube([50, 40 - 4*i, 25 - 4*i], [8, 4], 24); translate([i*70, 60, 0]) rcorn_cube([50, 40 - 6*i, 25 - 6*i], [10, 5, -5], 64); } function rs = radius sphere() { r0 / cos(90 / ceil($fn / 2)); } function redg edge radius sphere low res() { (ceil($fn / 2) % 2 == 0) ? r0 : rs; } // Corner Translations for the eight corners of a cube hull() { for (i = [0:7]) { corner_transl(i, shm) // Translate to the eight corners of a cube intersection() { // Keep box inside boundaries in any case mirror([(floor(i ) % 2 == 0) ? 0 : 1, (floor(i/2) % 2 == 0) ? 0 : 1, 0]) rotate([0, 0, 45]) union() { // Point towards the middle of sphere and optional cylinder sphere(r = rs, $fn = $fn); if ((len(r) >= 2) && (r[1] > 0)) { translate([0, 0, (len(r) >= 3) ? r[2] : 0]) cylinder(h = 2*r[1], r = redg, $fn = $fn, center = true); } } corner_transl(i, shlim/2) // Translate to the eight corners of a cube cube(shlim, center = true); } }
With this file you will be able to print Another round corner cube library with your 3D printer. Click on the button and save the file on your computer to work, edit or customize your design. You can also find more 3D designs for printers on Another round corner cube library.