Skip to content

Instantly share code, notes, and snippets.

@LeLocTai
Last active February 2, 2021 10:17
Show Gist options
  • Save LeLocTai/cc67ddcd70e2fe11e67f1ffe4cb7c12e to your computer and use it in GitHub Desktop.
Save LeLocTai/cc67ddcd70e2fe11e67f1ffe4cb7c12e to your computer and use it in GitHub Desktop.
function makeBox(w, h, l, thick){
return difference(
cube({size: [w + thick, h+thick, l], center: true}),
translate(
[0,0,thick],
cube({size: [w, h, l], center: true})
)
)
}
function cutOut(toCut, radius, depth, offset){
var start = offset;
var end = [...offset];
end[1] += depth;
return difference(
toCut,
cylinder( {
start,
end,
r1: radius, r2: radius
} )
)
}
function deckbox () {
var box = makeBox(50, 15, 80, 1.6);
return cutOut(box, 25, 10, [0,0,60]);
}
function main () {
return deckbox();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment