Skip to content
Snippets Groups Projects
Commit 59bafc66 authored by fxk8y's avatar fxk8y :spider:
Browse files

Adding cube module with round edges

parent f37f34c0
No related branches found
No related tags found
No related merge requests found
......@@ -23,6 +23,7 @@ module roundTri(w, h, r, style="inner") {
}
/**
*
* TODO: Moar documentation!
......@@ -41,6 +42,24 @@ module roundRect(w, h, r, center=false, centerX=false, centerY=false) {
}
/**
*
* TODO: Moar documentation!
*
*/
module roundCube(sx, sy, sz, r, center=false, centerX=false, centerY=false, centerZ=false) {
tx = center || centerX ? -sx/2 : 0;
ty = center || centerY ? -sy/2 : 0;
tz = center || centerZ ? -sz/2 : 0;
translate([tx, ty, tz])
if (r > 0)
hull() for (_tx=[r, sx-r], _ty=[r, sy-r], _tz=[r, sz-r]) translate([_tx, _ty, _tz]) sphere(r=r);
else
cube([sx, sy, sz]);
}
/**
*
* TODO: Proper documentation!
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment