Skip to content

Instantly share code, notes, and snippets.

@cr1901
Last active September 10, 2015 01:25
Show Gist options
  • Save cr1901/cc5aaa4c5616eec4d174 to your computer and use it in GitHub Desktop.
Save cr1901/cc5aaa4c5616eec4d174 to your computer and use it in GitHub Desktop.
Three.js Solvespace Export HTML Test
/* Autogenerated Three.js viewer for Solvespace Model (copy into another document):
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"></meta>
<title>Three.js Solvespace Mesh</title>
<script src="http://threejs.org/build/three.min.js"></script>
<script src="http://threejs.org/examples/js/controls/OrthographicTrackballControls.js"></script>
<script src="final_mesh.js"></script>
</head>
<body>
<script>
solvespace = function(obj, params) {
var scene, edgeScene, camera, edgeCamera, renderer, directionalLight;
var geometry, controls, material, mesh, edges;
var width, height, edgeBias;
if(typeof params === "undefined" || !("width" in params)) {
width = window.innerWidth;
} else {
width = params.width;
}
if(typeof params === "undefined" || !("height" in params)) {
height = window.innerHeight;
} else {
height = params.height;
}
edgeBias = obj.bounds.edgeBias;
domElement = init();
render();
return domElement;
function init() {
scene = new THREE.Scene();
edgeScene = new THREE.Scene();
var ratio = (width/height);
camera = new THREE.OrthographicCamera(-obj.bounds.x * ratio,
obj.bounds.x * ratio, obj.bounds.y, -obj.bounds.y, obj.bounds.near,
obj.bounds.far);
camera.position.z = obj.bounds.z;
mesh = createMesh(obj);
scene.add(mesh);
edges = createEdges(obj);
edgeScene.add(edges);
directionalLight = new THREE.DirectionalLight(0xffffff, 1);
directionalLight.position.set(0, 0, 1);
scene.add(directionalLight);
var ambientLight = new THREE.AmbientLight(0x444444);
scene.add(ambientLight);
renderer = new THREE.WebGLRenderer();
renderer.setSize(width, height);
renderer.autoClear = false;
controls = new THREE.OrthographicTrackballControls(camera, renderer.domElement);
controls.screen.width = width;
controls.screen.height = height;
controls.radius = (width + height)/4;
controls.rotateSpeed = 2.0;
controls.zoomSpeed = 2.0;
controls.panSpeed = 1.0;
controls.staticMoving = true;
controls.addEventListener("change", render);
controls.addEventListener("change", lightUpdate);
controls.addEventListener("change", setControlsCenter);
animate();
return renderer.domElement;
}
function animate() {
requestAnimationFrame(animate);
controls.update();
}
function render() {
renderer.clear();
renderer.render(scene, camera);
var oldFar = camera.far
camera.far = camera.far + edgeBias;
camera.updateProjectionMatrix();
renderer.render(edgeScene, camera);
camera.far = oldFar;
camera.updateProjectionMatrix();
}
function lightUpdate() {
directionalLight.position.copy(camera.position);
}
function setControlsCenter() {
var rect = renderer.domElement.getBoundingClientRect()
controls.screen.left = rect.left + document.body.scrollLeft;
controls.screen.top = rect.top + document.body.scrollTop;
}
function createMesh(mesh_obj) {
var geometry = new THREE.Geometry();
var materialIndex = 0, materialList = [];
var opacitiesSeen = {};
for(var i = 0; i < mesh_obj.points.length; i++) {
geometry.vertices.push(new THREE.Vector3(mesh_obj.points[i][0],
mesh_obj.points[i][1], mesh_obj.points[i][2]));
}
for(var i = 0; i < mesh_obj.faces.length; i++) {
var currOpacity = mesh_obj.colors[i][1]
if(opacitiesSeen[currOpacity] === undefined) {
opacitiesSeen[currOpacity] = materialIndex;
materialIndex++;
materialList.push(new THREE.MeshLambertMaterial(
{vertexColors: THREE.FaceColors, opacity: currOpacity,
transparent: true}));
}
geometry.faces.push(new THREE.Face3(mesh_obj.faces[i][0],
mesh_obj.faces[i][1], mesh_obj.faces[i][2],
new THREE.Vector3(mesh_obj.normals[i][0],
mesh_obj.normals[i][1], mesh_obj.normals[i][2]),
new THREE.Color(mesh_obj.colors[i][0]),
opacitiesSeen[currOpacity]));
}
geometry.computeBoundingSphere();
return new THREE.Mesh(geometry, new THREE.MeshFaceMaterial(materialList));
}
function createEdges(mesh_obj) {
var geometry = new THREE.Geometry();
var material = new THREE.LineBasicMaterial();
for(var i = 0; i < mesh_obj.edges.length; i++) {
geometry.vertices.push(new THREE.Vector3(mesh_obj.edges[i][0][0],
mesh_obj.edges[i][0][1], mesh_obj.edges[i][0][2]),
new THREE.Vector3(mesh_obj.edges[i][1][0],
mesh_obj.edges[i][1][1], mesh_obj.edges[i][1][2]));
}
return new THREE.Line(geometry, material, THREE.LinePieces);
}
};
document.body.appendChild(solvespace(three_js_final_mesh));
</script>
</body>
</html>
*/
var three_js_bracket = {
bounds: {
x: 69.555708, y: 69.555708, near: 1.000000, far: 139.111416, z: 69.555708, edgeBias: 0.278223
},
lights: {
d: [
{
intensity: 1.000000, direction: [-1.000000, 1.000000, 0.000000]
},
{
intensity: 0.500000, direction: [1.000000, 0.000000, 0.000000]
},
],
a: 0.300000
},
points: [
[43.454555, 10.229617, 31.884205],
[19.663134, 10.229617, 31.884205],
[43.454555, 0.000000, 31.884205],
[0.000000, 0.000000, 31.884205],
[16.689112, 10.421828, 31.884205],
[-26.101154, 47.226503, 31.884205],
[-17.147952, 52.174761, 31.884205],
[13.686458, 11.016034, 31.884205],
[-0.558224, 22.157895, 31.884205],
[10.736690, 12.023662, 31.884205],
[1.048593, 19.647936, 31.884205],
[7.924447, 13.433882, 31.884205],
[3.021097, 17.307372, 31.884205],
[5.329854, 15.213074, 31.884205],
[43.454555, 0.000000, -31.884205],
[-0.000000, 0.000000, -31.884205],
[43.454555, 10.229617, -31.884205],
[19.663134, 10.229617, -31.884205],
[16.689112, 10.421828, -31.884205],
[13.686458, 11.016034, -31.884205],
[10.736690, 12.023662, -31.884205],
[7.924447, 13.433882, -31.884205],
[5.329854, 15.213074, -31.884205],
[3.021097, 17.307372, -31.884205],
[-26.101154, 47.226503, -31.884205],
[1.048593, 19.647936, -31.884205],
[-0.558224, 22.157895, -31.884205],
[-17.147952, 52.174761, -31.884205],
[-0.558224, 22.157895, 5.114809],
[-7.161521, 34.105666, 5.114809],
[-14.089417, 46.640756, 17.628095],
[-13.884082, 46.269230, 19.853560],
[-13.232847, 45.090908, 21.903193],
[-12.241400, 43.297020, 23.249504],
[-11.164902, 41.349241, 23.673997],
[-10.088403, 39.401463, 23.249504],
[-9.096957, 37.607575, 21.903193],
[-8.445721, 36.429252, 19.853560],
[-8.240386, 36.057726, 17.628095],
[-7.161521, 34.105666, -5.114809],
[-8.445721, 36.429252, 15.402631],
[-9.096957, 37.607575, 13.352997],
[-10.088403, 39.401463, 12.006687],
[-11.164902, 41.349241, 11.582194],
[-12.241400, 43.297020, 12.006687],
[-13.232847, 45.090908, 13.352997],
[-13.884082, 46.269230, 15.402631],
[-14.089417, 46.640756, -17.628095],
[-13.884082, 46.269230, -15.402631],
[-13.232847, 45.090908, -13.352997],
[-12.241400, 43.297020, -12.006687],
[-0.558224, 22.157895, -5.114809],
[-11.164902, 41.349241, -11.582194],
[-10.088403, 39.401463, -12.006687],
[-9.096957, 37.607575, -13.352997],
[-8.445721, 36.429252, -15.402631],
[-8.240386, 36.057726, -17.628095],
[-8.445721, 36.429252, -19.853560],
[-9.096957, 37.607575, -21.903193],
[-10.088403, 39.401463, -23.249504],
[-11.164902, 41.349241, -23.673997],
[-12.241400, 43.297020, -23.249504],
[-13.232847, 45.090908, -21.903193],
[-13.884082, 46.269230, -19.853560],
[19.663134, 10.229617, -5.114809],
[16.689112, 10.421828, -5.114809],
[1.048593, 19.647936, -5.114809],
[13.686458, 11.016034, -5.114809],
[3.021097, 17.307372, -5.114809],
[10.736690, 12.023662, -5.114809],
[5.329854, 15.213074, -5.114809],
[7.924447, 13.433882, -5.114809],
[1.048593, 19.647936, 5.114809],
[19.663134, 10.229617, 5.114809],
[16.689112, 10.421828, 5.114809],
[3.021097, 17.307372, 5.114809],
[13.686458, 11.016034, 5.114809],
[5.329854, 15.213074, 5.114809],
[10.736690, 12.023662, 5.114809],
[7.924447, 13.433882, 5.114809],
[33.314243, 10.229617, -5.114809],
[33.314243, 10.229617, 5.114809],
[-22.837284, 41.320973, -15.402631],
[-19.041605, 34.453205, 23.249504],
[-20.118103, 36.400984, 23.673997],
[-22.186048, 40.142650, -13.352997],
[-21.194602, 38.348763, 23.249504],
[-21.194602, 38.348763, -12.006687],
[-22.186048, 40.142650, 21.903193],
[-20.118103, 36.400984, -11.582194],
[-22.837284, 41.320973, 19.853560],
[-19.041605, 34.453205, -12.006687],
[-23.042619, 41.692499, 17.628095],
[-18.050158, 32.659318, -13.352997],
[-22.837284, 41.320973, 15.402631],
[-17.398923, 31.480995, -15.402631],
[-22.186048, 40.142650, 13.352997],
[-21.194602, 38.348763, 12.006687],
[-20.118103, 36.400984, 11.582194],
[-19.041605, 34.453205, 12.006687],
[-17.193588, 31.109469, -17.628095],
[-18.050158, 32.659318, 13.352997],
[-17.398923, 31.480995, 15.402631],
[-17.193588, 31.109469, 17.628095],
[-18.050158, 32.659318, 21.903193],
[-17.398923, 31.480995, 19.853560],
[-17.398923, 31.480995, -19.853560],
[-23.042619, 41.692499, -17.628095],
[-18.050158, 32.659318, -21.903193],
[-22.837284, 41.320973, -19.853560],
[-19.041605, 34.453205, -23.249504],
[-20.118103, 36.400984, -23.673997],
[-22.186048, 40.142650, -21.903193],
[-21.194602, 38.348763, -23.249504],
],
faces: [
[0, 1, 2],
[2, 1, 3],
[1, 4, 3],
[5, 3, 6],
[4, 7, 3],
[6, 3, 8],
[7, 9, 3],
[8, 3, 10],
[9, 11, 3],
[10, 3, 12],
[11, 13, 3],
[3, 13, 12],
[14, 15, 16],
[16, 15, 17],
[17, 15, 18],
[18, 15, 19],
[19, 15, 20],
[20, 15, 21],
[21, 15, 22],
[22, 15, 23],
[15, 24, 23],
[23, 24, 25],
[25, 24, 26],
[26, 24, 27],
[27, 24, 6],
[6, 24, 5],
[28, 29, 8],
[30, 6, 31],
[31, 6, 32],
[32, 6, 33],
[6, 8, 33],
[33, 8, 34],
[34, 8, 35],
[35, 8, 36],
[36, 8, 37],
[37, 8, 38],
[8, 29, 38],
[29, 39, 38],
[38, 39, 40],
[40, 39, 41],
[41, 39, 42],
[42, 39, 43],
[43, 39, 44],
[44, 39, 45],
[30, 46, 6],
[6, 46, 27],
[46, 45, 27],
[27, 45, 47],
[47, 45, 48],
[48, 45, 49],
[49, 45, 50],
[45, 39, 50],
[39, 51, 50],
[50, 51, 52],
[52, 51, 53],
[53, 51, 54],
[51, 26, 54],
[54, 26, 55],
[55, 26, 56],
[56, 26, 57],
[57, 26, 58],
[58, 26, 59],
[26, 27, 59],
[59, 27, 60],
[60, 27, 61],
[61, 27, 62],
[62, 27, 63],
[63, 27, 47],
[17, 18, 64],
[64, 18, 65],
[51, 66, 26],
[26, 66, 25],
[18, 19, 65],
[65, 19, 67],
[66, 68, 25],
[25, 68, 23],
[19, 20, 67],
[67, 20, 69],
[68, 70, 23],
[23, 70, 22],
[20, 21, 69],
[69, 21, 71],
[21, 22, 71],
[71, 22, 70],
[8, 10, 28],
[28, 10, 72],
[73, 74, 1],
[1, 74, 4],
[10, 12, 72],
[72, 12, 75],
[74, 76, 4],
[4, 76, 7],
[12, 13, 75],
[75, 13, 77],
[76, 78, 7],
[7, 78, 9],
[13, 11, 77],
[77, 11, 79],
[11, 9, 79],
[79, 9, 78],
[64, 80, 17],
[17, 80, 16],
[80, 81, 16],
[16, 81, 0],
[81, 73, 0],
[0, 73, 1],
[14, 16, 2],
[2, 16, 0],
[15, 14, 3],
[3, 14, 2],
[24, 82, 5],
[83, 5, 84],
[82, 85, 5],
[84, 5, 86],
[85, 87, 5],
[86, 5, 88],
[87, 89, 5],
[88, 5, 90],
[89, 91, 5],
[90, 5, 92],
[91, 93, 5],
[92, 5, 94],
[93, 95, 5],
[5, 95, 94],
[94, 95, 96],
[96, 95, 97],
[97, 95, 98],
[98, 95, 99],
[95, 100, 99],
[99, 100, 101],
[101, 100, 102],
[102, 100, 103],
[5, 83, 3],
[83, 104, 3],
[104, 105, 3],
[105, 103, 3],
[103, 100, 3],
[3, 100, 15],
[100, 106, 15],
[82, 24, 107],
[106, 108, 15],
[107, 24, 109],
[108, 110, 15],
[15, 110, 24],
[110, 111, 24],
[109, 24, 112],
[111, 113, 24],
[24, 113, 112],
[39, 80, 51],
[51, 80, 66],
[80, 64, 66],
[66, 64, 68],
[64, 65, 68],
[68, 65, 70],
[65, 67, 70],
[70, 67, 71],
[71, 67, 69],
[81, 29, 73],
[73, 29, 74],
[29, 28, 74],
[74, 28, 76],
[28, 72, 76],
[76, 72, 78],
[72, 75, 78],
[78, 75, 79],
[79, 75, 77],
[80, 39, 81],
[81, 39, 29],
[52, 53, 89],
[89, 53, 91],
[100, 95, 56],
[56, 95, 55],
[53, 54, 91],
[91, 54, 93],
[54, 55, 93],
[93, 55, 95],
[56, 57, 100],
[100, 57, 106],
[111, 110, 60],
[60, 110, 59],
[57, 58, 106],
[106, 58, 108],
[58, 59, 108],
[108, 59, 110],
[60, 61, 111],
[111, 61, 113],
[107, 109, 47],
[47, 109, 63],
[61, 62, 113],
[113, 62, 112],
[62, 63, 112],
[112, 63, 109],
[47, 48, 107],
[107, 48, 82],
[89, 87, 52],
[52, 87, 50],
[48, 49, 82],
[82, 49, 85],
[49, 50, 85],
[85, 50, 87],
[34, 35, 84],
[84, 35, 83],
[103, 105, 38],
[38, 105, 37],
[35, 36, 83],
[83, 36, 104],
[36, 37, 104],
[104, 37, 105],
[38, 40, 103],
[103, 40, 102],
[98, 99, 43],
[43, 99, 42],
[40, 41, 102],
[102, 41, 101],
[41, 42, 101],
[101, 42, 99],
[43, 44, 98],
[98, 44, 97],
[92, 94, 30],
[30, 94, 46],
[44, 45, 97],
[97, 45, 96],
[45, 46, 96],
[96, 46, 94],
[30, 31, 92],
[92, 31, 90],
[84, 86, 34],
[34, 86, 33],
[31, 32, 90],
[90, 32, 88],
[32, 33, 88],
[88, 33, 86],
],
colors: [
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0x7f000066,
0x7f000066,
0x7f000066,
0x7f000066,
0x7f000066,
0x7f000066,
0x7f000066,
0x7f000066,
0x7f000066,
0x7f000066,
0x7f000066,
0x7f000066,
0x7f000066,
0x7f000066,
0x7f000066,
0x7f000066,
0x7f000066,
0x7f000066,
0x7f000066,
0x7f000066,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
0xff646464,
],
normals: [
[-0.000000, 0.000000, 243.377128],
[0.000000, 0.000000, 444.523462],
[0.000000, -0.000000, 34.202570],
[-0.000000, -0.000000, 551.983630],
[-0.000000, 0.000000, 41.209925],
[0.000000, 0.000000, 350.837296],
[0.000000, 0.000000, 46.285588],
[-0.000000, -0.000000, 34.202570],
[0.000000, -0.000000, 48.954565],
[0.000000, -0.000000, 41.209925],
[-0.000000, -0.000000, 48.954565],
[-0.000000, 0.000000, 46.285588],
[-0.000000, -0.000000, -444.523462],
[-0.000000, 0.000000, -243.377128],
[-0.000000, 0.000000, -34.202570],
[0.000000, -0.000000, -41.209925],
[-0.000000, 0.000000, -46.285588],
[0.000000, -0.000000, -48.954565],
[-0.000000, 0.000000, -48.954565],
[-0.000000, 0.000000, -46.285588],
[0.000000, 0.000000, -594.418198],
[0.000000, 0.000000, -9.146918],
[-0.000000, -0.000000, -23.831009],
[-0.000000, -0.000000, -350.837296],
[-315.542503, 570.931437, 0.000000],
[-315.542503, 570.931437, 0.000000],
[319.834642, 176.766275, 0.000000],
[17.612249, 9.733941, 0.000000],
[26.280156, 14.524522, -0.000000],
[27.441879, 15.166583, 0.000000],
[259.186684, 143.247350, 0.000000],
[7.845077, 4.335819, 0.000000],
[24.138262, 13.340740, -0.000000],
[38.704881, 21.391421, 0.000000],
[43.427037, 24.001263, -0.000000],
[36.230099, 20.023658, -0.000000],
[201.761359, 111.509509, 0.000000],
[19.968826, 11.036375, -0.000000],
[12.793826, 7.070894, 0.000000],
[28.938664, 15.993827, -0.000000],
[37.843823, 20.915532, 0.000000],
[35.596913, 19.673709, 0.000000],
[29.447219, 16.274895, -0.000000],
[18.339621, 10.135945, 0.000000],
[7.019210, 3.879378, -0.000000],
[376.586299, 208.131793, 0.000000],
[67.823323, 37.484608, -0.000000],
[149.354684, 82.545377, 0.000000],
[8.061156, 4.455241, -0.000000],
[31.468278, 17.391894, 0.000000],
[47.907550, 26.477555, 0.000000],
[245.453083, 135.657060, 0.000000],
[82.342588, 45.509118, 0.000000],
[4.450443, 2.459672, 0.000000],
[20.743628, 11.464593, 0.000000],
[35.578451, 19.663506, -0.000000],
[413.578628, 228.576720, -0.000000],
[9.830442, 5.433091, 0.000000],
[25.637060, 14.169096, 0.000000],
[36.230099, 20.023658, 0.000000],
[43.427037, 24.001263, -0.000000],
[38.704881, 21.391421, -0.000000],
[259.186684, 143.247350, 0.000000],
[11.396312, 6.298516, -0.000000],
[20.587027, 11.378042, -0.000000],
[27.441879, 15.166583, -0.000000],
[26.280156, 14.524522, 0.000000],
[17.612249, 9.733941, -0.000000],
[5.145362, 79.612777, 0.000000],
[5.145362, 79.612777, -0.000000],
[67.190067, 43.013532, 0.000000],
[67.190067, 43.013532, 0.000000],
[15.906551, 80.379243, 0.000000],
[15.906551, 80.379243, 0.000000],
[62.655507, 52.802731, 0.000000],
[62.655507, 52.802731, -0.000000],
[26.973572, 78.963498, 0.000000],
[26.973572, 78.963498, -0.000000],
[56.063089, 61.804026, -0.000000],
[56.063089, 61.804026, -0.000000],
[37.750755, 75.282061, -0.000000],
[37.750755, 75.282061, 0.000000],
[47.627884, 69.455691, 0.000000],
[47.627884, 69.455691, -0.000000],
[67.190067, 43.013532, -0.000000],
[67.190067, 43.013532, 0.000000],
[5.145362, 79.612777, -0.000000],
[5.145362, 79.612777, -0.000000],
[62.655507, 52.802731, 0.000000],
[62.655507, 52.802731, 0.000000],
[15.906551, 80.379243, -0.000000],
[15.906551, 80.379243, 0.000000],
[56.063089, 61.804026, 0.000000],
[56.063089, 61.804026, -0.000000],
[26.973572, 78.963498, 0.000000],
[26.973572, 78.963498, 0.000000],
[47.627884, 69.455691, -0.000000],
[47.627884, 69.455691, 0.000000],
[37.750755, 75.282061, 0.000000],
[37.750755, 75.282061, -0.000000],
[-0.000000, 365.431955, 0.000000],
[-0.000000, 636.881981, 0.000000],
[-0.000000, 103.731507, 0.000000],
[0.000000, 646.631557, -0.000000],
[0.000000, 365.431955, -0.000000],
[0.000000, 636.881981, -0.000000],
[652.326435, 0.000000, -0.000000],
[652.326435, -0.000000, 0.000000],
[0.000000, -2771.027890, 0.000000],
[0.000000, -2771.027890, 0.000000],
[-376.586299, -208.131793, 0.000000],
[-11.396312, -6.298516, 0.000000],
[-67.823323, -37.484608, 0.000000],
[-20.587027, -11.378042, -0.000000],
[-90.687519, -50.121197, -0.000000],
[-27.441879, -15.166583, 0.000000],
[-89.258285, -49.331287, 0.000000],
[-26.280156, -14.524522, -0.000000],
[-80.067570, -44.251761, -0.000000],
[-17.612249, -9.733941, 0.000000],
[-61.538498, -34.011109, -0.000000],
[-7.019210, -3.879378, -0.000000],
[-23.446627, -12.958487, 0.000000],
[-19.743090, -10.911615, 0.000000],
[-16.130189, -8.914836, 0.000000],
[-39.923085, -22.064699, 0.000000],
[-50.471967, -27.894857, 0.000000],
[-54.648969, -30.203403, -0.000000],
[-3.568734, -1.972369, 0.000000],
[-57.663173, -31.869294, -0.000000],
[-39.682345, -21.931647, -0.000000],
[-13.098601, -7.239337, -0.000000],
[-407.786768, -225.375674, 0.000000],
[-61.874396, -34.196754, -0.000000],
[-78.700487, -43.496201, -0.000000],
[-74.529533, -41.190997, -0.000000],
[-1096.801364, -606.180401, -0.000000],
[-1983.801391, -1096.407757, 0.000000],
[-74.529533, -41.190997, 0.000000],
[-7.019210, -3.879378, -0.000000],
[-78.700487, -43.496201, 0.000000],
[-17.612249, -9.733941, -0.000000],
[-61.874396, -34.196754, 0.000000],
[-407.786768, -225.375674, 0.000000],
[-11.396312, -6.298516, -0.000000],
[-26.280156, -14.524522, 0.000000],
[-20.587027, -11.378042, 0.000000],
[-27.441879, -15.166583, -0.000000],
[-0.000000, -0.000000, -325.934550],
[-0.000000, -0.000000, -65.851914],
[0.000000, 0.000000, -128.570501],
[0.000000, 0.000000, -24.990870],
[-0.000000, -0.000000, -17.850622],
[-0.000000, -0.000000, -12.727849],
[0.000000, 0.000000, -7.636709],
[-0.000000, -0.000000, -3.978390],
[0.000000, 0.000000, -1.326130],
[0.000000, 0.000000, 325.934550],
[0.000000, 0.000000, 65.851914],
[0.000000, 0.000000, 128.570501],
[0.000000, 0.000000, 24.990870],
[0.000000, 0.000000, 17.850622],
[-0.000000, -0.000000, 12.727849],
[0.000000, 0.000000, 7.636709],
[0.000000, 0.000000, 3.978390],
[0.000000, 0.000000, 1.326130],
[244.242843, 414.051575, 0.000000],
[244.242843, 414.051575, -0.000000],
[-2.100501, 3.800572, -22.765648],
[-2.100501, 3.800572, -22.765648],
[-11.012170, 19.925031, -4.342401],
[-11.012170, 19.925031, -4.342401],
[-6.661891, 12.053790, -20.966967],
[-6.661891, 12.053790, -20.966967],
[-10.142114, 18.350783, -13.772241],
[-10.142114, 18.350783, -13.772241],
[-11.012170, 19.925031, 4.342401],
[-11.012170, 19.925031, 4.342401],
[-2.100501, 3.800572, 22.765648],
[-2.100501, 3.800572, 22.765648],
[-10.142114, 18.350783, 13.772241],
[-10.142114, 18.350783, 13.772241],
[-6.661891, 12.053790, 20.966967],
[-6.661891, 12.053790, 20.966967],
[2.100501, -3.800572, 22.765648],
[2.100501, -3.800572, 22.765648],
[11.012170, -19.925031, 4.342401],
[11.012170, -19.925031, 4.342401],
[6.661891, -12.053790, 20.966967],
[6.661891, -12.053790, 20.966967],
[10.142114, -18.350783, 13.772241],
[10.142114, -18.350783, 13.772241],
[11.012170, -19.925031, -4.342401],
[11.012170, -19.925031, -4.342401],
[2.100501, -3.800572, -22.765648],
[2.100501, -3.800572, -22.765648],
[10.142114, -18.350783, -13.772241],
[10.142114, -18.350783, -13.772241],
[6.661891, -12.053790, -20.966967],
[6.661891, -12.053790, -20.966967],
[-2.100501, 3.800572, -22.765648],
[-2.100501, 3.800572, -22.765648],
[-11.012170, 19.925031, -4.342401],
[-11.012170, 19.925031, -4.342401],
[-6.661891, 12.053790, -20.966967],
[-6.661891, 12.053790, -20.966967],
[-10.142114, 18.350783, -13.772241],
[-10.142114, 18.350783, -13.772241],
[-11.012170, 19.925031, 4.342401],
[-11.012170, 19.925031, 4.342401],
[-2.100501, 3.800572, 22.765648],
[-2.100501, 3.800572, 22.765648],
[-10.142114, 18.350783, 13.772241],
[-10.142114, 18.350783, 13.772241],
[-6.661891, 12.053790, 20.966967],
[-6.661891, 12.053790, 20.966967],
[2.100501, -3.800572, 22.765648],
[2.100501, -3.800572, 22.765648],
[11.012170, -19.925031, 4.342401],
[11.012170, -19.925031, 4.342401],
[6.661891, -12.053790, 20.966967],
[6.661891, -12.053790, 20.966967],
[10.142114, -18.350783, 13.772241],
[10.142114, -18.350783, 13.772241],
[11.012170, -19.925031, -4.342401],
[11.012170, -19.925031, -4.342401],
[2.100501, -3.800572, -22.765648],
[2.100501, -3.800572, -22.765648],
[10.142114, -18.350783, -13.772241],
[10.142114, -18.350783, -13.772241],
[6.661891, -12.053790, -20.966967],
[6.661891, -12.053790, -20.966967],
],
edges: [
[[43.454555, 10.229617, 31.884205], [43.454555, 0.000000, 31.884205]],
[[43.454555, 0.000000, 31.884205], [0.000000, 0.000000, 31.884205]],
[[0.000000, 0.000000, 31.884205], [-26.101154, 47.226503, 31.884205]],
[[-26.101154, 47.226503, 31.884205], [-17.147952, 52.174761, 31.884205]],
[[-17.147952, 52.174761, 31.884205], [-0.558224, 22.157895, 31.884205]],
[[-0.558224, 22.157895, 31.884205], [1.048593, 19.647936, 31.884205]],
[[1.048593, 19.647936, 31.884205], [3.021097, 17.307372, 31.884205]],
[[3.021097, 17.307372, 31.884205], [5.329854, 15.213074, 31.884205]],
[[5.329854, 15.213074, 31.884205], [7.924447, 13.433882, 31.884205]],
[[7.924447, 13.433882, 31.884205], [10.736690, 12.023662, 31.884205]],
[[10.736690, 12.023662, 31.884205], [13.686458, 11.016034, 31.884205]],
[[13.686458, 11.016034, 31.884205], [16.689112, 10.421828, 31.884205]],
[[16.689112, 10.421828, 31.884205], [19.663134, 10.229617, 31.884205]],
[[19.663134, 10.229617, 31.884205], [43.454555, 10.229617, 31.884205]],
[[43.454555, 0.000000, -31.884205], [43.454555, 10.229617, -31.884205]],
[[43.454555, 10.229617, -31.884205], [19.663134, 10.229617, -31.884205]],
[[19.663134, 10.229617, -31.884205], [16.689112, 10.421828, -31.884205]],
[[16.689112, 10.421828, -31.884205], [13.686458, 11.016034, -31.884205]],
[[13.686458, 11.016034, -31.884205], [10.736690, 12.023662, -31.884205]],
[[10.736690, 12.023662, -31.884205], [7.924447, 13.433882, -31.884205]],
[[7.924447, 13.433882, -31.884205], [5.329854, 15.213074, -31.884205]],
[[5.329854, 15.213074, -31.884205], [3.021097, 17.307372, -31.884205]],
[[3.021097, 17.307372, -31.884205], [1.048593, 19.647936, -31.884205]],
[[1.048593, 19.647936, -31.884205], [-0.558224, 22.157895, -31.884205]],
[[-0.558224, 22.157895, -31.884205], [-17.147952, 52.174761, -31.884205]],
[[-17.147952, 52.174761, -31.884205], [-26.101154, 47.226503, -31.884205]],
[[-26.101154, 47.226503, -31.884205], [0.000000, 0.000000, -31.884205]],
[[0.000000, 0.000000, -31.884205], [43.454555, 0.000000, -31.884205]],
[[-17.147952, 52.174761, 31.884205], [-26.101154, 47.226503, 31.884205]],
[[-26.101154, 47.226503, 31.884205], [-26.101154, 47.226503, -31.884205]],
[[-26.101154, 47.226503, -31.884205], [-17.147952, 52.174761, -31.884205]],
[[-17.147952, 52.174761, -31.884205], [-17.147952, 52.174761, 31.884205]],
[[-7.161521, 34.105666, 5.114809], [-0.558224, 22.157895, 5.114809]],
[[-0.558224, 22.157895, 5.114809], [-0.558224, 22.157895, 31.884205]],
[[-0.558224, 22.157895, 31.884205], [-17.147952, 52.174761, 31.884205]],
[[-17.147952, 52.174761, 31.884205], [-17.147952, 52.174761, -31.884205]],
[[-17.147952, 52.174761, -31.884205], [-0.558224, 22.157895, -31.884205]],
[[-0.558224, 22.157895, -31.884205], [-0.558224, 22.157895, -5.114809]],
[[-0.558224, 22.157895, -5.114809], [-7.161521, 34.105666, -5.114809]],
[[-7.161521, 34.105666, -5.114809], [-7.161521, 34.105666, 5.114809]],
[[-14.089417, 46.640756, -17.628095], [-13.884082, 46.269230, -15.402631]],
[[-13.884082, 46.269230, -15.402631], [-13.232847, 45.090908, -13.352997]],
[[-13.232847, 45.090908, -13.352997], [-12.241400, 43.297020, -12.006687]],
[[-12.241400, 43.297020, -12.006687], [-11.164902, 41.349241, -11.582194]],
[[-11.164902, 41.349241, -11.582194], [-10.088403, 39.401463, -12.006687]],
[[-10.088403, 39.401463, -12.006687], [-9.096957, 37.607575, -13.352997]],
[[-9.096957, 37.607575, -13.352997], [-8.445721, 36.429252, -15.402631]],
[[-8.445721, 36.429252, -15.402631], [-8.240386, 36.057726, -17.628095]],
[[-8.240386, 36.057726, -17.628095], [-8.445721, 36.429252, -19.853560]],
[[-8.445721, 36.429252, -19.853560], [-9.096957, 37.607575, -21.903193]],
[[-9.096957, 37.607575, -21.903193], [-10.088403, 39.401463, -23.249504]],
[[-10.088403, 39.401463, -23.249504], [-11.164902, 41.349241, -23.673997]],
[[-11.164902, 41.349241, -23.673997], [-12.241400, 43.297020, -23.249504]],
[[-12.241400, 43.297020, -23.249504], [-13.232847, 45.090908, -21.903193]],
[[-13.232847, 45.090908, -21.903193], [-13.884082, 46.269230, -19.853560]],
[[-13.884082, 46.269230, -19.853560], [-14.089417, 46.640756, -17.628095]],
[[-14.089417, 46.640756, 17.628095], [-13.884082, 46.269230, 19.853560]],
[[-13.884082, 46.269230, 19.853560], [-13.232847, 45.090908, 21.903193]],
[[-13.232847, 45.090908, 21.903193], [-12.241400, 43.297020, 23.249504]],
[[-12.241400, 43.297020, 23.249504], [-11.164902, 41.349241, 23.673997]],
[[-11.164902, 41.349241, 23.673997], [-10.088403, 39.401463, 23.249504]],
[[-10.088403, 39.401463, 23.249504], [-9.096957, 37.607575, 21.903193]],
[[-9.096957, 37.607575, 21.903193], [-8.445721, 36.429252, 19.853560]],
[[-8.445721, 36.429252, 19.853560], [-8.240386, 36.057726, 17.628095]],
[[-8.240386, 36.057726, 17.628095], [-8.445721, 36.429252, 15.402631]],
[[-8.445721, 36.429252, 15.402631], [-9.096957, 37.607575, 13.352997]],
[[-9.096957, 37.607575, 13.352997], [-10.088403, 39.401463, 12.006687]],
[[-10.088403, 39.401463, 12.006687], [-11.164902, 41.349241, 11.582194]],
[[-11.164902, 41.349241, 11.582194], [-12.241400, 43.297020, 12.006687]],
[[-12.241400, 43.297020, 12.006687], [-13.232847, 45.090908, 13.352997]],
[[-13.232847, 45.090908, 13.352997], [-13.884082, 46.269230, 15.402631]],
[[-13.884082, 46.269230, 15.402631], [-14.089417, 46.640756, 17.628095]],
[[19.663134, 10.229617, -5.114809], [16.689112, 10.421828, -5.114809]],
[[16.689112, 10.421828, -5.114809], [13.686458, 11.016034, -5.114809]],
[[13.686458, 11.016034, -5.114809], [10.736690, 12.023662, -5.114809]],
[[10.736690, 12.023662, -5.114809], [7.924447, 13.433882, -5.114809]],
[[7.924447, 13.433882, -5.114809], [5.329854, 15.213074, -5.114809]],
[[5.329854, 15.213074, -5.114809], [3.021097, 17.307372, -5.114809]],
[[3.021097, 17.307372, -5.114809], [1.048593, 19.647936, -5.114809]],
[[1.048593, 19.647936, -5.114809], [-0.558224, 22.157895, -5.114809]],
[[-0.558224, 22.157895, -5.114809], [-0.558224, 22.157895, -31.884205]],
[[-0.558224, 22.157895, -31.884205], [1.048593, 19.647936, -31.884205]],
[[1.048593, 19.647936, -31.884205], [3.021097, 17.307372, -31.884205]],
[[3.021097, 17.307372, -31.884205], [5.329854, 15.213074, -31.884205]],
[[5.329854, 15.213074, -31.884205], [7.924447, 13.433882, -31.884205]],
[[7.924447, 13.433882, -31.884205], [10.736690, 12.023662, -31.884205]],
[[10.736690, 12.023662, -31.884205], [13.686458, 11.016034, -31.884205]],
[[13.686458, 11.016034, -31.884205], [16.689112, 10.421828, -31.884205]],
[[16.689112, 10.421828, -31.884205], [19.663134, 10.229617, -31.884205]],
[[19.663134, 10.229617, -31.884205], [19.663134, 10.229617, -5.114809]],
[[-0.558224, 22.157895, 5.114809], [1.048593, 19.647936, 5.114809]],
[[1.048593, 19.647936, 5.114809], [3.021097, 17.307372, 5.114809]],
[[3.021097, 17.307372, 5.114809], [5.329854, 15.213074, 5.114809]],
[[5.329854, 15.213074, 5.114809], [7.924447, 13.433882, 5.114809]],
[[7.924447, 13.433882, 5.114809], [10.736690, 12.023662, 5.114809]],
[[10.736690, 12.023662, 5.114809], [13.686458, 11.016034, 5.114809]],
[[13.686458, 11.016034, 5.114809], [16.689112, 10.421828, 5.114809]],
[[16.689112, 10.421828, 5.114809], [19.663134, 10.229617, 5.114809]],
[[19.663134, 10.229617, 5.114809], [19.663134, 10.229617, 31.884205]],
[[19.663134, 10.229617, 31.884205], [16.689112, 10.421828, 31.884205]],
[[16.689112, 10.421828, 31.884205], [13.686458, 11.016034, 31.884205]],
[[13.686458, 11.016034, 31.884205], [10.736690, 12.023662, 31.884205]],
[[10.736690, 12.023662, 31.884205], [7.924447, 13.433882, 31.884205]],
[[7.924447, 13.433882, 31.884205], [5.329854, 15.213074, 31.884205]],
[[5.329854, 15.213074, 31.884205], [3.021097, 17.307372, 31.884205]],
[[3.021097, 17.307372, 31.884205], [1.048593, 19.647936, 31.884205]],
[[1.048593, 19.647936, 31.884205], [-0.558224, 22.157895, 31.884205]],
[[-0.558224, 22.157895, 31.884205], [-0.558224, 22.157895, 5.114809]],
[[33.314243, 10.229617, -5.114809], [19.663134, 10.229617, -5.114809]],
[[19.663134, 10.229617, -5.114809], [19.663134, 10.229617, -31.884205]],
[[19.663134, 10.229617, -31.884205], [43.454555, 10.229617, -31.884205]],
[[43.454555, 10.229617, -31.884205], [43.454555, 10.229617, 31.884205]],
[[43.454555, 10.229617, 31.884205], [19.663134, 10.229617, 31.884205]],
[[19.663134, 10.229617, 31.884205], [19.663134, 10.229617, 5.114809]],
[[19.663134, 10.229617, 5.114809], [33.314243, 10.229617, 5.114809]],
[[33.314243, 10.229617, 5.114809], [33.314243, 10.229617, -5.114809]],
[[43.454555, 0.000000, 31.884205], [43.454555, 10.229617, 31.884205]],
[[43.454555, 10.229617, 31.884205], [43.454555, 10.229617, -31.884205]],
[[43.454555, 10.229617, -31.884205], [43.454555, 0.000000, -31.884205]],
[[43.454555, 0.000000, -31.884205], [43.454555, 0.000000, 31.884205]],
[[0.000000, 0.000000, 31.884205], [43.454555, 0.000000, 31.884205]],
[[43.454555, 0.000000, 31.884205], [43.454555, 0.000000, -31.884205]],
[[43.454555, 0.000000, -31.884205], [0.000000, 0.000000, -31.884205]],
[[0.000000, 0.000000, -31.884205], [0.000000, 0.000000, 31.884205]],
[[-26.101154, 47.226503, 31.884205], [0.000000, 0.000000, 31.884205]],
[[0.000000, 0.000000, 31.884205], [0.000000, 0.000000, -31.884205]],
[[0.000000, 0.000000, -31.884205], [-26.101154, 47.226503, -31.884205]],
[[-26.101154, 47.226503, -31.884205], [-26.101154, 47.226503, 31.884205]],
[[-20.118103, 36.400984, -11.582194], [-21.194602, 38.348763, -12.006687]],
[[-21.194602, 38.348763, -12.006687], [-22.186048, 40.142650, -13.352997]],
[[-22.186048, 40.142650, -13.352997], [-22.837284, 41.320973, -15.402631]],
[[-22.837284, 41.320973, -15.402631], [-23.042619, 41.692499, -17.628095]],
[[-23.042619, 41.692499, -17.628095], [-22.837284, 41.320973, -19.853560]],
[[-22.837284, 41.320973, -19.853560], [-22.186048, 40.142650, -21.903193]],
[[-22.186048, 40.142650, -21.903193], [-21.194602, 38.348763, -23.249504]],
[[-21.194602, 38.348763, -23.249504], [-20.118103, 36.400984, -23.673997]],
[[-20.118103, 36.400984, -23.673997], [-19.041605, 34.453205, -23.249504]],
[[-19.041605, 34.453205, -23.249504], [-18.050158, 32.659318, -21.903193]],
[[-18.050158, 32.659318, -21.903193], [-17.398923, 31.480995, -19.853560]],
[[-17.398923, 31.480995, -19.853560], [-17.193588, 31.109469, -17.628095]],
[[-17.193588, 31.109469, -17.628095], [-17.398923, 31.480995, -15.402631]],
[[-17.398923, 31.480995, -15.402631], [-18.050158, 32.659318, -13.352997]],
[[-18.050158, 32.659318, -13.352997], [-19.041605, 34.453205, -12.006687]],
[[-19.041605, 34.453205, -12.006687], [-20.118103, 36.400984, -11.582194]],
[[-20.118103, 36.400984, 23.673997], [-21.194602, 38.348763, 23.249504]],
[[-21.194602, 38.348763, 23.249504], [-22.186048, 40.142650, 21.903193]],
[[-22.186048, 40.142650, 21.903193], [-22.837284, 41.320973, 19.853560]],
[[-22.837284, 41.320973, 19.853560], [-23.042619, 41.692499, 17.628095]],
[[-23.042619, 41.692499, 17.628095], [-22.837284, 41.320973, 15.402631]],
[[-22.837284, 41.320973, 15.402631], [-22.186048, 40.142650, 13.352997]],
[[-22.186048, 40.142650, 13.352997], [-21.194602, 38.348763, 12.006687]],
[[-21.194602, 38.348763, 12.006687], [-20.118103, 36.400984, 11.582194]],
[[-20.118103, 36.400984, 11.582194], [-19.041605, 34.453205, 12.006687]],
[[-19.041605, 34.453205, 12.006687], [-18.050158, 32.659318, 13.352997]],
[[-18.050158, 32.659318, 13.352997], [-17.398923, 31.480995, 15.402631]],
[[-17.398923, 31.480995, 15.402631], [-17.193588, 31.109469, 17.628095]],
[[-17.193588, 31.109469, 17.628095], [-17.398923, 31.480995, 19.853560]],
[[-17.398923, 31.480995, 19.853560], [-18.050158, 32.659318, 21.903193]],
[[-18.050158, 32.659318, 21.903193], [-19.041605, 34.453205, 23.249504]],
[[-19.041605, 34.453205, 23.249504], [-20.118103, 36.400984, 23.673997]],
[[-0.558224, 22.157895, -5.114809], [1.048593, 19.647936, -5.114809]],
[[1.048593, 19.647936, -5.114809], [3.021097, 17.307372, -5.114809]],
[[3.021097, 17.307372, -5.114809], [5.329854, 15.213074, -5.114809]],
[[5.329854, 15.213074, -5.114809], [7.924447, 13.433882, -5.114809]],
[[7.924447, 13.433882, -5.114809], [10.736690, 12.023662, -5.114809]],
[[10.736690, 12.023662, -5.114809], [13.686458, 11.016034, -5.114809]],
[[13.686458, 11.016034, -5.114809], [16.689112, 10.421828, -5.114809]],
[[16.689112, 10.421828, -5.114809], [19.663134, 10.229617, -5.114809]],
[[19.663134, 10.229617, -5.114809], [33.314243, 10.229617, -5.114809]],
[[33.314243, 10.229617, -5.114809], [-7.161521, 34.105666, -5.114809]],
[[-7.161521, 34.105666, -5.114809], [-0.558224, 22.157895, -5.114809]],
[[19.663134, 10.229617, 5.114809], [16.689112, 10.421828, 5.114809]],
[[16.689112, 10.421828, 5.114809], [13.686458, 11.016034, 5.114809]],
[[13.686458, 11.016034, 5.114809], [10.736690, 12.023662, 5.114809]],
[[10.736690, 12.023662, 5.114809], [7.924447, 13.433882, 5.114809]],
[[7.924447, 13.433882, 5.114809], [5.329854, 15.213074, 5.114809]],
[[5.329854, 15.213074, 5.114809], [3.021097, 17.307372, 5.114809]],
[[3.021097, 17.307372, 5.114809], [1.048593, 19.647936, 5.114809]],
[[1.048593, 19.647936, 5.114809], [-0.558224, 22.157895, 5.114809]],
[[-0.558224, 22.157895, 5.114809], [-7.161521, 34.105666, 5.114809]],
[[-7.161521, 34.105666, 5.114809], [33.314243, 10.229617, 5.114809]],
[[33.314243, 10.229617, 5.114809], [19.663134, 10.229617, 5.114809]],
[[33.314243, 10.229617, 5.114809], [-7.161521, 34.105666, 5.114809]],
[[-7.161521, 34.105666, 5.114809], [-7.161521, 34.105666, -5.114809]],
[[-7.161521, 34.105666, -5.114809], [33.314243, 10.229617, -5.114809]],
[[33.314243, 10.229617, -5.114809], [33.314243, 10.229617, 5.114809]],
[[-20.118103, 36.400984, -11.582194], [-19.041605, 34.453205, -12.006687]],
[[-19.041605, 34.453205, -12.006687], [-18.050158, 32.659318, -13.352997]],
[[-18.050158, 32.659318, -13.352997], [-17.398923, 31.480995, -15.402631]],
[[-17.398923, 31.480995, -15.402631], [-17.193588, 31.109469, -17.628095]],
[[-8.240386, 36.057726, -17.628095], [-8.445721, 36.429252, -15.402631]],
[[-8.445721, 36.429252, -15.402631], [-9.096957, 37.607575, -13.352997]],
[[-9.096957, 37.607575, -13.352997], [-10.088403, 39.401463, -12.006687]],
[[-10.088403, 39.401463, -12.006687], [-11.164902, 41.349241, -11.582194]],
[[-17.193588, 31.109469, -17.628095], [-8.240386, 36.057726, -17.628095]],
[[-11.164902, 41.349241, -11.582194], [-20.118103, 36.400984, -11.582194]],
[[-17.193588, 31.109469, -17.628095], [-17.398923, 31.480995, -19.853560]],
[[-17.398923, 31.480995, -19.853560], [-18.050158, 32.659318, -21.903193]],
[[-18.050158, 32.659318, -21.903193], [-19.041605, 34.453205, -23.249504]],
[[-19.041605, 34.453205, -23.249504], [-20.118103, 36.400984, -23.673997]],
[[-11.164902, 41.349241, -23.673997], [-10.088403, 39.401463, -23.249504]],
[[-10.088403, 39.401463, -23.249504], [-9.096957, 37.607575, -21.903193]],
[[-9.096957, 37.607575, -21.903193], [-8.445721, 36.429252, -19.853560]],
[[-8.445721, 36.429252, -19.853560], [-8.240386, 36.057726, -17.628095]],
[[-20.118103, 36.400984, -23.673997], [-11.164902, 41.349241, -23.673997]],
[[-8.240386, 36.057726, -17.628095], [-17.193588, 31.109469, -17.628095]],
[[-20.118103, 36.400984, -23.673997], [-21.194602, 38.348763, -23.249504]],
[[-21.194602, 38.348763, -23.249504], [-22.186048, 40.142650, -21.903193]],
[[-22.186048, 40.142650, -21.903193], [-22.837284, 41.320973, -19.853560]],
[[-22.837284, 41.320973, -19.853560], [-23.042619, 41.692499, -17.628095]],
[[-14.089417, 46.640756, -17.628095], [-13.884082, 46.269230, -19.853560]],
[[-13.884082, 46.269230, -19.853560], [-13.232847, 45.090908, -21.903193]],
[[-13.232847, 45.090908, -21.903193], [-12.241400, 43.297020, -23.249504]],
[[-12.241400, 43.297020, -23.249504], [-11.164902, 41.349241, -23.673997]],
[[-23.042619, 41.692499, -17.628095], [-14.089417, 46.640756, -17.628095]],
[[-11.164902, 41.349241, -23.673997], [-20.118103, 36.400984, -23.673997]],
[[-23.042619, 41.692499, -17.628095], [-22.837284, 41.320973, -15.402631]],
[[-22.837284, 41.320973, -15.402631], [-22.186048, 40.142650, -13.352997]],
[[-22.186048, 40.142650, -13.352997], [-21.194602, 38.348763, -12.006687]],
[[-21.194602, 38.348763, -12.006687], [-20.118103, 36.400984, -11.582194]],
[[-11.164902, 41.349241, -11.582194], [-12.241400, 43.297020, -12.006687]],
[[-12.241400, 43.297020, -12.006687], [-13.232847, 45.090908, -13.352997]],
[[-13.232847, 45.090908, -13.352997], [-13.884082, 46.269230, -15.402631]],
[[-13.884082, 46.269230, -15.402631], [-14.089417, 46.640756, -17.628095]],
[[-20.118103, 36.400984, -11.582194], [-11.164902, 41.349241, -11.582194]],
[[-14.089417, 46.640756, -17.628095], [-23.042619, 41.692499, -17.628095]],
[[-20.118103, 36.400984, 23.673997], [-19.041605, 34.453205, 23.249504]],
[[-19.041605, 34.453205, 23.249504], [-18.050158, 32.659318, 21.903193]],
[[-18.050158, 32.659318, 21.903193], [-17.398923, 31.480995, 19.853560]],
[[-17.398923, 31.480995, 19.853560], [-17.193588, 31.109469, 17.628095]],
[[-8.240386, 36.057726, 17.628095], [-8.445721, 36.429252, 19.853560]],
[[-8.445721, 36.429252, 19.853560], [-9.096957, 37.607575, 21.903193]],
[[-9.096957, 37.607575, 21.903193], [-10.088403, 39.401463, 23.249504]],
[[-10.088403, 39.401463, 23.249504], [-11.164902, 41.349241, 23.673997]],
[[-17.193588, 31.109469, 17.628095], [-8.240386, 36.057726, 17.628095]],
[[-11.164902, 41.349241, 23.673997], [-20.118103, 36.400984, 23.673997]],
[[-17.193588, 31.109469, 17.628095], [-17.398923, 31.480995, 15.402631]],
[[-17.398923, 31.480995, 15.402631], [-18.050158, 32.659318, 13.352997]],
[[-18.050158, 32.659318, 13.352997], [-19.041605, 34.453205, 12.006687]],
[[-19.041605, 34.453205, 12.006687], [-20.118103, 36.400984, 11.582194]],
[[-11.164902, 41.349241, 11.582194], [-10.088403, 39.401463, 12.006687]],
[[-10.088403, 39.401463, 12.006687], [-9.096957, 37.607575, 13.352997]],
[[-9.096957, 37.607575, 13.352997], [-8.445721, 36.429252, 15.402631]],
[[-8.445721, 36.429252, 15.402631], [-8.240386, 36.057726, 17.628095]],
[[-20.118103, 36.400984, 11.582194], [-11.164902, 41.349241, 11.582194]],
[[-8.240386, 36.057726, 17.628095], [-17.193588, 31.109469, 17.628095]],
[[-20.118103, 36.400984, 11.582194], [-21.194602, 38.348763, 12.006687]],
[[-21.194602, 38.348763, 12.006687], [-22.186048, 40.142650, 13.352997]],
[[-22.186048, 40.142650, 13.352997], [-22.837284, 41.320973, 15.402631]],
[[-22.837284, 41.320973, 15.402631], [-23.042619, 41.692499, 17.628095]],
[[-14.089417, 46.640756, 17.628095], [-13.884082, 46.269230, 15.402631]],
[[-13.884082, 46.269230, 15.402631], [-13.232847, 45.090908, 13.352997]],
[[-13.232847, 45.090908, 13.352997], [-12.241400, 43.297020, 12.006687]],
[[-12.241400, 43.297020, 12.006687], [-11.164902, 41.349241, 11.582194]],
[[-23.042619, 41.692499, 17.628095], [-14.089417, 46.640756, 17.628095]],
[[-11.164902, 41.349241, 11.582194], [-20.118103, 36.400984, 11.582194]],
[[-23.042619, 41.692499, 17.628095], [-22.837284, 41.320973, 19.853560]],
[[-22.837284, 41.320973, 19.853560], [-22.186048, 40.142650, 21.903193]],
[[-22.186048, 40.142650, 21.903193], [-21.194602, 38.348763, 23.249504]],
[[-21.194602, 38.348763, 23.249504], [-20.118103, 36.400984, 23.673997]],
[[-11.164902, 41.349241, 23.673997], [-12.241400, 43.297020, 23.249504]],
[[-12.241400, 43.297020, 23.249504], [-13.232847, 45.090908, 21.903193]],
[[-13.232847, 45.090908, 21.903193], [-13.884082, 46.269230, 19.853560]],
[[-13.884082, 46.269230, 19.853560], [-14.089417, 46.640756, 17.628095]],
[[-20.118103, 36.400984, 23.673997], [-11.164902, 41.349241, 23.673997]],
[[-14.089417, 46.640756, 17.628095], [-23.042619, 41.692499, 17.628095]],
]
};
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"></meta>
<title>Three.js Solvespace Mesh</title>
<script src="http://threejs.org/build/three.min.js"></script>
<script src="http://threejs.org/examples/js/controls/OrthographicTrackballControls.js"></script>
<script src="bracket.js"></script>
</head>
<body>
<script>
solvespace = function(obj, params) {
var scene, edgeScene, camera, edgeCamera, renderer;
var geometry, controls, material, mesh, edges, axes;
var width, height, edgeBias;
var directionalLightArray = [];
if(typeof params === "undefined" || !("width" in params)) {
width = window.innerWidth;
}else {
width = params.width;
}
if(typeof params === "undefined" || !("height" in params)) {
height = window.innerHeight;
}else {
height = params.height;
}
edgeBias = obj.bounds.edgeBias;
domElement = init();
render();
return domElement;
function init() {
scene = new THREE.Scene();
edgeScene = new THREE.Scene();
var ratio = (width/height);
camera = new THREE.OrthographicCamera(-obj.bounds.x * ratio,
obj.bounds.x * ratio, obj.bounds.y, -obj.bounds.y, obj.bounds.near,
obj.bounds.far*10);
camera.position.z = obj.bounds.z*3;
mesh = createMesh(obj);
scene.add(mesh);
edges = createEdges(obj);
edgeScene.add(edges);
for(var i = 0; i < obj.lights.d.length; i++) {
var lightColor = new THREE.Color(obj.lights.d[i].intensity,
obj.lights.d[i].intensity, obj.lights.d[i].intensity);
directionalLight = new THREE.DirectionalLight(lightColor, 1);
directionalLight.position.set(obj.lights.d[i].direction[0],
obj.lights.d[i].direction[1], obj.lights.d[i].direction[2]);
directionalLightArray.push(directionalLight);
scene.add(directionalLight);
}
lightColor = new THREE.Color(obj.lights.a, obj.lights.a, obj.lights.a);
var ambientLight = new THREE.AmbientLight(lightColor.getHex());
scene.add(ambientLight);
renderer = new THREE.WebGLRenderer();
renderer.setSize(width, height);
renderer.autoClear = false;
controls = new THREE.OrthographicTrackballControls(camera, renderer.domElement);
//controls = new THREE.SolvespaceControls(camera, renderer.domElement);
controls.screen.width = width;
controls.screen.height = height;
controls.radius = (width + height)/4;
controls.rotateSpeed = 1.0;
controls.zoomSpeed = 1.2;
controls.panSpeed = 0.8;
controls.staticMoving = true;
controls.addEventListener("change", render);
controls.addEventListener("change", lightUpdate);
controls.addEventListener("change", setControlsCenter);
animate();
return renderer.domElement;
}
function animate() {
requestAnimationFrame( animate );
controls.update();
}
function render() {
renderer.clear();
renderer.render(scene, camera);
var farTmp = camera.far
camera.far = camera.far + edgeBias;
camera.updateProjectionMatrix();
renderer.render(edgeScene, camera);
camera.far = farTmp;
camera.updateProjectionMatrix();
}
function lightUpdate() {
var projRight = new THREE.Vector3();
var projZ = new THREE.Vector3();
var changeBasis = new THREE.Matrix3();
return function() {
// The original light positions were in camera space.
// Project them into standard space using camera's basis
// vectors (up, target, and their cross product).
projRight.copy(camera.up);
projZ.copy(camera.position).sub(controls.target).normalize();
projRight.cross(projZ).normalize();
changeBasis.set(projRight.x, camera.up.x, controls.target.x,
projRight.y, camera.up.y, controls.target.y,
projRight.z, camera.up.z, controls.target.z);
for(var i = 0; i < 2; i++) {
var newLightPos = changeBasis.applyToVector3Array(
[obj.lights.d[i].direction[0], obj.lights.d[i].direction[1],
obj.lights.d[i].direction[2]]);
directionalLightArray[i].position.set(newLightPos[0],
newLightPos[1], newLightPos[2]);
}
}()
};
function setControlsCenter() {
var rect = renderer.domElement.getBoundingClientRect()
controls.screen.left = rect.left + document.body.scrollLeft;
controls.screen.top = rect.top + document.body.scrollTop;
}
function createMesh(mesh_obj) {
var geometry = new THREE.Geometry();
var i;
var matIndex = 0;
var seenOpacities = {};
var materialsList = [];
for(i = 0; i < mesh_obj.points.length; i++) {
geometry.vertices.push(new THREE.Vector3(mesh_obj.points[i][0],
mesh_obj.points[i][1], mesh_obj.points[i][2]));
}
for(i = 0; i < mesh_obj.faces.length; i++) {
var currOpacity = ((mesh_obj.colors[i] & 0xFF000000) >>> 24)/255.0;
if(seenOpacities[currOpacity] === undefined) {
seenOpacities[currOpacity] = matIndex;
matIndex++;
materialsList.push(new THREE.MeshLambertMaterial(
{vertexColors : THREE.FaceColors, opacity : currOpacity,
transparent : true}));
}
geometry.faces.push(new THREE.Face3(mesh_obj.faces[i][0],
mesh_obj.faces[i][1], mesh_obj.faces[i][2],
new THREE.Vector3(mesh_obj.normals[i][0],
mesh_obj.normals[i][1], mesh_obj.normals[i][2]),
new THREE.Color(mesh_obj.colors[i] & 0x00FFFFFF),
seenOpacities[currOpacity]));
}
geometry.computeBoundingSphere();
return new THREE.Mesh(geometry, new THREE.MeshFaceMaterial(materialsList));
}
function createEdges(mesh_obj) {
var geometry = new THREE.Geometry();
var material = new THREE.LineBasicMaterial();
var i;
for(i = 0; i < mesh_obj.edges.length; i++) {
geometry.vertices.push(new THREE.Vector3(mesh_obj.edges[i][0][0],
mesh_obj.edges[i][0][1], mesh_obj.edges[i][0][2]),
new THREE.Vector3(mesh_obj.edges[i][1][0],
mesh_obj.edges[i][1][1], mesh_obj.edges[i][1][2]));
}
return new THREE.Line(geometry, material, THREE.LinePieces);
}
};
my_render = solvespace(three_js_bracket);
document.body.appendChild(my_render);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment