-
Notifications
You must be signed in to change notification settings - Fork 1
/
shellbolts.scad
52 lines (51 loc) · 1.99 KB
/
shellbolts.scad
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
//shellbolts.scad by r. miloh
//a few modules for making polygon bolts with screwtop lids this design allows
//all parts to be quickly printed as shells Revamp of an earlier hexshell design,
//making it easily printed and parametizable
// todo: implement output of cross section, projections, and stls based on
// templating input (with python?) or command line inputs and make
//
// Functions: Apothem
function apothem(radius,num_sides) = radius * cos(180/num_sides);
//
// Modules:
//
// filleted_polycylinder: a nicer yet dimensionally accurate polycylinder extruded from the minkowski
// sum of the n sided polygon
// * has a dimensioning bug (outside of bounds)for large values of fillet
module filleted_polycylinder(radius,height,fillet_radius,num_sides){
linear_extrude(height,twist=0,slices=1){
minkowski(){
circle(r=fillet_radius,$fn=80);
circle(r=radius-fillet_radius,$fn=num_sides);
}
}
}
// creates a capsule of height and radius as smooth as you would like,
// used in shell bolts as negative space
module capsule(radius,height,smoothness){
hull(){
translate([0,0,height-radius])sphere(r=radius,$fn=smoothness);
translate([0,0,radius])sphere(r=radius,$fn=smoothness);
}
}
// screwshell created with thickness along radius centerline
module screwshell(radius,height,thickness,pitch,num_sides,layer_height){
linear_extrude(height, convexity=10,twist = pitch, slices = height/layer_height){
difference() {
offset(r = thickness/2){
circle(r=radius, center = true,$fn=num_sides);
}
offset(r = -thickness/2) {
circle(r=radius, center = true,$fn=num_sides);
}
}
}
}
// polyscrew for priting shells with vase settings
module polyscrew(radius,height,pitch,num_sides,layer_height){
num_slices = height/ layer_height;
linear_extrude(height,convexity=10,twist=pitch,slices=height/layer_height){
circle(r=radius, center = true,$fn=num_sides);
}
}