Files
phone-case-cq/doc.in/index.html

67 lines
1.9 KiB
HTML

<!-- vtk.js = Visualization ToolKit; JS version of the same library cadquery uses during runtime -->
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<style>
.vtk-viewer {
width: 100%;
height: 70%;
border: 1px solid #bbb;
}
</style>
<script src="vtk.js"></script>
<script src="renderWindow.js"></script>
<!-- load model data. populates a global variable whose name matches the filename -->
<script src="pinephone_case.vtk.js"></script>
<script src="pinephone_phone.vtk.js"></script>
</head>
<body>
<div id="vtk-viewer-root">
<!-- root element into which renderWindow.js will populate a canvas and the actual viewer -->
<script>
setVtkRoot(document.currentScript.parentNode);
</script>
</div>
<div class="vtk-viewer">
<!-- viewer for just the phone case, no phone -->
<script>
var parent_element = document.currentScript.parentNode;
var pinephone_case_options = [{
"color": [ 1.0, 0.8, 0.0, 1.0 ],
"position": [ 0.0, 0.0, 0.0 ],
"orientation": [ 0.0, 0.0, 0.0 ],
"shape": pinephone_case
}];
render(pinephone_case_options, parent_element);
</script>
</div>
<div class="vtk-viewer">
<!-- viewer for the phone case with a phone enclosed -->
<script>
var parent_element = document.currentScript.parentNode;
var pinephone_case_with_phone_options = [
{
"color": [ 1.0, 0.8, 0.0, 1.0 ],
"position": [ 0.0, 0.0, 0.0 ],
"orientation": [ 0.0, 0.0, 0.0 ],
"shape": pinephone_case
},
{
"color": [ 0.2, 0.2, 0.2, 1.0 ],
"position": [ 0.0, 0.0, 0.0 ],
"orientation": [ 0.0, 0.0, 0.0 ],
"shape": pinephone_phone
}
];
render(pinephone_case_with_phone_options, parent_element);
</script>
</div>
</body>
</html>