forked from jscad/OpenJSCAD.org
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
226 lines (212 loc) · 11.7 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
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<!--
== OpenJSCAD.org, Copyright (c) 2013-2016 by Rene K. Mueller <[email protected]>, Licensed under MIT License ==
with some code from OpenJsCad processfile.html by Joost Nieuwenhuijse
in conjunction with csg.js, openjscad.js, lightgl.js by various authors (see them listed in the individual files)
Purpose:
More modern interface for OpenJsCad as published at http://joostn.github.com/OpenJsCad/
History:
- 2016/27/01: 0.5.1: refactored AMF import and export by Z3 Dev
- enhanced STL import, adding support for MM colors by Z3 Dev
- added local storage by Robert Starkey
- 2016/05/01: 0.5.0: added options to Processor and View classes, allow more flexibility in HTML by Z3 Dev
- 2016/02/02: 0.4.0: refactored, functionality split up into more files, mostly done by Z3 Dev
- 2015/10/23: 0.3.1: including new parameter options by Z3 Dev
- 2015/07/02: 0.3.0: format.js (Stefan Baumann), and Blob.js/openjscad improved by Z3 Dev
- 2015/05/20: 0.2.4: renumbering, latest csg.js from http://joostn.github.com/OpenJsCad/ adapted
- 2015/04/08: 0.024: dev branch opened
- 2015/02/14: 0.023: bumping version based on openscad.js
- 2015/02/04; 0.020: browser window resizing done properly, thanks to Z3 devs via pull request
- 2015/01/07: 0.019: various pull requests from github merged again
- 2014/10/05: 0.018: various pull requests from github merged
- 2013/04/11: 0.017: alpha channel supported in color() and .setColor()
- 2013/04/07: 0.016: csg.js: solidFromSlices() and .setColor() on polygon level, and examples by Eduard Bespalov
- 2013/04/05: 0.015: rudimentary AMF export and import, web and cli
- 2013/04/03: 0.014: multiple files via drag'n'drop, developing locally
- 2013/04/01: 0.013: include() on web-online & drag'n'drop (but not off-line) and cli (server-side)
- 2013/03/20: 0.012: improved UI (slider from the left)
- 2013/03/28: 0.011: rectangular_extrude(), rotate_extrude() added, and torus()
- 2013/03/22: 0.010: leave .scad file intact, and translate on-the-fly
- 2013/03/20: 0.009: OpenSCAD .scad (via openscad-openjscad-translator) and .stl experimental import support integrated
- 2013/03/15: 0.008: minor changes, parameter window smaller, css changes
- 2013/03/14: 0.007: including jQuery to make UI changes easier, e.g. hint window moveable now
- 2013/03/11: 0.005: resize of browser fixed by fixing canvas size to full screen, and avoid scrollbars
- 2013/03/10: 0.001: first version, integrating ACE editor, for now pulled from 3rd party web-site
Todo:
- saving source code edited in ACE locally, perhaps 'SaveAs' (.JSCAD, .STL, .AMF)
- DONE: include(); support of multiple files, see http://jsfiddle.net/yybRu/
-->
<meta http-equiv=Pragma content=no-cache>
<meta http-equiv=Expires content=-1>
<meta http-equiv=CACHE-CONTROL content=NO-CACHE>
<title>OpenJSCAD.org</title>
<link rel="shortcut icon" href="imgs/favicon.png" type="image/x-png">
<link rel="stylesheet" href="jquery/themes/base/jquery-ui.css" />
<link rel="stylesheet" href="style.css?0.5.1" type="text/css">
<link rel="stylesheet" href="openjscad.css?0.5.1" type="text/css">
</head>
<body>
<script src="jquery/jquery-1.9.1.js"></script>
<script src="jquery/jquery-ui.js"></script>
<script src="jquery/jquery.hammer.js"></script>
<script src="lightgl.js"></script>
<script src="csg.js?0.5.1"></script>
<script src="formats.js?0.5.1"></script>
<script src="openjscad.js?0.5.1"></script>
<script src="js/jscad-worker.js?0.5.1" charset="utf-8"></script>
<script src="js/jscad-function.js?0.5.1" charset="utf-8"></script>
<script src="openscad.js?0.5.1"></script>
<script src="underscore.js"></script>
<script src="openscad-openjscad-translator.js"></script>
<script src="ace/ace.js?0.5.1" charset="utf-8"></script>
<script src="js/ui-drag-drop.js?0.5.1" charset="utf-8"></script>
<script src="js/ui-editor.js?0.5.1" charset="utf-8"></script>
<script src="js/ui-cookies.js?0.5.1" charset="utf-8"></script>
<script src="js/ui-worker.js?0.5.1" charset="utf-8"></script>
<script src="js/index.js?0.5.1" charset="utf-8"></script>
<!-- top left header (logo and error message) -->
<div id="header">
<img src="imgs/title.png">
<div id="errordiv"></div>
</div>
<!-- sliding tab (help, links, examples, options, etc) -->
<div id="menu">
<img id="menuHandle" src="imgs/menuHandleVL.png">
<nav>
<div id="menuVersion">Version <script>document.write(OpenJsCad.version);</script></div>
<p/>
<table class="info">
<tr><td class="infoView" colspan=2>Editor</td></tr>
<tr><td align="right" class="infoOperation">Render Code</td><td class="infoKey">F5 or SHIFT + Return</td></tr>
<tr><td align="right" class="infoOperation">Save To Cache</td><td class="infoKey">CTRL + S</td></tr>
<tr><td align="right" class="infoOperation">Load From Cache</td><td class="infoKey">CTRL + L</td></tr>
<tr><td align="right" class="infoOperation">Download Code</td><td class="infoKey">CTRL + SHIFT + S</td></tr>
<tr><td align="right" class="infoOperation">Reset View</td><td class="infoKey">CRTL + Return</td></tr>
<tr><td class="infoView" colspan=2>3D View</td></tr>
<tr><td align="right" class="infoOperation">Rotate XZ</td><td class="infoKey">Left Mouse</td></tr>
<tr><td align="right" class="infoOperation">Pan</td><td class="infoKey">Middle Mouse or SHIFT + Left Mouse</td></tr>
<tr><td align="right" class="infoOperation">Rotate XY</td><td class="infoKey">Right Mouse or ALT + Left Mouse</td></tr>
<tr><td align="right" class="infoOperation">Zoom In/Out</td><td class="infoKey">Wheel Mouse or CTRL + Left Mouse</td></tr>
</table>
<p>
<a class="navlink" href="https://en.wikibooks.org/wiki/OpenJSCAD_User_Guide" target="_blank">User Guide / Documentation <img src="imgs/externalLink.png" style="externalLink"></a>
<br/><span class="menuSubInfo">How to program with OpenJSCAD: online, offline & CLI</span>
</p>
<p>
<a class="navlink" href="https://plus.google.com/115007999023701819645" rel="publisher" target="_blank">Recent Updates <img src="imgs/externalLink.png" style="externalLink"></a>
<br/><span class="menuSubInfo">Announcements of recent developments</span>
</p>
<p>
<a class="navlink" href="https://plus.google.com/communities/114958480887231067224" target="_blank">Google+ Community <img src="imgs/externalLink.png" style="externalLink"></a>
<br/><span class="menuSubInfo">Discuss with other users & developers</span>
</p>
<div id="examplesTitle" class="navlink"><a href='#' onclick='return false'>Examples</a></div>
<div id="examples"></div>
<span class="menuSubInfo">Dozens of examples to learn from</span>
<p/>
<!--
<div id="optionsTitle" class="navlink"><a href='#' onclick='return false'>Options</a></div>
<div id="options"></div>
<span class="menuSubInfo">Your personal settings</span></p>
-->
<p/>
<b>Supported Formats</b>
<table class="info">
<tr><td align="right"><b>jscad</b></td><td><a target="_blank" href="https://github.com/Spiritdude/OpenJSCAD.org/wiki/User-Guide">OpenJSCAD</a> (native, import/export)</td></tr>
<tr><td align="right"><b>scad</b></td><td><a target="_blank" href="http://openscad.org">OpenSCAD</a> (<a target=_blank href="https://github.com/Spiritdude/OpenJSCAD.org/wiki/User-Guide#direct-openscad-scad-import">experimental</a>, import)</td></tr>
<tr><td align="right"><b>stl</b></td><td><a target="_blank" href="http://en.wikipedia.org/wiki/STL_(file_format)">STL format</a> (experimental, import/export)</td></tr>
<tr><td align="right"><b>amf</b></td><td><a target="_blank" href="http://en.wikipedia.org/wiki/Additive_Manufacturing_File_Format">AMF format</a> (experimental, import/export)</td></tr>
<tr><td align="right"><b>dxf</b></td><td><a target="_blank" href="https://en.wikipedia.org/wiki/AutoCAD_DXF">DXF format</a> (experimental, import/export)</td></tr>
<tr><td align="right"><b>svg</b></td><td><a target="_blank" href="https://en.wikipedia.org/wiki/Scalable_Vector_Graphics">SVG format</a> (experimental, import/export)</td></tr>
</table>
<p><a class="navlink" href="#" onclick="$('#about').show(); return false;">About</a></p>
</nav>
</div> <!-- /menu -->
<!-- about dialog -->
<div id="about">
<img src="imgs/title.png">
<br/>Version <script>document.write(OpenJsCad.version);</script>
<p>
by
Joost Nieuwenhuijse (core),
René K. Müller (UI & CLI),
Stefan Baumann (core),
Z3 Dev (CLI & GUI),
Eduard Bespalov (core),
Gary Hogdson (OpenSCAD translator)
</p>
<p>csg.js core & improvements by
Evan Wallace,
Eduard Bespalov,
Joost Nieuwenhuijse,
Alexandre Girard
</p>
<p>
License: MIT License<br>
Get your copy/clone/fork from <a href="https://github.com/Spiritdude/OpenJSCAD.org" target=_blank>GitHub: OpenJSCAD</a>
</p>
<p>
<br/><a class="okButton" href='#' onclick="$('#about').hide(); return false;"> OK </a>
</p>
</div> <!-- about -->
<!-- editor -->
<div id="editFrame">
<div>
<img id="editHandle" src="imgs/editHandleIn.png"></img>
</div>
<div id="editor">
// -- OpenJSCAD.org logo
function main() {
return union(
difference(
cube({size: 3, center: true}),
sphere({r:2, center: true})
),
intersection(
sphere({r: 1.3, center: true}),
cube({size: 2.1, center: true})
)
).translate([0,0,1.5]).scale(10);
}
</div>
</div> <!-- editor -->
<!-- design viewer -->
<div oncontextmenu="return false;" id="viewerContext"></div> <!-- avoiding popup when right mouse is clicked -->
<!-- design parameters -->
<div id="parametersdiv"></div>
<!-- design information (status message, download buttons, drag and drop area, etc) -->
<div id="tail">
<div id="statusdiv"></div>
<div id="filedropzone">
<div id="filedropzone_empty">
<script>document.write("Drop one or more supported files"+
(browser=='chrome'&&me=='web-online'?", or folder with jscad files ":"")+
" here (see <a style='font-weight: normal' href='https://github.com/Spiritdude/OpenJSCAD.org/wiki/User-Guide#support-of-include' target=_blank>details</a>) "+
"<br>or directly edit OpenJSCAD or OpenSCAD code using the editor.");
</script>
</div>
<div id="filedropzone_input">
<p>
<label class="input-control">Add Supported Files: <input type="file" id="files-input" accept="*/*" multiple="1"></input></label>
</p>
</div>
<div id="filedropzone_filled">
<span id="currentfile">...</span>
<div id="filebuttons">
<button id="getstlbutton" style="display:none" onclick="getStl();">Get STL</button>
<button onclick="reloadAllFiles();">Reload</button>
<!--button onclick="parseFile(gCurrentFile,true,false);">Debug (see below)</button-->
<label for="autoreload">Auto Reload</label><input type="checkbox" name="autoreload" value="" id="autoreload" onclick="toggleAutoReload();">
</div>
</div>
</div>
</div> <!-- tail -->
<!-- footer (version, copyright) -->
<div id="footer">
OpenJSCAD.org <script>document.write(OpenJsCad.version);</script>, MIT License, get your own copy/clone/fork from <a target=_blank href="https://github.com/Spiritdude/OpenJSCAD.org">GitHub: OpenJSCAD</a>
</div>
</body>
</html>