-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
213 lines (197 loc) · 5.87 KB
/
index.html
File metadata and controls
213 lines (197 loc) · 5.87 KB
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>🔨  Drawer designer</title>
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Roboto:300,300italic,700,700italic"
/>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.css"
/>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/milligram/1.4.1/milligram.css"
/>
<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/three@0.154.0/build/three.module.js",
"three/orbit": "https://unpkg.com/three@0.148.0/examples/jsm/controls/OrbitControls.js",
"three/stl": "https://unpkg.com/three@0.148.0/examples/jsm/exporters/STLExporter.js",
"three/obj": "https://unpkg.com/three@0.148.0/examples/jsm/exporters/OBJExporter.js"
}
}
</script>
<script src="1.js" type="module"></script>
</head>
<body>
<div class="container">
<h2>Drawer designer</h2>
<form>
<div class="row">
<div class="column">
<label>
Drawer width (mm):
<input
type="text"
id="drawer_width"
name="drawer_width"
value="400"
required
/>
</label>
</div>
<div class="column">
<label>
Drawer height (mm):
<input
type="text"
id="drawer_height"
name="drawer_height"
value="120"
required
/>
</label>
</div>
<div class="column">
<label>
Drawer depth (mm):
<input
type="text"
id="drawer_depth"
name="drawer_depth"
value="300"
required
/>
</label>
</div>
</div>
<div class="row">
<div class="column">
<label>
Material width (mm):
<input
type="text"
id="material_width"
name="material_width"
value="1200"
required
/>
</label>
</div>
<div class="column">
<label>
Material height (mm):
<input
type="text"
id="material_height"
name="material_height"
value="600"
required
/>
</label>
</div>
<div class="column">
<label>
Material thickness (mm):
<input
type="text"
id="material_thickness"
name="material_thickness"
value="10"
required
/>
</label>
</div>
</div>
<div class="row">
<div class="column">
<label>
Number of drawers (n):
<input type="text" id="count" name="count" value="2" required />
</label>
</div>
<div class="column">
<label>
Blade/cut width (mm):
<input
type="text"
id="cut_width"
name="cut_width"
value="2.5"
required
/>
</label>
</div>
<div class="column"></div>
</div>
<div class="row">
<div class="column">
<input
type="radio"
value="inner_only"
name="arrange"
id="inner_only"
checked
/>
<label class="label-inline" for="inner_only"
>Include cut margins</label
>
<br />
<input
type="radio"
value="no_margin"
name="arrange"
id="no_margin"
/>
<label class="label-inline" for="no_margin">No margin</label>
</div>
<div class="column">
<input
type="checkbox"
value="base"
name="rotate"
id="rotate_base"
/>
<label class="label-inline" for="rotate_base">Rotate base</label>
<br />
<input
type="checkbox"
value="sides"
name="rotate"
id="rotate_sides"
/>
<label class="label-inline" for="rotate_sides">Rotate sides</label>
<br />
<input
type="checkbox"
value="front & back"
name="rotate"
id="rotate_fb"
/>
<label class="label-inline" for="rotate_fb">Rotate front & back</label>
</div>
<div class="column">
<button type="button" class="button-primary" id="update_button">
Update
</button>
<button type="button" class="button-secondary" id="save_stl_button" style="visibility: hidden;">
Save STL...
</button>
</div>
</div>
</form>
</div>
<h4 id="message" style="text-align: center"></h4>
<canvas id="cvs" width="1500" height="3000"></canvas>
<canvas id="cvs_3d" width="1200" height="800" myattr="myattr"></canvas>
<div class="container">
Designed by Tom Moore</a>. Licensed under the<a href="https://www.gnu.org/licenses/gpl-3.0.en.html" rel="noopener" target="_blank"> GNU GPL v3 License</a>.
<br>
Rectangle packing code modified from code originally shared by <a href="https://observablehq.com/@mourner/simple-rectangle-packing">Volodymyr Agafonkin</a>.
</div>
</body>
</html>