-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.html
More file actions
62 lines (56 loc) · 1.92 KB
/
index.html
File metadata and controls
62 lines (56 loc) · 1.92 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>GCode viewer</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div style="display:inline-block;">
<textarea id="gcode" name="" cols="30" rows="10"></textarea>
<button id="view">View</button>
<button id="resize">Resize</button>
</div>
<div id="container" style="display: inline-block;">
</div>
<script src="js/gcodetogeometry.min.js"></script>
<script src="js/three.min.js"></script>
<script src="js/CombinedCamera.js"></script>
<script src="js/helvetiker_regular.typeface.js"></script>
<script src="js/OrbitControls.js"></script>
<script src="js/path.js"></script>
<script src="js/helper.js"></script>
<script src="js/gui.js"></script>
<script src="js/animation.js"></script>
<script src="js/util.js"></script>
<script src="js/viewer.js"></script>
<script type="text/javascript">
// var config = {
// initialPosition: { x: 5, y: 3, z: 1 },
// board: { width: 10, length: 50, height: 5 }
// };
var container = document.getElementById("container");
var width = 600, height = 400;
var viewer = new GCodeViewer.Viewer(
container,
width,
height,
function(msg) { alert(msg); },
{
hideGCode : false
},
false
);
document.getElementById("view").onclick = function() {
viewer.setGCode(document.getElementById("gcode").value);
}
document.getElementById("resize").onclick = function() {
var container = document.getElementById("container");
var width = 600, height = 300;
container.style.width = width + "px";
container.style.height = height + "px";
viewer.resize(width, height);
}
</script>
</body>
</html>