Last active
February 4, 2024 22:21
-
-
Save patmandenver/4a2368925e83552ab7453e30ecdbefe4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$fn=100; | |
grand_teton="grand_tetons.stl"; | |
adjust=[0,0,2]; // X,Y,Z adjustments | |
just_display=false; //Set to false to split | |
split=true;//Set to false to adjust | |
//Split size in mm | |
edge=20; | |
//split per side | |
split_per_side=5; | |
//Total squares | |
square_max=split_per_side*split_per_side; | |
chosen_square=12; // <== Change me to chosen square | |
X = chosen_square % split_per_side; | |
Y = floor(chosen_square / split_per_side); | |
//Caclulate zero point in upper right | |
X_ZERO = (split_per_side * edge)/2; | |
Y_ZERO = -X_ZERO; | |
echo(X); | |
echo(Y); | |
if(just_display){ | |
translate(adjust){ | |
import(grand_teton, convexity=3); | |
} | |
} | |
else{ | |
intersection(){ | |
translate([adjust[0] + X_ZERO, | |
adjust[1] + Y_ZERO, | |
adjust[2]]){ | |
import(grand_teton, convexity=3); | |
} | |
if(split){ | |
linear_extrude(1000){ | |
translate([X*edge,-Y*edge-edge]){ | |
square(edge); | |
} | |
} | |
} | |
else{ | |
//Remove nothing | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you probably know this, but thought I would mention it just in case:
at lines 37-39, you can replace those array indexes with
.d
whered
is the axis, likeI'm not sure if that makes it easier, or harder, for readers who aren't already code monkeys, but I lean towards "maybe" lol