Skip to content

Instantly share code, notes, and snippets.

@tofarley
Last active August 20, 2018 17:54
Show Gist options
  • Save tofarley/4fec49cc3a6363dbf430e9c473406b3f to your computer and use it in GitHub Desktop.
Save tofarley/4fec49cc3a6363dbf430e9c473406b3f to your computer and use it in GitHub Desktop.
Example openscad
// Ensure objects have a sufficient number of faces.
$fn = 30;
// Draw a flat panel 100mm * 100mm * 3mm and then remove 3mm holes for screws.
panel_size = 100;
screw_size = 3;
screw_distance_from_edge = 10;
difference() {
cube([panel_size,panel_size,3]);
translate([screw_distance_from_edge,screw_distance_from_edge,-1]) {
cylinder(d=screw_size, h=5);
}
translate([screw_distance_from_edge,panel_size-screw_distance_from_edge,-1]) {
cylinder(d=screw_size, h=5);
}
translate([panel_size-screw_distance_from_edge,screw_distance_from_edge,-1]) {
cylinder(d=screw_size, h=5);
}
translate([panel_size-screw_distance_from_edge,panel_size-screw_distance_from_edge,-1]) {
cylinder(d=screw_size, h=5);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment