-
Notifications
You must be signed in to change notification settings - Fork 0
/
microphone_support_p1.scad
158 lines (137 loc) · 3.68 KB
/
microphone_support_p1.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
//include <BOSL/constants.scad>
//use <BOSL/masks.scad>
$fn = $preview ? 64 : 256;
width=14;
depth=30;
height=5;
nut_hole_width=10;
nut_hole_height=3;
hole_width=5;
pin_height=5;
gap=11.5;
module support_side(side, fn) {
translate([gap*side, 0, width/2]) rotate([0, 90, 0]) difference() {
union() {
cylinder(r=width/2, h=height, $fn=200, center=true);
translate([width/2, 0, 0]) cube([width, width, height], center=true);
}
translate([0, 0, (height-nut_hole_height)*side]) cylinder(r=nut_hole_width/2, h=nut_hole_height+1, $fn=fn, center=true);
cylinder(r=hole_width/2, h=height, $fn=200, center=true);
}
}
support_side(1, 6);
support_side(-1, 200);
cube([width, height, height], center=true);
/*rotate([0, 90, 0]) cylinder(r=width/2, h=height, $fn=200, center=true);*/
/*translate([width/2, 0, 0]) cube([width, width, height], center=true);*/
/*translate([width, 0, height]) cube([2, width, height+10], center=true);*/
// # Syntax
//
// var = value;
// var = cond ? value_if_true : value_if_false;
// var = function (x) x + x;
// module name(…) { … } name();
// function name(…) = … name();
// include <….scad>
// use <….scad>
// # Constants
//
// PI
// # Special variables
//
// $fa minimum angle
// $fs minimum size
// $fn number of fragments
// $t animation step
// $vpr viewport rotation angles in degrees
// $vpt viewport translation
// $vpd viewport camera distance
// $vpf viewport camera field of view
// $children number of module children
// $preview true in F5 preview, false for F6
// # Modifier Characters
//
// * disable
// ! show only
// # highlight / debug
// % transparent / background
// # 2D
//
// circle(radius | d=diameter)
// square(size,center)
// square([width,height],center)
// polygon([points])
// polygon([points],[paths])
// text(t, size, font, halign, valign, spacing, direction, language, script)
// import("….ext", convexity)
// projection(cut)
// # 3D
//
// sphere(radius | d=diameter)
// cube(size, center)
// cube([width,depth,height], center)
// cylinder(h,r|d,center)
// cylinder(h,r1|d1,r2|d2,center)
// polyhedron(points, faces, convexity)
// import("….ext", convexity)
// linear_extrude(height,center,convexity,twist,slices)
// rotate_extrude(angle,convexity)
// surface(file = "….ext",center,convexity)
// # Transformations
//
// translate([x,y,z])
// rotate([x,y,z])
// rotate(a, [x,y,z])
// scale([x,y,z])
// resize([x,y,z],auto,convexity)
// mirror([x,y,z])
// multmatrix(m)
// color("colorname",alpha)
// color("#hexvalue")
// color([r,g,b,a])
// offset(r|delta,chamfer)
// hull()
// minkowski(convexity)
// # Lists
//
// list = […, …, …]; create a list
// var = list[2]; index a list (from 0)
// var = list.z; dot notation indexing (x/y/z)
// # Boolean operations
//
// union()
// difference()
// intersection()
// # List Comprehensions
//
// Generate [ for (i = range|list) i ]
// Generate [ for (init;condition;next) i ]
// Flatten [ each i ]
// Conditions [ for (i = …) if (condition(i)) i ]
// Conditions [ for (i = …) if (condition(i)) x else y ]
// Assignments [ for (i = …) let (assignments) a ]
// # Flow Control
//
// for (i = [start:end]) { … }
// for (i = [start:step:end]) { … }
// for (i = […,…,…]) { … }
// for (i = …, j = …, …) { … }
// intersection_for(i = [start:end]) { … }
// intersection_for(i = [start:step:end]) { … }
// intersection_for(i = […,…,…]) { … }
// if (…) { … }
// let (…) { … }
// # Type test functions
//
// is_undef
// is_bool
// is_num
// is_string
// is_list
// is_function
// # Other
//
// echo(…)
// render(convexity)
// children([idx])
// assert(condition, message)