Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example of creating a cutout for a 3D object which is pivoting around the origin.
module rotate_extrude3D(clearance, bounds=[1000,1000]) {
rotate_extrude()
intersection() { // clip to positive x axis before rotate_extrude
translate([0,-bounds[1]/2]) square(bounds);
offset(delta=clearance) // add clearance to profile
union() for(a=[-90:$fa:90]) // union projections from multiple angles
projection() rotate([-90,a]) children();
}
}
difference() {
translate([0,0,-10]) cube([100,100,100]);
// assumes object is pointing along positive X axis before sweeping
rotate_extrude3D(clearance=0.5, $fs=1, $fa=1) mything();
}
// View -> animate to show sweeping
%rotate($t*360) mything();
module mything() {
union() {
cube([50,20,2]);
cube([50,2,10]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.