Skip to content

Instantly share code, notes, and snippets.

@lf94

lf94/.scad Secret

Created March 13, 2023 19:57
Show Gist options
  • Save lf94/741a60897a91adcb28b3cd64fc31dcda to your computer and use it in GitHub Desktop.
Save lf94/741a60897a91adcb28b3cd64fc31dcda to your computer and use it in GitHub Desktop.
z_min = 0;
z_max = 100;
x_max = 50;
y_max = 105;
slice = 1;
n = floor(sqrt((z_max - z_min)/slice)+1);
for(z = [-z_max:slice:z_min]) {
i = (z + z_max) / slice;
x = x_max * (i % n);
y = y_max * floor(i / n);
intersection() {
translate([x,y,z]) cube([x_max, y_max, 1]);
import("/home/lee/Downloads/2 and 3 repaired.stl");
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment