Skip to content

Instantly share code, notes, and snippets.

@Stemer114
Stemer114 / polyhole_hollow.scad
Last active May 14, 2017 22:05
polyhole with hollow interior (hollow column)
/* this module makes use of the polyhole library function by nophead (MCAD library)
* MCAD Library - Polyholes Copyright 2011 Nophead (of RepRap fame)
* It is licensed under the terms of Creative Commons Attribution 3.0 Unported.
* https://github.com/SolidCode/MCAD/blob/master/polyholes.scad
*/
function polyhole_hollow_eps() = 0.1; //epsilon environment for non-manifold differences
module polyhole_hollow(
h=10,
do=10, //outer diameter
di=8 //inner diameter
@Stemer114
Stemer114 / stacked_polyholes.scad
Created October 28, 2016 22:05
two polyholes (l1, d1 and l2, d2) stacked on top of each other, with optional support layer in between
//two polyholes (d1, h1 and d2, h2) stacked on top of each other
//can be used for modelling cutouts for cylinder head screws, bearings with axle bore etc.
//out of solid components
module stacked_polyholes(
d1 = 5, //first polyhole (bottom)
l1 = 10,
d2 = 10, //second polyhole (stacked on top)
l2 = 20,
lS = 0 //optional support layer in betwenn (set this to layer thickness for upside down printing)
)
@Stemer114
Stemer114 / slot_hole_asymmetric.scad
Created October 23, 2016 14:49
slot hole (asymmetric)
// slot hole, asymmetric (different dias at ends)
module slot_hole_asymmetric(
w1 = 5, //dia left
w2 = 5, //dia right (if different)
l = 20, //length
h = 5 //thickness
)
{
hull() {
//left
@Stemer114
Stemer114 / countersunk_screw.scad
Created October 23, 2016 14:27
countersunk screw
//counter-sunk screw
//(standing upside down on its head)
//defaults are for 3x20mm torx screw
module countersunk_screw(
l=20, //total length (including head)
dH = 6, //head dia
lH = 3, //head length
dB = 3.2, //bolt dia (with tolerance)
lS = 0 //support thickness if any (set this to layer thickness for upside down printing)
)
@Stemer114
Stemer114 / nut_trap_metric.scad
Last active October 23, 2016 14:31
nut traps metric (predefined, no params necessary)
//metric nut traps (M3 .. M4)
//see https://gist.github.com/Stemer114
// you can use the param functions for e.g. translation ops
// (access to height, thickness etc.)
function nut_trap_eps() = 0.1; //epsilon environment for non-manifold differences
function nut_trap_m3_w() = 5.5; //M3 wrench size
function nut_trap_m3_h() = 3; //M3 nut thickness
function nut_trap_m3nyloc_h() = 4.1; //M3 nyloc nut thickness
function nut_trap_m4_w() = 7; //M4 .. (and so on)
@Stemer114
Stemer114 / polyhole_half.scad
Last active September 13, 2015 19:23
polyhole half
/* this module makes use of the polyhole library function by nophead (MCAD library)
* MCAD Library - Polyholes Copyright 2011 Nophead (of RepRap fame)
* It is licensed under the terms of Creative Commons Attribution 3.0 Unported.
* https://github.com/SolidCode/MCAD/blob/master/polyholes.scad
*/
module polyhole_half(
h=10,
d=10
)
{
@Stemer114
Stemer114 / difference_of_unions.scad
Created August 10, 2015 21:29
difference of unions
/*
* module template for creating complex structures in openscad
* uses a difference of two unions
* the first union contains all openscad entities that make up the
* outline of the object
* the second union is for shaping by cutting away
*/
module foo()
{
difference()
@Stemer114
Stemer114 / template_simple.scad
Created August 9, 2015 10:15
template simple (without params or flags)
/*-----------------------------------------------------------------------------------
simple template for scad models without flags or params
(c) 2015 by Stemer114 (stemer114@gmail.com)
http://www.thingiverse.com/Stemer114/designs
License: licensed under the
Creative Commons - Attribution - Share Alike license.
http://creativecommons.org/licenses/by-sa/3.0/
Credits:
@Stemer114
Stemer114 / hexhead_screw.scad
Last active August 29, 2015 14:26
screw with hex head
// screw with hex head
// useful for modelling attachment bores
// with nut trap
// default values are for M3 (5.5mm head) screw 20mm (3.2mm bore for tolerance)
// param membrane thickness is for additional layer between head and shaft,
// for upside down printing, usually set this to your layer thickness
module hexhead_screw(
length=20, //per definition, excluding head
head_wrenchsize = 5.6,
head_thickness = 3,
@Stemer114
Stemer114 / right_triangle.scad
Created July 16, 2015 21:19
right triangle
// right triangle
// side a oriented in x direction
// side b oriented in y direction
// height is in z direction
module right_triangle(
a = 10, //side a (x direction)
b = 10, //side b (y direction)
thickness = 5 //thickness (z-direction)
)
{