Skip to content

Instantly share code, notes, and snippets.

module slot_hole(
width = 5, //width/dia at ends
length = 20, //length
thickness = 5 //thickness
)
{
hull() {
translate([-length/2+width/2, 0, 0]) polyhole(h=thickness, d=width);
translate([length/2-width/2, 0, 0]) polyhole(h=thickness, d=width);
}
@Stemer114
Stemer114 / nut_trap.scad
Last active February 1, 2023 22:07
openscad nut trap module
//nut trap
//default values are for M3 nut
//if you use this module as a nut trap cutout, you need to add +de (ie 0.1mm or similiar) to height
//in order to get non-manifold cutouts
module nut_trap (
w = 5.5,
h = 3
)
{
cylinder(r = w / 2 / cos(180 / 6) + 0.05, h=h, $fn=6);
@Stemer114
Stemer114 / tribeam.scad
Created February 22, 2015 19:55
openscad modules for tribeams (rectangular beams with triangular support underneath, for overhanging printing)
/* beam with triangular support underneath,
* length direction is x
* beam dimensions are w, h1
* support (triangle) height is h2
* the beam is centered around the center of the rectangle
*/
module tribeam_x(
w = 10, //width
h1 = 10, //height of rectangular sub-beam
h2 = 5, //height of triangular sub-beam
@Stemer114
Stemer114 / beams.scad
Last active August 29, 2015 14:15
modules for beams (just long cubes, really, but axis-centered and parametric, therefore easy to use)
// beam with length in x direction
// it is centered along its central axis at the x axis
module beam_x(
wy = 10, //width
wz = 10, //height
l = 100 //length
)
{
translate([0, -wy/2, -wz/2])
cube([l, wy, wz]);
@Stemer114
Stemer114 / ring.scad
Created February 16, 2015 21:25
openscad ring (with cutout)
// ring with cutout
// default values are for 1mm height, 10mm outside diameter and 5mm cutout
// de is epsilon environment to make cutouts non-manifold
module ring(
h=1,
od = 10,
id = 5,
de = 0.1
)
{
@Stemer114
Stemer114 / screw_countersunk.scad
Created February 16, 2015 21:22
openscad module to model countersunk screw (with head), useful for subtracting when constructing attachment bores
// model countersunk screw for 3d printing
// useful for creating attachement bores
// which fit these screws
// default values are for 3mm x 20mm screw with 6mm head (3.2mm bore for tolerance)
module screw_countersunk(
l=20, //length
dh = 6, //head dia
lh = 3, //head length
ds = 3.2, //shaft dia
)