summaryrefslogtreecommitdiff
path: root/experimental/filament-spindle/spindle.scad
blob: 76d4e7a32d8407f9d81482b2ed97a1fd36e118e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
 *  Mendel Filament Spindle Include
 *  by Tony Buser <tbuser@gmail.com>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

include <../mendel.inc>
include <../mendel.conf>

rod_diameter = 8;

module spindle_hole_vert(l) {
	if (rod_diameter == 8) {
		m8_hole_vert(l);
	} else if (rod_diameter == 4) {
		m4_hole_vert(l);
	} else if (rod_diameter == 3) {
		m3_hole_vert(l);
	} else {
		cylinder(l,rod_diameter/2,rod_diameter/2,center=true);
	}
}

module spindle_hole_horiz(l) {
	if (rod_diameter == 8) {
		m8_hole_horiz(l);
	} else if (rod_diameter == 4) {
		m4_hole_horiz(l);
	} else if (rod_diameter == 3) {
		m3_hole_horiz(l);
	} else {
		hole_horiz(rod_diameter, l);
	}
}

module spindle_nut_cavity(l) {
	if (rod_diameter == 8) {
		m8_nut_cavity(l);
	} else if (rod_diameter == 4) {
		m4_nut_cavity(l);
	} else if (rod_diameter == 3) {
		m3_nut_cavity(l);
	} else {
		// FIXME: this is probably wrong...
		hexagon(rod_diameter+5, l);
	}
}