-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathjsoncad_example_7.html
77 lines (69 loc) · 2.67 KB
/
jsoncad_example_7.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
<html>
<head>
<title>testviewer</title>
<script type="text/javascript" src="three70.js" ></script>
<script type="text/javascript" src="OrthographicTrackballControls.js" ></script>
<script type="text/javascript" src="potree.js" ></script>
<script type="text/javascript" src="BinaryLoader.js" ></script>
<script type="text/javascript" src="csg.js" ></script>
<script type="text/javascript" src="threecsg.js" ></script>
<script type="text/javascript" src="Arial Narrow_Regular.js" ></script>
<script type="text/javascript" src="openscad.js" ></script>
<script type="text/javascript" src="jsoncad_base.js" ></script>
<script type="text/javascript" src="jsoncad_parser.js" ></script>
<script type="text/javascript" src="jsoncad_annotate.js" ></script>
<script type="text/javascript" >
//JSCad Parsing JSON structure
var nodes = {
'TEST_LIST': {
//Spheres
'SPHERE1' : ['SPHR', [10, 18, 5, [0, 1, 0, 1]], [
{x: 15 ,y: -25 ,z: 0 ,r1: {axis: 0,degrees: 0},r2: {axis: 0,degrees: 0},color: [1,0, 0, 1],size: [1, 1, 1]}
]
]
, 'SPHERE2' : ['SPHR', [10, 32, 5, [0, 1, 0, 1]], [
{x: 15 ,y: 0 ,z: 0 ,r1: {axis: 0,degrees: 0},r2: {axis: 0,degrees: 0},color: [1,0, 0, 1],size: [ 1, 1, 1]}
,{x: 15 ,y: 25 ,z: 0 ,r1: {axis: 0,degrees: 0},r2: {axis: 0,degrees: 0},color: [0,1, 0, 1],size: [0.5, 1, 2]}
,{x: 30 ,y: 25 ,z: 0 ,r1: {axis: 0,degrees: 0},r2: {axis: 0,degrees: 0},color: [0,0, 1, 1],size: [0.5, 2, 1]}
]
]
}
}
//
// The entire set of options sent to JSCad/Three.js/SVG to render and view online
//
var options ={
this_ : null
,containerElm_ : document.getElementById("viewer")
,widthDefault_ : "1600px"
,heightDefault_ : "900px"
,width_ : "1600px"
,height_ : "900px"
,heightRatio_ : 16/9
,perspective_ : 45
,drawOptions_ : { lines : false, faces : true}
,defaultColor_ : [ 0, 0, 1 ,1]
,bgColor_ : [.93,.93,.93,1]
,drawFaces_ : true
,background_ : true
,drawLines_ : false
,cameraStart_ : null
,csgScript_ : "jscad.jscad"
,headsUpDisplay_ : null
,pointcloudName_ : null
,threeJSEnvObjs_ : null
,threeJSAnnotate_ : null
,axisxyz_ : true
,camera_ : 'ortho'
,renderer_ : 'webgl'
,controls_ : 'ortho'
};
var gViewer = null;
function document_ready(){ gViewer = new OpenJSONCad.Viewer( options); };
</script>
<script id="jscad.jscad" >function main() { return makeVirtualObject(nodes['TEST_LIST'] );}
</script>
</head>
<body onload="document_ready()" >
</body>
</html>