Skip to content

Instantly share code, notes, and snippets.

@rocktronica
Last active October 2, 2024 16:20
Show Gist options
  • Save rocktronica/9bf386b416345a472ef2b871b6a45c42 to your computer and use it in GitHub Desktop.
Save rocktronica/9bf386b416345a472ef2b871b6a45c42 to your computer and use it in GitHub Desktop.
module horn_goldilocks_array(
height = 2.5,
plot = 10,
tolerances = [0, .1, .2, .3, .4, .5, .6, .7, .8, .9, 1],
shim_counts = [0, 3, 6]
) {
difference() {
cube([
plot * len(tolerances),
plot * len(shim_counts),
height
]);
for (i_tolerance = [0 : len(tolerances) - 1]) {
for (i_shim_count = [0 : len(shim_counts) - 1]) {
translate([
i_tolerance * plot + plot / 2,
i_shim_count * plot + plot / 2,
0
]) {
// So now we have X and Y as tolerances[i_tolerance] and
// shim_counts[i_shim_count], and they can be used to make
// each individual test.
// Here, for example, they're passed as arguments to an
// external cavity() module.
cavity(
diameter = SERVO_SHAFT_DIAMETER
+ tolerances[i_tolerance] * 2,
shim_count = shim_counts[i_shim_count],
height = height
);
}
}
}
}
}
@rocktronica
Copy link
Author

@DPHAD Oh, nice. I like OpenSCAD a lot. Feel free to email if you need anything else. I'm happy to help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment