-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathImage2Surface.html
74 lines (67 loc) · 2.63 KB
/
Image2Surface.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
<!DOCTYPE html>
<html>
<head>
<title>Image 2 Surface</title>
<link href="css/style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="content">
<div id="dropzone" class="dropzone">
<span class="dropzone">Drop Image Here</span>
</div>
</div>
<div id="controls">
<h1>Image 2 Surface</h1>
<p>
<p>Load an image by Dragging & Dropping onto view. Or load from file:</p>
<input type='file' id='getimagefile' />
</p>
<h3>Image Information</h3>
<ul>
<li>FileName: <span id="imagefilename"></span></li>
<li>Dimensions: <span id="imagedim">0x0</span></li>
</ul>
<h3>Surface Information</h3>
<ul>
<li>Dimensions: <span id="surfacedim"></span></li>
</ul>
<p>Generate a surface and send to Fusion 360:</p>
<button type='button' onclick='sendInfoToFusion()'>Generate Surface</button>
<p>Clear current image:</p>
<button type='button' onclick='clearImage()'>Clear Image</button>
<h3>Help</h3>
<ul>
<li>View Rotate: Left mouse button</li>
<li>View Pan: Middle mouse button</li>
<li>View Zoom: Mousewheel</li>
<li>Adjust parameters to define surface mesh</li>
</ul>
<div><small>https://github.com/hanskellner/Fusion360Image2Surface</small></div>
</div>
<script src="js/Three.js"></script>
<script src="js/Detector.js"></script>
<script src="js/RequestAnimationFrame.js"></script>
<script src="js/TrackballControls.js"></script>
<script src="js/jquery.min.js"></script>
<script src="js/jquery.mousewheel.min.js"></script>
<script src="js/DAT.GUI.min.js"></script>
<script src="js/Utils.js"></script>
<script src="js/image2surface.js"></script>
</body>
<script>
function sendInfoToFusion() {
var meshOBJStr = createMeshOBJString();
// Package up surface as JSON and send to Fusion
var args = {
obj : meshOBJStr
};
// DEFECT: This works on Mac but not Windows (undefined)
//adsk.fusionSendData('send', JSON.stringify(args));
// Use the wrapper function
neutronJavaScriptObject.executeQuery('send', JSON.stringify(args));
}
function clearImage() {
clearImageLoaded();
}
</script>
</html>