-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlaptop_standing_battery_support.scad
172 lines (145 loc) · 4.19 KB
/
laptop_standing_battery_support.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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
include <import/smow_lib.scad>
$fn = $preview ? 64 : 256;
HOLE_DIAMETER = 6;
HOLE_DISTANCE = 76;
HOLE_TO_BORDER_DIST = 80;
border = 8;
base_width = HOLE_DISTANCE+HOLE_DIAMETER+border;
base_height = HOLE_TO_BORDER_DIST;
thickness = 2;
power_brick_width = 40;
power_brick_height = 30;
power_brick_y = 10;
power_brick_length = 40;
square_hole_width = base_width-(HOLE_DIAMETER+border)*2;
square_hole_height = 25;
support_z = thickness + 3;
difference() {
union() {
cube([base_width, base_height, thickness], center=true);
mirror_copy([1, 0, 0])
translate([HOLE_DISTANCE/2, HOLE_TO_BORDER_DIST/2, 0])
cylinder(thickness, d=HOLE_DIAMETER+border, center=true);
}
mirror_copy([1, 0, 0])
translate([HOLE_DISTANCE/2, HOLE_TO_BORDER_DIST/2, 0])
cylinder(thickness+1, d=HOLE_DIAMETER, center=true);
translate([0, square_hole_height/2-base_height/2+border/2, 0])
cube([square_hole_width, square_hole_height, thickness+1], center=true);
}
translate([5, power_brick_y + power_brick_length/2 + 10, 0]) rotate(180) triangle(10, 10, power_brick_height);
translate([0, power_brick_y, power_brick_height/2+thickness/2]) difference() {
cube([power_brick_length, power_brick_width+thickness*2, power_brick_height+thickness*2], center=true);
cube([power_brick_length+1, power_brick_width, power_brick_height], center=true);
}
/*translate([0, -(base_height/2+thickness/2), support_z/2-thickness/2]) cube([base_width, thickness, support_z], 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)