-
Notifications
You must be signed in to change notification settings - Fork 8
/
index.html
executable file
·333 lines (303 loc) · 19.9 KB
/
index.html
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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
<!DOCTYPE html>
<html>
<head>
<title>OpenSCAD.net</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="icon" href="img/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" href="css/layout-default-latest.css">
<link rel="stylesheet" href="css/bootstrap/bootstrap.min.css">
<link rel="stylesheet" href="css/bootstrap/bootstrap-responsive.min.css">
<link rel="stylesheet" href="css/openscad.net.css">
</head>
<body>
<div id="navbar" class="navbar">
<form id="settingsForm" method="POST">
<div class="navbar-inner">
<div class="nav-container container">
<a class="brand" href="/openscad.net/">OpenSCAD.net</a>
<ul class="nav pull-right">
<li id="notificationbar" title="Not Connected to Filesystem"><img src="img/led-icons/disconnect.png"/> Filesystem</li>
</ul>
<ul class="nav">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">File <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#" id="menu_file_new">New</a></li>
<li><a href="#" id="menu_file_open" data-toggle="modal" data-target="#fileOpenModal">Open…</a></li>
<li class="dropdown-submenu">
<a class="menu_option" href="#">Examples</a>
<ul class="dropdown-menu">
<li><a href="#" class="loadExample" data-filename="example001.scad" title="Modules and functions">example001 (Modules and functions)</a></li>
<li><a href="#" class="loadExample" data-filename="example002.scad" title="CSG operations">example002 (CSG operations)</a></li>
<li><a href="#" class="loadExample" data-filename="example003.scad" title="CSG difference">example003 (CSG difference)</a></li>
<li><a href="#" class="loadExample" data-filename="example004.scad" title="CSG intersection">example004 (CSG intersection)</a></li>
<li><a href="#" class="loadExample" data-filename="example005.scad" title="For loop (pavillion)">example005 (For loop (pavillion))</a></li>
<li><a href="#" class="loadExample" data-filename="example006.scad" title="For loop over array (dice)">example006 (For loop over array (dice))</a></li>
<li><a href="#" class="loadExample" data-filename="example007.scad" title="Rotate_extrude with DXF import"><strike>example007 (Rotate_extrude with DXF import)</strike></a></li>
<li><a href="#" class="loadExample" data-filename="example008.scad" title="DXF import"><strike>example008 (DXF import)</strike></a></li>
<li><a href="#" class="loadExample" data-filename="example009.scad" title="DXF dimensions"><strike>example009 (DXF dimensions)</strike></a></li>
<li><a href="#" class="loadExample" data-filename="example010.scad" title="Surface function with data file"><strike>example010 (Surface function with data file)</strike></a></li>
<li><a href="#" class="loadExample" data-filename="example011.scad" title="Polyhedron">example011 (Polyhedron)</a></li>
<li><a href="#" class="loadExample" data-filename="example012.scad" title="STL import">example012 (STL import)</a></li>
<li><a href="#" class="loadExample" data-filename="example013.scad" title="DXF import with linear extrude"><strike>example013 (DXF import with linear extrude)</strike></a></li>
<li><a href="#" class="loadExample" data-filename="example014.scad" title="intersection_for">example014 (intersection_for)</a></li>
<li><a href="#" class="loadExample" data-filename="example015.scad" title="DXF import"><strike>example015 (DXF import)</strike></a></li>
<li><a href="#" class="loadExample" data-filename="example016.scad" title="STL import">example016 (STL import)</a></li>
<li><a href="#" class="loadExample" data-filename="example017.scad" title="Render DXF"><strike>example017 (Render DXF)</strike></a></li>
<li><a href="#" class="loadExample" data-filename="example018.scad" title="For loop with submodule calling child function">example018 (For loop and child call)</a></li>
<li><a href="#" class="loadExample" data-filename="example019.scad" title="lookup function">example019 (lookup function)</a></li>
<li><a href="#" class="loadExample" data-filename="example020.scad" title="Screw, nut and spring">example020 (Screw, nut and spring)</a></li>
<li><a href="#" class="loadExample" data-filename="example021.scad" title="projection function"><strike>example021 (projection function)</strike></a></li>
<li><a href="#" class="loadExample" data-filename="example022.scad" title="Rounded boxes">example022 (Rounded boxes)</a></li>
<li><a href="#" class="loadExample" data-filename="example023.scad" title="Example combining MCAD/fonts with search() function."><strike>example023 (MCAD/fonts.scad and search() function.)</strike></a></li>
</ul>
</li>
<li class="divider"></li>
<li><a href="#" id="menu_file_save">Save</a></li>
<li><a href="#" id="menu_file_share_as_link">Share as Link</a></li>
<li class="divider"></li>
<li class="nav-header">Filesystem</li>
<li><a href="#" id="menu_file_connect">Connect</a></li>
<li><a href="#" id="menu_file_disconnect">Disconnect</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Edit <b class="caret"></b></a>
<ul class="dropdown-menu">
<li class="nav-header">Input Syntax</li>
<li> <input type="radio" class="menu_option" name="sourcetype" id="sourcetype_openscad" value="openscad"> OpenSCAD</li>
<li> <input type="radio" class="menu_option" name="sourcetype" id="sourcetype_openjscad" value="openjscad"> OpenJsCad</li>
<li class="divider"></li>
<li><a href="#" data-toggle="modal" data-target="#preferencesModal" id="menu_edit_preferences">Preferences</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Design <b class="caret"></b></a>
<ul class="dropdown-menu">
<li> <input type="checkbox" class="menu_option" name="menu_design_auto_reload" value="auto_reload"> Automatic Reload</li>
<li><a href="#" id="menu_design_reload_compile">Reload and Compile [F4]</a></li>
<li><a href="#" id="menu_design_export_stl">Export as STL / DXF</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">View <b class="caret"></b></a>
<ul class="dropdown-menu">
<li> <input type="checkbox" class="menu_option" name="menu_view_show_axis" value="show_axis" > Show Axis</li>
<li> <input type="checkbox" class="menu_option" name="menu_view_show_grid" value="show_grid" > Show Grid</li>
<li class="divider"></li>
<li><a href="#" id="menu_view_top" onclick="viewer.cameraAngle(0,0,0);">Top</a></li>
<li><a href="#" id="menu_view_bottom" onclick="viewer.cameraAngle(180,0,0);">Bottom</a></li>
<li><a href="#" id="menu_view_left" onclick="viewer.cameraAngle(270,0,90);">Left</a></li>
<li><a href="#" id="menu_view_right" onclick="viewer.cameraAngle(270,0,270);">Right</a></li>
<li><a href="#" id="menu_view_front" onclick="viewer.cameraAngle(270,0,0);">Front</a></li>
<li><a href="#" id="menu_view_back" onclick="viewer.cameraAngle(270,0,180);">Back</a></li>
<li><a href="#" id="menu_view_back" onclick="viewer.cameraAngle(325,0,325);">Diagonal</a></li>
<li><a href="#" id="menu_view_back" onclick="viewer.cameraPosition(0,0);">Center</a></li>
<li class="divider"></li>
<li> <input type="checkbox" class="menu_option" name="menu_view_hide_editor" value="hide_editor"> Hide Editor</li>
<li> <input type="checkbox" class="menu_option" name="menu_view_hide_console" value="hide_console"> Hide Console</li>
<li class="divider"></li>
<li><a href="#" id="menu_view_clear_console">Clear Console</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Help <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#" data-toggle="modal" data-target="#helpModal">Help</a></li>
<li class="divider"></li>
<li><a href="http://www.openscad.org/" target="_blank">OpenSCAD Homepage</a></li>
<li><a href="http://en.wikibooks.org/wiki/OpenSCAD_User_Manual" target="_blank">OpenSCAD Manual</a></li>
<li><a href="http://joostn.github.com/OpenJsCad/" target="_blank">OpenJsCad Homepage</a></li>
<li class="divider"></li>
<li><a href="https://github.com/garyhodgson/openscad.net" target="_blank">OpenSCAD.net @ Github</a></li>
<li class="divider"></li>
<li><a href="#" data-toggle="modal" data-target="#aboutModal">About</a></li>
</ul>
</li>
</ul>
</div>
</div>
<input type="hidden" id="currentFilename" name="currentFilename" />
</form>
</div>
<div id="container">
<div class="outer-center" id="center-container">
<div class="ui-layout-center" id="viewer-container" oncontextmenu="return false;"></div>
<div class="ui-layout-south" id="log-container">
<textarea id="log" name="log" readonly></textarea>
</div>
</div>
<div class="ui-layout-west editor-layout">
<textarea id="editor" name="editor" spellcheck="false"></textarea>
</div>
</div>
<!--Note: the example content is loaded via requireJS text plugin after startup. -->
<div id="examples"></div>
<div id="aboutModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="aboutModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="aboutModalLabel">About</h3>
</div>
<div class="modal-body">
<h4>Overview</h4>
<p>OpenSCAD.net is a partial port of OpenSCAD for the web. Powered by OpenJsCad, it uses the familiar OpenSCAD syntax to allow many OpenSCAD models to be rendered, and saved as STL, via the browser.</p>
<hr>
<h4>Credits & Libraries Used</h4>
<p>
<ul>
<li><a href="http://www.openscad.org/" target="_blank">OpenSCAD</a></li>
<li><a href="http://joostn.github.com/OpenJsCad/" target="_blank">OpenJsCad</a></li>
<li><a href="http://zaach.github.com/jison/" target="_blank">Jison</a></li>
<li><a href="https://github.com/dropbox/dropbox-js" target="_blank">Dropbox.js</a></li>
<li><a href="http://twitter.github.com/bootstrap" target="_blank">Bootstrap</a></li>
<li><a href="http://jquery.com/" target="_blank">jQuery</a></li>
<li><a href="http://layout.jquery-dev.net/" target="_blank">jQuery UI Layout Plug-in</a></li>
<li><a href="http://underscorejs.org/" target="_blank">underscore.js</a></li>
<li><a href="http://garlicjs.org" target="_blank">garlic.js</a></li>
<li><a href="http://www.jstree.com/" target="_blank">jstree</a></li>
<li><a href="https://github.com/alanhogan/Tabby" target="_blank">Tabby</a></li>
<li><a href="https://github.com/CD1212/jQuery-Font-Chooser" target="_blank">jQuery-Font-Chooser</a></li>
<li><a href="http://led24.de/iconset/" target="_blank">LED Icon Set</a></li>
</ul>
</p>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
</div>
</div>
<div id="helpModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="helpModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="helpModalLabel">Help</h3>
</div>
<div class="modal-body">
<p>The layout and menu options have been made as similar to the desktop version of OpenSCAD to aid quick adoption.</p>
<hr>
<h4>Basics</h4>
<p>Paste or type an OpenSCAD script into the editor and hit F4 (or select "Reload and Compile" from the Design menu). The model should render in the panel to the right. Any error messages should appear in the log panel at the bottom, or in the browser console.</p>
<hr>
<h4>Imported Libraries via Dropbox</h4>
<p>So that scripts can utilise the "use" and "include" directives, the application can connect to a Dropbox account in order to import library files stored there. Authorising access for the app will create a dedicated, sandboxed, folder in your Dropbox space. Folders and files stored here can be referenced via "use" and "include" statements. Scripts can also be saved to the Dropbox space, via the Save option.</p>
<hr>
<h4>Missing Features</h4>
<p>Several features are either not yet implemented or can/will not be implemented. For this reason many of the original OpenSCAD examples, which are available through the File/Examples menu, will not work. These are marked as such with a strikethrough.
<ul>
<li>DXF import and manipulation (e.g. import_dxf, dxf-cross, dxf_dim functions).</li>
<li>STL import.</li>
<li>rotate_extrude.</li>
<li>search and surface functions.</li>
<li>Animation.</li>
<li>minkowski and hull transformations.</li>
<li>$fa, $fs global variables.</li>
<li>Modifier characters: #, !, and %).</li>
<li>Nested include calls.</li>
</ul>
Also check the <a target="_blank" href="https://github.com/garyhodgson/openscad.net/issues">issue list</a> in the github project for bugs.
</p>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
</div>
</div>
<div id="shareLinkModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="shareLinkModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="shareLinkModalLabel">Share as Link</h3>
</div>
<div class="modal-body">
<textarea id="share_link" rows=10></textarea>
Add autoload flag: <input type="checkbox" id="share_autoload">
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
</div>
</div>
<div id="preferencesModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="preferencesModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="preferencesModalLabel">Preferences</h3>
</div>
<div class="modal-body">
<ul class="nav nav-tabs">
<li><a href="#preferences3dView" data-toggle="tab">3D View</a></li>
<li><a href="#preferencesEditor" data-toggle="tab">Editor</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="preferences3dView">
<label>Color Schemes</label>
<select id="colorScheme">
<option value="cornfield">Cornfield</option>
<option value="metallic">Metallic</option>
<option value="sunset">Sunset</option>
<option value="sunrise">Sunrise</option>
</select>
</div>
<div class="tab-pane" id="preferencesEditor">
<label>Font</label>
<div id="fontSelect">
<span>Arial</span>
<div class="arrow-down"></div>
<ul>
<li>Arial,Arial,Helvetica,sans-serif</li>
<li>Arial Black,Arial Black,Gadget,sans-serif</li>
<li>Comic Sans MS,Comic Sans MS,cursive</li>
<li>Courier New,Courier New,Courier,monospace</li>
<li>Georgia,Georgia,serif</li>
<li>Impact,Charcoal,sans-serif</li>
<li>Lucida Console,Monaco,monospace</li>
<li>Lucida Sans Unicode,Lucida Grande,sans-serif</li>
<li>Palatino Linotype,Book Antiqua,Palatino,serif</li>
<li>Tahoma,Geneva,sans-serif</li>
<li>Times New Roman,Times,serif</li>
<li>Trebuchet MS,Helvetica,sans-serif</li>
<li>Verdana,Geneva,sans-serif</li>
<li>Gill Sans,Geneva,sans-serif</li>
</ul>
</div>
<select id="preferencesFontSize">
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="14">14</option>
<option value="16">16</option>
<option value="18">18</option>
<option value="20">20</option>
<option value="22">22</option>
<option value="24">24</option>
<option value="26">26</option>
<option value="28">28</option>
<option value="36">36</option>
<option value="48">48</option>
<option value="72">72</option>
</select>
</div>
</div>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
</div>
</div>
<div id="fileOpenModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="fileOpenModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="fileOpenModalLabel">Open File</h3>
</div>
<div class="modal-body">
<div id="jstree_container">
<button id="connect_to_filesystem" class="btn btn-success" type="button">Connect to Filesystem</button>
</div>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Cancel</button>
<button id="openFile" class="btn btn-primary">Open</button>
</div>
</div>
<script src="js/lib/underscore.js"></script>
<script src="js/lib/openscadOpenjscadTranslator.js"></script>
<script data-main="js/main" src="js/require.js"></script>
</body>
</html>