40 lines
778 B
OpenSCAD
40 lines
778 B
OpenSCAD
|
|
module torus(major_radius, minor_radius, $fn=10) {
|
||
|
|
rotate_extrude(convexity = 10)
|
||
|
|
translate([major_radius, 0, 0])
|
||
|
|
circle(r = minor_radius);
|
||
|
|
}
|
||
|
|
|
||
|
|
module rounded_cube() {
|
||
|
|
minkowski() {
|
||
|
|
|
||
|
|
|
||
|
|
union(){
|
||
|
|
sphere(r=2, $fn=10);
|
||
|
|
/*
|
||
|
|
difference(){
|
||
|
|
rotate([180, 0, 0])
|
||
|
|
cylinder(d = 10, h = 3, $fn=10);
|
||
|
|
torus(major_radius = 5, minor_radius = 3);
|
||
|
|
}
|
||
|
|
*/
|
||
|
|
}
|
||
|
|
|
||
|
|
cube([10, 10, 10]); // Base shape
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
rounded_cube();
|
||
|
|
// Example usage
|
||
|
|
/*
|
||
|
|
union(){
|
||
|
|
sphere(r=2, $fn=100);
|
||
|
|
difference(){
|
||
|
|
rotate([180, 0, 0])
|
||
|
|
cylinder(d = 10, h = 3, $fn=100);
|
||
|
|
torus(major_radius = 5, minor_radius = 3);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
*/
|
||
|
|
|