Skip to content

Instantly share code, notes, and snippets.

@odyzzeus
Created March 12, 2023 11:17
Show Gist options
  • Save odyzzeus/7ff76fad035e36600c47c6662e1fe4bb to your computer and use it in GitHub Desktop.
Save odyzzeus/7ff76fad035e36600c47c6662e1fe4bb to your computer and use it in GitHub Desktop.
module minkowskiCorr(x,y,r,h)
{
difference()
{
translate([r,r,0]) // corrects for origin shift
{
minkowski()
{
cube([x-2*r,y-2*r,h]); //cube reduced by twice the radius which is added by minkowski method
cylinder(h=h,r=r);
}
}
translate([0,0,h]) // cuts off the top, since minkowski method doubles the height
{
cube([x,y,h]);
}
}
}
// example
minkowskiCorr(40,30,6,10);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment