Differences
This shows you the differences between two versions of the page.
— | user_guide:tutorials:latest:hyperbolic_surface_tutorial [2023/11/06 10:57] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Tutorial on hyperbolic surfaces ====== | ||
+ | |||
+ | A // | ||
+ | |||
+ | The [[https:// | ||
+ | |||
+ | This tutorial shows how to deal with secondary fans and secondary polyhedra of hyperbolic surfaces. | ||
+ | |||
+ | ==== Construction of hyperbolic surfaces ==== | ||
+ | |||
+ | To define a hyperbolic surface we need to specify (a) a triangulation and (b) Penner coordinates. | ||
+ | |||
+ | (a) The triangulation is obtained by specifying the '' | ||
+ | |||
+ | (b) The '' | ||
+ | |||
+ | ==== Example 1: hyperbolic sphere with three cusps ==== | ||
+ | |||
+ | <code perl> | ||
+ | > application ' | ||
+ | > application ' | ||
+ | > $S3 = new Matrix< | ||
+ | > $s = new HyperbolicSurface(DCEL=> | ||
+ | </ | ||
+ | In this example the doubly connected edge list looks like this: < | ||
+ | |||
+ | ==== The secondary fan ==== | ||
+ | |||
+ | The secondary fan of the hyperbolic sphere from above can now be computed as follows. | ||
+ | |||
+ | <code perl> | ||
+ | > $f = $s-> | ||
+ | > $f-> | ||
+ | type: PolyhedralFan< | ||
+ | |||
+ | MAXIMAL_CONES | ||
+ | {0 1 2} | ||
+ | {0 1 3} | ||
+ | {1 2 4} | ||
+ | {0 2 5} | ||
+ | |||
+ | |||
+ | RAYS | ||
+ | 0 1 1 | ||
+ | 1 0 1 | ||
+ | 1 1 0 | ||
+ | 0 0 1 | ||
+ | 1 0 0 | ||
+ | 0 1 0 | ||
+ | |||
+ | > $f-> | ||
+ | </ | ||
+ | < | ||
+ | <!-- | ||
+ | polymake for knusper | ||
+ | Thu Mar 3 00:31:34 2022 | ||
+ | fan: | ||
+ | --> | ||
+ | |||
+ | |||
+ | < | ||
+ | < | ||
+ | <meta charset=utf-8> | ||
+ | < | ||
+ | < | ||
+ | /* | ||
+ | // COMMON_CODE_BLOCK_BEGIN | ||
+ | */ | ||
+ | html {overflow: scroll;} | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | # | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | } | ||
+ | /* | ||
+ | // COMMON_CODE_BLOCK_END | ||
+ | */ | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | <div id=' | ||
+ | <div class=group id=' | ||
+ | < | ||
+ | < | ||
+ | <div class=indented>< | ||
+ | <div class=suboption> | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | <div class=group id=' | ||
+ | < | ||
+ | < | ||
+ | <div class=indented>< | ||
+ | </ | ||
+ | |||
+ | <div class=group id=' | ||
+ | < | ||
+ | <div class=indented> | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | <div class=suboption> | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | |||
+ | <div class=group id=' | ||
+ | < | ||
+ | <div class=indented> | ||
+ | < | ||
+ | </ | ||
+ | <div class=suboption> | ||
+ | <div class=indented> | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | < | ||
+ | <div class=indented> | ||
+ | < | ||
+ | <select id=" | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | <div class=group id=' | ||
+ | < | ||
+ | <div class=indented> | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | </ | ||
+ | <img id=' | ||
+ | <img id=' | ||
+ | <div id=" | ||
+ | </ | ||
+ | < | ||
+ | requirejs.config({ | ||
+ | paths: { | ||
+ | three: '/ | ||
+ | TrackballControls: | ||
+ | OrbitControls: | ||
+ | Projector: '/ | ||
+ | SVGRenderer: | ||
+ | WEBGL: '/ | ||
+ | }, | ||
+ | shim: { | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | } | ||
+ | }); | ||
+ | | ||
+ | require([' | ||
+ | window.THREE = THREE; | ||
+ | require([' | ||
+ | | ||
+ | THREE.TrackballControls = TrackballControls; | ||
+ | THREE.OrbitControls = OrbitControls; | ||
+ | THREE.Projector = Projector; | ||
+ | THREE.SVGRenderer = SVGRenderer; | ||
+ | THREE.WEBGL = WEBGL; | ||
+ | |||
+ | // COMMON_CODE_BLOCK_BEGIN | ||
+ | |||
+ | const intervalLength = 25; // for automatic animations | ||
+ | const explodableModel = true; | ||
+ | const modelContains = { points: false, pointlabels: | ||
+ | const foldables = []; | ||
+ | |||
+ | var three = document.getElementById(" | ||
+ | var scene = new THREE.Scene(); | ||
+ | var renderer = new THREE.WebGLRenderer( { antialias: true } ); | ||
+ | var svgRenderer = new THREE.SVGRenderer( { antialias: true } ); | ||
+ | renderer.setPixelRatio( window.devicePixelRatio ); | ||
+ | renderer.setClearColor(0xFFFFFF, | ||
+ | svgRenderer.setClearColor(0xFFFFFF, | ||
+ | three.appendChild(renderer.domElement); | ||
+ | |||
+ | var frustumSize = 4; | ||
+ | var cameras = [new THREE.PerspectiveCamera(75, | ||
+ | cameras.forEach(function(cam) { | ||
+ | cam.position.set(0, | ||
+ | cam.lookAt(0, | ||
+ | cam.up.set(0, | ||
+ | }); | ||
+ | var controls = [new THREE.TrackballControls(cameras[0], | ||
+ | var camera, control; | ||
+ | |||
+ | controls[0].zoomSpeed = 0.2; | ||
+ | controls[0].rotateSpeed = 4; | ||
+ | |||
+ | |||
+ | // class to allow move points together with labels and spheres | ||
+ | var PMPoint = function (x,y,z) { | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | PMPoint.prototype.addLabel = function(labelsprite) { | ||
+ | | ||
+ | | ||
+ | } | ||
+ | PMPoint.prototype.addSphere = function(spheremesh) { | ||
+ | | ||
+ | | ||
+ | } | ||
+ | PMPoint.prototype.set = function(x, | ||
+ | | ||
+ | if (this.sprite) { | ||
+ | this.sprite.position.copy(this.vector); | ||
+ | } | ||
+ | if (this.sphere) { | ||
+ | this.sphere.position.copy(this.vector); | ||
+ | } | ||
+ | } | ||
+ | PMPoint.prototype.radius = function() { | ||
+ | if (this.sphere) { | ||
+ | return this.sphere.geometry.parameters.radius; | ||
+ | } else { | ||
+ | return 0; | ||
+ | } | ||
+ | }; | ||
+ | // select the target node | ||
+ | var target = document.querySelector('# | ||
+ | |||
+ | // create an observer instance | ||
+ | var observer = new MutationObserver(function(mutations) { | ||
+ | | ||
+ | if (mutation.removedNodes && mutation.removedNodes.length > 0) { | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | }); | ||
+ | }); | ||
+ | |||
+ | // configuration of the observer: | ||
+ | var config = { childList: true, characterData: | ||
+ | |||
+ | // pass in the target node, as well as the observer options | ||
+ | while (target) { | ||
+ | if (target.className==" | ||
+ | observer.observe(target, | ||
+ | break; | ||
+ | } | ||
+ | | ||
+ | } | ||
+ | |||
+ | // COMMON_CODE_BLOCK_END | ||
+ | |||
+ | var obj0 = new THREE.Object3D(); | ||
+ | obj0.name = " | ||
+ | obj0.userData.explodable = 0; | ||
+ | obj0.userData.points = []; | ||
+ | obj0.userData.points.push(new PMPoint(0, 0, 0)); | ||
+ | obj0.userData.points.push(new PMPoint(0, 0.707107, 0.707107)); | ||
+ | obj0.userData.points.push(new PMPoint(0.707107, | ||
+ | obj0.userData.points.push(new PMPoint(0.707107, | ||
+ | obj0.userData.points.push(new PMPoint(0, 0, 1)); | ||
+ | obj0.userData.points.push(new PMPoint(1, 0, 0)); | ||
+ | obj0.userData.points.push(new PMPoint(0, 1, 0)); | ||
+ | |||
+ | obj0.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj0.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj0.userData.pointlabels = [" ", " | ||
+ | obj0.userData.edgeindices = [1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0]; | ||
+ | < | ||
+ | obj0.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | init_object(obj0); | ||
+ | scene.add(obj0); | ||
+ | |||
+ | var obj1 = new THREE.Object3D(); | ||
+ | obj1.name = " | ||
+ | obj1.userData.explodable = 1; | ||
+ | obj1.userData.points = []; | ||
+ | obj1.userData.points.push(new PMPoint(0, 0.707107, 0.707107)); | ||
+ | obj1.userData.points.push(new PMPoint(0.707107, | ||
+ | obj1.userData.points.push(new PMPoint(0.707107, | ||
+ | obj1.userData.points.push(new PMPoint(0, 0, 0)); | ||
+ | |||
+ | obj1.userData.edgeindices = [0, 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3]; | ||
+ | < | ||
+ | obj1.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj1.userData.facets = [[2, 3, 0], [1, 3, 2], [0, 3, 1], [2, 0, 1]]; | ||
+ | < | ||
+ | obj1.userData.facetmaterial = [new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj1); | ||
+ | scene.add(obj1); | ||
+ | |||
+ | var obj2 = new THREE.Object3D(); | ||
+ | obj2.name = " | ||
+ | obj2.userData.explodable = 1; | ||
+ | obj2.userData.points = []; | ||
+ | obj2.userData.points.push(new PMPoint(0, 0.707107, 0.707107)); | ||
+ | obj2.userData.points.push(new PMPoint(0.707107, | ||
+ | obj2.userData.points.push(new PMPoint(0, 0, 1)); | ||
+ | obj2.userData.points.push(new PMPoint(0, 0, 0)); | ||
+ | |||
+ | obj2.userData.edgeindices = [0, 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3]; | ||
+ | < | ||
+ | obj2.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj2.userData.facets = [[3, 0, 1], [2, 0, 3], [3, 1, 2], [1, 0, 2]]; | ||
+ | < | ||
+ | obj2.userData.facetmaterial = [new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj2); | ||
+ | scene.add(obj2); | ||
+ | |||
+ | var obj3 = new THREE.Object3D(); | ||
+ | obj3.name = " | ||
+ | obj3.userData.explodable = 1; | ||
+ | obj3.userData.points = []; | ||
+ | obj3.userData.points.push(new PMPoint(0.707107, | ||
+ | obj3.userData.points.push(new PMPoint(0.707107, | ||
+ | obj3.userData.points.push(new PMPoint(1, 0, 0)); | ||
+ | obj3.userData.points.push(new PMPoint(0, 0, 0)); | ||
+ | |||
+ | obj3.userData.edgeindices = [0, 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3]; | ||
+ | < | ||
+ | obj3.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj3.userData.facets = [[3, 0, 1], [2, 0, 3], [3, 1, 2], [1, 0, 2]]; | ||
+ | < | ||
+ | obj3.userData.facetmaterial = [new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj3); | ||
+ | scene.add(obj3); | ||
+ | |||
+ | var obj4 = new THREE.Object3D(); | ||
+ | obj4.name = " | ||
+ | obj4.userData.explodable = 1; | ||
+ | obj4.userData.points = []; | ||
+ | obj4.userData.points.push(new PMPoint(0, 0.707107, 0.707107)); | ||
+ | obj4.userData.points.push(new PMPoint(0.707107, | ||
+ | obj4.userData.points.push(new PMPoint(0, 1, 0)); | ||
+ | obj4.userData.points.push(new PMPoint(0, 0, 0)); | ||
+ | |||
+ | obj4.userData.edgeindices = [0, 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3]; | ||
+ | < | ||
+ | obj4.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj4.userData.facets = [[0, 3, 1], [2, 3, 0], [1, 3, 2], [0, 1, 2]]; | ||
+ | < | ||
+ | obj4.userData.facetmaterial = [new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj4); | ||
+ | scene.add(obj4); | ||
+ | |||
+ | // COMMON_CODE_BLOCK_BEGIN | ||
+ | function textSpriteMaterial(message, | ||
+ | if ( parameters === undefined ) parameters = {}; | ||
+ | var fontface = " | ||
+ | var fontsize = parameters.hasOwnProperty(" | ||
+ | fontsize = fontsize*10; | ||
+ | var lines = message.split(' | ||
+ | var size = 512; | ||
+ | for(var i = 0; i< | ||
+ | var tmp = lines[i].length; | ||
+ | while(tmp*fontsize > size){ | ||
+ | | ||
+ | } | ||
+ | } | ||
+ | | ||
+ | var canvas = document.createElement(' | ||
+ | canvas.width = size; | ||
+ | canvas.height = size; | ||
+ | var context = canvas.getContext(' | ||
+ | context.fillStyle = " | ||
+ | context.fill(); | ||
+ | context.font = fontsize + "px " + fontface; | ||
+ | | ||
+ | // text color | ||
+ | context.fillStyle = " | ||
+ | | ||
+ | context.fillText(lines[i], | ||
+ | } | ||
+ | | ||
+ | // canvas contents will be used for a texture | ||
+ | var texture = new THREE.Texture(canvas); | ||
+ | texture.needsUpdate = true; | ||
+ | | ||
+ | var spriteMaterial = new THREE.SpriteMaterial({map: | ||
+ | return spriteMaterial; | ||
+ | } | ||
+ | |||
+ | |||
+ | // ---------------------- INITIALIZING OBJECTS-------------------------------------- | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | |||
+ | function init_object(obj) { | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_points(obj); | ||
+ | modelContains.points = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_pointlabels(obj); | ||
+ | modelContains.pointlabels = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_lines(obj); | ||
+ | modelContains.lines = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_edgelabels(obj); | ||
+ | modelContains.edgelabels = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_arrowheads(obj); | ||
+ | modelContains.arrowheads = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_faces(obj); | ||
+ | modelContains.faces = true; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function init_points(obj) { | ||
+ | var pointgroup = new THREE.Group(); | ||
+ | pointgroup.name = " | ||
+ | var points = obj.userData.points; | ||
+ | var radii = obj.userData.pointradii; | ||
+ | var materials = obj.userData.pointmaterial; | ||
+ | var geometry, | ||
+ | if (!Array.isArray(radii)) { | ||
+ | geometry = new THREE.SphereBufferGeometry(radii); | ||
+ | } | ||
+ | if (!Array.isArray(materials)) { | ||
+ | material = materials; | ||
+ | } | ||
+ | for (var i=0; i< | ||
+ | var point = points[i]; | ||
+ | if (Array.isArray(radii)) { | ||
+ | if (radii[i] == 0) { | ||
+ | continue; | ||
+ | } | ||
+ | geometry = new THREE.SphereBufferGeometry(radii[i]); | ||
+ | } | ||
+ | if (Array.isArray(materials)) { | ||
+ | material = materials[i]; | ||
+ | } | ||
+ | var sphere = new THREE.Mesh(geometry, | ||
+ | point.addSphere(sphere); | ||
+ | pointgroup.add(sphere); | ||
+ | } | ||
+ | obj.add(pointgroup); | ||
+ | } | ||
+ | |||
+ | function init_pointlabels(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var labels = obj.userData.pointlabels; | ||
+ | var pointlabels = new THREE.Group(); | ||
+ | pointlabels.name = " | ||
+ | if (Array.isArray(labels)) { | ||
+ | for (var i=0; i< | ||
+ | var point = points[i]; | ||
+ | var spriteMaterial = textSpriteMaterial( labels[i] ); | ||
+ | var sprite = new THREE.Sprite(spriteMaterial); | ||
+ | point.addLabel(sprite); | ||
+ | pointlabels.add(sprite); | ||
+ | } | ||
+ | } else { | ||
+ | var spriteMaterial = textSpriteMaterial( labels ); | ||
+ | for (var i=0; i< | ||
+ | var point = points[i]; | ||
+ | var sprite = new THREE.Sprite(spriteMaterial); | ||
+ | point.addLabel(sprite); | ||
+ | pointlabels.add(sprite); | ||
+ | } | ||
+ | } | ||
+ | obj.add(pointlabels); | ||
+ | } | ||
+ | |||
+ | function init_lines(obj) { | ||
+ | var edgeindices = obj.userData.edgeindices; | ||
+ | var points = obj.userData.points; | ||
+ | var materials = obj.userData.edgematerial; | ||
+ | var geometry = new THREE.BufferGeometry(); | ||
+ | var bufarr = new Float32Array( obj.userData.edgeindices.length * 3 ); | ||
+ | var bufattr = new THREE.Float32BufferAttribute( bufarr, 3 ); | ||
+ | var geometry = new THREE.BufferGeometry(); | ||
+ | geometry.setAttribute(' | ||
+ | if (Array.isArray(materials)) { | ||
+ | for (var i=0; i< | ||
+ | geometry.addGroup(2*i, | ||
+ | } | ||
+ | } | ||
+ | var lines = new THREE.LineSegments(geometry, | ||
+ | lines.name = " | ||
+ | obj.add(lines); | ||
+ | updateEdgesPosition(obj); | ||
+ | } | ||
+ | |||
+ | function init_edgelabels(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var edgeindices = obj.userData.edgeindices; | ||
+ | var labels = obj.userData.edgelabels; | ||
+ | var edgelabels = new THREE.Group(); | ||
+ | edgelabels.name = " | ||
+ | if (Array.isArray(labels)) { | ||
+ | for (var i=0; i< | ||
+ | var spriteMaterial = textSpriteMaterial( labels[i] ); | ||
+ | var sprite = new THREE.Sprite(spriteMaterial); | ||
+ | sprite.position.copy(new THREE.Vector3().addVectors(points[edgeindices[2*i]].vector, | ||
+ | edgelabels.add(sprite); | ||
+ | } | ||
+ | } else { | ||
+ | var spriteMaterial = textSpriteMaterial( labels ); | ||
+ | for (var i=0; i< | ||
+ | var sprite = new THREE.Sprite(spriteMaterial); | ||
+ | sprite.position.copy(new THREE.Vector3().addVectors(points[edgeindices[2*i]].vector, | ||
+ | edgelabels.add(sprite); | ||
+ | } | ||
+ | } | ||
+ | obj.add(edgelabels); | ||
+ | } | ||
+ | |||
+ | function init_arrowheads(obj) { | ||
+ | var arrowheads = new THREE.Group(); | ||
+ | arrowheads.name = " | ||
+ | var arrowstyle = obj.userData.arrowstyle; | ||
+ | var edgeindices = obj.userData.edgeindices; | ||
+ | var edgematerials = obj.userData.edgematerial; | ||
+ | var points = obj.userData.points; | ||
+ | var material; | ||
+ | if (!Array.isArray(edgematerials)) { | ||
+ | material = new THREE.MeshBasicMaterial( {color: edgematerials.color} ); | ||
+ | } | ||
+ | |||
+ | for (var i=0; i< | ||
+ | var start = points[edgeindices[i]]; | ||
+ | var end = points[edgeindices[i+1]]; | ||
+ | var dist = start.vector.distanceTo( end.vector ) - start.radius() - end.radius(); | ||
+ | if (dist <= 0) { | ||
+ | continue; | ||
+ | } | ||
+ | var dir = new THREE.Vector3().subVectors(end.vector, | ||
+ | dir.normalize(); | ||
+ | var axis = new THREE.Vector3().set(dir.z, | ||
+ | axis.normalize(); | ||
+ | var radians = Math.acos( dir.y ); | ||
+ | var radius = dist/25; | ||
+ | var height = dist/5; | ||
+ | var geometry = new THREE.ConeBufferGeometry(radius, | ||
+ | var position = new THREE.Vector3().addVectors(start.vector, | ||
+ | if (Array.isArray(edgematerials)) { | ||
+ | material = new THREE.MeshBasicMaterial( {color: edgematerials[i].color} ); | ||
+ | } | ||
+ | var cone = new THREE.Mesh( geometry, material ); | ||
+ | cone.quaternion.setFromAxisAngle(axis, | ||
+ | cone.position.copy(position);; | ||
+ | arrowheads.add(cone); | ||
+ | } | ||
+ | obj.add(arrowheads); | ||
+ | } | ||
+ | |||
+ | function init_faces(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var facets = obj.userData.facets; | ||
+ | obj.userData.triangleindices = []; | ||
+ | for (var i=0; i< | ||
+ | facet = facets[i]; | ||
+ | for (var t=0; t< | ||
+ | obj.userData.triangleindices.push(facet[0], | ||
+ | } | ||
+ | } | ||
+ | var bufarr = new Float32Array( obj.userData.triangleindices.length * 3 ); | ||
+ | var bufattr = new THREE.Float32BufferAttribute(bufarr, | ||
+ | | ||
+ | var materials = obj.userData.facetmaterial; | ||
+ | var geometry = new THREE.BufferGeometry(); | ||
+ | var frontmaterials = []; | ||
+ | var backmaterials = []; | ||
+ | geometry.setAttribute(' | ||
+ | if (Array.isArray(materials)) { | ||
+ | var tricount = 0; | ||
+ | var facet; | ||
+ | for (var i=0; i< | ||
+ | facet = facets[i]; | ||
+ | geometry.addGroup(tricount, | ||
+ | tricount += (facet.length-2)*3; | ||
+ | } | ||
+ | for (var j=0; j< | ||
+ | var fmat = materials[j].clone() | ||
+ | fmat.side = THREE.FrontSide; | ||
+ | frontmaterials.push(fmat); | ||
+ | var bmat = materials[j].clone() | ||
+ | bmat.side = THREE.BackSide; | ||
+ | backmaterials.push(bmat); | ||
+ | obj.userData.facetmaterial = frontmaterials.concat(backmaterials); | ||
+ | } | ||
+ | } else if (materials instanceof THREE.Material) { | ||
+ | frontmaterials = materials.clone() | ||
+ | frontmaterials.side = THREE.FrontSide; | ||
+ | backmaterials = materials.clone() | ||
+ | backmaterials.side = THREE.BackSide; | ||
+ | obj.userData.facetmaterial = [frontmaterials, | ||
+ | } | ||
+ | // duplicating the object with front and back should avoid transparency issues | ||
+ | var backmesh = new THREE.Mesh(geometry, | ||
+ | // meshname is used to show/hide objects | ||
+ | backmesh.name = " | ||
+ | obj.add(backmesh); | ||
+ | var frontmesh = new THREE.Mesh(geometry, | ||
+ | frontmesh.name = " | ||
+ | obj.add(frontmesh); | ||
+ | updateFacesPosition(obj); | ||
+ | } | ||
+ | // // | ||
+ | |||
+ | |||
+ | function updateFacesPosition(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var indices = obj.userData.triangleindices; | ||
+ | var faces = obj.getObjectByName(" | ||
+ | var ba = faces.geometry.getAttribute(" | ||
+ | for (var i=0; i< | ||
+ | ba.setXYZ(i, | ||
+ | } | ||
+ | faces.geometry.attributes.position.needsUpdate = true; | ||
+ | | ||
+ | } | ||
+ | |||
+ | function updateEdgesPosition(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var indices = obj.userData.edgeindices; | ||
+ | var lines = obj.getObjectByName(" | ||
+ | var ba = lines.geometry.getAttribute(" | ||
+ | for (var i=0; i< | ||
+ | ba.setXYZ(i, | ||
+ | } | ||
+ | lines.geometry.attributes.position.needsUpdate = true; | ||
+ | } | ||
+ | |||
+ | function onWindowResize() { | ||
+ | renderer.setSize( three.clientWidth, | ||
+ | svgRenderer.setSize( three.clientWidth, | ||
+ | updateCamera(); | ||
+ | } | ||
+ | |||
+ | function updateCamera() { | ||
+ | var width = three.clientWidth; | ||
+ | var height = three.clientHeight; | ||
+ | var aspect = width / height; | ||
+ | if (camera.type == " | ||
+ | camera.left = frustumSize * aspect / - 2; | ||
+ | camera.right = frustumSize * aspect / 2; | ||
+ | camera.top = frustumSize / 2; | ||
+ | camera.bottom = - frustumSize / 2; | ||
+ | } else if (camera.type == " | ||
+ | camera.aspect = aspect; | ||
+ | } | ||
+ | camera.updateProjectionMatrix(); | ||
+ | } | ||
+ | |||
+ | function changeCamera(event) { | ||
+ | var selindex = event.currentTarget.selectedIndex; | ||
+ | camera = cameras[selindex]; | ||
+ | control = controls[selindex]; | ||
+ | control.enabled = true; | ||
+ | for (var i=0; i< | ||
+ | if (i!=selindex) { | ||
+ | controls[i].enabled = false; | ||
+ | } | ||
+ | } | ||
+ | updateCamera(); | ||
+ | } | ||
+ | |||
+ | var camtypenode = document.getElementById(' | ||
+ | camtypenode.onchange = changeCamera; | ||
+ | camtypenode.dispatchEvent(new Event(' | ||
+ | |||
+ | onWindowResize(); | ||
+ | window.addEventListener(' | ||
+ | |||
+ | |||
+ | var xRotationEnabled = false; | ||
+ | var yRotationEnabled = false; | ||
+ | var zRotationEnabled = false; | ||
+ | var rotationSpeedFactor = 1; | ||
+ | var settingsShown = false; | ||
+ | var labelsShown = true; | ||
+ | var intervals = []; | ||
+ | var timeouts = []; | ||
+ | var explodingSpeed = 0.05; | ||
+ | var explodeScale = 0.000001; | ||
+ | var XMLS = new XMLSerializer(); | ||
+ | var svgElement; | ||
+ | var renderId; | ||
+ | |||
+ | var render = function () { | ||
+ | |||
+ | renderId = requestAnimationFrame(render); | ||
+ | |||
+ | // comment in for automatic explosion | ||
+ | // | ||
+ | |||
+ | var phi = 0.02 * rotationSpeedFactor; | ||
+ | |||
+ | if (xRotationEnabled) { | ||
+ | scene.rotation.x += phi; | ||
+ | } | ||
+ | if (yRotationEnabled) { | ||
+ | scene.rotation.y += phi; | ||
+ | } | ||
+ | if (zRotationEnabled) { | ||
+ | scene.rotation.z += phi; | ||
+ | } | ||
+ | |||
+ | control.update(); | ||
+ | renderer.render(scene, | ||
+ | }; | ||
+ | |||
+ | if ( THREE.WEBGL.isWebGLAvailable() ) { | ||
+ | render(); | ||
+ | } else { | ||
+ | var warning = WEBGL.getWebGLErrorMessage(); | ||
+ | three.appendChild( warning ); | ||
+ | } | ||
+ | | ||
+ | function changeTransparency() { | ||
+ | var opacity = 1-Number(event.currentTarget.value); | ||
+ | for (var i=0; i< | ||
+ | child = scene.children[i]; | ||
+ | if ( child.userData.hasOwnProperty(" | ||
+ | if (Array.isArray(child.userData.facetmaterial)) { | ||
+ | for (var j=0; j< | ||
+ | child.userData.facetmaterial[j].opacity = opacity; | ||
+ | } | ||
+ | } else { | ||
+ | child.userData.facetmaterial.opacity = opacity; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function toggleDepthWrite(event) { | ||
+ | depthwrite = event.currentTarget.checked; | ||
+ | for (var i=0; i< | ||
+ | child = scene.children[i]; | ||
+ | if ( child.userData.hasOwnProperty(" | ||
+ | if (Array.isArray(child.userData.facetmaterial)) { | ||
+ | for (var j=0; j< | ||
+ | child.userData.facetmaterial[j].depthWrite = depthwrite; | ||
+ | } | ||
+ | } else { | ||
+ | child.userData.facetmaterial.depthWrite = depthWrite; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function changeRotationX(event){ | ||
+ | xRotationEnabled = event.currentTarget.checked; | ||
+ | } | ||
+ | |||
+ | function changeRotationY(event){ | ||
+ | yRotationEnabled = event.currentTarget.checked; | ||
+ | } | ||
+ | |||
+ | function changeRotationZ(event){ | ||
+ | zRotationEnabled = event.currentTarget.checked; | ||
+ | } | ||
+ | |||
+ | |||
+ | function changeRotationSpeedFactor(event){ | ||
+ | rotationSpeedFactor = Number(event.currentTarget.value); | ||
+ | } | ||
+ | |||
+ | function resetScene(){ | ||
+ | scene.rotation.set(0, | ||
+ | camera.position.set(0, | ||
+ | camera.up.set(0, | ||
+ | } | ||
+ | |||
+ | function showSettings(event){ | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | settingsShown = true; | ||
+ | } | ||
+ | |||
+ | function hideSettings(event){ | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | settingsShown = false; | ||
+ | } | ||
+ | |||
+ | |||
+ | |||
+ | var pos = 150* Math.PI; | ||
+ | |||
+ | function updateFactor() { | ||
+ | pos++; | ||
+ | return Math.sin(.01*pos)+1; | ||
+ | } | ||
+ | |||
+ | // ------------------------ FOLDING ------------------------------------------------ | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | // rotate point p around axis defined by points p1 and p2 by given angle | ||
+ | function rotate(p, p1, p2, angle ){ | ||
+ | angle = -angle; | ||
+ | var x = p.x, y = p.y, z = p.z, | ||
+ | a = p1.x, b = p1.y, c = p1.z, | ||
+ | u = p2.x-p1.x, v = p2.y-p1.y, w = p2.z-p1.z; | ||
+ | var result = []; | ||
+ | var L = u*u + v*v + w*w; | ||
+ | var sqrt = Math.sqrt; | ||
+ | var cos = Math.cos; | ||
+ | var sin = Math.sin; | ||
+ | |||
+ | result[0] = ((a*(v*v+w*w)-u*(b*v+c*w-u*x-v*y-w*z))*(1-cos(angle))+L*x*cos(angle)+sqrt(L)*(-c*v+b*w-w*y+v*z)*sin(angle))/ | ||
+ | result[1] = ((b*(u*u+w*w)-v*(a*u+c*w-u*x-v*y-w*z))*(1-cos(angle))+L*y*cos(angle)+sqrt(L)*(c*u-a*w+w*x-u*z)*sin(angle))/ | ||
+ | result[2] = ((c*(u*u+v*v)-w*(a*u+b*v-u*x-v*y-w*z))*(1-cos(angle))+L*z*cos(angle)+sqrt(L)*(-b*u+a*v-v*x+u*y)*sin(angle))/ | ||
+ | |||
+ | return result; | ||
+ | } | ||
+ | |||
+ | var fold = function(event){ | ||
+ | var obj = foldables[Number(event.currentTarget.name)]; | ||
+ | var foldvalue = Number(event.currentTarget.value); | ||
+ | var scale = foldvalue - obj.userData.oldscale; | ||
+ | |||
+ | for (var j=0; j< | ||
+ | rotateVertices(obj, | ||
+ | } | ||
+ | update(obj); | ||
+ | obj.userData.oldscale += scale; | ||
+ | lookAtBarycenter(obj); | ||
+ | } | ||
+ | |||
+ | function lookAtBarycenter(obj){ | ||
+ | control.target = barycenter(obj); | ||
+ | } | ||
+ | |||
+ | function barycenter(obj) { | ||
+ | var center = new THREE.Vector3(0, | ||
+ | var points = obj.userData.points; | ||
+ | for (var i=0; i< | ||
+ | center.add(points[i].vector); | ||
+ | } | ||
+ | center.divideScalar(points.length); | ||
+ | return center; | ||
+ | } | ||
+ | |||
+ | function rotateVertices(obj, | ||
+ | var axes = obj.userData.axes; | ||
+ | var subtrees = obj.userData.subtrees; | ||
+ | var points = obj.userData.points; | ||
+ | var angles = obj.userData.angles; | ||
+ | if (edge < axes.length){ | ||
+ | for (var j=0; j< | ||
+ | var rotP = rotate(points[subtrees[edge][j]].vector, | ||
+ | points[subtrees[edge][j]].set(rotP[0], | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function update(obj) { | ||
+ | | ||
+ | | ||
+ | } | ||
+ | |||
+ | if (foldables.length) { | ||
+ | var settings = document.getElementById(' | ||
+ | var foldDiv = document.createElement(' | ||
+ | foldDiv.id = ' | ||
+ | var title = document.createElement(' | ||
+ | title.innerHTML = ' | ||
+ | foldDiv.appendChild(title); | ||
+ | foldDiv.className = ' | ||
+ | for (var i=0; i< | ||
+ | var range = document.createElement(' | ||
+ | range.type = ' | ||
+ | range.min = 0; | ||
+ | range.max = 1; | ||
+ | range.value = 0; | ||
+ | range.step = 0.001; | ||
+ | range.name = String(i); | ||
+ | range.oninput = fold; | ||
+ | foldDiv.appendChild(range); | ||
+ | } | ||
+ | lookAtBarycenter(foldables[0]); | ||
+ | settings.insertBefore(foldDiv, | ||
+ | } | ||
+ | |||
+ | | ||
+ | // ---------------------- EXPLOSION ------------------------------------------------ | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | |||
+ | if (explodableModel) { | ||
+ | for (var i=0; i< | ||
+ | obj = scene.children[i]; | ||
+ | if ( obj.userData.explodable ) { | ||
+ | computeCentroid(obj); | ||
+ | } | ||
+ | } | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | explode(0.000001); | ||
+ | } | ||
+ | |||
+ | function computeCentroid(obj) { | ||
+ | centroid = new THREE.Vector3(); | ||
+ | obj.userData.points.forEach(function(pmpoint) { | ||
+ | centroid.add(pmpoint.vector); | ||
+ | }); | ||
+ | centroid.divideScalar(obj.userData.points.length); | ||
+ | obj.userData.centroid = centroid; | ||
+ | } | ||
+ | |||
+ | function explode(factor) { | ||
+ | for (var i=0; i< | ||
+ | var obj = scene.children[i]; | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | var c = obj.userData.centroid; | ||
+ | obj.position.set(c.x*factor, | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function triggerExplode(event){ | ||
+ | explodeScale = Number(event.currentTarget.value); | ||
+ | explode(explodeScale); | ||
+ | } | ||
+ | |||
+ | function setExplodingSpeed(event){ | ||
+ | explodingSpeed = Number(event.currentTarget.value); | ||
+ | } | ||
+ | |||
+ | function triggerAutomaticExplode(event){ | ||
+ | if (event.currentTarget.checked){ | ||
+ | startExploding(); | ||
+ | } else { | ||
+ | clearIntervals(); | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function startExploding(){ | ||
+ | intervals.push(setInterval(explodingInterval, | ||
+ | } | ||
+ | |||
+ | |||
+ | function explodingInterval(){ | ||
+ | explodeScale += explodingSpeed; | ||
+ | if (explodeScale <= 6){ | ||
+ | explode(explodeScale); | ||
+ | } | ||
+ | else{ | ||
+ | explode(6); | ||
+ | explodeScale = 6; | ||
+ | clearIntervals(); | ||
+ | timeouts.push(setTimeout(startUnexploding, | ||
+ | } | ||
+ | document.getElementById(' | ||
+ | } | ||
+ | |||
+ | |||
+ | function startUnexploding(){ | ||
+ | intervals.push(setInterval(unexplodingInterval, | ||
+ | } | ||
+ | |||
+ | function unexplodingInterval(){ | ||
+ | explodeScale -= explodingSpeed; | ||
+ | if (explodeScale >= 0){ | ||
+ | explode(explodeScale); | ||
+ | } | ||
+ | else { | ||
+ | explode(0); | ||
+ | explodeScale = 0; | ||
+ | clearIntervals(); | ||
+ | timeouts.push(setTimeout(startExploding, | ||
+ | } | ||
+ | document.getElementById(' | ||
+ | } | ||
+ | |||
+ | function clearIntervals(){ | ||
+ | intervals.forEach(function(interval){ | ||
+ | clearInterval(interval); | ||
+ | }); | ||
+ | intervals = []; | ||
+ | timeouts.forEach(function(timeout){ | ||
+ | clearTimeout(timeout); | ||
+ | }); | ||
+ | timeouts = []; | ||
+ | } | ||
+ | |||
+ | // ---------------------- DISPLAY -------------------------------------------------- | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | |||
+ | const objectTypeInnerHTMLs = { points: " | ||
+ | const objectTypeVisible = {}; | ||
+ | Object.assign(objectTypeVisible, | ||
+ | const sortedObjectTypeKeys = Object.keys(objectTypeInnerHTMLs).sort(); | ||
+ | const shownObjectTypesList = document.getElementById(' | ||
+ | |||
+ | function setVisibility(bool, | ||
+ | for (var i=0; i< | ||
+ | var obj = scene.children[i].getObjectByName(objname); | ||
+ | if (obj) { | ||
+ | obj.visible = bool; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function toggleObjectTypeVisibility(event){ | ||
+ | var name = event.currentTarget.name; | ||
+ | var checked = event.currentTarget.checked; | ||
+ | objectTypeVisible[name] = checked; | ||
+ | if (name == " | ||
+ | setVisibility(checked," | ||
+ | setVisibility(checked," | ||
+ | } else { | ||
+ | setVisibility(checked, | ||
+ | } | ||
+ | } | ||
+ | |||
+ | for (var i=0; i< | ||
+ | var key = sortedObjectTypeKeys[i]; | ||
+ | if (modelContains[key]) { | ||
+ | var objTypeNode = document.createElement(' | ||
+ | objTypeNode.innerHTML = objectTypeInnerHTMLs[key] + '< | ||
+ | var checkbox = document.createElement(' | ||
+ | checkbox.type = ' | ||
+ | checkbox.checked = true; | ||
+ | checkbox.name = key; | ||
+ | checkbox.onchange = toggleObjectTypeVisibility; | ||
+ | shownObjectTypesList.appendChild(checkbox); | ||
+ | shownObjectTypesList.appendChild(objTypeNode); | ||
+ | } | ||
+ | } | ||
+ | |||
+ | // ------------------------------------------------------ | ||
+ | |||
+ | function toggleObjectVisibility(event){ | ||
+ | var nr = Number(event.currentTarget.name); | ||
+ | scene.children[nr].visible = event.currentTarget.checked; | ||
+ | } | ||
+ | |||
+ | // append checkboxes for displaying or hiding objects | ||
+ | var shownObjectsList = document.getElementById(' | ||
+ | for (var i=0; i< | ||
+ | obj = scene.children[i]; | ||
+ | var objNode = document.createElement(' | ||
+ | objNode.innerHTML = obj.name + '< | ||
+ | var checkbox = document.createElement(' | ||
+ | checkbox.type = ' | ||
+ | checkbox.checked = true; | ||
+ | checkbox.name = String(i); | ||
+ | checkbox.onchange = toggleObjectVisibility; | ||
+ | shownObjectsList.appendChild(checkbox); | ||
+ | shownObjectsList.appendChild(objNode); | ||
+ | } | ||
+ | |||
+ | // ---------------------- SVG ------------------------------------------------------ | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | |||
+ | function takeSvgScreenshot() { | ||
+ | if (objectTypeVisible[" | ||
+ | setVisibility(false," | ||
+ | } | ||
+ | if (objectTypeVisible[" | ||
+ | setVisibility(false," | ||
+ | } | ||
+ | svgRenderer.render(scene, | ||
+ | svgElement = XMLS.serializeToString(svgRenderer.domElement); | ||
+ | | ||
+ | if (objectTypeVisible[" | ||
+ | setVisibility(true," | ||
+ | } | ||
+ | if (objectTypeVisible[" | ||
+ | setVisibility(true," | ||
+ | } | ||
+ | |||
+ | if (document.getElementById(' | ||
+ | //show in new tab | ||
+ | var myWindow = window.open("","" | ||
+ | myWindow.document.body.innerHTML = svgElement; | ||
+ | } else{ | ||
+ | // download svg file | ||
+ | download(" | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function download(filename, | ||
+ | var element = document.createElement(' | ||
+ | element.setAttribute(' | ||
+ | element.setAttribute(' | ||
+ | |||
+ | element.style.display = ' | ||
+ | document.body.appendChild(element); | ||
+ | |||
+ | element.click(); | ||
+ | |||
+ | document.body.removeChild(element); | ||
+ | } | ||
+ | |||
+ | |||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | |||
+ | |||
+ | // ------------------ SHORTCUTS -------------------------------------------- | ||
+ | // ------------------------------------------------------------------------- | ||
+ | |||
+ | /** | ||
+ | * http:// | ||
+ | * Version : 2.01.B | ||
+ | * By Binny V A | ||
+ | * License : BSD | ||
+ | */ | ||
+ | shortcut = { | ||
+ | ' | ||
+ | ' | ||
+ | //Provide a set of default options | ||
+ | var default_options = { | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | } | ||
+ | if(!opt) opt = default_options; | ||
+ | else { | ||
+ | for(var dfo in default_options) { | ||
+ | if(typeof opt[dfo] == ' | ||
+ | } | ||
+ | } | ||
+ | |||
+ | var ele = opt.target; | ||
+ | if(typeof opt.target == ' | ||
+ | var ths = this; | ||
+ | shortcut_combination = shortcut_combination.toLowerCase(); | ||
+ | |||
+ | //The function to be called at keypress | ||
+ | var func = function(e) { | ||
+ | e = e || window.event; | ||
+ | |||
+ | if(opt[' | ||
+ | var element; | ||
+ | if(e.target) element=e.target; | ||
+ | else if(e.srcElement) element=e.srcElement; | ||
+ | if(element.nodeType==3) element=element.parentNode; | ||
+ | |||
+ | if(element.tagName == ' | ||
+ | } | ||
+ | |||
+ | //Find Which key is pressed | ||
+ | if (e.keyCode) code = e.keyCode; | ||
+ | else if (e.which) code = e.which; | ||
+ | var character = String.fromCharCode(code).toLowerCase(); | ||
+ | |||
+ | if(code == 188) character=","; | ||
+ | if(code == 190) character=" | ||
+ | |||
+ | var keys = shortcut_combination.split(" | ||
+ | //Key Pressed - counts the number of valid keypresses - if it is same as the number of keys, the shortcut function is invoked | ||
+ | var kp = 0; | ||
+ | |||
+ | //Work around for stupid Shift key bug created by using lowercase - as a result the shift+num combination was broken | ||
+ | var shift_nums = { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | ";":":", | ||
+ | "'":" | ||
+ | ",":"<", | ||
+ | " | ||
+ | "/":"?", | ||
+ | " | ||
+ | } | ||
+ | // | ||
+ | var special_keys = { | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | } | ||
+ | |||
+ | var modifiers = { | ||
+ | shift: { wanted: | ||
+ | ctrl : { wanted: | ||
+ | alt | ||
+ | meta : { wanted: | ||
+ | }; | ||
+ | | ||
+ | if(e.ctrlKey) modifiers.ctrl.pressed = true; | ||
+ | if(e.shiftKey) modifiers.shift.pressed = true; | ||
+ | if(e.altKey) modifiers.alt.pressed = true; | ||
+ | if(e.metaKey) | ||
+ | | ||
+ | for(var i=0; k=keys[i], | ||
+ | // | ||
+ | if(k == ' | ||
+ | kp++; | ||
+ | modifiers.ctrl.wanted = true; | ||
+ | |||
+ | } else if(k == ' | ||
+ | kp++; | ||
+ | modifiers.shift.wanted = true; | ||
+ | |||
+ | } else if(k == ' | ||
+ | kp++; | ||
+ | modifiers.alt.wanted = true; | ||
+ | } else if(k == ' | ||
+ | kp++; | ||
+ | modifiers.meta.wanted = true; | ||
+ | } else if(k.length > 1) { //If it is a special key | ||
+ | if(special_keys[k] == code) kp++; | ||
+ | |||
+ | } else if(opt[' | ||
+ | if(opt[' | ||
+ | |||
+ | } else { //The special keys did not match | ||
+ | if(character == k) kp++; | ||
+ | else { | ||
+ | if(shift_nums[character] && e.shiftKey) { //Stupid Shift key bug created by using lowercase | ||
+ | character = shift_nums[character]; | ||
+ | if(character == k) kp++; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | if(kp == keys.length && | ||
+ | modifiers.ctrl.pressed == modifiers.ctrl.wanted && | ||
+ | modifiers.shift.pressed == modifiers.shift.wanted && | ||
+ | modifiers.alt.pressed == modifiers.alt.wanted && | ||
+ | modifiers.meta.pressed == modifiers.meta.wanted) { | ||
+ | callback(e); | ||
+ | |||
+ | if(!opt[' | ||
+ | // | ||
+ | e.cancelBubble = true; | ||
+ | e.returnValue = false; | ||
+ | |||
+ | // | ||
+ | if (e.stopPropagation) { | ||
+ | e.stopPropagation(); | ||
+ | e.preventDefault(); | ||
+ | } | ||
+ | return false; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | this.all_shortcuts[shortcut_combination] = { | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | }; | ||
+ | //Attach the function with the event | ||
+ | if(ele.addEventListener) ele.addEventListener(opt[' | ||
+ | else if(ele.attachEvent) ele.attachEvent(' | ||
+ | else ele[' | ||
+ | }, | ||
+ | |||
+ | //Remove the shortcut - just specify the shortcut and I will remove the binding | ||
+ | ' | ||
+ | shortcut_combination = shortcut_combination.toLowerCase(); | ||
+ | var binding = this.all_shortcuts[shortcut_combination]; | ||
+ | delete(this.all_shortcuts[shortcut_combination]) | ||
+ | if(!binding) return; | ||
+ | var type = binding[' | ||
+ | var ele = binding[' | ||
+ | var callback = binding[' | ||
+ | |||
+ | if(ele.detachEvent) ele.detachEvent(' | ||
+ | else if(ele.removeEventListener) ele.removeEventListener(type, | ||
+ | else ele[' | ||
+ | } | ||
+ | } | ||
+ | |||
+ | shortcut.add(" | ||
+ | var event = new Event(' | ||
+ | if (settingsShown){ | ||
+ | document.getElementById(' | ||
+ | } else { | ||
+ | document.getElementById(' | ||
+ | } | ||
+ | }); | ||
+ | |||
+ | |||
+ | // COMMON_CODE_BLOCK_END | ||
+ | |||
+ | });}); | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | <code perl> | ||
+ | > $s-> | ||
+ | name: s | ||
+ | type: HyperbolicSurface | ||
+ | |||
+ | DCEL | ||
+ | N_vertices: 3 | ||
+ | Halfedges list: (edgeIndex: twinIndex nextIndex prevIndex headIndex) | ||
+ | 0: 1 2 4 1 (0 ---> 1) | ||
+ | 1: 0 5 3 0 (1 ---> 0) | ||
+ | 2: 3 4 0 2 (1 ---> 2) | ||
+ | 3: 2 1 5 1 (2 ---> 1) | ||
+ | 4: 5 0 2 0 (2 ---> 0) | ||
+ | 5: 4 3 1 2 (0 ---> 2) | ||
+ | |||
+ | |||
+ | FLIP_WORDS | ||
+ | {} | ||
+ | {0} | ||
+ | {1} | ||
+ | {2} | ||
+ | |||
+ | |||
+ | PENNER_COORDINATES | ||
+ | 1 1 1 | ||
+ | |||
+ | SECONDARY_FAN | ||
+ | type: PolyhedralFan< | ||
+ | </ | ||
+ | The '' | ||
+ | |||
+ | ==== GKZ vectors & secondary polyhedra ==== | ||
+ | |||
+ | In order to compute '' | ||
+ | |||
+ | Continuing with the above example, lets look at the following. | ||
+ | |||
+ | <code perl> | ||
+ | > $s = new HyperbolicSurface(DCEL=> | ||
+ | </ | ||
+ | Now we may compute an approximation of the '' | ||
+ | |||
+ | <code perl> | ||
+ | > print $s-> | ||
+ | 1 33346854621/ | ||
+ | 1 2361/3250 3955357/ | ||
+ | 1 10549213550005124385885122/ | ||
+ | 1 11433978/ | ||
+ | </ | ||
+ | The secondary polyhedron can be computed similarly using the function '' | ||
+ | |||
+ | <code perl> | ||
+ | > $p = secondary_polyhedron($s, | ||
+ | > $p-> | ||
+ | name: p | ||
+ | type: Polytope< | ||
+ | |||
+ | CONE_AMBIENT_DIM | ||
+ | 4 | ||
+ | |||
+ | VERTICES | ||
+ | 1 1.315301353 1.315301353 0.7316378744 | ||
+ | 1 0.7316489581 0.7316267908 1.315301353 | ||
+ | 1 1.752046187 0.8750928112 0.2910011302 | ||
+ | 1 0.8750928112 1.752046187 0.2910011302 | ||
+ | 0 -1 0 0 | ||
+ | 0 0 -1 0 | ||
+ | 0 0 0 -1 | ||
+ | |||
+ | |||
+ | VERTICES_IN_FACETS | ||
+ | {0 1 3 4} | ||
+ | {0 1 2 5} | ||
+ | {0 2 3 6} | ||
+ | {1 4 5} | ||
+ | {2 5 6} | ||
+ | {3 4 6} | ||
+ | |||
+ | > $p-> | ||
+ | </ | ||
+ | < | ||
+ | <!-- | ||
+ | polymake for knusper | ||
+ | Thu Mar 3 00:31:35 2022 | ||
+ | p_bounded | ||
+ | --> | ||
+ | |||
+ | |||
+ | < | ||
+ | < | ||
+ | <meta charset=utf-8> | ||
+ | < | ||
+ | < | ||
+ | /* | ||
+ | // COMMON_CODE_BLOCK_BEGIN | ||
+ | */ | ||
+ | html {overflow: scroll;} | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | # | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | } | ||
+ | /* | ||
+ | // COMMON_CODE_BLOCK_END | ||
+ | */ | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | <div id=' | ||
+ | <div class=group id=' | ||
+ | < | ||
+ | < | ||
+ | <div class=indented>< | ||
+ | </ | ||
+ | |||
+ | <div class=group id=' | ||
+ | < | ||
+ | <div class=indented> | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | <div class=suboption> | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | |||
+ | <div class=group id=' | ||
+ | < | ||
+ | <div class=indented> | ||
+ | < | ||
+ | </ | ||
+ | <div class=suboption> | ||
+ | <div class=indented> | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | < | ||
+ | <div class=indented> | ||
+ | < | ||
+ | <select id=" | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | <div class=group id=' | ||
+ | < | ||
+ | <div class=indented> | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | </ | ||
+ | <img id=' | ||
+ | <img id=' | ||
+ | <div id=" | ||
+ | </ | ||
+ | < | ||
+ | requirejs.config({ | ||
+ | paths: { | ||
+ | three: '/ | ||
+ | TrackballControls: | ||
+ | OrbitControls: | ||
+ | Projector: '/ | ||
+ | SVGRenderer: | ||
+ | WEBGL: '/ | ||
+ | }, | ||
+ | shim: { | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | } | ||
+ | }); | ||
+ | | ||
+ | require([' | ||
+ | window.THREE = THREE; | ||
+ | require([' | ||
+ | | ||
+ | THREE.TrackballControls = TrackballControls; | ||
+ | THREE.OrbitControls = OrbitControls; | ||
+ | THREE.Projector = Projector; | ||
+ | THREE.SVGRenderer = SVGRenderer; | ||
+ | THREE.WEBGL = WEBGL; | ||
+ | |||
+ | // COMMON_CODE_BLOCK_BEGIN | ||
+ | |||
+ | const intervalLength = 25; // for automatic animations | ||
+ | const explodableModel = false; | ||
+ | const modelContains = { points: false, pointlabels: | ||
+ | const foldables = []; | ||
+ | |||
+ | var three = document.getElementById(" | ||
+ | var scene = new THREE.Scene(); | ||
+ | var renderer = new THREE.WebGLRenderer( { antialias: true } ); | ||
+ | var svgRenderer = new THREE.SVGRenderer( { antialias: true } ); | ||
+ | renderer.setPixelRatio( window.devicePixelRatio ); | ||
+ | renderer.setClearColor(0xFFFFFF, | ||
+ | svgRenderer.setClearColor(0xFFFFFF, | ||
+ | three.appendChild(renderer.domElement); | ||
+ | |||
+ | var frustumSize = 4; | ||
+ | var cameras = [new THREE.PerspectiveCamera(75, | ||
+ | cameras.forEach(function(cam) { | ||
+ | cam.position.set(0, | ||
+ | cam.lookAt(0, | ||
+ | cam.up.set(0, | ||
+ | }); | ||
+ | var controls = [new THREE.TrackballControls(cameras[0], | ||
+ | var camera, control; | ||
+ | |||
+ | controls[0].zoomSpeed = 0.2; | ||
+ | controls[0].rotateSpeed = 4; | ||
+ | |||
+ | |||
+ | // class to allow move points together with labels and spheres | ||
+ | var PMPoint = function (x,y,z) { | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | PMPoint.prototype.addLabel = function(labelsprite) { | ||
+ | | ||
+ | | ||
+ | } | ||
+ | PMPoint.prototype.addSphere = function(spheremesh) { | ||
+ | | ||
+ | | ||
+ | } | ||
+ | PMPoint.prototype.set = function(x, | ||
+ | | ||
+ | if (this.sprite) { | ||
+ | this.sprite.position.copy(this.vector); | ||
+ | } | ||
+ | if (this.sphere) { | ||
+ | this.sphere.position.copy(this.vector); | ||
+ | } | ||
+ | } | ||
+ | PMPoint.prototype.radius = function() { | ||
+ | if (this.sphere) { | ||
+ | return this.sphere.geometry.parameters.radius; | ||
+ | } else { | ||
+ | return 0; | ||
+ | } | ||
+ | }; | ||
+ | // select the target node | ||
+ | var target = document.querySelector('# | ||
+ | |||
+ | // create an observer instance | ||
+ | var observer = new MutationObserver(function(mutations) { | ||
+ | | ||
+ | if (mutation.removedNodes && mutation.removedNodes.length > 0) { | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | }); | ||
+ | }); | ||
+ | |||
+ | // configuration of the observer: | ||
+ | var config = { childList: true, characterData: | ||
+ | |||
+ | // pass in the target node, as well as the observer options | ||
+ | while (target) { | ||
+ | if (target.className==" | ||
+ | observer.observe(target, | ||
+ | break; | ||
+ | } | ||
+ | | ||
+ | } | ||
+ | |||
+ | // COMMON_CODE_BLOCK_END | ||
+ | |||
+ | var obj0 = new THREE.Object3D(); | ||
+ | obj0.name = " | ||
+ | obj0.userData.explodable = 1; | ||
+ | obj0.userData.points = []; | ||
+ | obj0.userData.points.push(new PMPoint(1.75205, | ||
+ | obj0.userData.points.push(new PMPoint(1.75205, | ||
+ | obj0.userData.points.push(new PMPoint(0.731446, | ||
+ | obj0.userData.points.push(new PMPoint(-0.492828, | ||
+ | obj0.userData.points.push(new PMPoint(-0.492828, | ||
+ | obj0.userData.points.push(new PMPoint(-0.492828, | ||
+ | obj0.userData.points.push(new PMPoint(1.75205, | ||
+ | obj0.userData.points.push(new PMPoint(1.75205, | ||
+ | obj0.userData.points.push(new PMPoint(0.875004, | ||
+ | obj0.userData.points.push(new PMPoint(-0.492828, | ||
+ | obj0.userData.points.push(new PMPoint(-0.492828, | ||
+ | obj0.userData.points.push(new PMPoint(0.876119, | ||
+ | obj0.userData.points.push(new PMPoint(0.732223, | ||
+ | obj0.userData.points.push(new PMPoint(1.31428, | ||
+ | |||
+ | obj0.userData.pointradii = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; | ||
+ | < | ||
+ | obj0.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj0.userData.pointlabels = [" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "]; | ||
+ | obj0.userData.edgeindices = [0, 1, 1, 2, 2, 4, 3, 5, 4, 5, 1, 6, 5, 6, 0, 7, 6, 7, 3, 8, 7, 8, 4, 9, 3, 10, 9, 10, 8, 11, 10, 11, 2, 12, 9, 12, 0, 13, 11, 13, 12, 13]; | ||
+ | < | ||
+ | obj0.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj0.userData.facets = [[12, 13, 11, 10, 9], [0, 13, 12, 2, 1], [11, 13, 0, 7, 8], [12, 9, 4, 2], [7, 0, 1, 6], [10, 11, 8, 3], [9, 10, 3, 5, 4], [4, 5, 6, 1, 2], [8, 7, 6, 5, 3]]; | ||
+ | < | ||
+ | obj0.userData.facetmaterial = [new THREE.MeshBasicMaterial( { color: 0xFFB450, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFFB450, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFFB450, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFFB450, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFFB450, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFFB450, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj0); | ||
+ | scene.add(obj0); | ||
+ | |||
+ | // COMMON_CODE_BLOCK_BEGIN | ||
+ | function textSpriteMaterial(message, | ||
+ | if ( parameters === undefined ) parameters = {}; | ||
+ | var fontface = " | ||
+ | var fontsize = parameters.hasOwnProperty(" | ||
+ | fontsize = fontsize*10; | ||
+ | var lines = message.split(' | ||
+ | var size = 512; | ||
+ | for(var i = 0; i< | ||
+ | var tmp = lines[i].length; | ||
+ | while(tmp*fontsize > size){ | ||
+ | | ||
+ | } | ||
+ | } | ||
+ | | ||
+ | var canvas = document.createElement(' | ||
+ | canvas.width = size; | ||
+ | canvas.height = size; | ||
+ | var context = canvas.getContext(' | ||
+ | context.fillStyle = " | ||
+ | context.fill(); | ||
+ | context.font = fontsize + "px " + fontface; | ||
+ | | ||
+ | // text color | ||
+ | context.fillStyle = " | ||
+ | | ||
+ | context.fillText(lines[i], | ||
+ | } | ||
+ | | ||
+ | // canvas contents will be used for a texture | ||
+ | var texture = new THREE.Texture(canvas); | ||
+ | texture.needsUpdate = true; | ||
+ | | ||
+ | var spriteMaterial = new THREE.SpriteMaterial({map: | ||
+ | return spriteMaterial; | ||
+ | } | ||
+ | |||
+ | |||
+ | // ---------------------- INITIALIZING OBJECTS-------------------------------------- | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | |||
+ | function init_object(obj) { | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_points(obj); | ||
+ | modelContains.points = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_pointlabels(obj); | ||
+ | modelContains.pointlabels = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_lines(obj); | ||
+ | modelContains.lines = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_edgelabels(obj); | ||
+ | modelContains.edgelabels = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_arrowheads(obj); | ||
+ | modelContains.arrowheads = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_faces(obj); | ||
+ | modelContains.faces = true; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function init_points(obj) { | ||
+ | var pointgroup = new THREE.Group(); | ||
+ | pointgroup.name = " | ||
+ | var points = obj.userData.points; | ||
+ | var radii = obj.userData.pointradii; | ||
+ | var materials = obj.userData.pointmaterial; | ||
+ | var geometry, | ||
+ | if (!Array.isArray(radii)) { | ||
+ | geometry = new THREE.SphereBufferGeometry(radii); | ||
+ | } | ||
+ | if (!Array.isArray(materials)) { | ||
+ | material = materials; | ||
+ | } | ||
+ | for (var i=0; i< | ||
+ | var point = points[i]; | ||
+ | if (Array.isArray(radii)) { | ||
+ | if (radii[i] == 0) { | ||
+ | continue; | ||
+ | } | ||
+ | geometry = new THREE.SphereBufferGeometry(radii[i]); | ||
+ | } | ||
+ | if (Array.isArray(materials)) { | ||
+ | material = materials[i]; | ||
+ | } | ||
+ | var sphere = new THREE.Mesh(geometry, | ||
+ | point.addSphere(sphere); | ||
+ | pointgroup.add(sphere); | ||
+ | } | ||
+ | obj.add(pointgroup); | ||
+ | } | ||
+ | |||
+ | function init_pointlabels(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var labels = obj.userData.pointlabels; | ||
+ | var pointlabels = new THREE.Group(); | ||
+ | pointlabels.name = " | ||
+ | if (Array.isArray(labels)) { | ||
+ | for (var i=0; i< | ||
+ | var point = points[i]; | ||
+ | var spriteMaterial = textSpriteMaterial( labels[i] ); | ||
+ | var sprite = new THREE.Sprite(spriteMaterial); | ||
+ | point.addLabel(sprite); | ||
+ | pointlabels.add(sprite); | ||
+ | } | ||
+ | } else { | ||
+ | var spriteMaterial = textSpriteMaterial( labels ); | ||
+ | for (var i=0; i< | ||
+ | var point = points[i]; | ||
+ | var sprite = new THREE.Sprite(spriteMaterial); | ||
+ | point.addLabel(sprite); | ||
+ | pointlabels.add(sprite); | ||
+ | } | ||
+ | } | ||
+ | obj.add(pointlabels); | ||
+ | } | ||
+ | |||
+ | function init_lines(obj) { | ||
+ | var edgeindices = obj.userData.edgeindices; | ||
+ | var points = obj.userData.points; | ||
+ | var materials = obj.userData.edgematerial; | ||
+ | var geometry = new THREE.BufferGeometry(); | ||
+ | var bufarr = new Float32Array( obj.userData.edgeindices.length * 3 ); | ||
+ | var bufattr = new THREE.Float32BufferAttribute( bufarr, 3 ); | ||
+ | var geometry = new THREE.BufferGeometry(); | ||
+ | geometry.setAttribute(' | ||
+ | if (Array.isArray(materials)) { | ||
+ | for (var i=0; i< | ||
+ | geometry.addGroup(2*i, | ||
+ | } | ||
+ | } | ||
+ | var lines = new THREE.LineSegments(geometry, | ||
+ | lines.name = " | ||
+ | obj.add(lines); | ||
+ | updateEdgesPosition(obj); | ||
+ | } | ||
+ | |||
+ | function init_edgelabels(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var edgeindices = obj.userData.edgeindices; | ||
+ | var labels = obj.userData.edgelabels; | ||
+ | var edgelabels = new THREE.Group(); | ||
+ | edgelabels.name = " | ||
+ | if (Array.isArray(labels)) { | ||
+ | for (var i=0; i< | ||
+ | var spriteMaterial = textSpriteMaterial( labels[i] ); | ||
+ | var sprite = new THREE.Sprite(spriteMaterial); | ||
+ | sprite.position.copy(new THREE.Vector3().addVectors(points[edgeindices[2*i]].vector, | ||
+ | edgelabels.add(sprite); | ||
+ | } | ||
+ | } else { | ||
+ | var spriteMaterial = textSpriteMaterial( labels ); | ||
+ | for (var i=0; i< | ||
+ | var sprite = new THREE.Sprite(spriteMaterial); | ||
+ | sprite.position.copy(new THREE.Vector3().addVectors(points[edgeindices[2*i]].vector, | ||
+ | edgelabels.add(sprite); | ||
+ | } | ||
+ | } | ||
+ | obj.add(edgelabels); | ||
+ | } | ||
+ | |||
+ | function init_arrowheads(obj) { | ||
+ | var arrowheads = new THREE.Group(); | ||
+ | arrowheads.name = " | ||
+ | var arrowstyle = obj.userData.arrowstyle; | ||
+ | var edgeindices = obj.userData.edgeindices; | ||
+ | var edgematerials = obj.userData.edgematerial; | ||
+ | var points = obj.userData.points; | ||
+ | var material; | ||
+ | if (!Array.isArray(edgematerials)) { | ||
+ | material = new THREE.MeshBasicMaterial( {color: edgematerials.color} ); | ||
+ | } | ||
+ | |||
+ | for (var i=0; i< | ||
+ | var start = points[edgeindices[i]]; | ||
+ | var end = points[edgeindices[i+1]]; | ||
+ | var dist = start.vector.distanceTo( end.vector ) - start.radius() - end.radius(); | ||
+ | if (dist <= 0) { | ||
+ | continue; | ||
+ | } | ||
+ | var dir = new THREE.Vector3().subVectors(end.vector, | ||
+ | dir.normalize(); | ||
+ | var axis = new THREE.Vector3().set(dir.z, | ||
+ | axis.normalize(); | ||
+ | var radians = Math.acos( dir.y ); | ||
+ | var radius = dist/25; | ||
+ | var height = dist/5; | ||
+ | var geometry = new THREE.ConeBufferGeometry(radius, | ||
+ | var position = new THREE.Vector3().addVectors(start.vector, | ||
+ | if (Array.isArray(edgematerials)) { | ||
+ | material = new THREE.MeshBasicMaterial( {color: edgematerials[i].color} ); | ||
+ | } | ||
+ | var cone = new THREE.Mesh( geometry, material ); | ||
+ | cone.quaternion.setFromAxisAngle(axis, | ||
+ | cone.position.copy(position);; | ||
+ | arrowheads.add(cone); | ||
+ | } | ||
+ | obj.add(arrowheads); | ||
+ | } | ||
+ | |||
+ | function init_faces(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var facets = obj.userData.facets; | ||
+ | obj.userData.triangleindices = []; | ||
+ | for (var i=0; i< | ||
+ | facet = facets[i]; | ||
+ | for (var t=0; t< | ||
+ | obj.userData.triangleindices.push(facet[0], | ||
+ | } | ||
+ | } | ||
+ | var bufarr = new Float32Array( obj.userData.triangleindices.length * 3 ); | ||
+ | var bufattr = new THREE.Float32BufferAttribute(bufarr, | ||
+ | | ||
+ | var materials = obj.userData.facetmaterial; | ||
+ | var geometry = new THREE.BufferGeometry(); | ||
+ | var frontmaterials = []; | ||
+ | var backmaterials = []; | ||
+ | geometry.setAttribute(' | ||
+ | if (Array.isArray(materials)) { | ||
+ | var tricount = 0; | ||
+ | var facet; | ||
+ | for (var i=0; i< | ||
+ | facet = facets[i]; | ||
+ | geometry.addGroup(tricount, | ||
+ | tricount += (facet.length-2)*3; | ||
+ | } | ||
+ | for (var j=0; j< | ||
+ | var fmat = materials[j].clone() | ||
+ | fmat.side = THREE.FrontSide; | ||
+ | frontmaterials.push(fmat); | ||
+ | var bmat = materials[j].clone() | ||
+ | bmat.side = THREE.BackSide; | ||
+ | backmaterials.push(bmat); | ||
+ | obj.userData.facetmaterial = frontmaterials.concat(backmaterials); | ||
+ | } | ||
+ | } else if (materials instanceof THREE.Material) { | ||
+ | frontmaterials = materials.clone() | ||
+ | frontmaterials.side = THREE.FrontSide; | ||
+ | backmaterials = materials.clone() | ||
+ | backmaterials.side = THREE.BackSide; | ||
+ | obj.userData.facetmaterial = [frontmaterials, | ||
+ | } | ||
+ | // duplicating the object with front and back should avoid transparency issues | ||
+ | var backmesh = new THREE.Mesh(geometry, | ||
+ | // meshname is used to show/hide objects | ||
+ | backmesh.name = " | ||
+ | obj.add(backmesh); | ||
+ | var frontmesh = new THREE.Mesh(geometry, | ||
+ | frontmesh.name = " | ||
+ | obj.add(frontmesh); | ||
+ | updateFacesPosition(obj); | ||
+ | } | ||
+ | // // | ||
+ | |||
+ | |||
+ | function updateFacesPosition(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var indices = obj.userData.triangleindices; | ||
+ | var faces = obj.getObjectByName(" | ||
+ | var ba = faces.geometry.getAttribute(" | ||
+ | for (var i=0; i< | ||
+ | ba.setXYZ(i, | ||
+ | } | ||
+ | faces.geometry.attributes.position.needsUpdate = true; | ||
+ | | ||
+ | } | ||
+ | |||
+ | function updateEdgesPosition(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var indices = obj.userData.edgeindices; | ||
+ | var lines = obj.getObjectByName(" | ||
+ | var ba = lines.geometry.getAttribute(" | ||
+ | for (var i=0; i< | ||
+ | ba.setXYZ(i, | ||
+ | } | ||
+ | lines.geometry.attributes.position.needsUpdate = true; | ||
+ | } | ||
+ | |||
+ | function onWindowResize() { | ||
+ | renderer.setSize( three.clientWidth, | ||
+ | svgRenderer.setSize( three.clientWidth, | ||
+ | updateCamera(); | ||
+ | } | ||
+ | |||
+ | function updateCamera() { | ||
+ | var width = three.clientWidth; | ||
+ | var height = three.clientHeight; | ||
+ | var aspect = width / height; | ||
+ | if (camera.type == " | ||
+ | camera.left = frustumSize * aspect / - 2; | ||
+ | camera.right = frustumSize * aspect / 2; | ||
+ | camera.top = frustumSize / 2; | ||
+ | camera.bottom = - frustumSize / 2; | ||
+ | } else if (camera.type == " | ||
+ | camera.aspect = aspect; | ||
+ | } | ||
+ | camera.updateProjectionMatrix(); | ||
+ | } | ||
+ | |||
+ | function changeCamera(event) { | ||
+ | var selindex = event.currentTarget.selectedIndex; | ||
+ | camera = cameras[selindex]; | ||
+ | control = controls[selindex]; | ||
+ | control.enabled = true; | ||
+ | for (var i=0; i< | ||
+ | if (i!=selindex) { | ||
+ | controls[i].enabled = false; | ||
+ | } | ||
+ | } | ||
+ | updateCamera(); | ||
+ | } | ||
+ | |||
+ | var camtypenode = document.getElementById(' | ||
+ | camtypenode.onchange = changeCamera; | ||
+ | camtypenode.dispatchEvent(new Event(' | ||
+ | |||
+ | onWindowResize(); | ||
+ | window.addEventListener(' | ||
+ | |||
+ | |||
+ | var xRotationEnabled = false; | ||
+ | var yRotationEnabled = false; | ||
+ | var zRotationEnabled = false; | ||
+ | var rotationSpeedFactor = 1; | ||
+ | var settingsShown = false; | ||
+ | var labelsShown = true; | ||
+ | var intervals = []; | ||
+ | var timeouts = []; | ||
+ | var explodingSpeed = 0.05; | ||
+ | var explodeScale = 0.000001; | ||
+ | var XMLS = new XMLSerializer(); | ||
+ | var svgElement; | ||
+ | var renderId; | ||
+ | |||
+ | var render = function () { | ||
+ | |||
+ | renderId = requestAnimationFrame(render); | ||
+ | |||
+ | // comment in for automatic explosion | ||
+ | // | ||
+ | |||
+ | var phi = 0.02 * rotationSpeedFactor; | ||
+ | |||
+ | if (xRotationEnabled) { | ||
+ | scene.rotation.x += phi; | ||
+ | } | ||
+ | if (yRotationEnabled) { | ||
+ | scene.rotation.y += phi; | ||
+ | } | ||
+ | if (zRotationEnabled) { | ||
+ | scene.rotation.z += phi; | ||
+ | } | ||
+ | |||
+ | control.update(); | ||
+ | renderer.render(scene, | ||
+ | }; | ||
+ | |||
+ | if ( THREE.WEBGL.isWebGLAvailable() ) { | ||
+ | render(); | ||
+ | } else { | ||
+ | var warning = WEBGL.getWebGLErrorMessage(); | ||
+ | three.appendChild( warning ); | ||
+ | } | ||
+ | | ||
+ | function changeTransparency() { | ||
+ | var opacity = 1-Number(event.currentTarget.value); | ||
+ | for (var i=0; i< | ||
+ | child = scene.children[i]; | ||
+ | if ( child.userData.hasOwnProperty(" | ||
+ | if (Array.isArray(child.userData.facetmaterial)) { | ||
+ | for (var j=0; j< | ||
+ | child.userData.facetmaterial[j].opacity = opacity; | ||
+ | } | ||
+ | } else { | ||
+ | child.userData.facetmaterial.opacity = opacity; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function toggleDepthWrite(event) { | ||
+ | depthwrite = event.currentTarget.checked; | ||
+ | for (var i=0; i< | ||
+ | child = scene.children[i]; | ||
+ | if ( child.userData.hasOwnProperty(" | ||
+ | if (Array.isArray(child.userData.facetmaterial)) { | ||
+ | for (var j=0; j< | ||
+ | child.userData.facetmaterial[j].depthWrite = depthwrite; | ||
+ | } | ||
+ | } else { | ||
+ | child.userData.facetmaterial.depthWrite = depthWrite; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function changeRotationX(event){ | ||
+ | xRotationEnabled = event.currentTarget.checked; | ||
+ | } | ||
+ | |||
+ | function changeRotationY(event){ | ||
+ | yRotationEnabled = event.currentTarget.checked; | ||
+ | } | ||
+ | |||
+ | function changeRotationZ(event){ | ||
+ | zRotationEnabled = event.currentTarget.checked; | ||
+ | } | ||
+ | |||
+ | |||
+ | function changeRotationSpeedFactor(event){ | ||
+ | rotationSpeedFactor = Number(event.currentTarget.value); | ||
+ | } | ||
+ | |||
+ | function resetScene(){ | ||
+ | scene.rotation.set(0, | ||
+ | camera.position.set(0, | ||
+ | camera.up.set(0, | ||
+ | } | ||
+ | |||
+ | function showSettings(event){ | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | settingsShown = true; | ||
+ | } | ||
+ | |||
+ | function hideSettings(event){ | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | settingsShown = false; | ||
+ | } | ||
+ | |||
+ | |||
+ | |||
+ | var pos = 150* Math.PI; | ||
+ | |||
+ | function updateFactor() { | ||
+ | pos++; | ||
+ | return Math.sin(.01*pos)+1; | ||
+ | } | ||
+ | |||
+ | // ------------------------ FOLDING ------------------------------------------------ | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | // rotate point p around axis defined by points p1 and p2 by given angle | ||
+ | function rotate(p, p1, p2, angle ){ | ||
+ | angle = -angle; | ||
+ | var x = p.x, y = p.y, z = p.z, | ||
+ | a = p1.x, b = p1.y, c = p1.z, | ||
+ | u = p2.x-p1.x, v = p2.y-p1.y, w = p2.z-p1.z; | ||
+ | var result = []; | ||
+ | var L = u*u + v*v + w*w; | ||
+ | var sqrt = Math.sqrt; | ||
+ | var cos = Math.cos; | ||
+ | var sin = Math.sin; | ||
+ | |||
+ | result[0] = ((a*(v*v+w*w)-u*(b*v+c*w-u*x-v*y-w*z))*(1-cos(angle))+L*x*cos(angle)+sqrt(L)*(-c*v+b*w-w*y+v*z)*sin(angle))/ | ||
+ | result[1] = ((b*(u*u+w*w)-v*(a*u+c*w-u*x-v*y-w*z))*(1-cos(angle))+L*y*cos(angle)+sqrt(L)*(c*u-a*w+w*x-u*z)*sin(angle))/ | ||
+ | result[2] = ((c*(u*u+v*v)-w*(a*u+b*v-u*x-v*y-w*z))*(1-cos(angle))+L*z*cos(angle)+sqrt(L)*(-b*u+a*v-v*x+u*y)*sin(angle))/ | ||
+ | |||
+ | return result; | ||
+ | } | ||
+ | |||
+ | var fold = function(event){ | ||
+ | var obj = foldables[Number(event.currentTarget.name)]; | ||
+ | var foldvalue = Number(event.currentTarget.value); | ||
+ | var scale = foldvalue - obj.userData.oldscale; | ||
+ | |||
+ | for (var j=0; j< | ||
+ | rotateVertices(obj, | ||
+ | } | ||
+ | update(obj); | ||
+ | obj.userData.oldscale += scale; | ||
+ | lookAtBarycenter(obj); | ||
+ | } | ||
+ | |||
+ | function lookAtBarycenter(obj){ | ||
+ | control.target = barycenter(obj); | ||
+ | } | ||
+ | |||
+ | function barycenter(obj) { | ||
+ | var center = new THREE.Vector3(0, | ||
+ | var points = obj.userData.points; | ||
+ | for (var i=0; i< | ||
+ | center.add(points[i].vector); | ||
+ | } | ||
+ | center.divideScalar(points.length); | ||
+ | return center; | ||
+ | } | ||
+ | |||
+ | function rotateVertices(obj, | ||
+ | var axes = obj.userData.axes; | ||
+ | var subtrees = obj.userData.subtrees; | ||
+ | var points = obj.userData.points; | ||
+ | var angles = obj.userData.angles; | ||
+ | if (edge < axes.length){ | ||
+ | for (var j=0; j< | ||
+ | var rotP = rotate(points[subtrees[edge][j]].vector, | ||
+ | points[subtrees[edge][j]].set(rotP[0], | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function update(obj) { | ||
+ | | ||
+ | | ||
+ | } | ||
+ | |||
+ | if (foldables.length) { | ||
+ | var settings = document.getElementById(' | ||
+ | var foldDiv = document.createElement(' | ||
+ | foldDiv.id = ' | ||
+ | var title = document.createElement(' | ||
+ | title.innerHTML = ' | ||
+ | foldDiv.appendChild(title); | ||
+ | foldDiv.className = ' | ||
+ | for (var i=0; i< | ||
+ | var range = document.createElement(' | ||
+ | range.type = ' | ||
+ | range.min = 0; | ||
+ | range.max = 1; | ||
+ | range.value = 0; | ||
+ | range.step = 0.001; | ||
+ | range.name = String(i); | ||
+ | range.oninput = fold; | ||
+ | foldDiv.appendChild(range); | ||
+ | } | ||
+ | lookAtBarycenter(foldables[0]); | ||
+ | settings.insertBefore(foldDiv, | ||
+ | } | ||
+ | |||
+ | | ||
+ | // ---------------------- EXPLOSION ------------------------------------------------ | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | |||
+ | if (explodableModel) { | ||
+ | for (var i=0; i< | ||
+ | obj = scene.children[i]; | ||
+ | if ( obj.userData.explodable ) { | ||
+ | computeCentroid(obj); | ||
+ | } | ||
+ | } | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | explode(0.000001); | ||
+ | } | ||
+ | |||
+ | function computeCentroid(obj) { | ||
+ | centroid = new THREE.Vector3(); | ||
+ | obj.userData.points.forEach(function(pmpoint) { | ||
+ | centroid.add(pmpoint.vector); | ||
+ | }); | ||
+ | centroid.divideScalar(obj.userData.points.length); | ||
+ | obj.userData.centroid = centroid; | ||
+ | } | ||
+ | |||
+ | function explode(factor) { | ||
+ | for (var i=0; i< | ||
+ | var obj = scene.children[i]; | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | var c = obj.userData.centroid; | ||
+ | obj.position.set(c.x*factor, | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function triggerExplode(event){ | ||
+ | explodeScale = Number(event.currentTarget.value); | ||
+ | explode(explodeScale); | ||
+ | } | ||
+ | |||
+ | function setExplodingSpeed(event){ | ||
+ | explodingSpeed = Number(event.currentTarget.value); | ||
+ | } | ||
+ | |||
+ | function triggerAutomaticExplode(event){ | ||
+ | if (event.currentTarget.checked){ | ||
+ | startExploding(); | ||
+ | } else { | ||
+ | clearIntervals(); | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function startExploding(){ | ||
+ | intervals.push(setInterval(explodingInterval, | ||
+ | } | ||
+ | |||
+ | |||
+ | function explodingInterval(){ | ||
+ | explodeScale += explodingSpeed; | ||
+ | if (explodeScale <= 6){ | ||
+ | explode(explodeScale); | ||
+ | } | ||
+ | else{ | ||
+ | explode(6); | ||
+ | explodeScale = 6; | ||
+ | clearIntervals(); | ||
+ | timeouts.push(setTimeout(startUnexploding, | ||
+ | } | ||
+ | document.getElementById(' | ||
+ | } | ||
+ | |||
+ | |||
+ | function startUnexploding(){ | ||
+ | intervals.push(setInterval(unexplodingInterval, | ||
+ | } | ||
+ | |||
+ | function unexplodingInterval(){ | ||
+ | explodeScale -= explodingSpeed; | ||
+ | if (explodeScale >= 0){ | ||
+ | explode(explodeScale); | ||
+ | } | ||
+ | else { | ||
+ | explode(0); | ||
+ | explodeScale = 0; | ||
+ | clearIntervals(); | ||
+ | timeouts.push(setTimeout(startExploding, | ||
+ | } | ||
+ | document.getElementById(' | ||
+ | } | ||
+ | |||
+ | function clearIntervals(){ | ||
+ | intervals.forEach(function(interval){ | ||
+ | clearInterval(interval); | ||
+ | }); | ||
+ | intervals = []; | ||
+ | timeouts.forEach(function(timeout){ | ||
+ | clearTimeout(timeout); | ||
+ | }); | ||
+ | timeouts = []; | ||
+ | } | ||
+ | |||
+ | // ---------------------- DISPLAY -------------------------------------------------- | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | |||
+ | const objectTypeInnerHTMLs = { points: " | ||
+ | const objectTypeVisible = {}; | ||
+ | Object.assign(objectTypeVisible, | ||
+ | const sortedObjectTypeKeys = Object.keys(objectTypeInnerHTMLs).sort(); | ||
+ | const shownObjectTypesList = document.getElementById(' | ||
+ | |||
+ | function setVisibility(bool, | ||
+ | for (var i=0; i< | ||
+ | var obj = scene.children[i].getObjectByName(objname); | ||
+ | if (obj) { | ||
+ | obj.visible = bool; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function toggleObjectTypeVisibility(event){ | ||
+ | var name = event.currentTarget.name; | ||
+ | var checked = event.currentTarget.checked; | ||
+ | objectTypeVisible[name] = checked; | ||
+ | if (name == " | ||
+ | setVisibility(checked," | ||
+ | setVisibility(checked," | ||
+ | } else { | ||
+ | setVisibility(checked, | ||
+ | } | ||
+ | } | ||
+ | |||
+ | for (var i=0; i< | ||
+ | var key = sortedObjectTypeKeys[i]; | ||
+ | if (modelContains[key]) { | ||
+ | var objTypeNode = document.createElement(' | ||
+ | objTypeNode.innerHTML = objectTypeInnerHTMLs[key] + '< | ||
+ | var checkbox = document.createElement(' | ||
+ | checkbox.type = ' | ||
+ | checkbox.checked = true; | ||
+ | checkbox.name = key; | ||
+ | checkbox.onchange = toggleObjectTypeVisibility; | ||
+ | shownObjectTypesList.appendChild(checkbox); | ||
+ | shownObjectTypesList.appendChild(objTypeNode); | ||
+ | } | ||
+ | } | ||
+ | |||
+ | // ------------------------------------------------------ | ||
+ | |||
+ | function toggleObjectVisibility(event){ | ||
+ | var nr = Number(event.currentTarget.name); | ||
+ | scene.children[nr].visible = event.currentTarget.checked; | ||
+ | } | ||
+ | |||
+ | // append checkboxes for displaying or hiding objects | ||
+ | var shownObjectsList = document.getElementById(' | ||
+ | for (var i=0; i< | ||
+ | obj = scene.children[i]; | ||
+ | var objNode = document.createElement(' | ||
+ | objNode.innerHTML = obj.name + '< | ||
+ | var checkbox = document.createElement(' | ||
+ | checkbox.type = ' | ||
+ | checkbox.checked = true; | ||
+ | checkbox.name = String(i); | ||
+ | checkbox.onchange = toggleObjectVisibility; | ||
+ | shownObjectsList.appendChild(checkbox); | ||
+ | shownObjectsList.appendChild(objNode); | ||
+ | } | ||
+ | |||
+ | // ---------------------- SVG ------------------------------------------------------ | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | |||
+ | function takeSvgScreenshot() { | ||
+ | if (objectTypeVisible[" | ||
+ | setVisibility(false," | ||
+ | } | ||
+ | if (objectTypeVisible[" | ||
+ | setVisibility(false," | ||
+ | } | ||
+ | svgRenderer.render(scene, | ||
+ | svgElement = XMLS.serializeToString(svgRenderer.domElement); | ||
+ | | ||
+ | if (objectTypeVisible[" | ||
+ | setVisibility(true," | ||
+ | } | ||
+ | if (objectTypeVisible[" | ||
+ | setVisibility(true," | ||
+ | } | ||
+ | |||
+ | if (document.getElementById(' | ||
+ | //show in new tab | ||
+ | var myWindow = window.open("","" | ||
+ | myWindow.document.body.innerHTML = svgElement; | ||
+ | } else{ | ||
+ | // download svg file | ||
+ | download(" | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function download(filename, | ||
+ | var element = document.createElement(' | ||
+ | element.setAttribute(' | ||
+ | element.setAttribute(' | ||
+ | |||
+ | element.style.display = ' | ||
+ | document.body.appendChild(element); | ||
+ | |||
+ | element.click(); | ||
+ | |||
+ | document.body.removeChild(element); | ||
+ | } | ||
+ | |||
+ | |||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | |||
+ | |||
+ | // ------------------ SHORTCUTS -------------------------------------------- | ||
+ | // ------------------------------------------------------------------------- | ||
+ | |||
+ | /** | ||
+ | * http:// | ||
+ | * Version : 2.01.B | ||
+ | * By Binny V A | ||
+ | * License : BSD | ||
+ | */ | ||
+ | shortcut = { | ||
+ | ' | ||
+ | ' | ||
+ | //Provide a set of default options | ||
+ | var default_options = { | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | } | ||
+ | if(!opt) opt = default_options; | ||
+ | else { | ||
+ | for(var dfo in default_options) { | ||
+ | if(typeof opt[dfo] == ' | ||
+ | } | ||
+ | } | ||
+ | |||
+ | var ele = opt.target; | ||
+ | if(typeof opt.target == ' | ||
+ | var ths = this; | ||
+ | shortcut_combination = shortcut_combination.toLowerCase(); | ||
+ | |||
+ | //The function to be called at keypress | ||
+ | var func = function(e) { | ||
+ | e = e || window.event; | ||
+ | |||
+ | if(opt[' | ||
+ | var element; | ||
+ | if(e.target) element=e.target; | ||
+ | else if(e.srcElement) element=e.srcElement; | ||
+ | if(element.nodeType==3) element=element.parentNode; | ||
+ | |||
+ | if(element.tagName == ' | ||
+ | } | ||
+ | |||
+ | //Find Which key is pressed | ||
+ | if (e.keyCode) code = e.keyCode; | ||
+ | else if (e.which) code = e.which; | ||
+ | var character = String.fromCharCode(code).toLowerCase(); | ||
+ | |||
+ | if(code == 188) character=","; | ||
+ | if(code == 190) character=" | ||
+ | |||
+ | var keys = shortcut_combination.split(" | ||
+ | //Key Pressed - counts the number of valid keypresses - if it is same as the number of keys, the shortcut function is invoked | ||
+ | var kp = 0; | ||
+ | |||
+ | //Work around for stupid Shift key bug created by using lowercase - as a result the shift+num combination was broken | ||
+ | var shift_nums = { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | ";":":", | ||
+ | "'":" | ||
+ | ",":"<", | ||
+ | " | ||
+ | "/":"?", | ||
+ | " | ||
+ | } | ||
+ | // | ||
+ | var special_keys = { | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | } | ||
+ | |||
+ | var modifiers = { | ||
+ | shift: { wanted: | ||
+ | ctrl : { wanted: | ||
+ | alt | ||
+ | meta : { wanted: | ||
+ | }; | ||
+ | | ||
+ | if(e.ctrlKey) modifiers.ctrl.pressed = true; | ||
+ | if(e.shiftKey) modifiers.shift.pressed = true; | ||
+ | if(e.altKey) modifiers.alt.pressed = true; | ||
+ | if(e.metaKey) | ||
+ | | ||
+ | for(var i=0; k=keys[i], | ||
+ | // | ||
+ | if(k == ' | ||
+ | kp++; | ||
+ | modifiers.ctrl.wanted = true; | ||
+ | |||
+ | } else if(k == ' | ||
+ | kp++; | ||
+ | modifiers.shift.wanted = true; | ||
+ | |||
+ | } else if(k == ' | ||
+ | kp++; | ||
+ | modifiers.alt.wanted = true; | ||
+ | } else if(k == ' | ||
+ | kp++; | ||
+ | modifiers.meta.wanted = true; | ||
+ | } else if(k.length > 1) { //If it is a special key | ||
+ | if(special_keys[k] == code) kp++; | ||
+ | |||
+ | } else if(opt[' | ||
+ | if(opt[' | ||
+ | |||
+ | } else { //The special keys did not match | ||
+ | if(character == k) kp++; | ||
+ | else { | ||
+ | if(shift_nums[character] && e.shiftKey) { //Stupid Shift key bug created by using lowercase | ||
+ | character = shift_nums[character]; | ||
+ | if(character == k) kp++; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | if(kp == keys.length && | ||
+ | modifiers.ctrl.pressed == modifiers.ctrl.wanted && | ||
+ | modifiers.shift.pressed == modifiers.shift.wanted && | ||
+ | modifiers.alt.pressed == modifiers.alt.wanted && | ||
+ | modifiers.meta.pressed == modifiers.meta.wanted) { | ||
+ | callback(e); | ||
+ | |||
+ | if(!opt[' | ||
+ | // | ||
+ | e.cancelBubble = true; | ||
+ | e.returnValue = false; | ||
+ | |||
+ | // | ||
+ | if (e.stopPropagation) { | ||
+ | e.stopPropagation(); | ||
+ | e.preventDefault(); | ||
+ | } | ||
+ | return false; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | this.all_shortcuts[shortcut_combination] = { | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | }; | ||
+ | //Attach the function with the event | ||
+ | if(ele.addEventListener) ele.addEventListener(opt[' | ||
+ | else if(ele.attachEvent) ele.attachEvent(' | ||
+ | else ele[' | ||
+ | }, | ||
+ | |||
+ | //Remove the shortcut - just specify the shortcut and I will remove the binding | ||
+ | ' | ||
+ | shortcut_combination = shortcut_combination.toLowerCase(); | ||
+ | var binding = this.all_shortcuts[shortcut_combination]; | ||
+ | delete(this.all_shortcuts[shortcut_combination]) | ||
+ | if(!binding) return; | ||
+ | var type = binding[' | ||
+ | var ele = binding[' | ||
+ | var callback = binding[' | ||
+ | |||
+ | if(ele.detachEvent) ele.detachEvent(' | ||
+ | else if(ele.removeEventListener) ele.removeEventListener(type, | ||
+ | else ele[' | ||
+ | } | ||
+ | } | ||
+ | |||
+ | shortcut.add(" | ||
+ | var event = new Event(' | ||
+ | if (settingsShown){ | ||
+ | document.getElementById(' | ||
+ | } else { | ||
+ | document.getElementById(' | ||
+ | } | ||
+ | }); | ||
+ | |||
+ | |||
+ | // COMMON_CODE_BLOCK_END | ||
+ | |||
+ | });}); | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | We may look at the GKZ domes of the individual Delaunay triangulations. | ||
+ | |||
+ | <code perl> | ||
+ | > $d0 = $s-> | ||
+ | > $d0-> | ||
+ | </ | ||
+ | < | ||
+ | <!-- | ||
+ | polymake for knusper | ||
+ | Thu Mar 3 00:31:37 2022 | ||
+ | pcom:d0 | ||
+ | --> | ||
+ | |||
+ | |||
+ | < | ||
+ | < | ||
+ | <meta charset=utf-8> | ||
+ | < | ||
+ | < | ||
+ | /* | ||
+ | // COMMON_CODE_BLOCK_BEGIN | ||
+ | */ | ||
+ | html {overflow: scroll;} | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | # | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | } | ||
+ | /* | ||
+ | // COMMON_CODE_BLOCK_END | ||
+ | */ | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | <div id=' | ||
+ | <div class=group id=' | ||
+ | < | ||
+ | < | ||
+ | <div class=indented>< | ||
+ | <div class=suboption> | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | <div class=group id=' | ||
+ | < | ||
+ | < | ||
+ | <div class=indented>< | ||
+ | </ | ||
+ | |||
+ | <div class=group id=' | ||
+ | < | ||
+ | <div class=indented> | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | <div class=suboption> | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | |||
+ | <div class=group id=' | ||
+ | < | ||
+ | <div class=indented> | ||
+ | < | ||
+ | </ | ||
+ | <div class=suboption> | ||
+ | <div class=indented> | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | < | ||
+ | <div class=indented> | ||
+ | < | ||
+ | <select id=" | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | <div class=group id=' | ||
+ | < | ||
+ | <div class=indented> | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | </ | ||
+ | <img id=' | ||
+ | <img id=' | ||
+ | <div id=" | ||
+ | </ | ||
+ | < | ||
+ | requirejs.config({ | ||
+ | paths: { | ||
+ | three: '/ | ||
+ | TrackballControls: | ||
+ | OrbitControls: | ||
+ | Projector: '/ | ||
+ | SVGRenderer: | ||
+ | WEBGL: '/ | ||
+ | }, | ||
+ | shim: { | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | } | ||
+ | }); | ||
+ | | ||
+ | require([' | ||
+ | window.THREE = THREE; | ||
+ | require([' | ||
+ | | ||
+ | THREE.TrackballControls = TrackballControls; | ||
+ | THREE.OrbitControls = OrbitControls; | ||
+ | THREE.Projector = Projector; | ||
+ | THREE.SVGRenderer = SVGRenderer; | ||
+ | THREE.WEBGL = WEBGL; | ||
+ | |||
+ | // COMMON_CODE_BLOCK_BEGIN | ||
+ | |||
+ | const intervalLength = 25; // for automatic animations | ||
+ | const explodableModel = true; | ||
+ | const modelContains = { points: false, pointlabels: | ||
+ | const foldables = []; | ||
+ | |||
+ | var three = document.getElementById(" | ||
+ | var scene = new THREE.Scene(); | ||
+ | var renderer = new THREE.WebGLRenderer( { antialias: true } ); | ||
+ | var svgRenderer = new THREE.SVGRenderer( { antialias: true } ); | ||
+ | renderer.setPixelRatio( window.devicePixelRatio ); | ||
+ | renderer.setClearColor(0xFFFFFF, | ||
+ | svgRenderer.setClearColor(0xFFFFFF, | ||
+ | three.appendChild(renderer.domElement); | ||
+ | |||
+ | var frustumSize = 4; | ||
+ | var cameras = [new THREE.PerspectiveCamera(75, | ||
+ | cameras.forEach(function(cam) { | ||
+ | cam.position.set(0, | ||
+ | cam.lookAt(0, | ||
+ | cam.up.set(0, | ||
+ | }); | ||
+ | var controls = [new THREE.TrackballControls(cameras[0], | ||
+ | var camera, control; | ||
+ | |||
+ | controls[0].zoomSpeed = 0.2; | ||
+ | controls[0].rotateSpeed = 4; | ||
+ | |||
+ | |||
+ | // class to allow move points together with labels and spheres | ||
+ | var PMPoint = function (x,y,z) { | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | PMPoint.prototype.addLabel = function(labelsprite) { | ||
+ | | ||
+ | | ||
+ | } | ||
+ | PMPoint.prototype.addSphere = function(spheremesh) { | ||
+ | | ||
+ | | ||
+ | } | ||
+ | PMPoint.prototype.set = function(x, | ||
+ | | ||
+ | if (this.sprite) { | ||
+ | this.sprite.position.copy(this.vector); | ||
+ | } | ||
+ | if (this.sphere) { | ||
+ | this.sphere.position.copy(this.vector); | ||
+ | } | ||
+ | } | ||
+ | PMPoint.prototype.radius = function() { | ||
+ | if (this.sphere) { | ||
+ | return this.sphere.geometry.parameters.radius; | ||
+ | } else { | ||
+ | return 0; | ||
+ | } | ||
+ | }; | ||
+ | // select the target node | ||
+ | var target = document.querySelector('# | ||
+ | |||
+ | // create an observer instance | ||
+ | var observer = new MutationObserver(function(mutations) { | ||
+ | | ||
+ | if (mutation.removedNodes && mutation.removedNodes.length > 0) { | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | }); | ||
+ | }); | ||
+ | |||
+ | // configuration of the observer: | ||
+ | var config = { childList: true, characterData: | ||
+ | |||
+ | // pass in the target node, as well as the observer options | ||
+ | while (target) { | ||
+ | if (target.className==" | ||
+ | observer.observe(target, | ||
+ | break; | ||
+ | } | ||
+ | | ||
+ | } | ||
+ | |||
+ | // COMMON_CODE_BLOCK_END | ||
+ | |||
+ | var obj0 = new THREE.Object3D(); | ||
+ | obj0.name = " | ||
+ | obj0.userData.explodable = 1; | ||
+ | obj0.userData.points = []; | ||
+ | obj0.userData.points.push(new PMPoint(-1, 0, 0.5)); | ||
+ | obj0.userData.points.push(new PMPoint(1, 0, 0.5)); | ||
+ | obj0.userData.points.push(new PMPoint(0, 1, 0.125)); | ||
+ | |||
+ | obj0.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj0.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj0.userData.pointlabels = [" | ||
+ | obj0.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj0.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj0.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj0.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj0); | ||
+ | scene.add(obj0); | ||
+ | |||
+ | var obj1 = new THREE.Object3D(); | ||
+ | obj1.name = " | ||
+ | obj1.userData.explodable = 1; | ||
+ | obj1.userData.points = []; | ||
+ | obj1.userData.points.push(new PMPoint(-1, 0, 0.5)); | ||
+ | obj1.userData.points.push(new PMPoint(1, 0, 0.5)); | ||
+ | obj1.userData.points.push(new PMPoint(0, -1, 0.125)); | ||
+ | |||
+ | obj1.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj1.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj1.userData.pointlabels = [" | ||
+ | obj1.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj1.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj1.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj1.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj1); | ||
+ | scene.add(obj1); | ||
+ | |||
+ | var obj2 = new THREE.Object3D(); | ||
+ | obj2.name = " | ||
+ | obj2.userData.explodable = 1; | ||
+ | obj2.userData.points = []; | ||
+ | obj2.userData.points.push(new PMPoint(1, 0, 0.5)); | ||
+ | obj2.userData.points.push(new PMPoint(0, 1, 0.125)); | ||
+ | obj2.userData.points.push(new PMPoint(0.6, | ||
+ | |||
+ | obj2.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj2.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj2.userData.pointlabels = [" | ||
+ | obj2.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj2.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj2.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj2.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj2); | ||
+ | scene.add(obj2); | ||
+ | |||
+ | var obj3 = new THREE.Object3D(); | ||
+ | obj3.name = " | ||
+ | obj3.userData.explodable = 1; | ||
+ | obj3.userData.points = []; | ||
+ | obj3.userData.points.push(new PMPoint(-1, 0, 0.5)); | ||
+ | obj3.userData.points.push(new PMPoint(0, 1, 0.125)); | ||
+ | obj3.userData.points.push(new PMPoint(-0.6, | ||
+ | |||
+ | obj3.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj3.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj3.userData.pointlabels = [" | ||
+ | obj3.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj3.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj3.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj3.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj3); | ||
+ | scene.add(obj3); | ||
+ | |||
+ | var obj4 = new THREE.Object3D(); | ||
+ | obj4.name = " | ||
+ | obj4.userData.explodable = 1; | ||
+ | obj4.userData.points = []; | ||
+ | obj4.userData.points.push(new PMPoint(-1, 0, 0.5)); | ||
+ | obj4.userData.points.push(new PMPoint(0, -1, 0.125)); | ||
+ | obj4.userData.points.push(new PMPoint(-0.6, | ||
+ | |||
+ | obj4.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj4.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj4.userData.pointlabels = [" | ||
+ | obj4.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj4.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj4.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj4.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj4); | ||
+ | scene.add(obj4); | ||
+ | |||
+ | var obj5 = new THREE.Object3D(); | ||
+ | obj5.name = " | ||
+ | obj5.userData.explodable = 1; | ||
+ | obj5.userData.points = []; | ||
+ | obj5.userData.points.push(new PMPoint(1, 0, 0.5)); | ||
+ | obj5.userData.points.push(new PMPoint(0, -1, 0.125)); | ||
+ | obj5.userData.points.push(new PMPoint(0.6, | ||
+ | |||
+ | obj5.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj5.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj5.userData.pointlabels = [" | ||
+ | obj5.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj5.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj5.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj5.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj5); | ||
+ | scene.add(obj5); | ||
+ | |||
+ | var obj6 = new THREE.Object3D(); | ||
+ | obj6.name = " | ||
+ | obj6.userData.explodable = 1; | ||
+ | obj6.userData.points = []; | ||
+ | obj6.userData.points.push(new PMPoint(1, 0, 0.5)); | ||
+ | obj6.userData.points.push(new PMPoint(0.6, | ||
+ | obj6.userData.points.push(new PMPoint(0.8, | ||
+ | |||
+ | obj6.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj6.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj6.userData.pointlabels = [" | ||
+ | obj6.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj6.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj6.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj6.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj6); | ||
+ | scene.add(obj6); | ||
+ | |||
+ | var obj7 = new THREE.Object3D(); | ||
+ | obj7.name = " | ||
+ | obj7.userData.explodable = 1; | ||
+ | obj7.userData.points = []; | ||
+ | obj7.userData.points.push(new PMPoint(0, 1, 0.125)); | ||
+ | obj7.userData.points.push(new PMPoint(0.6, | ||
+ | obj7.userData.points.push(new PMPoint(0.384615, | ||
+ | |||
+ | obj7.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj7.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj7.userData.pointlabels = [" | ||
+ | obj7.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj7.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj7.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj7.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj7); | ||
+ | scene.add(obj7); | ||
+ | |||
+ | var obj8 = new THREE.Object3D(); | ||
+ | obj8.name = " | ||
+ | obj8.userData.explodable = 1; | ||
+ | obj8.userData.points = []; | ||
+ | obj8.userData.points.push(new PMPoint(0, 1, 0.125)); | ||
+ | obj8.userData.points.push(new PMPoint(-0.6, | ||
+ | obj8.userData.points.push(new PMPoint(-0.384615, | ||
+ | |||
+ | obj8.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj8.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj8.userData.pointlabels = [" | ||
+ | obj8.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj8.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj8.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj8.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj8); | ||
+ | scene.add(obj8); | ||
+ | |||
+ | var obj9 = new THREE.Object3D(); | ||
+ | obj9.name = " | ||
+ | obj9.userData.explodable = 1; | ||
+ | obj9.userData.points = []; | ||
+ | obj9.userData.points.push(new PMPoint(-1, 0, 0.5)); | ||
+ | obj9.userData.points.push(new PMPoint(-0.6, | ||
+ | obj9.userData.points.push(new PMPoint(-0.8, | ||
+ | |||
+ | obj9.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj9.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj9.userData.pointlabels = [" | ||
+ | obj9.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj9.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj9.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj9.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj9); | ||
+ | scene.add(obj9); | ||
+ | |||
+ | var obj10 = new THREE.Object3D(); | ||
+ | obj10.name = " | ||
+ | obj10.userData.explodable = 1; | ||
+ | obj10.userData.points = []; | ||
+ | obj10.userData.points.push(new PMPoint(-1, 0, 0.5)); | ||
+ | obj10.userData.points.push(new PMPoint(-0.6, | ||
+ | obj10.userData.points.push(new PMPoint(-0.8, | ||
+ | |||
+ | obj10.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj10.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj10.userData.pointlabels = [" | ||
+ | obj10.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj10.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj10.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj10.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj10); | ||
+ | scene.add(obj10); | ||
+ | |||
+ | var obj11 = new THREE.Object3D(); | ||
+ | obj11.name = " | ||
+ | obj11.userData.explodable = 1; | ||
+ | obj11.userData.points = []; | ||
+ | obj11.userData.points.push(new PMPoint(0, -1, 0.125)); | ||
+ | obj11.userData.points.push(new PMPoint(-0.6, | ||
+ | obj11.userData.points.push(new PMPoint(-0.384615, | ||
+ | |||
+ | obj11.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj11.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj11.userData.pointlabels = [" | ||
+ | obj11.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj11.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj11.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj11.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj11); | ||
+ | scene.add(obj11); | ||
+ | |||
+ | var obj12 = new THREE.Object3D(); | ||
+ | obj12.name = " | ||
+ | obj12.userData.explodable = 1; | ||
+ | obj12.userData.points = []; | ||
+ | obj12.userData.points.push(new PMPoint(0, -1, 0.125)); | ||
+ | obj12.userData.points.push(new PMPoint(0.6, | ||
+ | obj12.userData.points.push(new PMPoint(0.384615, | ||
+ | |||
+ | obj12.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj12.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj12.userData.pointlabels = [" | ||
+ | obj12.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj12.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj12.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj12.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj12); | ||
+ | scene.add(obj12); | ||
+ | |||
+ | var obj13 = new THREE.Object3D(); | ||
+ | obj13.name = " | ||
+ | obj13.userData.explodable = 1; | ||
+ | obj13.userData.points = []; | ||
+ | obj13.userData.points.push(new PMPoint(1, 0, 0.5)); | ||
+ | obj13.userData.points.push(new PMPoint(0.6, | ||
+ | obj13.userData.points.push(new PMPoint(0.8, | ||
+ | |||
+ | obj13.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj13.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj13.userData.pointlabels = [" | ||
+ | obj13.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj13.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj13.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj13.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj13); | ||
+ | scene.add(obj13); | ||
+ | |||
+ | var obj14 = new THREE.Object3D(); | ||
+ | obj14.name = " | ||
+ | obj14.userData.explodable = 1; | ||
+ | obj14.userData.points = []; | ||
+ | obj14.userData.points.push(new PMPoint(1, 0, 0.5)); | ||
+ | obj14.userData.points.push(new PMPoint(0.8, | ||
+ | obj14.userData.points.push(new PMPoint(0.882353, | ||
+ | |||
+ | obj14.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj14.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj14.userData.pointlabels = [" | ||
+ | obj14.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj14.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj14.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj14.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj14); | ||
+ | scene.add(obj14); | ||
+ | |||
+ | var obj15 = new THREE.Object3D(); | ||
+ | obj15.name = " | ||
+ | obj15.userData.explodable = 1; | ||
+ | obj15.userData.points = []; | ||
+ | obj15.userData.points.push(new PMPoint(0.6, | ||
+ | obj15.userData.points.push(new PMPoint(0.8, | ||
+ | obj15.userData.points.push(new PMPoint(0.724138, | ||
+ | |||
+ | obj15.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj15.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj15.userData.pointlabels = [" | ||
+ | obj15.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj15.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj15.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj15.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj15); | ||
+ | scene.add(obj15); | ||
+ | |||
+ | var obj16 = new THREE.Object3D(); | ||
+ | obj16.name = " | ||
+ | obj16.userData.explodable = 1; | ||
+ | obj16.userData.points = []; | ||
+ | obj16.userData.points.push(new PMPoint(0.6, | ||
+ | obj16.userData.points.push(new PMPoint(0.384615, | ||
+ | obj16.userData.points.push(new PMPoint(0.470588, | ||
+ | |||
+ | obj16.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj16.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj16.userData.pointlabels = [" | ||
+ | obj16.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj16.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj16.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj16.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj16); | ||
+ | scene.add(obj16); | ||
+ | |||
+ | var obj17 = new THREE.Object3D(); | ||
+ | obj17.name = " | ||
+ | obj17.userData.explodable = 1; | ||
+ | obj17.userData.points = []; | ||
+ | obj17.userData.points.push(new PMPoint(0, 1, 0.125)); | ||
+ | obj17.userData.points.push(new PMPoint(0.384615, | ||
+ | obj17.userData.points.push(new PMPoint(0.28, | ||
+ | |||
+ | obj17.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj17.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj17.userData.pointlabels = [" | ||
+ | obj17.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj17.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj17.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj17.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj17); | ||
+ | scene.add(obj17); | ||
+ | |||
+ | var obj18 = new THREE.Object3D(); | ||
+ | obj18.name = " | ||
+ | obj18.userData.explodable = 1; | ||
+ | obj18.userData.points = []; | ||
+ | obj18.userData.points.push(new PMPoint(0, 1, 0.125)); | ||
+ | obj18.userData.points.push(new PMPoint(-0.384615, | ||
+ | obj18.userData.points.push(new PMPoint(-0.28, | ||
+ | |||
+ | obj18.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj18.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj18.userData.pointlabels = [" | ||
+ | obj18.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj18.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj18.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj18.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj18); | ||
+ | scene.add(obj18); | ||
+ | |||
+ | var obj19 = new THREE.Object3D(); | ||
+ | obj19.name = " | ||
+ | obj19.userData.explodable = 1; | ||
+ | obj19.userData.points = []; | ||
+ | obj19.userData.points.push(new PMPoint(-0.6, | ||
+ | obj19.userData.points.push(new PMPoint(-0.384615, | ||
+ | obj19.userData.points.push(new PMPoint(-0.470588, | ||
+ | |||
+ | obj19.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj19.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj19.userData.pointlabels = [" | ||
+ | obj19.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj19.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj19.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj19.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj19); | ||
+ | scene.add(obj19); | ||
+ | |||
+ | var obj20 = new THREE.Object3D(); | ||
+ | obj20.name = " | ||
+ | obj20.userData.explodable = 1; | ||
+ | obj20.userData.points = []; | ||
+ | obj20.userData.points.push(new PMPoint(-0.6, | ||
+ | obj20.userData.points.push(new PMPoint(-0.8, | ||
+ | obj20.userData.points.push(new PMPoint(-0.724138, | ||
+ | |||
+ | obj20.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj20.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj20.userData.pointlabels = [" | ||
+ | obj20.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj20.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj20.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj20.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj20); | ||
+ | scene.add(obj20); | ||
+ | |||
+ | var obj21 = new THREE.Object3D(); | ||
+ | obj21.name = " | ||
+ | obj21.userData.explodable = 1; | ||
+ | obj21.userData.points = []; | ||
+ | obj21.userData.points.push(new PMPoint(-1, 0, 0.5)); | ||
+ | obj21.userData.points.push(new PMPoint(-0.8, | ||
+ | obj21.userData.points.push(new PMPoint(-0.882353, | ||
+ | |||
+ | obj21.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj21.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj21.userData.pointlabels = [" | ||
+ | obj21.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj21.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj21.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj21.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj21); | ||
+ | scene.add(obj21); | ||
+ | |||
+ | var obj22 = new THREE.Object3D(); | ||
+ | obj22.name = " | ||
+ | obj22.userData.explodable = 1; | ||
+ | obj22.userData.points = []; | ||
+ | obj22.userData.points.push(new PMPoint(-1, 0, 0.5)); | ||
+ | obj22.userData.points.push(new PMPoint(-0.8, | ||
+ | obj22.userData.points.push(new PMPoint(-0.882353, | ||
+ | |||
+ | obj22.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj22.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj22.userData.pointlabels = [" | ||
+ | obj22.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj22.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj22.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj22.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj22); | ||
+ | scene.add(obj22); | ||
+ | |||
+ | var obj23 = new THREE.Object3D(); | ||
+ | obj23.name = " | ||
+ | obj23.userData.explodable = 1; | ||
+ | obj23.userData.points = []; | ||
+ | obj23.userData.points.push(new PMPoint(-0.6, | ||
+ | obj23.userData.points.push(new PMPoint(-0.8, | ||
+ | obj23.userData.points.push(new PMPoint(-0.724138, | ||
+ | |||
+ | obj23.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj23.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj23.userData.pointlabels = [" | ||
+ | obj23.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj23.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj23.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj23.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj23); | ||
+ | scene.add(obj23); | ||
+ | |||
+ | var obj24 = new THREE.Object3D(); | ||
+ | obj24.name = " | ||
+ | obj24.userData.explodable = 1; | ||
+ | obj24.userData.points = []; | ||
+ | obj24.userData.points.push(new PMPoint(-0.6, | ||
+ | obj24.userData.points.push(new PMPoint(-0.384615, | ||
+ | obj24.userData.points.push(new PMPoint(-0.470588, | ||
+ | |||
+ | obj24.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj24.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj24.userData.pointlabels = [" | ||
+ | obj24.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj24.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj24.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj24.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj24); | ||
+ | scene.add(obj24); | ||
+ | |||
+ | var obj25 = new THREE.Object3D(); | ||
+ | obj25.name = " | ||
+ | obj25.userData.explodable = 1; | ||
+ | obj25.userData.points = []; | ||
+ | obj25.userData.points.push(new PMPoint(0, -1, 0.125)); | ||
+ | obj25.userData.points.push(new PMPoint(-0.384615, | ||
+ | obj25.userData.points.push(new PMPoint(-0.28, | ||
+ | |||
+ | obj25.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj25.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj25.userData.pointlabels = [" | ||
+ | obj25.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj25.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj25.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj25.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj25); | ||
+ | scene.add(obj25); | ||
+ | |||
+ | var obj26 = new THREE.Object3D(); | ||
+ | obj26.name = " | ||
+ | obj26.userData.explodable = 1; | ||
+ | obj26.userData.points = []; | ||
+ | obj26.userData.points.push(new PMPoint(0, -1, 0.125)); | ||
+ | obj26.userData.points.push(new PMPoint(0.384615, | ||
+ | obj26.userData.points.push(new PMPoint(0.28, | ||
+ | |||
+ | obj26.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj26.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj26.userData.pointlabels = [" | ||
+ | obj26.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj26.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj26.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj26.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj26); | ||
+ | scene.add(obj26); | ||
+ | |||
+ | var obj27 = new THREE.Object3D(); | ||
+ | obj27.name = " | ||
+ | obj27.userData.explodable = 1; | ||
+ | obj27.userData.points = []; | ||
+ | obj27.userData.points.push(new PMPoint(0.6, | ||
+ | obj27.userData.points.push(new PMPoint(0.384615, | ||
+ | obj27.userData.points.push(new PMPoint(0.470588, | ||
+ | |||
+ | obj27.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj27.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj27.userData.pointlabels = [" | ||
+ | obj27.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj27.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj27.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj27.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj27); | ||
+ | scene.add(obj27); | ||
+ | |||
+ | var obj28 = new THREE.Object3D(); | ||
+ | obj28.name = " | ||
+ | obj28.userData.explodable = 1; | ||
+ | obj28.userData.points = []; | ||
+ | obj28.userData.points.push(new PMPoint(0.6, | ||
+ | obj28.userData.points.push(new PMPoint(0.8, | ||
+ | obj28.userData.points.push(new PMPoint(0.724138, | ||
+ | |||
+ | obj28.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj28.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj28.userData.pointlabels = [" | ||
+ | obj28.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj28.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj28.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj28.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj28); | ||
+ | scene.add(obj28); | ||
+ | |||
+ | var obj29 = new THREE.Object3D(); | ||
+ | obj29.name = " | ||
+ | obj29.userData.explodable = 1; | ||
+ | obj29.userData.points = []; | ||
+ | obj29.userData.points.push(new PMPoint(1, 0, 0.5)); | ||
+ | obj29.userData.points.push(new PMPoint(0.8, | ||
+ | obj29.userData.points.push(new PMPoint(0.882353, | ||
+ | |||
+ | obj29.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj29.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj29.userData.pointlabels = [" | ||
+ | obj29.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj29.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj29.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj29.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj29); | ||
+ | scene.add(obj29); | ||
+ | |||
+ | var obj30 = new THREE.Object3D(); | ||
+ | obj30.name = " | ||
+ | obj30.userData.explodable = 1; | ||
+ | obj30.userData.points = []; | ||
+ | obj30.userData.points.push(new PMPoint(1, 0, 0.5)); | ||
+ | obj30.userData.points.push(new PMPoint(0.882353, | ||
+ | obj30.userData.points.push(new PMPoint(0.923077, | ||
+ | |||
+ | obj30.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj30.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj30.userData.pointlabels = [" | ||
+ | obj30.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj30.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj30.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj30.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj30); | ||
+ | scene.add(obj30); | ||
+ | |||
+ | var obj31 = new THREE.Object3D(); | ||
+ | obj31.name = " | ||
+ | obj31.userData.explodable = 1; | ||
+ | obj31.userData.points = []; | ||
+ | obj31.userData.points.push(new PMPoint(0.8, | ||
+ | obj31.userData.points.push(new PMPoint(0.882353, | ||
+ | obj31.userData.points.push(new PMPoint(0.849057, | ||
+ | |||
+ | obj31.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj31.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj31.userData.pointlabels = [" | ||
+ | obj31.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj31.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj31.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj31.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj31); | ||
+ | scene.add(obj31); | ||
+ | |||
+ | var obj32 = new THREE.Object3D(); | ||
+ | obj32.name = " | ||
+ | obj32.userData.explodable = 1; | ||
+ | obj32.userData.points = []; | ||
+ | obj32.userData.points.push(new PMPoint(0.8, | ||
+ | obj32.userData.points.push(new PMPoint(0.724138, | ||
+ | obj32.userData.points.push(new PMPoint(0.753425, | ||
+ | |||
+ | obj32.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj32.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj32.userData.pointlabels = [" | ||
+ | obj32.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj32.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj32.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj32.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj32); | ||
+ | scene.add(obj32); | ||
+ | |||
+ | var obj33 = new THREE.Object3D(); | ||
+ | obj33.name = " | ||
+ | obj33.userData.explodable = 1; | ||
+ | obj33.userData.points = []; | ||
+ | obj33.userData.points.push(new PMPoint(0.6, | ||
+ | obj33.userData.points.push(new PMPoint(0.724138, | ||
+ | obj33.userData.points.push(new PMPoint(0.689655, | ||
+ | |||
+ | obj33.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj33.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj33.userData.pointlabels = [" | ||
+ | obj33.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj33.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj33.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj33.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj33); | ||
+ | scene.add(obj33); | ||
+ | |||
+ | var obj34 = new THREE.Object3D(); | ||
+ | obj34.name = " | ||
+ | obj34.userData.explodable = 1; | ||
+ | obj34.userData.points = []; | ||
+ | obj34.userData.points.push(new PMPoint(0.6, | ||
+ | obj34.userData.points.push(new PMPoint(0.470588, | ||
+ | obj34.userData.points.push(new PMPoint(0.507692, | ||
+ | |||
+ | obj34.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj34.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj34.userData.pointlabels = [" | ||
+ | obj34.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj34.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj34.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj34.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj34); | ||
+ | scene.add(obj34); | ||
+ | |||
+ | var obj35 = new THREE.Object3D(); | ||
+ | obj35.name = " | ||
+ | obj35.userData.explodable = 1; | ||
+ | obj35.userData.points = []; | ||
+ | obj35.userData.points.push(new PMPoint(0.384615, | ||
+ | obj35.userData.points.push(new PMPoint(0.470588, | ||
+ | obj35.userData.points.push(new PMPoint(0.438202, | ||
+ | |||
+ | obj35.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj35.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj35.userData.pointlabels = [" | ||
+ | obj35.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj35.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj35.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj35.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj35); | ||
+ | scene.add(obj35); | ||
+ | |||
+ | var obj36 = new THREE.Object3D(); | ||
+ | obj36.name = " | ||
+ | obj36.userData.explodable = 1; | ||
+ | obj36.userData.points = []; | ||
+ | obj36.userData.points.push(new PMPoint(0.384615, | ||
+ | obj36.userData.points.push(new PMPoint(0.28, | ||
+ | obj36.userData.points.push(new PMPoint(0.324324, | ||
+ | |||
+ | obj36.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj36.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj36.userData.pointlabels = [" | ||
+ | obj36.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj36.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj36.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj36.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj36); | ||
+ | scene.add(obj36); | ||
+ | |||
+ | var obj37 = new THREE.Object3D(); | ||
+ | obj37.name = " | ||
+ | obj37.userData.explodable = 1; | ||
+ | obj37.userData.points = []; | ||
+ | obj37.userData.points.push(new PMPoint(0, 1, 0.125)); | ||
+ | obj37.userData.points.push(new PMPoint(0.28, | ||
+ | obj37.userData.points.push(new PMPoint(0.219512, | ||
+ | |||
+ | obj37.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj37.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj37.userData.pointlabels = [" | ||
+ | obj37.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj37.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj37.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj37.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj37); | ||
+ | scene.add(obj37); | ||
+ | |||
+ | var obj38 = new THREE.Object3D(); | ||
+ | obj38.name = " | ||
+ | obj38.userData.explodable = 1; | ||
+ | obj38.userData.points = []; | ||
+ | obj38.userData.points.push(new PMPoint(0, 1, 0.125)); | ||
+ | obj38.userData.points.push(new PMPoint(-0.28, | ||
+ | obj38.userData.points.push(new PMPoint(-0.219512, | ||
+ | |||
+ | obj38.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj38.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj38.userData.pointlabels = [" | ||
+ | obj38.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj38.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj38.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj38.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj38); | ||
+ | scene.add(obj38); | ||
+ | |||
+ | var obj39 = new THREE.Object3D(); | ||
+ | obj39.name = " | ||
+ | obj39.userData.explodable = 1; | ||
+ | obj39.userData.points = []; | ||
+ | obj39.userData.points.push(new PMPoint(-0.384615, | ||
+ | obj39.userData.points.push(new PMPoint(-0.28, | ||
+ | obj39.userData.points.push(new PMPoint(-0.324324, | ||
+ | |||
+ | obj39.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj39.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj39.userData.pointlabels = [" | ||
+ | obj39.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj39.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj39.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj39.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj39); | ||
+ | scene.add(obj39); | ||
+ | |||
+ | var obj40 = new THREE.Object3D(); | ||
+ | obj40.name = " | ||
+ | obj40.userData.explodable = 1; | ||
+ | obj40.userData.points = []; | ||
+ | obj40.userData.points.push(new PMPoint(-0.384615, | ||
+ | obj40.userData.points.push(new PMPoint(-0.470588, | ||
+ | obj40.userData.points.push(new PMPoint(-0.438202, | ||
+ | |||
+ | obj40.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj40.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj40.userData.pointlabels = [" | ||
+ | obj40.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj40.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj40.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj40.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj40); | ||
+ | scene.add(obj40); | ||
+ | |||
+ | var obj41 = new THREE.Object3D(); | ||
+ | obj41.name = " | ||
+ | obj41.userData.explodable = 1; | ||
+ | obj41.userData.points = []; | ||
+ | obj41.userData.points.push(new PMPoint(-0.6, | ||
+ | obj41.userData.points.push(new PMPoint(-0.470588, | ||
+ | obj41.userData.points.push(new PMPoint(-0.507692, | ||
+ | |||
+ | obj41.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj41.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj41.userData.pointlabels = [" | ||
+ | obj41.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj41.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj41.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj41.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj41); | ||
+ | scene.add(obj41); | ||
+ | |||
+ | var obj42 = new THREE.Object3D(); | ||
+ | obj42.name = " | ||
+ | obj42.userData.explodable = 1; | ||
+ | obj42.userData.points = []; | ||
+ | obj42.userData.points.push(new PMPoint(-0.6, | ||
+ | obj42.userData.points.push(new PMPoint(-0.724138, | ||
+ | obj42.userData.points.push(new PMPoint(-0.689655, | ||
+ | |||
+ | obj42.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj42.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj42.userData.pointlabels = [" | ||
+ | obj42.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj42.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj42.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj42.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj42); | ||
+ | scene.add(obj42); | ||
+ | |||
+ | var obj43 = new THREE.Object3D(); | ||
+ | obj43.name = " | ||
+ | obj43.userData.explodable = 1; | ||
+ | obj43.userData.points = []; | ||
+ | obj43.userData.points.push(new PMPoint(-0.8, | ||
+ | obj43.userData.points.push(new PMPoint(-0.724138, | ||
+ | obj43.userData.points.push(new PMPoint(-0.753425, | ||
+ | |||
+ | obj43.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj43.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj43.userData.pointlabels = [" | ||
+ | obj43.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj43.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj43.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj43.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj43); | ||
+ | scene.add(obj43); | ||
+ | |||
+ | var obj44 = new THREE.Object3D(); | ||
+ | obj44.name = " | ||
+ | obj44.userData.explodable = 1; | ||
+ | obj44.userData.points = []; | ||
+ | obj44.userData.points.push(new PMPoint(-0.8, | ||
+ | obj44.userData.points.push(new PMPoint(-0.882353, | ||
+ | obj44.userData.points.push(new PMPoint(-0.849057, | ||
+ | |||
+ | obj44.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj44.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj44.userData.pointlabels = [" | ||
+ | obj44.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj44.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj44.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj44.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj44); | ||
+ | scene.add(obj44); | ||
+ | |||
+ | var obj45 = new THREE.Object3D(); | ||
+ | obj45.name = " | ||
+ | obj45.userData.explodable = 1; | ||
+ | obj45.userData.points = []; | ||
+ | obj45.userData.points.push(new PMPoint(-1, 0, 0.5)); | ||
+ | obj45.userData.points.push(new PMPoint(-0.882353, | ||
+ | obj45.userData.points.push(new PMPoint(-0.923077, | ||
+ | |||
+ | obj45.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj45.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj45.userData.pointlabels = [" | ||
+ | obj45.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj45.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj45.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj45.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj45); | ||
+ | scene.add(obj45); | ||
+ | |||
+ | var obj46 = new THREE.Object3D(); | ||
+ | obj46.name = " | ||
+ | obj46.userData.explodable = 1; | ||
+ | obj46.userData.points = []; | ||
+ | obj46.userData.points.push(new PMPoint(-1, 0, 0.5)); | ||
+ | obj46.userData.points.push(new PMPoint(-0.882353, | ||
+ | obj46.userData.points.push(new PMPoint(-0.923077, | ||
+ | |||
+ | obj46.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj46.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj46.userData.pointlabels = [" | ||
+ | obj46.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj46.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj46.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj46.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj46); | ||
+ | scene.add(obj46); | ||
+ | |||
+ | var obj47 = new THREE.Object3D(); | ||
+ | obj47.name = " | ||
+ | obj47.userData.explodable = 1; | ||
+ | obj47.userData.points = []; | ||
+ | obj47.userData.points.push(new PMPoint(-0.8, | ||
+ | obj47.userData.points.push(new PMPoint(-0.882353, | ||
+ | obj47.userData.points.push(new PMPoint(-0.849057, | ||
+ | |||
+ | obj47.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj47.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj47.userData.pointlabels = [" | ||
+ | obj47.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj47.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj47.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj47.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj47); | ||
+ | scene.add(obj47); | ||
+ | |||
+ | var obj48 = new THREE.Object3D(); | ||
+ | obj48.name = " | ||
+ | obj48.userData.explodable = 1; | ||
+ | obj48.userData.points = []; | ||
+ | obj48.userData.points.push(new PMPoint(-0.8, | ||
+ | obj48.userData.points.push(new PMPoint(-0.724138, | ||
+ | obj48.userData.points.push(new PMPoint(-0.753425, | ||
+ | |||
+ | obj48.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj48.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj48.userData.pointlabels = [" | ||
+ | obj48.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj48.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj48.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj48.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj48); | ||
+ | scene.add(obj48); | ||
+ | |||
+ | var obj49 = new THREE.Object3D(); | ||
+ | obj49.name = " | ||
+ | obj49.userData.explodable = 1; | ||
+ | obj49.userData.points = []; | ||
+ | obj49.userData.points.push(new PMPoint(-0.6, | ||
+ | obj49.userData.points.push(new PMPoint(-0.724138, | ||
+ | obj49.userData.points.push(new PMPoint(-0.689655, | ||
+ | |||
+ | obj49.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj49.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj49.userData.pointlabels = [" | ||
+ | obj49.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj49.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj49.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj49.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj49); | ||
+ | scene.add(obj49); | ||
+ | |||
+ | var obj50 = new THREE.Object3D(); | ||
+ | obj50.name = " | ||
+ | obj50.userData.explodable = 1; | ||
+ | obj50.userData.points = []; | ||
+ | obj50.userData.points.push(new PMPoint(-0.6, | ||
+ | obj50.userData.points.push(new PMPoint(-0.470588, | ||
+ | obj50.userData.points.push(new PMPoint(-0.507692, | ||
+ | |||
+ | obj50.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj50.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj50.userData.pointlabels = [" | ||
+ | obj50.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj50.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj50.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj50.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj50); | ||
+ | scene.add(obj50); | ||
+ | |||
+ | var obj51 = new THREE.Object3D(); | ||
+ | obj51.name = " | ||
+ | obj51.userData.explodable = 1; | ||
+ | obj51.userData.points = []; | ||
+ | obj51.userData.points.push(new PMPoint(-0.384615, | ||
+ | obj51.userData.points.push(new PMPoint(-0.470588, | ||
+ | obj51.userData.points.push(new PMPoint(-0.438202, | ||
+ | |||
+ | obj51.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj51.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj51.userData.pointlabels = [" | ||
+ | obj51.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj51.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj51.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj51.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj51); | ||
+ | scene.add(obj51); | ||
+ | |||
+ | var obj52 = new THREE.Object3D(); | ||
+ | obj52.name = " | ||
+ | obj52.userData.explodable = 1; | ||
+ | obj52.userData.points = []; | ||
+ | obj52.userData.points.push(new PMPoint(-0.384615, | ||
+ | obj52.userData.points.push(new PMPoint(-0.28, | ||
+ | obj52.userData.points.push(new PMPoint(-0.324324, | ||
+ | |||
+ | obj52.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj52.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj52.userData.pointlabels = [" | ||
+ | obj52.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj52.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj52.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj52.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj52); | ||
+ | scene.add(obj52); | ||
+ | |||
+ | var obj53 = new THREE.Object3D(); | ||
+ | obj53.name = " | ||
+ | obj53.userData.explodable = 1; | ||
+ | obj53.userData.points = []; | ||
+ | obj53.userData.points.push(new PMPoint(0, -1, 0.125)); | ||
+ | obj53.userData.points.push(new PMPoint(-0.28, | ||
+ | obj53.userData.points.push(new PMPoint(-0.219512, | ||
+ | |||
+ | obj53.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj53.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj53.userData.pointlabels = [" | ||
+ | obj53.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj53.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj53.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj53.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj53); | ||
+ | scene.add(obj53); | ||
+ | |||
+ | var obj54 = new THREE.Object3D(); | ||
+ | obj54.name = " | ||
+ | obj54.userData.explodable = 1; | ||
+ | obj54.userData.points = []; | ||
+ | obj54.userData.points.push(new PMPoint(0, -1, 0.125)); | ||
+ | obj54.userData.points.push(new PMPoint(0.28, | ||
+ | obj54.userData.points.push(new PMPoint(0.219512, | ||
+ | |||
+ | obj54.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj54.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj54.userData.pointlabels = [" | ||
+ | obj54.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj54.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj54.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj54.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj54); | ||
+ | scene.add(obj54); | ||
+ | |||
+ | var obj55 = new THREE.Object3D(); | ||
+ | obj55.name = " | ||
+ | obj55.userData.explodable = 1; | ||
+ | obj55.userData.points = []; | ||
+ | obj55.userData.points.push(new PMPoint(0.384615, | ||
+ | obj55.userData.points.push(new PMPoint(0.28, | ||
+ | obj55.userData.points.push(new PMPoint(0.324324, | ||
+ | |||
+ | obj55.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj55.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj55.userData.pointlabels = [" | ||
+ | obj55.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj55.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj55.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj55.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj55); | ||
+ | scene.add(obj55); | ||
+ | |||
+ | var obj56 = new THREE.Object3D(); | ||
+ | obj56.name = " | ||
+ | obj56.userData.explodable = 1; | ||
+ | obj56.userData.points = []; | ||
+ | obj56.userData.points.push(new PMPoint(0.384615, | ||
+ | obj56.userData.points.push(new PMPoint(0.470588, | ||
+ | obj56.userData.points.push(new PMPoint(0.438202, | ||
+ | |||
+ | obj56.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj56.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj56.userData.pointlabels = [" | ||
+ | obj56.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj56.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj56.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj56.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj56); | ||
+ | scene.add(obj56); | ||
+ | |||
+ | var obj57 = new THREE.Object3D(); | ||
+ | obj57.name = " | ||
+ | obj57.userData.explodable = 1; | ||
+ | obj57.userData.points = []; | ||
+ | obj57.userData.points.push(new PMPoint(0.6, | ||
+ | obj57.userData.points.push(new PMPoint(0.470588, | ||
+ | obj57.userData.points.push(new PMPoint(0.507692, | ||
+ | |||
+ | obj57.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj57.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj57.userData.pointlabels = [" | ||
+ | obj57.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj57.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj57.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj57.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj57); | ||
+ | scene.add(obj57); | ||
+ | |||
+ | var obj58 = new THREE.Object3D(); | ||
+ | obj58.name = " | ||
+ | obj58.userData.explodable = 1; | ||
+ | obj58.userData.points = []; | ||
+ | obj58.userData.points.push(new PMPoint(0.6, | ||
+ | obj58.userData.points.push(new PMPoint(0.724138, | ||
+ | obj58.userData.points.push(new PMPoint(0.689655, | ||
+ | |||
+ | obj58.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj58.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj58.userData.pointlabels = [" | ||
+ | obj58.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj58.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj58.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj58.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj58); | ||
+ | scene.add(obj58); | ||
+ | |||
+ | var obj59 = new THREE.Object3D(); | ||
+ | obj59.name = " | ||
+ | obj59.userData.explodable = 1; | ||
+ | obj59.userData.points = []; | ||
+ | obj59.userData.points.push(new PMPoint(0.8, | ||
+ | obj59.userData.points.push(new PMPoint(0.724138, | ||
+ | obj59.userData.points.push(new PMPoint(0.753425, | ||
+ | |||
+ | obj59.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj59.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj59.userData.pointlabels = [" | ||
+ | obj59.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj59.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj59.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj59.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj59); | ||
+ | scene.add(obj59); | ||
+ | |||
+ | var obj60 = new THREE.Object3D(); | ||
+ | obj60.name = " | ||
+ | obj60.userData.explodable = 1; | ||
+ | obj60.userData.points = []; | ||
+ | obj60.userData.points.push(new PMPoint(0.8, | ||
+ | obj60.userData.points.push(new PMPoint(0.882353, | ||
+ | obj60.userData.points.push(new PMPoint(0.849057, | ||
+ | |||
+ | obj60.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj60.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj60.userData.pointlabels = [" | ||
+ | obj60.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj60.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj60.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj60.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj60); | ||
+ | scene.add(obj60); | ||
+ | |||
+ | var obj61 = new THREE.Object3D(); | ||
+ | obj61.name = " | ||
+ | obj61.userData.explodable = 1; | ||
+ | obj61.userData.points = []; | ||
+ | obj61.userData.points.push(new PMPoint(1, 0, 0.5)); | ||
+ | obj61.userData.points.push(new PMPoint(0.882353, | ||
+ | obj61.userData.points.push(new PMPoint(0.923077, | ||
+ | |||
+ | obj61.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj61.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj61.userData.pointlabels = [" | ||
+ | obj61.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj61.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj61.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj61.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj61); | ||
+ | scene.add(obj61); | ||
+ | |||
+ | var obj62 = new THREE.Object3D(); | ||
+ | obj62.name = " | ||
+ | obj62.userData.explodable = 1; | ||
+ | obj62.userData.points = []; | ||
+ | obj62.userData.points.push(new PMPoint(1, 0, 0.5)); | ||
+ | obj62.userData.points.push(new PMPoint(0.923077, | ||
+ | obj62.userData.points.push(new PMPoint(0.945946, | ||
+ | |||
+ | obj62.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj62.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj62.userData.pointlabels = [" | ||
+ | obj62.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj62.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj62.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj62.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj62); | ||
+ | scene.add(obj62); | ||
+ | |||
+ | var obj63 = new THREE.Object3D(); | ||
+ | obj63.name = " | ||
+ | obj63.userData.explodable = 1; | ||
+ | obj63.userData.points = []; | ||
+ | obj63.userData.points.push(new PMPoint(0.882353, | ||
+ | obj63.userData.points.push(new PMPoint(0.923077, | ||
+ | obj63.userData.points.push(new PMPoint(0.905882, | ||
+ | |||
+ | obj63.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj63.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj63.userData.pointlabels = [" | ||
+ | obj63.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj63.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj63.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj63.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj63); | ||
+ | scene.add(obj63); | ||
+ | |||
+ | var obj64 = new THREE.Object3D(); | ||
+ | obj64.name = " | ||
+ | obj64.userData.explodable = 1; | ||
+ | obj64.userData.points = []; | ||
+ | obj64.userData.points.push(new PMPoint(0.882353, | ||
+ | obj64.userData.points.push(new PMPoint(0.849057, | ||
+ | obj64.userData.points.push(new PMPoint(0.861538, | ||
+ | |||
+ | obj64.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj64.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj64.userData.pointlabels = [" | ||
+ | obj64.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj64.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj64.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj64.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj64); | ||
+ | scene.add(obj64); | ||
+ | |||
+ | var obj65 = new THREE.Object3D(); | ||
+ | obj65.name = " | ||
+ | obj65.userData.explodable = 1; | ||
+ | obj65.userData.points = []; | ||
+ | obj65.userData.points.push(new PMPoint(0.8, | ||
+ | obj65.userData.points.push(new PMPoint(0.849057, | ||
+ | obj65.userData.points.push(new PMPoint(0.834862, | ||
+ | |||
+ | obj65.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj65.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj65.userData.pointlabels = [" | ||
+ | obj65.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj65.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj65.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj65.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj65); | ||
+ | scene.add(obj65); | ||
+ | |||
+ | var obj66 = new THREE.Object3D(); | ||
+ | obj66.name = " | ||
+ | obj66.userData.explodable = 1; | ||
+ | obj66.userData.points = []; | ||
+ | obj66.userData.points.push(new PMPoint(0.8, | ||
+ | obj66.userData.points.push(new PMPoint(0.753425, | ||
+ | obj66.userData.points.push(new PMPoint(0.766423, | ||
+ | |||
+ | obj66.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj66.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj66.userData.pointlabels = [" | ||
+ | obj66.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj66.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj66.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj66.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj66); | ||
+ | scene.add(obj66); | ||
+ | |||
+ | var obj67 = new THREE.Object3D(); | ||
+ | obj67.name = " | ||
+ | obj67.userData.explodable = 1; | ||
+ | obj67.userData.points = []; | ||
+ | obj67.userData.points.push(new PMPoint(0.724138, | ||
+ | obj67.userData.points.push(new PMPoint(0.753425, | ||
+ | obj67.userData.points.push(new PMPoint(0.742268, | ||
+ | |||
+ | obj67.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj67.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj67.userData.pointlabels = [" | ||
+ | obj67.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj67.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj67.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj67.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj67); | ||
+ | scene.add(obj67); | ||
+ | |||
+ | var obj68 = new THREE.Object3D(); | ||
+ | obj68.name = " | ||
+ | obj68.userData.explodable = 1; | ||
+ | obj68.userData.points = []; | ||
+ | obj68.userData.points.push(new PMPoint(0.724138, | ||
+ | obj68.userData.points.push(new PMPoint(0.689655, | ||
+ | obj68.userData.points.push(new PMPoint(0.704142, | ||
+ | |||
+ | obj68.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj68.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj68.userData.pointlabels = [" | ||
+ | obj68.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj68.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj68.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj68.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj68); | ||
+ | scene.add(obj68); | ||
+ | |||
+ | var obj69 = new THREE.Object3D(); | ||
+ | obj69.name = " | ||
+ | obj69.userData.explodable = 1; | ||
+ | obj69.userData.points = []; | ||
+ | obj69.userData.points.push(new PMPoint(0.6, | ||
+ | obj69.userData.points.push(new PMPoint(0.689655, | ||
+ | obj69.userData.points.push(new PMPoint(0.670103, | ||
+ | |||
+ | obj69.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj69.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj69.userData.pointlabels = [" | ||
+ | obj69.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj69.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj69.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj69.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj69); | ||
+ | scene.add(obj69); | ||
+ | |||
+ | var obj70 = new THREE.Object3D(); | ||
+ | obj70.name = " | ||
+ | obj70.userData.explodable = 1; | ||
+ | obj70.userData.points = []; | ||
+ | obj70.userData.points.push(new PMPoint(0.6, | ||
+ | obj70.userData.points.push(new PMPoint(0.507692, | ||
+ | obj70.userData.points.push(new PMPoint(0.528302, | ||
+ | |||
+ | obj70.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj70.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj70.userData.pointlabels = [" | ||
+ | obj70.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj70.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj70.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj70.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj70); | ||
+ | scene.add(obj70); | ||
+ | |||
+ | var obj71 = new THREE.Object3D(); | ||
+ | obj71.name = " | ||
+ | obj71.userData.explodable = 1; | ||
+ | obj71.userData.points = []; | ||
+ | obj71.userData.points.push(new PMPoint(0.470588, | ||
+ | obj71.userData.points.push(new PMPoint(0.507692, | ||
+ | obj71.userData.points.push(new PMPoint(0.492228, | ||
+ | |||
+ | obj71.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj71.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj71.userData.pointlabels = [" | ||
+ | obj71.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj71.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj71.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj71.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj71); | ||
+ | scene.add(obj71); | ||
+ | |||
+ | var obj72 = new THREE.Object3D(); | ||
+ | obj72.name = " | ||
+ | obj72.userData.explodable = 1; | ||
+ | obj72.userData.points = []; | ||
+ | obj72.userData.points.push(new PMPoint(0.470588, | ||
+ | obj72.userData.points.push(new PMPoint(0.438202, | ||
+ | obj72.userData.points.push(new PMPoint(0.450644, | ||
+ | |||
+ | obj72.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj72.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj72.userData.pointlabels = [" | ||
+ | obj72.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj72.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj72.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj72.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj72); | ||
+ | scene.add(obj72); | ||
+ | |||
+ | var obj73 = new THREE.Object3D(); | ||
+ | obj73.name = " | ||
+ | obj73.userData.explodable = 1; | ||
+ | obj73.userData.points = []; | ||
+ | obj73.userData.points.push(new PMPoint(0.384615, | ||
+ | obj73.userData.points.push(new PMPoint(0.438202, | ||
+ | obj73.userData.points.push(new PMPoint(0.423529, | ||
+ | |||
+ | obj73.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj73.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj73.userData.pointlabels = [" | ||
+ | obj73.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj73.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj73.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj73.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj73); | ||
+ | scene.add(obj73); | ||
+ | |||
+ | var obj74 = new THREE.Object3D(); | ||
+ | obj74.name = " | ||
+ | obj74.userData.explodable = 1; | ||
+ | obj74.userData.points = []; | ||
+ | obj74.userData.points.push(new PMPoint(0.384615, | ||
+ | obj74.userData.points.push(new PMPoint(0.324324, | ||
+ | obj74.userData.points.push(new PMPoint(0.342282, | ||
+ | |||
+ | obj74.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj74.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj74.userData.pointlabels = [" | ||
+ | obj74.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj74.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj74.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj74.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj74); | ||
+ | scene.add(obj74); | ||
+ | |||
+ | var obj75 = new THREE.Object3D(); | ||
+ | obj75.name = " | ||
+ | obj75.userData.explodable = 1; | ||
+ | obj75.userData.points = []; | ||
+ | obj75.userData.points.push(new PMPoint(0.28, | ||
+ | obj75.userData.points.push(new PMPoint(0.324324, | ||
+ | obj75.userData.points.push(new PMPoint(0.308108, | ||
+ | |||
+ | obj75.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj75.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj75.userData.pointlabels = [" | ||
+ | obj75.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj75.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj75.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj75.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj75); | ||
+ | scene.add(obj75); | ||
+ | |||
+ | var obj76 = new THREE.Object3D(); | ||
+ | obj76.name = " | ||
+ | obj76.userData.explodable = 1; | ||
+ | obj76.userData.points = []; | ||
+ | obj76.userData.points.push(new PMPoint(0.28, | ||
+ | obj76.userData.points.push(new PMPoint(0.219512, | ||
+ | obj76.userData.points.push(new PMPoint(0.246154, | ||
+ | |||
+ | obj76.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj76.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj76.userData.pointlabels = [" | ||
+ | obj76.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj76.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj76.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj76.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj76); | ||
+ | scene.add(obj76); | ||
+ | |||
+ | var obj77 = new THREE.Object3D(); | ||
+ | obj77.name = " | ||
+ | obj77.userData.explodable = 1; | ||
+ | obj77.userData.points = []; | ||
+ | obj77.userData.points.push(new PMPoint(0, 1, 0.125)); | ||
+ | obj77.userData.points.push(new PMPoint(0.219512, | ||
+ | obj77.userData.points.push(new PMPoint(0.180328, | ||
+ | |||
+ | obj77.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj77.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj77.userData.pointlabels = [" | ||
+ | obj77.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj77.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj77.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj77.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj77); | ||
+ | scene.add(obj77); | ||
+ | |||
+ | var obj78 = new THREE.Object3D(); | ||
+ | obj78.name = " | ||
+ | obj78.userData.explodable = 1; | ||
+ | obj78.userData.points = []; | ||
+ | obj78.userData.points.push(new PMPoint(0, 1, 0.125)); | ||
+ | obj78.userData.points.push(new PMPoint(-0.219512, | ||
+ | obj78.userData.points.push(new PMPoint(-0.180328, | ||
+ | |||
+ | obj78.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj78.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj78.userData.pointlabels = [" | ||
+ | obj78.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj78.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj78.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj78.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj78); | ||
+ | scene.add(obj78); | ||
+ | |||
+ | var obj79 = new THREE.Object3D(); | ||
+ | obj79.name = " | ||
+ | obj79.userData.explodable = 1; | ||
+ | obj79.userData.points = []; | ||
+ | obj79.userData.points.push(new PMPoint(-0.28, | ||
+ | obj79.userData.points.push(new PMPoint(-0.219512, | ||
+ | obj79.userData.points.push(new PMPoint(-0.246154, | ||
+ | |||
+ | obj79.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj79.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj79.userData.pointlabels = [" | ||
+ | obj79.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj79.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj79.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj79.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj79); | ||
+ | scene.add(obj79); | ||
+ | |||
+ | var obj80 = new THREE.Object3D(); | ||
+ | obj80.name = " | ||
+ | obj80.userData.explodable = 1; | ||
+ | obj80.userData.points = []; | ||
+ | obj80.userData.points.push(new PMPoint(-0.28, | ||
+ | obj80.userData.points.push(new PMPoint(-0.324324, | ||
+ | obj80.userData.points.push(new PMPoint(-0.308108, | ||
+ | |||
+ | obj80.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj80.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj80.userData.pointlabels = [" | ||
+ | obj80.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj80.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj80.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj80.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj80); | ||
+ | scene.add(obj80); | ||
+ | |||
+ | var obj81 = new THREE.Object3D(); | ||
+ | obj81.name = " | ||
+ | obj81.userData.explodable = 1; | ||
+ | obj81.userData.points = []; | ||
+ | obj81.userData.points.push(new PMPoint(-0.384615, | ||
+ | obj81.userData.points.push(new PMPoint(-0.324324, | ||
+ | obj81.userData.points.push(new PMPoint(-0.342282, | ||
+ | |||
+ | obj81.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj81.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj81.userData.pointlabels = [" | ||
+ | obj81.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj81.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj81.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj81.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj81); | ||
+ | scene.add(obj81); | ||
+ | |||
+ | var obj82 = new THREE.Object3D(); | ||
+ | obj82.name = " | ||
+ | obj82.userData.explodable = 1; | ||
+ | obj82.userData.points = []; | ||
+ | obj82.userData.points.push(new PMPoint(-0.384615, | ||
+ | obj82.userData.points.push(new PMPoint(-0.438202, | ||
+ | obj82.userData.points.push(new PMPoint(-0.423529, | ||
+ | |||
+ | obj82.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj82.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj82.userData.pointlabels = [" | ||
+ | obj82.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj82.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj82.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj82.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj82); | ||
+ | scene.add(obj82); | ||
+ | |||
+ | var obj83 = new THREE.Object3D(); | ||
+ | obj83.name = " | ||
+ | obj83.userData.explodable = 1; | ||
+ | obj83.userData.points = []; | ||
+ | obj83.userData.points.push(new PMPoint(-0.470588, | ||
+ | obj83.userData.points.push(new PMPoint(-0.438202, | ||
+ | obj83.userData.points.push(new PMPoint(-0.450644, | ||
+ | |||
+ | obj83.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj83.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj83.userData.pointlabels = [" | ||
+ | obj83.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj83.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj83.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj83.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj83); | ||
+ | scene.add(obj83); | ||
+ | |||
+ | var obj84 = new THREE.Object3D(); | ||
+ | obj84.name = " | ||
+ | obj84.userData.explodable = 1; | ||
+ | obj84.userData.points = []; | ||
+ | obj84.userData.points.push(new PMPoint(-0.470588, | ||
+ | obj84.userData.points.push(new PMPoint(-0.507692, | ||
+ | obj84.userData.points.push(new PMPoint(-0.492228, | ||
+ | |||
+ | obj84.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj84.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj84.userData.pointlabels = [" | ||
+ | obj84.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj84.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj84.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj84.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj84); | ||
+ | scene.add(obj84); | ||
+ | |||
+ | var obj85 = new THREE.Object3D(); | ||
+ | obj85.name = " | ||
+ | obj85.userData.explodable = 1; | ||
+ | obj85.userData.points = []; | ||
+ | obj85.userData.points.push(new PMPoint(-0.6, | ||
+ | obj85.userData.points.push(new PMPoint(-0.507692, | ||
+ | obj85.userData.points.push(new PMPoint(-0.528302, | ||
+ | |||
+ | obj85.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj85.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj85.userData.pointlabels = [" | ||
+ | obj85.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj85.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj85.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj85.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj85); | ||
+ | scene.add(obj85); | ||
+ | |||
+ | var obj86 = new THREE.Object3D(); | ||
+ | obj86.name = " | ||
+ | obj86.userData.explodable = 1; | ||
+ | obj86.userData.points = []; | ||
+ | obj86.userData.points.push(new PMPoint(-0.6, | ||
+ | obj86.userData.points.push(new PMPoint(-0.689655, | ||
+ | obj86.userData.points.push(new PMPoint(-0.670103, | ||
+ | |||
+ | obj86.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj86.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj86.userData.pointlabels = [" | ||
+ | obj86.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj86.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj86.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj86.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj86); | ||
+ | scene.add(obj86); | ||
+ | |||
+ | var obj87 = new THREE.Object3D(); | ||
+ | obj87.name = " | ||
+ | obj87.userData.explodable = 1; | ||
+ | obj87.userData.points = []; | ||
+ | obj87.userData.points.push(new PMPoint(-0.724138, | ||
+ | obj87.userData.points.push(new PMPoint(-0.689655, | ||
+ | obj87.userData.points.push(new PMPoint(-0.704142, | ||
+ | |||
+ | obj87.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj87.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj87.userData.pointlabels = [" | ||
+ | obj87.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj87.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj87.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj87.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj87); | ||
+ | scene.add(obj87); | ||
+ | |||
+ | var obj88 = new THREE.Object3D(); | ||
+ | obj88.name = " | ||
+ | obj88.userData.explodable = 1; | ||
+ | obj88.userData.points = []; | ||
+ | obj88.userData.points.push(new PMPoint(-0.724138, | ||
+ | obj88.userData.points.push(new PMPoint(-0.753425, | ||
+ | obj88.userData.points.push(new PMPoint(-0.742268, | ||
+ | |||
+ | obj88.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj88.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj88.userData.pointlabels = [" | ||
+ | obj88.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj88.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj88.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj88.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj88); | ||
+ | scene.add(obj88); | ||
+ | |||
+ | var obj89 = new THREE.Object3D(); | ||
+ | obj89.name = " | ||
+ | obj89.userData.explodable = 1; | ||
+ | obj89.userData.points = []; | ||
+ | obj89.userData.points.push(new PMPoint(-0.8, | ||
+ | obj89.userData.points.push(new PMPoint(-0.753425, | ||
+ | obj89.userData.points.push(new PMPoint(-0.766423, | ||
+ | |||
+ | obj89.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj89.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj89.userData.pointlabels = [" | ||
+ | obj89.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj89.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj89.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj89.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj89); | ||
+ | scene.add(obj89); | ||
+ | |||
+ | var obj90 = new THREE.Object3D(); | ||
+ | obj90.name = " | ||
+ | obj90.userData.explodable = 1; | ||
+ | obj90.userData.points = []; | ||
+ | obj90.userData.points.push(new PMPoint(-0.8, | ||
+ | obj90.userData.points.push(new PMPoint(-0.849057, | ||
+ | obj90.userData.points.push(new PMPoint(-0.834862, | ||
+ | |||
+ | obj90.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj90.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj90.userData.pointlabels = [" | ||
+ | obj90.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj90.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj90.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj90.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj90); | ||
+ | scene.add(obj90); | ||
+ | |||
+ | var obj91 = new THREE.Object3D(); | ||
+ | obj91.name = " | ||
+ | obj91.userData.explodable = 1; | ||
+ | obj91.userData.points = []; | ||
+ | obj91.userData.points.push(new PMPoint(-0.882353, | ||
+ | obj91.userData.points.push(new PMPoint(-0.849057, | ||
+ | obj91.userData.points.push(new PMPoint(-0.861538, | ||
+ | |||
+ | obj91.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj91.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj91.userData.pointlabels = [" | ||
+ | obj91.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj91.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj91.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj91.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj91); | ||
+ | scene.add(obj91); | ||
+ | |||
+ | var obj92 = new THREE.Object3D(); | ||
+ | obj92.name = " | ||
+ | obj92.userData.explodable = 1; | ||
+ | obj92.userData.points = []; | ||
+ | obj92.userData.points.push(new PMPoint(-0.882353, | ||
+ | obj92.userData.points.push(new PMPoint(-0.923077, | ||
+ | obj92.userData.points.push(new PMPoint(-0.905882, | ||
+ | |||
+ | obj92.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj92.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj92.userData.pointlabels = [" | ||
+ | obj92.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj92.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj92.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj92.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj92); | ||
+ | scene.add(obj92); | ||
+ | |||
+ | var obj93 = new THREE.Object3D(); | ||
+ | obj93.name = " | ||
+ | obj93.userData.explodable = 1; | ||
+ | obj93.userData.points = []; | ||
+ | obj93.userData.points.push(new PMPoint(-1, 0, 0.5)); | ||
+ | obj93.userData.points.push(new PMPoint(-0.923077, | ||
+ | obj93.userData.points.push(new PMPoint(-0.945946, | ||
+ | |||
+ | obj93.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj93.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj93.userData.pointlabels = [" | ||
+ | obj93.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj93.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj93.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj93.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj93); | ||
+ | scene.add(obj93); | ||
+ | |||
+ | // COMMON_CODE_BLOCK_BEGIN | ||
+ | function textSpriteMaterial(message, | ||
+ | if ( parameters === undefined ) parameters = {}; | ||
+ | var fontface = " | ||
+ | var fontsize = parameters.hasOwnProperty(" | ||
+ | fontsize = fontsize*10; | ||
+ | var lines = message.split(' | ||
+ | var size = 512; | ||
+ | for(var i = 0; i< | ||
+ | var tmp = lines[i].length; | ||
+ | while(tmp*fontsize > size){ | ||
+ | | ||
+ | } | ||
+ | } | ||
+ | | ||
+ | var canvas = document.createElement(' | ||
+ | canvas.width = size; | ||
+ | canvas.height = size; | ||
+ | var context = canvas.getContext(' | ||
+ | context.fillStyle = " | ||
+ | context.fill(); | ||
+ | context.font = fontsize + "px " + fontface; | ||
+ | | ||
+ | // text color | ||
+ | context.fillStyle = " | ||
+ | | ||
+ | context.fillText(lines[i], | ||
+ | } | ||
+ | | ||
+ | // canvas contents will be used for a texture | ||
+ | var texture = new THREE.Texture(canvas); | ||
+ | texture.needsUpdate = true; | ||
+ | | ||
+ | var spriteMaterial = new THREE.SpriteMaterial({map: | ||
+ | return spriteMaterial; | ||
+ | } | ||
+ | |||
+ | |||
+ | // ---------------------- INITIALIZING OBJECTS-------------------------------------- | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | |||
+ | function init_object(obj) { | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_points(obj); | ||
+ | modelContains.points = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_pointlabels(obj); | ||
+ | modelContains.pointlabels = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_lines(obj); | ||
+ | modelContains.lines = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_edgelabels(obj); | ||
+ | modelContains.edgelabels = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_arrowheads(obj); | ||
+ | modelContains.arrowheads = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_faces(obj); | ||
+ | modelContains.faces = true; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function init_points(obj) { | ||
+ | var pointgroup = new THREE.Group(); | ||
+ | pointgroup.name = " | ||
+ | var points = obj.userData.points; | ||
+ | var radii = obj.userData.pointradii; | ||
+ | var materials = obj.userData.pointmaterial; | ||
+ | var geometry, | ||
+ | if (!Array.isArray(radii)) { | ||
+ | geometry = new THREE.SphereBufferGeometry(radii); | ||
+ | } | ||
+ | if (!Array.isArray(materials)) { | ||
+ | material = materials; | ||
+ | } | ||
+ | for (var i=0; i< | ||
+ | var point = points[i]; | ||
+ | if (Array.isArray(radii)) { | ||
+ | if (radii[i] == 0) { | ||
+ | continue; | ||
+ | } | ||
+ | geometry = new THREE.SphereBufferGeometry(radii[i]); | ||
+ | } | ||
+ | if (Array.isArray(materials)) { | ||
+ | material = materials[i]; | ||
+ | } | ||
+ | var sphere = new THREE.Mesh(geometry, | ||
+ | point.addSphere(sphere); | ||
+ | pointgroup.add(sphere); | ||
+ | } | ||
+ | obj.add(pointgroup); | ||
+ | } | ||
+ | |||
+ | function init_pointlabels(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var labels = obj.userData.pointlabels; | ||
+ | var pointlabels = new THREE.Group(); | ||
+ | pointlabels.name = " | ||
+ | if (Array.isArray(labels)) { | ||
+ | for (var i=0; i< | ||
+ | var point = points[i]; | ||
+ | var spriteMaterial = textSpriteMaterial( labels[i] ); | ||
+ | var sprite = new THREE.Sprite(spriteMaterial); | ||
+ | point.addLabel(sprite); | ||
+ | pointlabels.add(sprite); | ||
+ | } | ||
+ | } else { | ||
+ | var spriteMaterial = textSpriteMaterial( labels ); | ||
+ | for (var i=0; i< | ||
+ | var point = points[i]; | ||
+ | var sprite = new THREE.Sprite(spriteMaterial); | ||
+ | point.addLabel(sprite); | ||
+ | pointlabels.add(sprite); | ||
+ | } | ||
+ | } | ||
+ | obj.add(pointlabels); | ||
+ | } | ||
+ | |||
+ | function init_lines(obj) { | ||
+ | var edgeindices = obj.userData.edgeindices; | ||
+ | var points = obj.userData.points; | ||
+ | var materials = obj.userData.edgematerial; | ||
+ | var geometry = new THREE.BufferGeometry(); | ||
+ | var bufarr = new Float32Array( obj.userData.edgeindices.length * 3 ); | ||
+ | var bufattr = new THREE.Float32BufferAttribute( bufarr, 3 ); | ||
+ | var geometry = new THREE.BufferGeometry(); | ||
+ | geometry.setAttribute(' | ||
+ | if (Array.isArray(materials)) { | ||
+ | for (var i=0; i< | ||
+ | geometry.addGroup(2*i, | ||
+ | } | ||
+ | } | ||
+ | var lines = new THREE.LineSegments(geometry, | ||
+ | lines.name = " | ||
+ | obj.add(lines); | ||
+ | updateEdgesPosition(obj); | ||
+ | } | ||
+ | |||
+ | function init_edgelabels(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var edgeindices = obj.userData.edgeindices; | ||
+ | var labels = obj.userData.edgelabels; | ||
+ | var edgelabels = new THREE.Group(); | ||
+ | edgelabels.name = " | ||
+ | if (Array.isArray(labels)) { | ||
+ | for (var i=0; i< | ||
+ | var spriteMaterial = textSpriteMaterial( labels[i] ); | ||
+ | var sprite = new THREE.Sprite(spriteMaterial); | ||
+ | sprite.position.copy(new THREE.Vector3().addVectors(points[edgeindices[2*i]].vector, | ||
+ | edgelabels.add(sprite); | ||
+ | } | ||
+ | } else { | ||
+ | var spriteMaterial = textSpriteMaterial( labels ); | ||
+ | for (var i=0; i< | ||
+ | var sprite = new THREE.Sprite(spriteMaterial); | ||
+ | sprite.position.copy(new THREE.Vector3().addVectors(points[edgeindices[2*i]].vector, | ||
+ | edgelabels.add(sprite); | ||
+ | } | ||
+ | } | ||
+ | obj.add(edgelabels); | ||
+ | } | ||
+ | |||
+ | function init_arrowheads(obj) { | ||
+ | var arrowheads = new THREE.Group(); | ||
+ | arrowheads.name = " | ||
+ | var arrowstyle = obj.userData.arrowstyle; | ||
+ | var edgeindices = obj.userData.edgeindices; | ||
+ | var edgematerials = obj.userData.edgematerial; | ||
+ | var points = obj.userData.points; | ||
+ | var material; | ||
+ | if (!Array.isArray(edgematerials)) { | ||
+ | material = new THREE.MeshBasicMaterial( {color: edgematerials.color} ); | ||
+ | } | ||
+ | |||
+ | for (var i=0; i< | ||
+ | var start = points[edgeindices[i]]; | ||
+ | var end = points[edgeindices[i+1]]; | ||
+ | var dist = start.vector.distanceTo( end.vector ) - start.radius() - end.radius(); | ||
+ | if (dist <= 0) { | ||
+ | continue; | ||
+ | } | ||
+ | var dir = new THREE.Vector3().subVectors(end.vector, | ||
+ | dir.normalize(); | ||
+ | var axis = new THREE.Vector3().set(dir.z, | ||
+ | axis.normalize(); | ||
+ | var radians = Math.acos( dir.y ); | ||
+ | var radius = dist/25; | ||
+ | var height = dist/5; | ||
+ | var geometry = new THREE.ConeBufferGeometry(radius, | ||
+ | var position = new THREE.Vector3().addVectors(start.vector, | ||
+ | if (Array.isArray(edgematerials)) { | ||
+ | material = new THREE.MeshBasicMaterial( {color: edgematerials[i].color} ); | ||
+ | } | ||
+ | var cone = new THREE.Mesh( geometry, material ); | ||
+ | cone.quaternion.setFromAxisAngle(axis, | ||
+ | cone.position.copy(position);; | ||
+ | arrowheads.add(cone); | ||
+ | } | ||
+ | obj.add(arrowheads); | ||
+ | } | ||
+ | |||
+ | function init_faces(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var facets = obj.userData.facets; | ||
+ | obj.userData.triangleindices = []; | ||
+ | for (var i=0; i< | ||
+ | facet = facets[i]; | ||
+ | for (var t=0; t< | ||
+ | obj.userData.triangleindices.push(facet[0], | ||
+ | } | ||
+ | } | ||
+ | var bufarr = new Float32Array( obj.userData.triangleindices.length * 3 ); | ||
+ | var bufattr = new THREE.Float32BufferAttribute(bufarr, | ||
+ | | ||
+ | var materials = obj.userData.facetmaterial; | ||
+ | var geometry = new THREE.BufferGeometry(); | ||
+ | var frontmaterials = []; | ||
+ | var backmaterials = []; | ||
+ | geometry.setAttribute(' | ||
+ | if (Array.isArray(materials)) { | ||
+ | var tricount = 0; | ||
+ | var facet; | ||
+ | for (var i=0; i< | ||
+ | facet = facets[i]; | ||
+ | geometry.addGroup(tricount, | ||
+ | tricount += (facet.length-2)*3; | ||
+ | } | ||
+ | for (var j=0; j< | ||
+ | var fmat = materials[j].clone() | ||
+ | fmat.side = THREE.FrontSide; | ||
+ | frontmaterials.push(fmat); | ||
+ | var bmat = materials[j].clone() | ||
+ | bmat.side = THREE.BackSide; | ||
+ | backmaterials.push(bmat); | ||
+ | obj.userData.facetmaterial = frontmaterials.concat(backmaterials); | ||
+ | } | ||
+ | } else if (materials instanceof THREE.Material) { | ||
+ | frontmaterials = materials.clone() | ||
+ | frontmaterials.side = THREE.FrontSide; | ||
+ | backmaterials = materials.clone() | ||
+ | backmaterials.side = THREE.BackSide; | ||
+ | obj.userData.facetmaterial = [frontmaterials, | ||
+ | } | ||
+ | // duplicating the object with front and back should avoid transparency issues | ||
+ | var backmesh = new THREE.Mesh(geometry, | ||
+ | // meshname is used to show/hide objects | ||
+ | backmesh.name = " | ||
+ | obj.add(backmesh); | ||
+ | var frontmesh = new THREE.Mesh(geometry, | ||
+ | frontmesh.name = " | ||
+ | obj.add(frontmesh); | ||
+ | updateFacesPosition(obj); | ||
+ | } | ||
+ | // // | ||
+ | |||
+ | |||
+ | function updateFacesPosition(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var indices = obj.userData.triangleindices; | ||
+ | var faces = obj.getObjectByName(" | ||
+ | var ba = faces.geometry.getAttribute(" | ||
+ | for (var i=0; i< | ||
+ | ba.setXYZ(i, | ||
+ | } | ||
+ | faces.geometry.attributes.position.needsUpdate = true; | ||
+ | | ||
+ | } | ||
+ | |||
+ | function updateEdgesPosition(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var indices = obj.userData.edgeindices; | ||
+ | var lines = obj.getObjectByName(" | ||
+ | var ba = lines.geometry.getAttribute(" | ||
+ | for (var i=0; i< | ||
+ | ba.setXYZ(i, | ||
+ | } | ||
+ | lines.geometry.attributes.position.needsUpdate = true; | ||
+ | } | ||
+ | |||
+ | function onWindowResize() { | ||
+ | renderer.setSize( three.clientWidth, | ||
+ | svgRenderer.setSize( three.clientWidth, | ||
+ | updateCamera(); | ||
+ | } | ||
+ | |||
+ | function updateCamera() { | ||
+ | var width = three.clientWidth; | ||
+ | var height = three.clientHeight; | ||
+ | var aspect = width / height; | ||
+ | if (camera.type == " | ||
+ | camera.left = frustumSize * aspect / - 2; | ||
+ | camera.right = frustumSize * aspect / 2; | ||
+ | camera.top = frustumSize / 2; | ||
+ | camera.bottom = - frustumSize / 2; | ||
+ | } else if (camera.type == " | ||
+ | camera.aspect = aspect; | ||
+ | } | ||
+ | camera.updateProjectionMatrix(); | ||
+ | } | ||
+ | |||
+ | function changeCamera(event) { | ||
+ | var selindex = event.currentTarget.selectedIndex; | ||
+ | camera = cameras[selindex]; | ||
+ | control = controls[selindex]; | ||
+ | control.enabled = true; | ||
+ | for (var i=0; i< | ||
+ | if (i!=selindex) { | ||
+ | controls[i].enabled = false; | ||
+ | } | ||
+ | } | ||
+ | updateCamera(); | ||
+ | } | ||
+ | |||
+ | var camtypenode = document.getElementById(' | ||
+ | camtypenode.onchange = changeCamera; | ||
+ | camtypenode.dispatchEvent(new Event(' | ||
+ | |||
+ | onWindowResize(); | ||
+ | window.addEventListener(' | ||
+ | |||
+ | |||
+ | var xRotationEnabled = false; | ||
+ | var yRotationEnabled = false; | ||
+ | var zRotationEnabled = false; | ||
+ | var rotationSpeedFactor = 1; | ||
+ | var settingsShown = false; | ||
+ | var labelsShown = true; | ||
+ | var intervals = []; | ||
+ | var timeouts = []; | ||
+ | var explodingSpeed = 0.05; | ||
+ | var explodeScale = 0.000001; | ||
+ | var XMLS = new XMLSerializer(); | ||
+ | var svgElement; | ||
+ | var renderId; | ||
+ | |||
+ | var render = function () { | ||
+ | |||
+ | renderId = requestAnimationFrame(render); | ||
+ | |||
+ | // comment in for automatic explosion | ||
+ | // | ||
+ | |||
+ | var phi = 0.02 * rotationSpeedFactor; | ||
+ | |||
+ | if (xRotationEnabled) { | ||
+ | scene.rotation.x += phi; | ||
+ | } | ||
+ | if (yRotationEnabled) { | ||
+ | scene.rotation.y += phi; | ||
+ | } | ||
+ | if (zRotationEnabled) { | ||
+ | scene.rotation.z += phi; | ||
+ | } | ||
+ | |||
+ | control.update(); | ||
+ | renderer.render(scene, | ||
+ | }; | ||
+ | |||
+ | if ( THREE.WEBGL.isWebGLAvailable() ) { | ||
+ | render(); | ||
+ | } else { | ||
+ | var warning = WEBGL.getWebGLErrorMessage(); | ||
+ | three.appendChild( warning ); | ||
+ | } | ||
+ | | ||
+ | function changeTransparency() { | ||
+ | var opacity = 1-Number(event.currentTarget.value); | ||
+ | for (var i=0; i< | ||
+ | child = scene.children[i]; | ||
+ | if ( child.userData.hasOwnProperty(" | ||
+ | if (Array.isArray(child.userData.facetmaterial)) { | ||
+ | for (var j=0; j< | ||
+ | child.userData.facetmaterial[j].opacity = opacity; | ||
+ | } | ||
+ | } else { | ||
+ | child.userData.facetmaterial.opacity = opacity; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function toggleDepthWrite(event) { | ||
+ | depthwrite = event.currentTarget.checked; | ||
+ | for (var i=0; i< | ||
+ | child = scene.children[i]; | ||
+ | if ( child.userData.hasOwnProperty(" | ||
+ | if (Array.isArray(child.userData.facetmaterial)) { | ||
+ | for (var j=0; j< | ||
+ | child.userData.facetmaterial[j].depthWrite = depthwrite; | ||
+ | } | ||
+ | } else { | ||
+ | child.userData.facetmaterial.depthWrite = depthWrite; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function changeRotationX(event){ | ||
+ | xRotationEnabled = event.currentTarget.checked; | ||
+ | } | ||
+ | |||
+ | function changeRotationY(event){ | ||
+ | yRotationEnabled = event.currentTarget.checked; | ||
+ | } | ||
+ | |||
+ | function changeRotationZ(event){ | ||
+ | zRotationEnabled = event.currentTarget.checked; | ||
+ | } | ||
+ | |||
+ | |||
+ | function changeRotationSpeedFactor(event){ | ||
+ | rotationSpeedFactor = Number(event.currentTarget.value); | ||
+ | } | ||
+ | |||
+ | function resetScene(){ | ||
+ | scene.rotation.set(0, | ||
+ | camera.position.set(0, | ||
+ | camera.up.set(0, | ||
+ | } | ||
+ | |||
+ | function showSettings(event){ | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | settingsShown = true; | ||
+ | } | ||
+ | |||
+ | function hideSettings(event){ | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | settingsShown = false; | ||
+ | } | ||
+ | |||
+ | |||
+ | |||
+ | var pos = 150* Math.PI; | ||
+ | |||
+ | function updateFactor() { | ||
+ | pos++; | ||
+ | return Math.sin(.01*pos)+1; | ||
+ | } | ||
+ | |||
+ | // ------------------------ FOLDING ------------------------------------------------ | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | // rotate point p around axis defined by points p1 and p2 by given angle | ||
+ | function rotate(p, p1, p2, angle ){ | ||
+ | angle = -angle; | ||
+ | var x = p.x, y = p.y, z = p.z, | ||
+ | a = p1.x, b = p1.y, c = p1.z, | ||
+ | u = p2.x-p1.x, v = p2.y-p1.y, w = p2.z-p1.z; | ||
+ | var result = []; | ||
+ | var L = u*u + v*v + w*w; | ||
+ | var sqrt = Math.sqrt; | ||
+ | var cos = Math.cos; | ||
+ | var sin = Math.sin; | ||
+ | |||
+ | result[0] = ((a*(v*v+w*w)-u*(b*v+c*w-u*x-v*y-w*z))*(1-cos(angle))+L*x*cos(angle)+sqrt(L)*(-c*v+b*w-w*y+v*z)*sin(angle))/ | ||
+ | result[1] = ((b*(u*u+w*w)-v*(a*u+c*w-u*x-v*y-w*z))*(1-cos(angle))+L*y*cos(angle)+sqrt(L)*(c*u-a*w+w*x-u*z)*sin(angle))/ | ||
+ | result[2] = ((c*(u*u+v*v)-w*(a*u+b*v-u*x-v*y-w*z))*(1-cos(angle))+L*z*cos(angle)+sqrt(L)*(-b*u+a*v-v*x+u*y)*sin(angle))/ | ||
+ | |||
+ | return result; | ||
+ | } | ||
+ | |||
+ | var fold = function(event){ | ||
+ | var obj = foldables[Number(event.currentTarget.name)]; | ||
+ | var foldvalue = Number(event.currentTarget.value); | ||
+ | var scale = foldvalue - obj.userData.oldscale; | ||
+ | |||
+ | for (var j=0; j< | ||
+ | rotateVertices(obj, | ||
+ | } | ||
+ | update(obj); | ||
+ | obj.userData.oldscale += scale; | ||
+ | lookAtBarycenter(obj); | ||
+ | } | ||
+ | |||
+ | function lookAtBarycenter(obj){ | ||
+ | control.target = barycenter(obj); | ||
+ | } | ||
+ | |||
+ | function barycenter(obj) { | ||
+ | var center = new THREE.Vector3(0, | ||
+ | var points = obj.userData.points; | ||
+ | for (var i=0; i< | ||
+ | center.add(points[i].vector); | ||
+ | } | ||
+ | center.divideScalar(points.length); | ||
+ | return center; | ||
+ | } | ||
+ | |||
+ | function rotateVertices(obj, | ||
+ | var axes = obj.userData.axes; | ||
+ | var subtrees = obj.userData.subtrees; | ||
+ | var points = obj.userData.points; | ||
+ | var angles = obj.userData.angles; | ||
+ | if (edge < axes.length){ | ||
+ | for (var j=0; j< | ||
+ | var rotP = rotate(points[subtrees[edge][j]].vector, | ||
+ | points[subtrees[edge][j]].set(rotP[0], | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function update(obj) { | ||
+ | | ||
+ | | ||
+ | } | ||
+ | |||
+ | if (foldables.length) { | ||
+ | var settings = document.getElementById(' | ||
+ | var foldDiv = document.createElement(' | ||
+ | foldDiv.id = ' | ||
+ | var title = document.createElement(' | ||
+ | title.innerHTML = ' | ||
+ | foldDiv.appendChild(title); | ||
+ | foldDiv.className = ' | ||
+ | for (var i=0; i< | ||
+ | var range = document.createElement(' | ||
+ | range.type = ' | ||
+ | range.min = 0; | ||
+ | range.max = 1; | ||
+ | range.value = 0; | ||
+ | range.step = 0.001; | ||
+ | range.name = String(i); | ||
+ | range.oninput = fold; | ||
+ | foldDiv.appendChild(range); | ||
+ | } | ||
+ | lookAtBarycenter(foldables[0]); | ||
+ | settings.insertBefore(foldDiv, | ||
+ | } | ||
+ | |||
+ | | ||
+ | // ---------------------- EXPLOSION ------------------------------------------------ | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | |||
+ | if (explodableModel) { | ||
+ | for (var i=0; i< | ||
+ | obj = scene.children[i]; | ||
+ | if ( obj.userData.explodable ) { | ||
+ | computeCentroid(obj); | ||
+ | } | ||
+ | } | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | explode(0.000001); | ||
+ | } | ||
+ | |||
+ | function computeCentroid(obj) { | ||
+ | centroid = new THREE.Vector3(); | ||
+ | obj.userData.points.forEach(function(pmpoint) { | ||
+ | centroid.add(pmpoint.vector); | ||
+ | }); | ||
+ | centroid.divideScalar(obj.userData.points.length); | ||
+ | obj.userData.centroid = centroid; | ||
+ | } | ||
+ | |||
+ | function explode(factor) { | ||
+ | for (var i=0; i< | ||
+ | var obj = scene.children[i]; | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | var c = obj.userData.centroid; | ||
+ | obj.position.set(c.x*factor, | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function triggerExplode(event){ | ||
+ | explodeScale = Number(event.currentTarget.value); | ||
+ | explode(explodeScale); | ||
+ | } | ||
+ | |||
+ | function setExplodingSpeed(event){ | ||
+ | explodingSpeed = Number(event.currentTarget.value); | ||
+ | } | ||
+ | |||
+ | function triggerAutomaticExplode(event){ | ||
+ | if (event.currentTarget.checked){ | ||
+ | startExploding(); | ||
+ | } else { | ||
+ | clearIntervals(); | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function startExploding(){ | ||
+ | intervals.push(setInterval(explodingInterval, | ||
+ | } | ||
+ | |||
+ | |||
+ | function explodingInterval(){ | ||
+ | explodeScale += explodingSpeed; | ||
+ | if (explodeScale <= 6){ | ||
+ | explode(explodeScale); | ||
+ | } | ||
+ | else{ | ||
+ | explode(6); | ||
+ | explodeScale = 6; | ||
+ | clearIntervals(); | ||
+ | timeouts.push(setTimeout(startUnexploding, | ||
+ | } | ||
+ | document.getElementById(' | ||
+ | } | ||
+ | |||
+ | |||
+ | function startUnexploding(){ | ||
+ | intervals.push(setInterval(unexplodingInterval, | ||
+ | } | ||
+ | |||
+ | function unexplodingInterval(){ | ||
+ | explodeScale -= explodingSpeed; | ||
+ | if (explodeScale >= 0){ | ||
+ | explode(explodeScale); | ||
+ | } | ||
+ | else { | ||
+ | explode(0); | ||
+ | explodeScale = 0; | ||
+ | clearIntervals(); | ||
+ | timeouts.push(setTimeout(startExploding, | ||
+ | } | ||
+ | document.getElementById(' | ||
+ | } | ||
+ | |||
+ | function clearIntervals(){ | ||
+ | intervals.forEach(function(interval){ | ||
+ | clearInterval(interval); | ||
+ | }); | ||
+ | intervals = []; | ||
+ | timeouts.forEach(function(timeout){ | ||
+ | clearTimeout(timeout); | ||
+ | }); | ||
+ | timeouts = []; | ||
+ | } | ||
+ | |||
+ | // ---------------------- DISPLAY -------------------------------------------------- | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | |||
+ | const objectTypeInnerHTMLs = { points: " | ||
+ | const objectTypeVisible = {}; | ||
+ | Object.assign(objectTypeVisible, | ||
+ | const sortedObjectTypeKeys = Object.keys(objectTypeInnerHTMLs).sort(); | ||
+ | const shownObjectTypesList = document.getElementById(' | ||
+ | |||
+ | function setVisibility(bool, | ||
+ | for (var i=0; i< | ||
+ | var obj = scene.children[i].getObjectByName(objname); | ||
+ | if (obj) { | ||
+ | obj.visible = bool; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function toggleObjectTypeVisibility(event){ | ||
+ | var name = event.currentTarget.name; | ||
+ | var checked = event.currentTarget.checked; | ||
+ | objectTypeVisible[name] = checked; | ||
+ | if (name == " | ||
+ | setVisibility(checked," | ||
+ | setVisibility(checked," | ||
+ | } else { | ||
+ | setVisibility(checked, | ||
+ | } | ||
+ | } | ||
+ | |||
+ | for (var i=0; i< | ||
+ | var key = sortedObjectTypeKeys[i]; | ||
+ | if (modelContains[key]) { | ||
+ | var objTypeNode = document.createElement(' | ||
+ | objTypeNode.innerHTML = objectTypeInnerHTMLs[key] + '< | ||
+ | var checkbox = document.createElement(' | ||
+ | checkbox.type = ' | ||
+ | checkbox.checked = true; | ||
+ | checkbox.name = key; | ||
+ | checkbox.onchange = toggleObjectTypeVisibility; | ||
+ | shownObjectTypesList.appendChild(checkbox); | ||
+ | shownObjectTypesList.appendChild(objTypeNode); | ||
+ | } | ||
+ | } | ||
+ | |||
+ | // ------------------------------------------------------ | ||
+ | |||
+ | function toggleObjectVisibility(event){ | ||
+ | var nr = Number(event.currentTarget.name); | ||
+ | scene.children[nr].visible = event.currentTarget.checked; | ||
+ | } | ||
+ | |||
+ | // append checkboxes for displaying or hiding objects | ||
+ | var shownObjectsList = document.getElementById(' | ||
+ | for (var i=0; i< | ||
+ | obj = scene.children[i]; | ||
+ | var objNode = document.createElement(' | ||
+ | objNode.innerHTML = obj.name + '< | ||
+ | var checkbox = document.createElement(' | ||
+ | checkbox.type = ' | ||
+ | checkbox.checked = true; | ||
+ | checkbox.name = String(i); | ||
+ | checkbox.onchange = toggleObjectVisibility; | ||
+ | shownObjectsList.appendChild(checkbox); | ||
+ | shownObjectsList.appendChild(objNode); | ||
+ | } | ||
+ | |||
+ | // ---------------------- SVG ------------------------------------------------------ | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | |||
+ | function takeSvgScreenshot() { | ||
+ | if (objectTypeVisible[" | ||
+ | setVisibility(false," | ||
+ | } | ||
+ | if (objectTypeVisible[" | ||
+ | setVisibility(false," | ||
+ | } | ||
+ | svgRenderer.render(scene, | ||
+ | svgElement = XMLS.serializeToString(svgRenderer.domElement); | ||
+ | | ||
+ | if (objectTypeVisible[" | ||
+ | setVisibility(true," | ||
+ | } | ||
+ | if (objectTypeVisible[" | ||
+ | setVisibility(true," | ||
+ | } | ||
+ | |||
+ | if (document.getElementById(' | ||
+ | //show in new tab | ||
+ | var myWindow = window.open("","" | ||
+ | myWindow.document.body.innerHTML = svgElement; | ||
+ | } else{ | ||
+ | // download svg file | ||
+ | download(" | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function download(filename, | ||
+ | var element = document.createElement(' | ||
+ | element.setAttribute(' | ||
+ | element.setAttribute(' | ||
+ | |||
+ | element.style.display = ' | ||
+ | document.body.appendChild(element); | ||
+ | |||
+ | element.click(); | ||
+ | |||
+ | document.body.removeChild(element); | ||
+ | } | ||
+ | |||
+ | |||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | |||
+ | |||
+ | // ------------------ SHORTCUTS -------------------------------------------- | ||
+ | // ------------------------------------------------------------------------- | ||
+ | |||
+ | /** | ||
+ | * http:// | ||
+ | * Version : 2.01.B | ||
+ | * By Binny V A | ||
+ | * License : BSD | ||
+ | */ | ||
+ | shortcut = { | ||
+ | ' | ||
+ | ' | ||
+ | //Provide a set of default options | ||
+ | var default_options = { | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | } | ||
+ | if(!opt) opt = default_options; | ||
+ | else { | ||
+ | for(var dfo in default_options) { | ||
+ | if(typeof opt[dfo] == ' | ||
+ | } | ||
+ | } | ||
+ | |||
+ | var ele = opt.target; | ||
+ | if(typeof opt.target == ' | ||
+ | var ths = this; | ||
+ | shortcut_combination = shortcut_combination.toLowerCase(); | ||
+ | |||
+ | //The function to be called at keypress | ||
+ | var func = function(e) { | ||
+ | e = e || window.event; | ||
+ | |||
+ | if(opt[' | ||
+ | var element; | ||
+ | if(e.target) element=e.target; | ||
+ | else if(e.srcElement) element=e.srcElement; | ||
+ | if(element.nodeType==3) element=element.parentNode; | ||
+ | |||
+ | if(element.tagName == ' | ||
+ | } | ||
+ | |||
+ | //Find Which key is pressed | ||
+ | if (e.keyCode) code = e.keyCode; | ||
+ | else if (e.which) code = e.which; | ||
+ | var character = String.fromCharCode(code).toLowerCase(); | ||
+ | |||
+ | if(code == 188) character=","; | ||
+ | if(code == 190) character=" | ||
+ | |||
+ | var keys = shortcut_combination.split(" | ||
+ | //Key Pressed - counts the number of valid keypresses - if it is same as the number of keys, the shortcut function is invoked | ||
+ | var kp = 0; | ||
+ | |||
+ | //Work around for stupid Shift key bug created by using lowercase - as a result the shift+num combination was broken | ||
+ | var shift_nums = { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | ";":":", | ||
+ | "'":" | ||
+ | ",":"<", | ||
+ | " | ||
+ | "/":"?", | ||
+ | " | ||
+ | } | ||
+ | // | ||
+ | var special_keys = { | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | } | ||
+ | |||
+ | var modifiers = { | ||
+ | shift: { wanted: | ||
+ | ctrl : { wanted: | ||
+ | alt | ||
+ | meta : { wanted: | ||
+ | }; | ||
+ | | ||
+ | if(e.ctrlKey) modifiers.ctrl.pressed = true; | ||
+ | if(e.shiftKey) modifiers.shift.pressed = true; | ||
+ | if(e.altKey) modifiers.alt.pressed = true; | ||
+ | if(e.metaKey) | ||
+ | | ||
+ | for(var i=0; k=keys[i], | ||
+ | // | ||
+ | if(k == ' | ||
+ | kp++; | ||
+ | modifiers.ctrl.wanted = true; | ||
+ | |||
+ | } else if(k == ' | ||
+ | kp++; | ||
+ | modifiers.shift.wanted = true; | ||
+ | |||
+ | } else if(k == ' | ||
+ | kp++; | ||
+ | modifiers.alt.wanted = true; | ||
+ | } else if(k == ' | ||
+ | kp++; | ||
+ | modifiers.meta.wanted = true; | ||
+ | } else if(k.length > 1) { //If it is a special key | ||
+ | if(special_keys[k] == code) kp++; | ||
+ | |||
+ | } else if(opt[' | ||
+ | if(opt[' | ||
+ | |||
+ | } else { //The special keys did not match | ||
+ | if(character == k) kp++; | ||
+ | else { | ||
+ | if(shift_nums[character] && e.shiftKey) { //Stupid Shift key bug created by using lowercase | ||
+ | character = shift_nums[character]; | ||
+ | if(character == k) kp++; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | if(kp == keys.length && | ||
+ | modifiers.ctrl.pressed == modifiers.ctrl.wanted && | ||
+ | modifiers.shift.pressed == modifiers.shift.wanted && | ||
+ | modifiers.alt.pressed == modifiers.alt.wanted && | ||
+ | modifiers.meta.pressed == modifiers.meta.wanted) { | ||
+ | callback(e); | ||
+ | |||
+ | if(!opt[' | ||
+ | // | ||
+ | e.cancelBubble = true; | ||
+ | e.returnValue = false; | ||
+ | |||
+ | // | ||
+ | if (e.stopPropagation) { | ||
+ | e.stopPropagation(); | ||
+ | e.preventDefault(); | ||
+ | } | ||
+ | return false; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | this.all_shortcuts[shortcut_combination] = { | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | }; | ||
+ | //Attach the function with the event | ||
+ | if(ele.addEventListener) ele.addEventListener(opt[' | ||
+ | else if(ele.attachEvent) ele.attachEvent(' | ||
+ | else ele[' | ||
+ | }, | ||
+ | |||
+ | //Remove the shortcut - just specify the shortcut and I will remove the binding | ||
+ | ' | ||
+ | shortcut_combination = shortcut_combination.toLowerCase(); | ||
+ | var binding = this.all_shortcuts[shortcut_combination]; | ||
+ | delete(this.all_shortcuts[shortcut_combination]) | ||
+ | if(!binding) return; | ||
+ | var type = binding[' | ||
+ | var ele = binding[' | ||
+ | var callback = binding[' | ||
+ | |||
+ | if(ele.detachEvent) ele.detachEvent(' | ||
+ | else if(ele.removeEventListener) ele.removeEventListener(type, | ||
+ | else ele[' | ||
+ | } | ||
+ | } | ||
+ | |||
+ | shortcut.add(" | ||
+ | var event = new Event(' | ||
+ | if (settingsShown){ | ||
+ | document.getElementById(' | ||
+ | } else { | ||
+ | document.getElementById(' | ||
+ | } | ||
+ | }); | ||
+ | |||
+ | |||
+ | // COMMON_CODE_BLOCK_END | ||
+ | |||
+ | });}); | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | <code perl> | ||
+ | > $d1 = $s-> | ||
+ | > $d1-> | ||
+ | </ | ||
+ | < | ||
+ | <!-- | ||
+ | polymake for knusper | ||
+ | Thu Mar 3 00:31:40 2022 | ||
+ | pcom:d1 | ||
+ | --> | ||
+ | |||
+ | |||
+ | < | ||
+ | < | ||
+ | <meta charset=utf-8> | ||
+ | < | ||
+ | < | ||
+ | /* | ||
+ | // COMMON_CODE_BLOCK_BEGIN | ||
+ | */ | ||
+ | html {overflow: scroll;} | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | # | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | } | ||
+ | /* | ||
+ | // COMMON_CODE_BLOCK_END | ||
+ | */ | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | <div id=' | ||
+ | <div class=group id=' | ||
+ | < | ||
+ | < | ||
+ | <div class=indented>< | ||
+ | <div class=suboption> | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | <div class=group id=' | ||
+ | < | ||
+ | < | ||
+ | <div class=indented>< | ||
+ | </ | ||
+ | |||
+ | <div class=group id=' | ||
+ | < | ||
+ | <div class=indented> | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | <div class=suboption> | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | |||
+ | <div class=group id=' | ||
+ | < | ||
+ | <div class=indented> | ||
+ | < | ||
+ | </ | ||
+ | <div class=suboption> | ||
+ | <div class=indented> | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | < | ||
+ | <div class=indented> | ||
+ | < | ||
+ | <select id=" | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | <div class=group id=' | ||
+ | < | ||
+ | <div class=indented> | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | </ | ||
+ | <img id=' | ||
+ | <img id=' | ||
+ | <div id=" | ||
+ | </ | ||
+ | < | ||
+ | requirejs.config({ | ||
+ | paths: { | ||
+ | three: '/ | ||
+ | TrackballControls: | ||
+ | OrbitControls: | ||
+ | Projector: '/ | ||
+ | SVGRenderer: | ||
+ | WEBGL: '/ | ||
+ | }, | ||
+ | shim: { | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | } | ||
+ | }); | ||
+ | | ||
+ | require([' | ||
+ | window.THREE = THREE; | ||
+ | require([' | ||
+ | | ||
+ | THREE.TrackballControls = TrackballControls; | ||
+ | THREE.OrbitControls = OrbitControls; | ||
+ | THREE.Projector = Projector; | ||
+ | THREE.SVGRenderer = SVGRenderer; | ||
+ | THREE.WEBGL = WEBGL; | ||
+ | |||
+ | // COMMON_CODE_BLOCK_BEGIN | ||
+ | |||
+ | const intervalLength = 25; // for automatic animations | ||
+ | const explodableModel = true; | ||
+ | const modelContains = { points: false, pointlabels: | ||
+ | const foldables = []; | ||
+ | |||
+ | var three = document.getElementById(" | ||
+ | var scene = new THREE.Scene(); | ||
+ | var renderer = new THREE.WebGLRenderer( { antialias: true } ); | ||
+ | var svgRenderer = new THREE.SVGRenderer( { antialias: true } ); | ||
+ | renderer.setPixelRatio( window.devicePixelRatio ); | ||
+ | renderer.setClearColor(0xFFFFFF, | ||
+ | svgRenderer.setClearColor(0xFFFFFF, | ||
+ | three.appendChild(renderer.domElement); | ||
+ | |||
+ | var frustumSize = 4; | ||
+ | var cameras = [new THREE.PerspectiveCamera(75, | ||
+ | cameras.forEach(function(cam) { | ||
+ | cam.position.set(0, | ||
+ | cam.lookAt(0, | ||
+ | cam.up.set(0, | ||
+ | }); | ||
+ | var controls = [new THREE.TrackballControls(cameras[0], | ||
+ | var camera, control; | ||
+ | |||
+ | controls[0].zoomSpeed = 0.2; | ||
+ | controls[0].rotateSpeed = 4; | ||
+ | |||
+ | |||
+ | // class to allow move points together with labels and spheres | ||
+ | var PMPoint = function (x,y,z) { | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | PMPoint.prototype.addLabel = function(labelsprite) { | ||
+ | | ||
+ | | ||
+ | } | ||
+ | PMPoint.prototype.addSphere = function(spheremesh) { | ||
+ | | ||
+ | | ||
+ | } | ||
+ | PMPoint.prototype.set = function(x, | ||
+ | | ||
+ | if (this.sprite) { | ||
+ | this.sprite.position.copy(this.vector); | ||
+ | } | ||
+ | if (this.sphere) { | ||
+ | this.sphere.position.copy(this.vector); | ||
+ | } | ||
+ | } | ||
+ | PMPoint.prototype.radius = function() { | ||
+ | if (this.sphere) { | ||
+ | return this.sphere.geometry.parameters.radius; | ||
+ | } else { | ||
+ | return 0; | ||
+ | } | ||
+ | }; | ||
+ | // select the target node | ||
+ | var target = document.querySelector('# | ||
+ | |||
+ | // create an observer instance | ||
+ | var observer = new MutationObserver(function(mutations) { | ||
+ | | ||
+ | if (mutation.removedNodes && mutation.removedNodes.length > 0) { | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | }); | ||
+ | }); | ||
+ | |||
+ | // configuration of the observer: | ||
+ | var config = { childList: true, characterData: | ||
+ | |||
+ | // pass in the target node, as well as the observer options | ||
+ | while (target) { | ||
+ | if (target.className==" | ||
+ | observer.observe(target, | ||
+ | break; | ||
+ | } | ||
+ | | ||
+ | } | ||
+ | |||
+ | // COMMON_CODE_BLOCK_END | ||
+ | |||
+ | var obj0 = new THREE.Object3D(); | ||
+ | obj0.name = " | ||
+ | obj0.userData.explodable = 1; | ||
+ | obj0.userData.points = []; | ||
+ | obj0.userData.points.push(new PMPoint(0, -1, 0.125)); | ||
+ | obj0.userData.points.push(new PMPoint(0, 1, 0.125)); | ||
+ | obj0.userData.points.push(new PMPoint(-1, 0, 0.5)); | ||
+ | |||
+ | obj0.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj0.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj0.userData.pointlabels = [" | ||
+ | obj0.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj0.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj0.userData.facets = [[0, 2, 1]]; | ||
+ | < | ||
+ | obj0.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj0); | ||
+ | scene.add(obj0); | ||
+ | |||
+ | var obj1 = new THREE.Object3D(); | ||
+ | obj1.name = " | ||
+ | obj1.userData.explodable = 1; | ||
+ | obj1.userData.points = []; | ||
+ | obj1.userData.points.push(new PMPoint(0, -1, 0.125)); | ||
+ | obj1.userData.points.push(new PMPoint(0, 1, 0.125)); | ||
+ | obj1.userData.points.push(new PMPoint(1, 0, 0.5)); | ||
+ | |||
+ | obj1.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj1.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj1.userData.pointlabels = [" | ||
+ | obj1.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj1.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj1.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj1.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj1); | ||
+ | scene.add(obj1); | ||
+ | |||
+ | var obj2 = new THREE.Object3D(); | ||
+ | obj2.name = " | ||
+ | obj2.userData.explodable = 1; | ||
+ | obj2.userData.points = []; | ||
+ | obj2.userData.points.push(new PMPoint(0, 1, 0.125)); | ||
+ | obj2.userData.points.push(new PMPoint(-1, 0, 0.5)); | ||
+ | obj2.userData.points.push(new PMPoint(-0.8, | ||
+ | |||
+ | obj2.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj2.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj2.userData.pointlabels = [" | ||
+ | obj2.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj2.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj2.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj2.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj2); | ||
+ | scene.add(obj2); | ||
+ | |||
+ | var obj3 = new THREE.Object3D(); | ||
+ | obj3.name = " | ||
+ | obj3.userData.explodable = 1; | ||
+ | obj3.userData.points = []; | ||
+ | obj3.userData.points.push(new PMPoint(0, -1, 0.125)); | ||
+ | obj3.userData.points.push(new PMPoint(-1, 0, 0.5)); | ||
+ | obj3.userData.points.push(new PMPoint(-0.8, | ||
+ | |||
+ | obj3.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj3.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj3.userData.pointlabels = [" | ||
+ | obj3.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj3.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj3.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj3.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj3); | ||
+ | scene.add(obj3); | ||
+ | |||
+ | var obj4 = new THREE.Object3D(); | ||
+ | obj4.name = " | ||
+ | obj4.userData.explodable = 1; | ||
+ | obj4.userData.points = []; | ||
+ | obj4.userData.points.push(new PMPoint(0, -1, 0.125)); | ||
+ | obj4.userData.points.push(new PMPoint(1, 0, 0.5)); | ||
+ | obj4.userData.points.push(new PMPoint(0.8, | ||
+ | |||
+ | obj4.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj4.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj4.userData.pointlabels = [" | ||
+ | obj4.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj4.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj4.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj4.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj4); | ||
+ | scene.add(obj4); | ||
+ | |||
+ | var obj5 = new THREE.Object3D(); | ||
+ | obj5.name = " | ||
+ | obj5.userData.explodable = 1; | ||
+ | obj5.userData.points = []; | ||
+ | obj5.userData.points.push(new PMPoint(0, 1, 0.125)); | ||
+ | obj5.userData.points.push(new PMPoint(1, 0, 0.5)); | ||
+ | obj5.userData.points.push(new PMPoint(0.8, | ||
+ | |||
+ | obj5.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj5.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj5.userData.pointlabels = [" | ||
+ | obj5.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj5.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj5.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj5.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj5); | ||
+ | scene.add(obj5); | ||
+ | |||
+ | var obj6 = new THREE.Object3D(); | ||
+ | obj6.name = " | ||
+ | obj6.userData.explodable = 1; | ||
+ | obj6.userData.points = []; | ||
+ | obj6.userData.points.push(new PMPoint(0, 1, 0.125)); | ||
+ | obj6.userData.points.push(new PMPoint(-0.8, | ||
+ | obj6.userData.points.push(new PMPoint(-0.6, | ||
+ | |||
+ | obj6.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj6.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj6.userData.pointlabels = [" | ||
+ | obj6.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj6.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj6.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj6.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj6); | ||
+ | scene.add(obj6); | ||
+ | |||
+ | var obj7 = new THREE.Object3D(); | ||
+ | obj7.name = " | ||
+ | obj7.userData.explodable = 1; | ||
+ | obj7.userData.points = []; | ||
+ | obj7.userData.points.push(new PMPoint(-1, 0, 0.5)); | ||
+ | obj7.userData.points.push(new PMPoint(-0.8, | ||
+ | obj7.userData.points.push(new PMPoint(-0.923077, | ||
+ | |||
+ | obj7.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj7.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj7.userData.pointlabels = [" | ||
+ | obj7.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj7.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj7.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj7.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj7); | ||
+ | scene.add(obj7); | ||
+ | |||
+ | var obj8 = new THREE.Object3D(); | ||
+ | obj8.name = " | ||
+ | obj8.userData.explodable = 1; | ||
+ | obj8.userData.points = []; | ||
+ | obj8.userData.points.push(new PMPoint(-1, 0, 0.5)); | ||
+ | obj8.userData.points.push(new PMPoint(-0.8, | ||
+ | obj8.userData.points.push(new PMPoint(-0.923077, | ||
+ | |||
+ | obj8.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj8.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj8.userData.pointlabels = [" | ||
+ | obj8.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj8.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj8.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj8.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj8); | ||
+ | scene.add(obj8); | ||
+ | |||
+ | var obj9 = new THREE.Object3D(); | ||
+ | obj9.name = " | ||
+ | obj9.userData.explodable = 1; | ||
+ | obj9.userData.points = []; | ||
+ | obj9.userData.points.push(new PMPoint(0, -1, 0.125)); | ||
+ | obj9.userData.points.push(new PMPoint(-0.8, | ||
+ | obj9.userData.points.push(new PMPoint(-0.6, | ||
+ | |||
+ | obj9.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj9.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj9.userData.pointlabels = [" | ||
+ | obj9.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj9.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj9.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj9.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj9); | ||
+ | scene.add(obj9); | ||
+ | |||
+ | var obj10 = new THREE.Object3D(); | ||
+ | obj10.name = " | ||
+ | obj10.userData.explodable = 1; | ||
+ | obj10.userData.points = []; | ||
+ | obj10.userData.points.push(new PMPoint(0, -1, 0.125)); | ||
+ | obj10.userData.points.push(new PMPoint(0.8, | ||
+ | obj10.userData.points.push(new PMPoint(0.6, | ||
+ | |||
+ | obj10.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj10.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj10.userData.pointlabels = [" | ||
+ | obj10.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj10.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj10.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj10.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj10); | ||
+ | scene.add(obj10); | ||
+ | |||
+ | var obj11 = new THREE.Object3D(); | ||
+ | obj11.name = " | ||
+ | obj11.userData.explodable = 1; | ||
+ | obj11.userData.points = []; | ||
+ | obj11.userData.points.push(new PMPoint(1, 0, 0.5)); | ||
+ | obj11.userData.points.push(new PMPoint(0.8, | ||
+ | obj11.userData.points.push(new PMPoint(0.923077, | ||
+ | |||
+ | obj11.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj11.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj11.userData.pointlabels = [" | ||
+ | obj11.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj11.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj11.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj11.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj11); | ||
+ | scene.add(obj11); | ||
+ | |||
+ | var obj12 = new THREE.Object3D(); | ||
+ | obj12.name = " | ||
+ | obj12.userData.explodable = 1; | ||
+ | obj12.userData.points = []; | ||
+ | obj12.userData.points.push(new PMPoint(1, 0, 0.5)); | ||
+ | obj12.userData.points.push(new PMPoint(0.8, | ||
+ | obj12.userData.points.push(new PMPoint(0.923077, | ||
+ | |||
+ | obj12.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj12.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj12.userData.pointlabels = [" | ||
+ | obj12.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj12.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj12.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj12.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj12); | ||
+ | scene.add(obj12); | ||
+ | |||
+ | var obj13 = new THREE.Object3D(); | ||
+ | obj13.name = " | ||
+ | obj13.userData.explodable = 1; | ||
+ | obj13.userData.points = []; | ||
+ | obj13.userData.points.push(new PMPoint(0, 1, 0.125)); | ||
+ | obj13.userData.points.push(new PMPoint(0.8, | ||
+ | obj13.userData.points.push(new PMPoint(0.6, | ||
+ | |||
+ | obj13.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj13.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj13.userData.pointlabels = [" | ||
+ | obj13.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj13.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj13.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj13.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj13); | ||
+ | scene.add(obj13); | ||
+ | |||
+ | var obj14 = new THREE.Object3D(); | ||
+ | obj14.name = " | ||
+ | obj14.userData.explodable = 1; | ||
+ | obj14.userData.points = []; | ||
+ | obj14.userData.points.push(new PMPoint(0, 1, 0.125)); | ||
+ | obj14.userData.points.push(new PMPoint(-0.6, | ||
+ | obj14.userData.points.push(new PMPoint(-0.470588, | ||
+ | |||
+ | obj14.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj14.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj14.userData.pointlabels = [" | ||
+ | obj14.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj14.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj14.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj14.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj14); | ||
+ | scene.add(obj14); | ||
+ | |||
+ | var obj15 = new THREE.Object3D(); | ||
+ | obj15.name = " | ||
+ | obj15.userData.explodable = 1; | ||
+ | obj15.userData.points = []; | ||
+ | obj15.userData.points.push(new PMPoint(-0.8, | ||
+ | obj15.userData.points.push(new PMPoint(-0.6, | ||
+ | obj15.userData.points.push(new PMPoint(-0.689655, | ||
+ | |||
+ | obj15.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj15.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj15.userData.pointlabels = [" | ||
+ | obj15.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj15.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj15.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj15.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj15); | ||
+ | scene.add(obj15); | ||
+ | |||
+ | var obj16 = new THREE.Object3D(); | ||
+ | obj16.name = " | ||
+ | obj16.userData.explodable = 1; | ||
+ | obj16.userData.points = []; | ||
+ | obj16.userData.points.push(new PMPoint(-0.8, | ||
+ | obj16.userData.points.push(new PMPoint(-0.923077, | ||
+ | obj16.userData.points.push(new PMPoint(-0.882353, | ||
+ | |||
+ | obj16.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj16.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj16.userData.pointlabels = [" | ||
+ | obj16.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj16.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj16.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj16.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj16); | ||
+ | scene.add(obj16); | ||
+ | |||
+ | var obj17 = new THREE.Object3D(); | ||
+ | obj17.name = " | ||
+ | obj17.userData.explodable = 1; | ||
+ | obj17.userData.points = []; | ||
+ | obj17.userData.points.push(new PMPoint(-1, 0, 0.5)); | ||
+ | obj17.userData.points.push(new PMPoint(-0.923077, | ||
+ | obj17.userData.points.push(new PMPoint(-0.96, | ||
+ | |||
+ | obj17.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj17.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj17.userData.pointlabels = [" | ||
+ | obj17.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj17.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj17.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj17.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj17); | ||
+ | scene.add(obj17); | ||
+ | |||
+ | var obj18 = new THREE.Object3D(); | ||
+ | obj18.name = " | ||
+ | obj18.userData.explodable = 1; | ||
+ | obj18.userData.points = []; | ||
+ | obj18.userData.points.push(new PMPoint(-1, 0, 0.5)); | ||
+ | obj18.userData.points.push(new PMPoint(-0.923077, | ||
+ | obj18.userData.points.push(new PMPoint(-0.96, | ||
+ | |||
+ | obj18.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj18.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj18.userData.pointlabels = [" | ||
+ | obj18.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj18.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj18.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj18.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj18); | ||
+ | scene.add(obj18); | ||
+ | |||
+ | var obj19 = new THREE.Object3D(); | ||
+ | obj19.name = " | ||
+ | obj19.userData.explodable = 1; | ||
+ | obj19.userData.points = []; | ||
+ | obj19.userData.points.push(new PMPoint(-0.8, | ||
+ | obj19.userData.points.push(new PMPoint(-0.923077, | ||
+ | obj19.userData.points.push(new PMPoint(-0.882353, | ||
+ | |||
+ | obj19.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj19.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj19.userData.pointlabels = [" | ||
+ | obj19.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj19.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj19.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj19.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj19); | ||
+ | scene.add(obj19); | ||
+ | |||
+ | var obj20 = new THREE.Object3D(); | ||
+ | obj20.name = " | ||
+ | obj20.userData.explodable = 1; | ||
+ | obj20.userData.points = []; | ||
+ | obj20.userData.points.push(new PMPoint(-0.8, | ||
+ | obj20.userData.points.push(new PMPoint(-0.6, | ||
+ | obj20.userData.points.push(new PMPoint(-0.689655, | ||
+ | |||
+ | obj20.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj20.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj20.userData.pointlabels = [" | ||
+ | obj20.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj20.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj20.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj20.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj20); | ||
+ | scene.add(obj20); | ||
+ | |||
+ | var obj21 = new THREE.Object3D(); | ||
+ | obj21.name = " | ||
+ | obj21.userData.explodable = 1; | ||
+ | obj21.userData.points = []; | ||
+ | obj21.userData.points.push(new PMPoint(0, -1, 0.125)); | ||
+ | obj21.userData.points.push(new PMPoint(-0.6, | ||
+ | obj21.userData.points.push(new PMPoint(-0.470588, | ||
+ | |||
+ | obj21.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj21.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj21.userData.pointlabels = [" | ||
+ | obj21.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj21.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj21.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj21.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj21); | ||
+ | scene.add(obj21); | ||
+ | |||
+ | var obj22 = new THREE.Object3D(); | ||
+ | obj22.name = " | ||
+ | obj22.userData.explodable = 1; | ||
+ | obj22.userData.points = []; | ||
+ | obj22.userData.points.push(new PMPoint(0, -1, 0.125)); | ||
+ | obj22.userData.points.push(new PMPoint(0.6, | ||
+ | obj22.userData.points.push(new PMPoint(0.470588, | ||
+ | |||
+ | obj22.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj22.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj22.userData.pointlabels = [" | ||
+ | obj22.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj22.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj22.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj22.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj22); | ||
+ | scene.add(obj22); | ||
+ | |||
+ | var obj23 = new THREE.Object3D(); | ||
+ | obj23.name = " | ||
+ | obj23.userData.explodable = 1; | ||
+ | obj23.userData.points = []; | ||
+ | obj23.userData.points.push(new PMPoint(0.8, | ||
+ | obj23.userData.points.push(new PMPoint(0.6, | ||
+ | obj23.userData.points.push(new PMPoint(0.689655, | ||
+ | |||
+ | obj23.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj23.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj23.userData.pointlabels = [" | ||
+ | obj23.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj23.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj23.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj23.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj23); | ||
+ | scene.add(obj23); | ||
+ | |||
+ | var obj24 = new THREE.Object3D(); | ||
+ | obj24.name = " | ||
+ | obj24.userData.explodable = 1; | ||
+ | obj24.userData.points = []; | ||
+ | obj24.userData.points.push(new PMPoint(0.8, | ||
+ | obj24.userData.points.push(new PMPoint(0.923077, | ||
+ | obj24.userData.points.push(new PMPoint(0.882353, | ||
+ | |||
+ | obj24.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj24.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj24.userData.pointlabels = [" | ||
+ | obj24.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj24.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj24.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj24.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj24); | ||
+ | scene.add(obj24); | ||
+ | |||
+ | var obj25 = new THREE.Object3D(); | ||
+ | obj25.name = " | ||
+ | obj25.userData.explodable = 1; | ||
+ | obj25.userData.points = []; | ||
+ | obj25.userData.points.push(new PMPoint(1, 0, 0.5)); | ||
+ | obj25.userData.points.push(new PMPoint(0.923077, | ||
+ | obj25.userData.points.push(new PMPoint(0.96, | ||
+ | |||
+ | obj25.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj25.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj25.userData.pointlabels = [" | ||
+ | obj25.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj25.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj25.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj25.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj25); | ||
+ | scene.add(obj25); | ||
+ | |||
+ | var obj26 = new THREE.Object3D(); | ||
+ | obj26.name = " | ||
+ | obj26.userData.explodable = 1; | ||
+ | obj26.userData.points = []; | ||
+ | obj26.userData.points.push(new PMPoint(1, 0, 0.5)); | ||
+ | obj26.userData.points.push(new PMPoint(0.923077, | ||
+ | obj26.userData.points.push(new PMPoint(0.96, | ||
+ | |||
+ | obj26.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj26.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj26.userData.pointlabels = [" | ||
+ | obj26.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj26.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj26.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj26.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj26); | ||
+ | scene.add(obj26); | ||
+ | |||
+ | var obj27 = new THREE.Object3D(); | ||
+ | obj27.name = " | ||
+ | obj27.userData.explodable = 1; | ||
+ | obj27.userData.points = []; | ||
+ | obj27.userData.points.push(new PMPoint(0.8, | ||
+ | obj27.userData.points.push(new PMPoint(0.923077, | ||
+ | obj27.userData.points.push(new PMPoint(0.882353, | ||
+ | |||
+ | obj27.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj27.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj27.userData.pointlabels = [" | ||
+ | obj27.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj27.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj27.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj27.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj27); | ||
+ | scene.add(obj27); | ||
+ | |||
+ | var obj28 = new THREE.Object3D(); | ||
+ | obj28.name = " | ||
+ | obj28.userData.explodable = 1; | ||
+ | obj28.userData.points = []; | ||
+ | obj28.userData.points.push(new PMPoint(0.8, | ||
+ | obj28.userData.points.push(new PMPoint(0.6, | ||
+ | obj28.userData.points.push(new PMPoint(0.689655, | ||
+ | |||
+ | obj28.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj28.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj28.userData.pointlabels = [" | ||
+ | obj28.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj28.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj28.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj28.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj28); | ||
+ | scene.add(obj28); | ||
+ | |||
+ | var obj29 = new THREE.Object3D(); | ||
+ | obj29.name = " | ||
+ | obj29.userData.explodable = 1; | ||
+ | obj29.userData.points = []; | ||
+ | obj29.userData.points.push(new PMPoint(0, 1, 0.125)); | ||
+ | obj29.userData.points.push(new PMPoint(0.6, | ||
+ | obj29.userData.points.push(new PMPoint(0.470588, | ||
+ | |||
+ | obj29.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj29.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj29.userData.pointlabels = [" | ||
+ | obj29.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj29.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj29.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj29.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj29); | ||
+ | scene.add(obj29); | ||
+ | |||
+ | var obj30 = new THREE.Object3D(); | ||
+ | obj30.name = " | ||
+ | obj30.userData.explodable = 1; | ||
+ | obj30.userData.points = []; | ||
+ | obj30.userData.points.push(new PMPoint(0, 1, 0.125)); | ||
+ | obj30.userData.points.push(new PMPoint(-0.470588, | ||
+ | obj30.userData.points.push(new PMPoint(-0.384615, | ||
+ | |||
+ | obj30.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj30.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj30.userData.pointlabels = [" | ||
+ | obj30.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj30.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj30.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj30.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj30); | ||
+ | scene.add(obj30); | ||
+ | |||
+ | var obj31 = new THREE.Object3D(); | ||
+ | obj31.name = " | ||
+ | obj31.userData.explodable = 1; | ||
+ | obj31.userData.points = []; | ||
+ | obj31.userData.points.push(new PMPoint(-0.6, | ||
+ | obj31.userData.points.push(new PMPoint(-0.470588, | ||
+ | obj31.userData.points.push(new PMPoint(-0.528302, | ||
+ | |||
+ | obj31.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj31.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj31.userData.pointlabels = [" | ||
+ | obj31.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj31.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj31.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj31.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj31); | ||
+ | scene.add(obj31); | ||
+ | |||
+ | var obj32 = new THREE.Object3D(); | ||
+ | obj32.name = " | ||
+ | obj32.userData.explodable = 1; | ||
+ | obj32.userData.points = []; | ||
+ | obj32.userData.points.push(new PMPoint(-0.6, | ||
+ | obj32.userData.points.push(new PMPoint(-0.689655, | ||
+ | obj32.userData.points.push(new PMPoint(-0.657534, | ||
+ | |||
+ | obj32.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj32.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj32.userData.pointlabels = [" | ||
+ | obj32.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj32.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj32.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj32.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj32); | ||
+ | scene.add(obj32); | ||
+ | |||
+ | var obj33 = new THREE.Object3D(); | ||
+ | obj33.name = " | ||
+ | obj33.userData.explodable = 1; | ||
+ | obj33.userData.points = []; | ||
+ | obj33.userData.points.push(new PMPoint(-0.8, | ||
+ | obj33.userData.points.push(new PMPoint(-0.689655, | ||
+ | obj33.userData.points.push(new PMPoint(-0.724138, | ||
+ | |||
+ | obj33.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj33.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj33.userData.pointlabels = [" | ||
+ | obj33.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj33.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj33.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj33.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj33); | ||
+ | scene.add(obj33); | ||
+ | |||
+ | var obj34 = new THREE.Object3D(); | ||
+ | obj34.name = " | ||
+ | obj34.userData.explodable = 1; | ||
+ | obj34.userData.points = []; | ||
+ | obj34.userData.points.push(new PMPoint(-0.8, | ||
+ | obj34.userData.points.push(new PMPoint(-0.882353, | ||
+ | obj34.userData.points.push(new PMPoint(-0.861538, | ||
+ | |||
+ | obj34.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj34.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj34.userData.pointlabels = [" | ||
+ | obj34.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj34.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj34.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj34.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj34); | ||
+ | scene.add(obj34); | ||
+ | |||
+ | var obj35 = new THREE.Object3D(); | ||
+ | obj35.name = " | ||
+ | obj35.userData.explodable = 1; | ||
+ | obj35.userData.points = []; | ||
+ | obj35.userData.points.push(new PMPoint(-0.923077, | ||
+ | obj35.userData.points.push(new PMPoint(-0.882353, | ||
+ | obj35.userData.points.push(new PMPoint(-0.898876, | ||
+ | |||
+ | obj35.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj35.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj35.userData.pointlabels = [" | ||
+ | obj35.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj35.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj35.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj35.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj35); | ||
+ | scene.add(obj35); | ||
+ | |||
+ | var obj36 = new THREE.Object3D(); | ||
+ | obj36.name = " | ||
+ | obj36.userData.explodable = 1; | ||
+ | obj36.userData.points = []; | ||
+ | obj36.userData.points.push(new PMPoint(-0.923077, | ||
+ | obj36.userData.points.push(new PMPoint(-0.96, | ||
+ | obj36.userData.points.push(new PMPoint(-0.945946, | ||
+ | |||
+ | obj36.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj36.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj36.userData.pointlabels = [" | ||
+ | obj36.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj36.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj36.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj36.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj36); | ||
+ | scene.add(obj36); | ||
+ | |||
+ | var obj37 = new THREE.Object3D(); | ||
+ | obj37.name = " | ||
+ | obj37.userData.explodable = 1; | ||
+ | obj37.userData.points = []; | ||
+ | obj37.userData.points.push(new PMPoint(-1, 0, 0.5)); | ||
+ | obj37.userData.points.push(new PMPoint(-0.96, | ||
+ | obj37.userData.points.push(new PMPoint(-0.97561, | ||
+ | |||
+ | obj37.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj37.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj37.userData.pointlabels = [" | ||
+ | obj37.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj37.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj37.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj37.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj37); | ||
+ | scene.add(obj37); | ||
+ | |||
+ | var obj38 = new THREE.Object3D(); | ||
+ | obj38.name = " | ||
+ | obj38.userData.explodable = 1; | ||
+ | obj38.userData.points = []; | ||
+ | obj38.userData.points.push(new PMPoint(-1, 0, 0.5)); | ||
+ | obj38.userData.points.push(new PMPoint(-0.96, | ||
+ | obj38.userData.points.push(new PMPoint(-0.97561, | ||
+ | |||
+ | obj38.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj38.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj38.userData.pointlabels = [" | ||
+ | obj38.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj38.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj38.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj38.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj38); | ||
+ | scene.add(obj38); | ||
+ | |||
+ | var obj39 = new THREE.Object3D(); | ||
+ | obj39.name = " | ||
+ | obj39.userData.explodable = 1; | ||
+ | obj39.userData.points = []; | ||
+ | obj39.userData.points.push(new PMPoint(-0.923077, | ||
+ | obj39.userData.points.push(new PMPoint(-0.96, | ||
+ | obj39.userData.points.push(new PMPoint(-0.945946, | ||
+ | |||
+ | obj39.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj39.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj39.userData.pointlabels = [" | ||
+ | obj39.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj39.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj39.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj39.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj39); | ||
+ | scene.add(obj39); | ||
+ | |||
+ | var obj40 = new THREE.Object3D(); | ||
+ | obj40.name = " | ||
+ | obj40.userData.explodable = 1; | ||
+ | obj40.userData.points = []; | ||
+ | obj40.userData.points.push(new PMPoint(-0.923077, | ||
+ | obj40.userData.points.push(new PMPoint(-0.882353, | ||
+ | obj40.userData.points.push(new PMPoint(-0.898876, | ||
+ | |||
+ | obj40.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj40.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj40.userData.pointlabels = [" | ||
+ | obj40.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj40.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj40.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj40.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj40); | ||
+ | scene.add(obj40); | ||
+ | |||
+ | var obj41 = new THREE.Object3D(); | ||
+ | obj41.name = " | ||
+ | obj41.userData.explodable = 1; | ||
+ | obj41.userData.points = []; | ||
+ | obj41.userData.points.push(new PMPoint(-0.8, | ||
+ | obj41.userData.points.push(new PMPoint(-0.882353, | ||
+ | obj41.userData.points.push(new PMPoint(-0.861538, | ||
+ | |||
+ | obj41.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj41.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj41.userData.pointlabels = [" | ||
+ | obj41.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj41.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj41.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj41.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj41); | ||
+ | scene.add(obj41); | ||
+ | |||
+ | var obj42 = new THREE.Object3D(); | ||
+ | obj42.name = " | ||
+ | obj42.userData.explodable = 1; | ||
+ | obj42.userData.points = []; | ||
+ | obj42.userData.points.push(new PMPoint(-0.8, | ||
+ | obj42.userData.points.push(new PMPoint(-0.689655, | ||
+ | obj42.userData.points.push(new PMPoint(-0.724138, | ||
+ | |||
+ | obj42.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj42.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj42.userData.pointlabels = [" | ||
+ | obj42.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj42.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj42.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj42.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj42); | ||
+ | scene.add(obj42); | ||
+ | |||
+ | var obj43 = new THREE.Object3D(); | ||
+ | obj43.name = " | ||
+ | obj43.userData.explodable = 1; | ||
+ | obj43.userData.points = []; | ||
+ | obj43.userData.points.push(new PMPoint(-0.6, | ||
+ | obj43.userData.points.push(new PMPoint(-0.689655, | ||
+ | obj43.userData.points.push(new PMPoint(-0.657534, | ||
+ | |||
+ | obj43.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj43.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj43.userData.pointlabels = [" | ||
+ | obj43.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj43.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj43.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj43.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj43); | ||
+ | scene.add(obj43); | ||
+ | |||
+ | var obj44 = new THREE.Object3D(); | ||
+ | obj44.name = " | ||
+ | obj44.userData.explodable = 1; | ||
+ | obj44.userData.points = []; | ||
+ | obj44.userData.points.push(new PMPoint(-0.6, | ||
+ | obj44.userData.points.push(new PMPoint(-0.470588, | ||
+ | obj44.userData.points.push(new PMPoint(-0.528302, | ||
+ | |||
+ | obj44.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj44.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj44.userData.pointlabels = [" | ||
+ | obj44.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj44.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj44.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj44.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj44); | ||
+ | scene.add(obj44); | ||
+ | |||
+ | var obj45 = new THREE.Object3D(); | ||
+ | obj45.name = " | ||
+ | obj45.userData.explodable = 1; | ||
+ | obj45.userData.points = []; | ||
+ | obj45.userData.points.push(new PMPoint(0, -1, 0.125)); | ||
+ | obj45.userData.points.push(new PMPoint(-0.470588, | ||
+ | obj45.userData.points.push(new PMPoint(-0.384615, | ||
+ | |||
+ | obj45.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj45.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj45.userData.pointlabels = [" | ||
+ | obj45.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj45.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj45.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj45.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj45); | ||
+ | scene.add(obj45); | ||
+ | |||
+ | var obj46 = new THREE.Object3D(); | ||
+ | obj46.name = " | ||
+ | obj46.userData.explodable = 1; | ||
+ | obj46.userData.points = []; | ||
+ | obj46.userData.points.push(new PMPoint(0, -1, 0.125)); | ||
+ | obj46.userData.points.push(new PMPoint(0.470588, | ||
+ | obj46.userData.points.push(new PMPoint(0.384615, | ||
+ | |||
+ | obj46.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj46.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj46.userData.pointlabels = [" | ||
+ | obj46.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj46.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj46.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj46.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj46); | ||
+ | scene.add(obj46); | ||
+ | |||
+ | var obj47 = new THREE.Object3D(); | ||
+ | obj47.name = " | ||
+ | obj47.userData.explodable = 1; | ||
+ | obj47.userData.points = []; | ||
+ | obj47.userData.points.push(new PMPoint(0.6, | ||
+ | obj47.userData.points.push(new PMPoint(0.470588, | ||
+ | obj47.userData.points.push(new PMPoint(0.528302, | ||
+ | |||
+ | obj47.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj47.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj47.userData.pointlabels = [" | ||
+ | obj47.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj47.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj47.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj47.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj47); | ||
+ | scene.add(obj47); | ||
+ | |||
+ | var obj48 = new THREE.Object3D(); | ||
+ | obj48.name = " | ||
+ | obj48.userData.explodable = 1; | ||
+ | obj48.userData.points = []; | ||
+ | obj48.userData.points.push(new PMPoint(0.6, | ||
+ | obj48.userData.points.push(new PMPoint(0.689655, | ||
+ | obj48.userData.points.push(new PMPoint(0.657534, | ||
+ | |||
+ | obj48.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj48.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj48.userData.pointlabels = [" | ||
+ | obj48.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj48.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj48.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj48.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj48); | ||
+ | scene.add(obj48); | ||
+ | |||
+ | var obj49 = new THREE.Object3D(); | ||
+ | obj49.name = " | ||
+ | obj49.userData.explodable = 1; | ||
+ | obj49.userData.points = []; | ||
+ | obj49.userData.points.push(new PMPoint(0.8, | ||
+ | obj49.userData.points.push(new PMPoint(0.689655, | ||
+ | obj49.userData.points.push(new PMPoint(0.724138, | ||
+ | |||
+ | obj49.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj49.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj49.userData.pointlabels = [" | ||
+ | obj49.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj49.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj49.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj49.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj49); | ||
+ | scene.add(obj49); | ||
+ | |||
+ | var obj50 = new THREE.Object3D(); | ||
+ | obj50.name = " | ||
+ | obj50.userData.explodable = 1; | ||
+ | obj50.userData.points = []; | ||
+ | obj50.userData.points.push(new PMPoint(0.8, | ||
+ | obj50.userData.points.push(new PMPoint(0.882353, | ||
+ | obj50.userData.points.push(new PMPoint(0.861538, | ||
+ | |||
+ | obj50.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj50.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj50.userData.pointlabels = [" | ||
+ | obj50.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj50.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj50.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj50.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj50); | ||
+ | scene.add(obj50); | ||
+ | |||
+ | var obj51 = new THREE.Object3D(); | ||
+ | obj51.name = " | ||
+ | obj51.userData.explodable = 1; | ||
+ | obj51.userData.points = []; | ||
+ | obj51.userData.points.push(new PMPoint(0.923077, | ||
+ | obj51.userData.points.push(new PMPoint(0.882353, | ||
+ | obj51.userData.points.push(new PMPoint(0.898876, | ||
+ | |||
+ | obj51.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj51.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj51.userData.pointlabels = [" | ||
+ | obj51.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj51.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj51.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj51.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj51); | ||
+ | scene.add(obj51); | ||
+ | |||
+ | var obj52 = new THREE.Object3D(); | ||
+ | obj52.name = " | ||
+ | obj52.userData.explodable = 1; | ||
+ | obj52.userData.points = []; | ||
+ | obj52.userData.points.push(new PMPoint(0.923077, | ||
+ | obj52.userData.points.push(new PMPoint(0.96, | ||
+ | obj52.userData.points.push(new PMPoint(0.945946, | ||
+ | |||
+ | obj52.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj52.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj52.userData.pointlabels = [" | ||
+ | obj52.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj52.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj52.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj52.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj52); | ||
+ | scene.add(obj52); | ||
+ | |||
+ | var obj53 = new THREE.Object3D(); | ||
+ | obj53.name = " | ||
+ | obj53.userData.explodable = 1; | ||
+ | obj53.userData.points = []; | ||
+ | obj53.userData.points.push(new PMPoint(1, 0, 0.5)); | ||
+ | obj53.userData.points.push(new PMPoint(0.96, | ||
+ | obj53.userData.points.push(new PMPoint(0.97561, | ||
+ | |||
+ | obj53.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj53.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj53.userData.pointlabels = [" | ||
+ | obj53.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj53.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj53.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj53.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj53); | ||
+ | scene.add(obj53); | ||
+ | |||
+ | var obj54 = new THREE.Object3D(); | ||
+ | obj54.name = " | ||
+ | obj54.userData.explodable = 1; | ||
+ | obj54.userData.points = []; | ||
+ | obj54.userData.points.push(new PMPoint(1, 0, 0.5)); | ||
+ | obj54.userData.points.push(new PMPoint(0.96, | ||
+ | obj54.userData.points.push(new PMPoint(0.97561, | ||
+ | |||
+ | obj54.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj54.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj54.userData.pointlabels = [" | ||
+ | obj54.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj54.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj54.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj54.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj54); | ||
+ | scene.add(obj54); | ||
+ | |||
+ | var obj55 = new THREE.Object3D(); | ||
+ | obj55.name = " | ||
+ | obj55.userData.explodable = 1; | ||
+ | obj55.userData.points = []; | ||
+ | obj55.userData.points.push(new PMPoint(0.923077, | ||
+ | obj55.userData.points.push(new PMPoint(0.96, | ||
+ | obj55.userData.points.push(new PMPoint(0.945946, | ||
+ | |||
+ | obj55.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj55.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj55.userData.pointlabels = [" | ||
+ | obj55.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj55.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj55.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj55.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj55); | ||
+ | scene.add(obj55); | ||
+ | |||
+ | var obj56 = new THREE.Object3D(); | ||
+ | obj56.name = " | ||
+ | obj56.userData.explodable = 1; | ||
+ | obj56.userData.points = []; | ||
+ | obj56.userData.points.push(new PMPoint(0.923077, | ||
+ | obj56.userData.points.push(new PMPoint(0.882353, | ||
+ | obj56.userData.points.push(new PMPoint(0.898876, | ||
+ | |||
+ | obj56.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj56.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj56.userData.pointlabels = [" | ||
+ | obj56.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj56.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj56.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj56.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj56); | ||
+ | scene.add(obj56); | ||
+ | |||
+ | var obj57 = new THREE.Object3D(); | ||
+ | obj57.name = " | ||
+ | obj57.userData.explodable = 1; | ||
+ | obj57.userData.points = []; | ||
+ | obj57.userData.points.push(new PMPoint(0.8, | ||
+ | obj57.userData.points.push(new PMPoint(0.882353, | ||
+ | obj57.userData.points.push(new PMPoint(0.861538, | ||
+ | |||
+ | obj57.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj57.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj57.userData.pointlabels = [" | ||
+ | obj57.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj57.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj57.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj57.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj57); | ||
+ | scene.add(obj57); | ||
+ | |||
+ | var obj58 = new THREE.Object3D(); | ||
+ | obj58.name = " | ||
+ | obj58.userData.explodable = 1; | ||
+ | obj58.userData.points = []; | ||
+ | obj58.userData.points.push(new PMPoint(0.8, | ||
+ | obj58.userData.points.push(new PMPoint(0.689655, | ||
+ | obj58.userData.points.push(new PMPoint(0.724138, | ||
+ | |||
+ | obj58.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj58.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj58.userData.pointlabels = [" | ||
+ | obj58.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj58.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj58.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj58.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj58); | ||
+ | scene.add(obj58); | ||
+ | |||
+ | var obj59 = new THREE.Object3D(); | ||
+ | obj59.name = " | ||
+ | obj59.userData.explodable = 1; | ||
+ | obj59.userData.points = []; | ||
+ | obj59.userData.points.push(new PMPoint(0.6, | ||
+ | obj59.userData.points.push(new PMPoint(0.689655, | ||
+ | obj59.userData.points.push(new PMPoint(0.657534, | ||
+ | |||
+ | obj59.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj59.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj59.userData.pointlabels = [" | ||
+ | obj59.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj59.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj59.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj59.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj59); | ||
+ | scene.add(obj59); | ||
+ | |||
+ | var obj60 = new THREE.Object3D(); | ||
+ | obj60.name = " | ||
+ | obj60.userData.explodable = 1; | ||
+ | obj60.userData.points = []; | ||
+ | obj60.userData.points.push(new PMPoint(0.6, | ||
+ | obj60.userData.points.push(new PMPoint(0.470588, | ||
+ | obj60.userData.points.push(new PMPoint(0.528302, | ||
+ | |||
+ | obj60.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj60.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj60.userData.pointlabels = [" | ||
+ | obj60.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj60.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj60.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj60.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj60); | ||
+ | scene.add(obj60); | ||
+ | |||
+ | var obj61 = new THREE.Object3D(); | ||
+ | obj61.name = " | ||
+ | obj61.userData.explodable = 1; | ||
+ | obj61.userData.points = []; | ||
+ | obj61.userData.points.push(new PMPoint(0, 1, 0.125)); | ||
+ | obj61.userData.points.push(new PMPoint(0.470588, | ||
+ | obj61.userData.points.push(new PMPoint(0.384615, | ||
+ | |||
+ | obj61.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj61.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj61.userData.pointlabels = [" | ||
+ | obj61.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj61.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj61.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj61.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj61); | ||
+ | scene.add(obj61); | ||
+ | |||
+ | var obj62 = new THREE.Object3D(); | ||
+ | obj62.name = " | ||
+ | obj62.userData.explodable = 1; | ||
+ | obj62.userData.points = []; | ||
+ | obj62.userData.points.push(new PMPoint(0, 1, 0.125)); | ||
+ | obj62.userData.points.push(new PMPoint(-0.384615, | ||
+ | obj62.userData.points.push(new PMPoint(-0.324324, | ||
+ | |||
+ | obj62.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj62.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj62.userData.pointlabels = [" | ||
+ | obj62.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj62.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj62.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj62.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj62); | ||
+ | scene.add(obj62); | ||
+ | |||
+ | var obj63 = new THREE.Object3D(); | ||
+ | obj63.name = " | ||
+ | obj63.userData.explodable = 1; | ||
+ | obj63.userData.points = []; | ||
+ | obj63.userData.points.push(new PMPoint(-0.470588, | ||
+ | obj63.userData.points.push(new PMPoint(-0.384615, | ||
+ | obj63.userData.points.push(new PMPoint(-0.423529, | ||
+ | |||
+ | obj63.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj63.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj63.userData.pointlabels = [" | ||
+ | obj63.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj63.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj63.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj63.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj63); | ||
+ | scene.add(obj63); | ||
+ | |||
+ | var obj64 = new THREE.Object3D(); | ||
+ | obj64.name = " | ||
+ | obj64.userData.explodable = 1; | ||
+ | obj64.userData.points = []; | ||
+ | obj64.userData.points.push(new PMPoint(-0.470588, | ||
+ | obj64.userData.points.push(new PMPoint(-0.528302, | ||
+ | obj64.userData.points.push(new PMPoint(-0.507692, | ||
+ | |||
+ | obj64.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj64.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj64.userData.pointlabels = [" | ||
+ | obj64.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj64.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj64.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj64.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj64); | ||
+ | scene.add(obj64); | ||
+ | |||
+ | var obj65 = new THREE.Object3D(); | ||
+ | obj65.name = " | ||
+ | obj65.userData.explodable = 1; | ||
+ | obj65.userData.points = []; | ||
+ | obj65.userData.points.push(new PMPoint(-0.6, | ||
+ | obj65.userData.points.push(new PMPoint(-0.528302, | ||
+ | obj65.userData.points.push(new PMPoint(-0.550459, | ||
+ | |||
+ | obj65.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj65.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj65.userData.pointlabels = [" | ||
+ | obj65.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj65.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj65.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj65.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj65); | ||
+ | scene.add(obj65); | ||
+ | |||
+ | var obj66 = new THREE.Object3D(); | ||
+ | obj66.name = " | ||
+ | obj66.userData.explodable = 1; | ||
+ | obj66.userData.points = []; | ||
+ | obj66.userData.points.push(new PMPoint(-0.6, | ||
+ | obj66.userData.points.push(new PMPoint(-0.657534, | ||
+ | obj66.userData.points.push(new PMPoint(-0.642336, | ||
+ | |||
+ | obj66.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj66.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj66.userData.pointlabels = [" | ||
+ | obj66.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj66.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj66.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj66.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj66); | ||
+ | scene.add(obj66); | ||
+ | |||
+ | var obj67 = new THREE.Object3D(); | ||
+ | obj67.name = " | ||
+ | obj67.userData.explodable = 1; | ||
+ | obj67.userData.points = []; | ||
+ | obj67.userData.points.push(new PMPoint(-0.689655, | ||
+ | obj67.userData.points.push(new PMPoint(-0.657534, | ||
+ | obj67.userData.points.push(new PMPoint(-0.670103, | ||
+ | |||
+ | obj67.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj67.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj67.userData.pointlabels = [" | ||
+ | obj67.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj67.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj67.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj67.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj67); | ||
+ | scene.add(obj67); | ||
+ | |||
+ | var obj68 = new THREE.Object3D(); | ||
+ | obj68.name = " | ||
+ | obj68.userData.explodable = 1; | ||
+ | obj68.userData.points = []; | ||
+ | obj68.userData.points.push(new PMPoint(-0.689655, | ||
+ | obj68.userData.points.push(new PMPoint(-0.724138, | ||
+ | obj68.userData.points.push(new PMPoint(-0.710059, | ||
+ | |||
+ | obj68.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj68.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj68.userData.pointlabels = [" | ||
+ | obj68.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj68.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj68.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj68.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj68); | ||
+ | scene.add(obj68); | ||
+ | |||
+ | var obj69 = new THREE.Object3D(); | ||
+ | obj69.name = " | ||
+ | obj69.userData.explodable = 1; | ||
+ | obj69.userData.points = []; | ||
+ | obj69.userData.points.push(new PMPoint(-0.8, | ||
+ | obj69.userData.points.push(new PMPoint(-0.724138, | ||
+ | obj69.userData.points.push(new PMPoint(-0.742268, | ||
+ | |||
+ | obj69.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj69.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj69.userData.pointlabels = [" | ||
+ | obj69.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj69.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj69.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj69.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj69); | ||
+ | scene.add(obj69); | ||
+ | |||
+ | var obj70 = new THREE.Object3D(); | ||
+ | obj70.name = " | ||
+ | obj70.userData.explodable = 1; | ||
+ | obj70.userData.points = []; | ||
+ | obj70.userData.points.push(new PMPoint(-0.8, | ||
+ | obj70.userData.points.push(new PMPoint(-0.861538, | ||
+ | obj70.userData.points.push(new PMPoint(-0.849057, | ||
+ | |||
+ | obj70.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj70.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj70.userData.pointlabels = [" | ||
+ | obj70.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj70.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj70.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj70.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj70); | ||
+ | scene.add(obj70); | ||
+ | |||
+ | var obj71 = new THREE.Object3D(); | ||
+ | obj71.name = " | ||
+ | obj71.userData.explodable = 1; | ||
+ | obj71.userData.points = []; | ||
+ | obj71.userData.points.push(new PMPoint(-0.882353, | ||
+ | obj71.userData.points.push(new PMPoint(-0.861538, | ||
+ | obj71.userData.points.push(new PMPoint(-0.870466, | ||
+ | |||
+ | obj71.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj71.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj71.userData.pointlabels = [" | ||
+ | obj71.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj71.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj71.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj71.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj71); | ||
+ | scene.add(obj71); | ||
+ | |||
+ | var obj72 = new THREE.Object3D(); | ||
+ | obj72.name = " | ||
+ | obj72.userData.explodable = 1; | ||
+ | obj72.userData.points = []; | ||
+ | obj72.userData.points.push(new PMPoint(-0.882353, | ||
+ | obj72.userData.points.push(new PMPoint(-0.898876, | ||
+ | obj72.userData.points.push(new PMPoint(-0.892704, | ||
+ | |||
+ | obj72.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj72.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj72.userData.pointlabels = [" | ||
+ | obj72.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj72.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj72.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj72.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj72); | ||
+ | scene.add(obj72); | ||
+ | |||
+ | var obj73 = new THREE.Object3D(); | ||
+ | obj73.name = " | ||
+ | obj73.userData.explodable = 1; | ||
+ | obj73.userData.points = []; | ||
+ | obj73.userData.points.push(new PMPoint(-0.923077, | ||
+ | obj73.userData.points.push(new PMPoint(-0.898876, | ||
+ | obj73.userData.points.push(new PMPoint(-0.905882, | ||
+ | |||
+ | obj73.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj73.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj73.userData.pointlabels = [" | ||
+ | obj73.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj73.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj73.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj73.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj73); | ||
+ | scene.add(obj73); | ||
+ | |||
+ | var obj74 = new THREE.Object3D(); | ||
+ | obj74.name = " | ||
+ | obj74.userData.explodable = 1; | ||
+ | obj74.userData.points = []; | ||
+ | obj74.userData.points.push(new PMPoint(-0.923077, | ||
+ | obj74.userData.points.push(new PMPoint(-0.945946, | ||
+ | obj74.userData.points.push(new PMPoint(-0.939597, | ||
+ | |||
+ | obj74.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj74.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj74.userData.pointlabels = [" | ||
+ | obj74.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj74.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj74.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj74.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj74); | ||
+ | scene.add(obj74); | ||
+ | |||
+ | var obj75 = new THREE.Object3D(); | ||
+ | obj75.name = " | ||
+ | obj75.userData.explodable = 1; | ||
+ | obj75.userData.points = []; | ||
+ | obj75.userData.points.push(new PMPoint(-0.96, | ||
+ | obj75.userData.points.push(new PMPoint(-0.945946, | ||
+ | obj75.userData.points.push(new PMPoint(-0.951351, | ||
+ | |||
+ | obj75.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj75.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj75.userData.pointlabels = [" | ||
+ | obj75.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj75.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj75.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj75.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj75); | ||
+ | scene.add(obj75); | ||
+ | |||
+ | var obj76 = new THREE.Object3D(); | ||
+ | obj76.name = " | ||
+ | obj76.userData.explodable = 1; | ||
+ | obj76.userData.points = []; | ||
+ | obj76.userData.points.push(new PMPoint(-0.96, | ||
+ | obj76.userData.points.push(new PMPoint(-0.97561, | ||
+ | obj76.userData.points.push(new PMPoint(-0.969231, | ||
+ | |||
+ | obj76.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj76.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj76.userData.pointlabels = [" | ||
+ | obj76.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj76.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj76.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj76.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj76); | ||
+ | scene.add(obj76); | ||
+ | |||
+ | var obj77 = new THREE.Object3D(); | ||
+ | obj77.name = " | ||
+ | obj77.userData.explodable = 1; | ||
+ | obj77.userData.points = []; | ||
+ | obj77.userData.points.push(new PMPoint(-1, 0, 0.5)); | ||
+ | obj77.userData.points.push(new PMPoint(-0.97561, | ||
+ | obj77.userData.points.push(new PMPoint(-0.983607, | ||
+ | |||
+ | obj77.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj77.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj77.userData.pointlabels = [" | ||
+ | obj77.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj77.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj77.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj77.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj77); | ||
+ | scene.add(obj77); | ||
+ | |||
+ | var obj78 = new THREE.Object3D(); | ||
+ | obj78.name = " | ||
+ | obj78.userData.explodable = 1; | ||
+ | obj78.userData.points = []; | ||
+ | obj78.userData.points.push(new PMPoint(-1, 0, 0.5)); | ||
+ | obj78.userData.points.push(new PMPoint(-0.97561, | ||
+ | obj78.userData.points.push(new PMPoint(-0.983607, | ||
+ | |||
+ | obj78.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj78.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj78.userData.pointlabels = [" | ||
+ | obj78.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj78.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj78.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj78.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj78); | ||
+ | scene.add(obj78); | ||
+ | |||
+ | var obj79 = new THREE.Object3D(); | ||
+ | obj79.name = " | ||
+ | obj79.userData.explodable = 1; | ||
+ | obj79.userData.points = []; | ||
+ | obj79.userData.points.push(new PMPoint(-0.96, | ||
+ | obj79.userData.points.push(new PMPoint(-0.97561, | ||
+ | obj79.userData.points.push(new PMPoint(-0.969231, | ||
+ | |||
+ | obj79.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj79.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj79.userData.pointlabels = [" | ||
+ | obj79.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj79.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj79.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj79.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj79); | ||
+ | scene.add(obj79); | ||
+ | |||
+ | var obj80 = new THREE.Object3D(); | ||
+ | obj80.name = " | ||
+ | obj80.userData.explodable = 1; | ||
+ | obj80.userData.points = []; | ||
+ | obj80.userData.points.push(new PMPoint(-0.96, | ||
+ | obj80.userData.points.push(new PMPoint(-0.945946, | ||
+ | obj80.userData.points.push(new PMPoint(-0.951351, | ||
+ | |||
+ | obj80.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj80.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj80.userData.pointlabels = [" | ||
+ | obj80.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj80.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj80.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj80.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj80); | ||
+ | scene.add(obj80); | ||
+ | |||
+ | var obj81 = new THREE.Object3D(); | ||
+ | obj81.name = " | ||
+ | obj81.userData.explodable = 1; | ||
+ | obj81.userData.points = []; | ||
+ | obj81.userData.points.push(new PMPoint(-0.923077, | ||
+ | obj81.userData.points.push(new PMPoint(-0.945946, | ||
+ | obj81.userData.points.push(new PMPoint(-0.939597, | ||
+ | |||
+ | obj81.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj81.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj81.userData.pointlabels = [" | ||
+ | obj81.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj81.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj81.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj81.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj81); | ||
+ | scene.add(obj81); | ||
+ | |||
+ | var obj82 = new THREE.Object3D(); | ||
+ | obj82.name = " | ||
+ | obj82.userData.explodable = 1; | ||
+ | obj82.userData.points = []; | ||
+ | obj82.userData.points.push(new PMPoint(-0.923077, | ||
+ | obj82.userData.points.push(new PMPoint(-0.898876, | ||
+ | obj82.userData.points.push(new PMPoint(-0.905882, | ||
+ | |||
+ | obj82.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj82.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj82.userData.pointlabels = [" | ||
+ | obj82.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj82.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj82.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj82.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj82); | ||
+ | scene.add(obj82); | ||
+ | |||
+ | var obj83 = new THREE.Object3D(); | ||
+ | obj83.name = " | ||
+ | obj83.userData.explodable = 1; | ||
+ | obj83.userData.points = []; | ||
+ | obj83.userData.points.push(new PMPoint(-0.882353, | ||
+ | obj83.userData.points.push(new PMPoint(-0.898876, | ||
+ | obj83.userData.points.push(new PMPoint(-0.892704, | ||
+ | |||
+ | obj83.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj83.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj83.userData.pointlabels = [" | ||
+ | obj83.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj83.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj83.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj83.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj83); | ||
+ | scene.add(obj83); | ||
+ | |||
+ | var obj84 = new THREE.Object3D(); | ||
+ | obj84.name = " | ||
+ | obj84.userData.explodable = 1; | ||
+ | obj84.userData.points = []; | ||
+ | obj84.userData.points.push(new PMPoint(-0.882353, | ||
+ | obj84.userData.points.push(new PMPoint(-0.861538, | ||
+ | obj84.userData.points.push(new PMPoint(-0.870466, | ||
+ | |||
+ | obj84.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj84.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj84.userData.pointlabels = [" | ||
+ | obj84.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj84.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj84.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj84.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj84); | ||
+ | scene.add(obj84); | ||
+ | |||
+ | var obj85 = new THREE.Object3D(); | ||
+ | obj85.name = " | ||
+ | obj85.userData.explodable = 1; | ||
+ | obj85.userData.points = []; | ||
+ | obj85.userData.points.push(new PMPoint(-0.8, | ||
+ | obj85.userData.points.push(new PMPoint(-0.861538, | ||
+ | obj85.userData.points.push(new PMPoint(-0.849057, | ||
+ | |||
+ | obj85.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj85.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj85.userData.pointlabels = [" | ||
+ | obj85.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj85.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj85.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj85.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj85); | ||
+ | scene.add(obj85); | ||
+ | |||
+ | var obj86 = new THREE.Object3D(); | ||
+ | obj86.name = " | ||
+ | obj86.userData.explodable = 1; | ||
+ | obj86.userData.points = []; | ||
+ | obj86.userData.points.push(new PMPoint(-0.8, | ||
+ | obj86.userData.points.push(new PMPoint(-0.724138, | ||
+ | obj86.userData.points.push(new PMPoint(-0.742268, | ||
+ | |||
+ | obj86.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj86.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj86.userData.pointlabels = [" | ||
+ | obj86.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj86.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj86.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj86.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj86); | ||
+ | scene.add(obj86); | ||
+ | |||
+ | var obj87 = new THREE.Object3D(); | ||
+ | obj87.name = " | ||
+ | obj87.userData.explodable = 1; | ||
+ | obj87.userData.points = []; | ||
+ | obj87.userData.points.push(new PMPoint(-0.689655, | ||
+ | obj87.userData.points.push(new PMPoint(-0.724138, | ||
+ | obj87.userData.points.push(new PMPoint(-0.710059, | ||
+ | |||
+ | obj87.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj87.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj87.userData.pointlabels = [" | ||
+ | obj87.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj87.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj87.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj87.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj87); | ||
+ | scene.add(obj87); | ||
+ | |||
+ | var obj88 = new THREE.Object3D(); | ||
+ | obj88.name = " | ||
+ | obj88.userData.explodable = 1; | ||
+ | obj88.userData.points = []; | ||
+ | obj88.userData.points.push(new PMPoint(-0.689655, | ||
+ | obj88.userData.points.push(new PMPoint(-0.657534, | ||
+ | obj88.userData.points.push(new PMPoint(-0.670103, | ||
+ | |||
+ | obj88.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj88.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj88.userData.pointlabels = [" | ||
+ | obj88.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj88.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj88.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj88.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj88); | ||
+ | scene.add(obj88); | ||
+ | |||
+ | var obj89 = new THREE.Object3D(); | ||
+ | obj89.name = " | ||
+ | obj89.userData.explodable = 1; | ||
+ | obj89.userData.points = []; | ||
+ | obj89.userData.points.push(new PMPoint(-0.6, | ||
+ | obj89.userData.points.push(new PMPoint(-0.657534, | ||
+ | obj89.userData.points.push(new PMPoint(-0.642336, | ||
+ | |||
+ | obj89.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj89.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj89.userData.pointlabels = [" | ||
+ | obj89.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj89.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj89.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj89.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj89); | ||
+ | scene.add(obj89); | ||
+ | |||
+ | var obj90 = new THREE.Object3D(); | ||
+ | obj90.name = " | ||
+ | obj90.userData.explodable = 1; | ||
+ | obj90.userData.points = []; | ||
+ | obj90.userData.points.push(new PMPoint(-0.6, | ||
+ | obj90.userData.points.push(new PMPoint(-0.528302, | ||
+ | obj90.userData.points.push(new PMPoint(-0.550459, | ||
+ | |||
+ | obj90.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj90.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj90.userData.pointlabels = [" | ||
+ | obj90.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj90.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj90.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj90.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj90); | ||
+ | scene.add(obj90); | ||
+ | |||
+ | var obj91 = new THREE.Object3D(); | ||
+ | obj91.name = " | ||
+ | obj91.userData.explodable = 1; | ||
+ | obj91.userData.points = []; | ||
+ | obj91.userData.points.push(new PMPoint(-0.470588, | ||
+ | obj91.userData.points.push(new PMPoint(-0.528302, | ||
+ | obj91.userData.points.push(new PMPoint(-0.507692, | ||
+ | |||
+ | obj91.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj91.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj91.userData.pointlabels = [" | ||
+ | obj91.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj91.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj91.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj91.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj91); | ||
+ | scene.add(obj91); | ||
+ | |||
+ | var obj92 = new THREE.Object3D(); | ||
+ | obj92.name = " | ||
+ | obj92.userData.explodable = 1; | ||
+ | obj92.userData.points = []; | ||
+ | obj92.userData.points.push(new PMPoint(-0.470588, | ||
+ | obj92.userData.points.push(new PMPoint(-0.384615, | ||
+ | obj92.userData.points.push(new PMPoint(-0.423529, | ||
+ | |||
+ | obj92.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj92.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj92.userData.pointlabels = [" | ||
+ | obj92.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj92.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj92.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj92.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj92); | ||
+ | scene.add(obj92); | ||
+ | |||
+ | var obj93 = new THREE.Object3D(); | ||
+ | obj93.name = " | ||
+ | obj93.userData.explodable = 1; | ||
+ | obj93.userData.points = []; | ||
+ | obj93.userData.points.push(new PMPoint(0, -1, 0.125)); | ||
+ | obj93.userData.points.push(new PMPoint(-0.384615, | ||
+ | obj93.userData.points.push(new PMPoint(-0.324324, | ||
+ | |||
+ | obj93.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj93.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj93.userData.pointlabels = [" | ||
+ | obj93.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj93.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj93.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj93.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj93); | ||
+ | scene.add(obj93); | ||
+ | |||
+ | // COMMON_CODE_BLOCK_BEGIN | ||
+ | function textSpriteMaterial(message, | ||
+ | if ( parameters === undefined ) parameters = {}; | ||
+ | var fontface = " | ||
+ | var fontsize = parameters.hasOwnProperty(" | ||
+ | fontsize = fontsize*10; | ||
+ | var lines = message.split(' | ||
+ | var size = 512; | ||
+ | for(var i = 0; i< | ||
+ | var tmp = lines[i].length; | ||
+ | while(tmp*fontsize > size){ | ||
+ | | ||
+ | } | ||
+ | } | ||
+ | | ||
+ | var canvas = document.createElement(' | ||
+ | canvas.width = size; | ||
+ | canvas.height = size; | ||
+ | var context = canvas.getContext(' | ||
+ | context.fillStyle = " | ||
+ | context.fill(); | ||
+ | context.font = fontsize + "px " + fontface; | ||
+ | | ||
+ | // text color | ||
+ | context.fillStyle = " | ||
+ | | ||
+ | context.fillText(lines[i], | ||
+ | } | ||
+ | | ||
+ | // canvas contents will be used for a texture | ||
+ | var texture = new THREE.Texture(canvas); | ||
+ | texture.needsUpdate = true; | ||
+ | | ||
+ | var spriteMaterial = new THREE.SpriteMaterial({map: | ||
+ | return spriteMaterial; | ||
+ | } | ||
+ | |||
+ | |||
+ | // ---------------------- INITIALIZING OBJECTS-------------------------------------- | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | |||
+ | function init_object(obj) { | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_points(obj); | ||
+ | modelContains.points = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_pointlabels(obj); | ||
+ | modelContains.pointlabels = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_lines(obj); | ||
+ | modelContains.lines = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_edgelabels(obj); | ||
+ | modelContains.edgelabels = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_arrowheads(obj); | ||
+ | modelContains.arrowheads = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_faces(obj); | ||
+ | modelContains.faces = true; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function init_points(obj) { | ||
+ | var pointgroup = new THREE.Group(); | ||
+ | pointgroup.name = " | ||
+ | var points = obj.userData.points; | ||
+ | var radii = obj.userData.pointradii; | ||
+ | var materials = obj.userData.pointmaterial; | ||
+ | var geometry, | ||
+ | if (!Array.isArray(radii)) { | ||
+ | geometry = new THREE.SphereBufferGeometry(radii); | ||
+ | } | ||
+ | if (!Array.isArray(materials)) { | ||
+ | material = materials; | ||
+ | } | ||
+ | for (var i=0; i< | ||
+ | var point = points[i]; | ||
+ | if (Array.isArray(radii)) { | ||
+ | if (radii[i] == 0) { | ||
+ | continue; | ||
+ | } | ||
+ | geometry = new THREE.SphereBufferGeometry(radii[i]); | ||
+ | } | ||
+ | if (Array.isArray(materials)) { | ||
+ | material = materials[i]; | ||
+ | } | ||
+ | var sphere = new THREE.Mesh(geometry, | ||
+ | point.addSphere(sphere); | ||
+ | pointgroup.add(sphere); | ||
+ | } | ||
+ | obj.add(pointgroup); | ||
+ | } | ||
+ | |||
+ | function init_pointlabels(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var labels = obj.userData.pointlabels; | ||
+ | var pointlabels = new THREE.Group(); | ||
+ | pointlabels.name = " | ||
+ | if (Array.isArray(labels)) { | ||
+ | for (var i=0; i< | ||
+ | var point = points[i]; | ||
+ | var spriteMaterial = textSpriteMaterial( labels[i] ); | ||
+ | var sprite = new THREE.Sprite(spriteMaterial); | ||
+ | point.addLabel(sprite); | ||
+ | pointlabels.add(sprite); | ||
+ | } | ||
+ | } else { | ||
+ | var spriteMaterial = textSpriteMaterial( labels ); | ||
+ | for (var i=0; i< | ||
+ | var point = points[i]; | ||
+ | var sprite = new THREE.Sprite(spriteMaterial); | ||
+ | point.addLabel(sprite); | ||
+ | pointlabels.add(sprite); | ||
+ | } | ||
+ | } | ||
+ | obj.add(pointlabels); | ||
+ | } | ||
+ | |||
+ | function init_lines(obj) { | ||
+ | var edgeindices = obj.userData.edgeindices; | ||
+ | var points = obj.userData.points; | ||
+ | var materials = obj.userData.edgematerial; | ||
+ | var geometry = new THREE.BufferGeometry(); | ||
+ | var bufarr = new Float32Array( obj.userData.edgeindices.length * 3 ); | ||
+ | var bufattr = new THREE.Float32BufferAttribute( bufarr, 3 ); | ||
+ | var geometry = new THREE.BufferGeometry(); | ||
+ | geometry.setAttribute(' | ||
+ | if (Array.isArray(materials)) { | ||
+ | for (var i=0; i< | ||
+ | geometry.addGroup(2*i, | ||
+ | } | ||
+ | } | ||
+ | var lines = new THREE.LineSegments(geometry, | ||
+ | lines.name = " | ||
+ | obj.add(lines); | ||
+ | updateEdgesPosition(obj); | ||
+ | } | ||
+ | |||
+ | function init_edgelabels(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var edgeindices = obj.userData.edgeindices; | ||
+ | var labels = obj.userData.edgelabels; | ||
+ | var edgelabels = new THREE.Group(); | ||
+ | edgelabels.name = " | ||
+ | if (Array.isArray(labels)) { | ||
+ | for (var i=0; i< | ||
+ | var spriteMaterial = textSpriteMaterial( labels[i] ); | ||
+ | var sprite = new THREE.Sprite(spriteMaterial); | ||
+ | sprite.position.copy(new THREE.Vector3().addVectors(points[edgeindices[2*i]].vector, | ||
+ | edgelabels.add(sprite); | ||
+ | } | ||
+ | } else { | ||
+ | var spriteMaterial = textSpriteMaterial( labels ); | ||
+ | for (var i=0; i< | ||
+ | var sprite = new THREE.Sprite(spriteMaterial); | ||
+ | sprite.position.copy(new THREE.Vector3().addVectors(points[edgeindices[2*i]].vector, | ||
+ | edgelabels.add(sprite); | ||
+ | } | ||
+ | } | ||
+ | obj.add(edgelabels); | ||
+ | } | ||
+ | |||
+ | function init_arrowheads(obj) { | ||
+ | var arrowheads = new THREE.Group(); | ||
+ | arrowheads.name = " | ||
+ | var arrowstyle = obj.userData.arrowstyle; | ||
+ | var edgeindices = obj.userData.edgeindices; | ||
+ | var edgematerials = obj.userData.edgematerial; | ||
+ | var points = obj.userData.points; | ||
+ | var material; | ||
+ | if (!Array.isArray(edgematerials)) { | ||
+ | material = new THREE.MeshBasicMaterial( {color: edgematerials.color} ); | ||
+ | } | ||
+ | |||
+ | for (var i=0; i< | ||
+ | var start = points[edgeindices[i]]; | ||
+ | var end = points[edgeindices[i+1]]; | ||
+ | var dist = start.vector.distanceTo( end.vector ) - start.radius() - end.radius(); | ||
+ | if (dist <= 0) { | ||
+ | continue; | ||
+ | } | ||
+ | var dir = new THREE.Vector3().subVectors(end.vector, | ||
+ | dir.normalize(); | ||
+ | var axis = new THREE.Vector3().set(dir.z, | ||
+ | axis.normalize(); | ||
+ | var radians = Math.acos( dir.y ); | ||
+ | var radius = dist/25; | ||
+ | var height = dist/5; | ||
+ | var geometry = new THREE.ConeBufferGeometry(radius, | ||
+ | var position = new THREE.Vector3().addVectors(start.vector, | ||
+ | if (Array.isArray(edgematerials)) { | ||
+ | material = new THREE.MeshBasicMaterial( {color: edgematerials[i].color} ); | ||
+ | } | ||
+ | var cone = new THREE.Mesh( geometry, material ); | ||
+ | cone.quaternion.setFromAxisAngle(axis, | ||
+ | cone.position.copy(position);; | ||
+ | arrowheads.add(cone); | ||
+ | } | ||
+ | obj.add(arrowheads); | ||
+ | } | ||
+ | |||
+ | function init_faces(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var facets = obj.userData.facets; | ||
+ | obj.userData.triangleindices = []; | ||
+ | for (var i=0; i< | ||
+ | facet = facets[i]; | ||
+ | for (var t=0; t< | ||
+ | obj.userData.triangleindices.push(facet[0], | ||
+ | } | ||
+ | } | ||
+ | var bufarr = new Float32Array( obj.userData.triangleindices.length * 3 ); | ||
+ | var bufattr = new THREE.Float32BufferAttribute(bufarr, | ||
+ | | ||
+ | var materials = obj.userData.facetmaterial; | ||
+ | var geometry = new THREE.BufferGeometry(); | ||
+ | var frontmaterials = []; | ||
+ | var backmaterials = []; | ||
+ | geometry.setAttribute(' | ||
+ | if (Array.isArray(materials)) { | ||
+ | var tricount = 0; | ||
+ | var facet; | ||
+ | for (var i=0; i< | ||
+ | facet = facets[i]; | ||
+ | geometry.addGroup(tricount, | ||
+ | tricount += (facet.length-2)*3; | ||
+ | } | ||
+ | for (var j=0; j< | ||
+ | var fmat = materials[j].clone() | ||
+ | fmat.side = THREE.FrontSide; | ||
+ | frontmaterials.push(fmat); | ||
+ | var bmat = materials[j].clone() | ||
+ | bmat.side = THREE.BackSide; | ||
+ | backmaterials.push(bmat); | ||
+ | obj.userData.facetmaterial = frontmaterials.concat(backmaterials); | ||
+ | } | ||
+ | } else if (materials instanceof THREE.Material) { | ||
+ | frontmaterials = materials.clone() | ||
+ | frontmaterials.side = THREE.FrontSide; | ||
+ | backmaterials = materials.clone() | ||
+ | backmaterials.side = THREE.BackSide; | ||
+ | obj.userData.facetmaterial = [frontmaterials, | ||
+ | } | ||
+ | // duplicating the object with front and back should avoid transparency issues | ||
+ | var backmesh = new THREE.Mesh(geometry, | ||
+ | // meshname is used to show/hide objects | ||
+ | backmesh.name = " | ||
+ | obj.add(backmesh); | ||
+ | var frontmesh = new THREE.Mesh(geometry, | ||
+ | frontmesh.name = " | ||
+ | obj.add(frontmesh); | ||
+ | updateFacesPosition(obj); | ||
+ | } | ||
+ | // // | ||
+ | |||
+ | |||
+ | function updateFacesPosition(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var indices = obj.userData.triangleindices; | ||
+ | var faces = obj.getObjectByName(" | ||
+ | var ba = faces.geometry.getAttribute(" | ||
+ | for (var i=0; i< | ||
+ | ba.setXYZ(i, | ||
+ | } | ||
+ | faces.geometry.attributes.position.needsUpdate = true; | ||
+ | | ||
+ | } | ||
+ | |||
+ | function updateEdgesPosition(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var indices = obj.userData.edgeindices; | ||
+ | var lines = obj.getObjectByName(" | ||
+ | var ba = lines.geometry.getAttribute(" | ||
+ | for (var i=0; i< | ||
+ | ba.setXYZ(i, | ||
+ | } | ||
+ | lines.geometry.attributes.position.needsUpdate = true; | ||
+ | } | ||
+ | |||
+ | function onWindowResize() { | ||
+ | renderer.setSize( three.clientWidth, | ||
+ | svgRenderer.setSize( three.clientWidth, | ||
+ | updateCamera(); | ||
+ | } | ||
+ | |||
+ | function updateCamera() { | ||
+ | var width = three.clientWidth; | ||
+ | var height = three.clientHeight; | ||
+ | var aspect = width / height; | ||
+ | if (camera.type == " | ||
+ | camera.left = frustumSize * aspect / - 2; | ||
+ | camera.right = frustumSize * aspect / 2; | ||
+ | camera.top = frustumSize / 2; | ||
+ | camera.bottom = - frustumSize / 2; | ||
+ | } else if (camera.type == " | ||
+ | camera.aspect = aspect; | ||
+ | } | ||
+ | camera.updateProjectionMatrix(); | ||
+ | } | ||
+ | |||
+ | function changeCamera(event) { | ||
+ | var selindex = event.currentTarget.selectedIndex; | ||
+ | camera = cameras[selindex]; | ||
+ | control = controls[selindex]; | ||
+ | control.enabled = true; | ||
+ | for (var i=0; i< | ||
+ | if (i!=selindex) { | ||
+ | controls[i].enabled = false; | ||
+ | } | ||
+ | } | ||
+ | updateCamera(); | ||
+ | } | ||
+ | |||
+ | var camtypenode = document.getElementById(' | ||
+ | camtypenode.onchange = changeCamera; | ||
+ | camtypenode.dispatchEvent(new Event(' | ||
+ | |||
+ | onWindowResize(); | ||
+ | window.addEventListener(' | ||
+ | |||
+ | |||
+ | var xRotationEnabled = false; | ||
+ | var yRotationEnabled = false; | ||
+ | var zRotationEnabled = false; | ||
+ | var rotationSpeedFactor = 1; | ||
+ | var settingsShown = false; | ||
+ | var labelsShown = true; | ||
+ | var intervals = []; | ||
+ | var timeouts = []; | ||
+ | var explodingSpeed = 0.05; | ||
+ | var explodeScale = 0.000001; | ||
+ | var XMLS = new XMLSerializer(); | ||
+ | var svgElement; | ||
+ | var renderId; | ||
+ | |||
+ | var render = function () { | ||
+ | |||
+ | renderId = requestAnimationFrame(render); | ||
+ | |||
+ | // comment in for automatic explosion | ||
+ | // | ||
+ | |||
+ | var phi = 0.02 * rotationSpeedFactor; | ||
+ | |||
+ | if (xRotationEnabled) { | ||
+ | scene.rotation.x += phi; | ||
+ | } | ||
+ | if (yRotationEnabled) { | ||
+ | scene.rotation.y += phi; | ||
+ | } | ||
+ | if (zRotationEnabled) { | ||
+ | scene.rotation.z += phi; | ||
+ | } | ||
+ | |||
+ | control.update(); | ||
+ | renderer.render(scene, | ||
+ | }; | ||
+ | |||
+ | if ( THREE.WEBGL.isWebGLAvailable() ) { | ||
+ | render(); | ||
+ | } else { | ||
+ | var warning = WEBGL.getWebGLErrorMessage(); | ||
+ | three.appendChild( warning ); | ||
+ | } | ||
+ | | ||
+ | function changeTransparency() { | ||
+ | var opacity = 1-Number(event.currentTarget.value); | ||
+ | for (var i=0; i< | ||
+ | child = scene.children[i]; | ||
+ | if ( child.userData.hasOwnProperty(" | ||
+ | if (Array.isArray(child.userData.facetmaterial)) { | ||
+ | for (var j=0; j< | ||
+ | child.userData.facetmaterial[j].opacity = opacity; | ||
+ | } | ||
+ | } else { | ||
+ | child.userData.facetmaterial.opacity = opacity; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function toggleDepthWrite(event) { | ||
+ | depthwrite = event.currentTarget.checked; | ||
+ | for (var i=0; i< | ||
+ | child = scene.children[i]; | ||
+ | if ( child.userData.hasOwnProperty(" | ||
+ | if (Array.isArray(child.userData.facetmaterial)) { | ||
+ | for (var j=0; j< | ||
+ | child.userData.facetmaterial[j].depthWrite = depthwrite; | ||
+ | } | ||
+ | } else { | ||
+ | child.userData.facetmaterial.depthWrite = depthWrite; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function changeRotationX(event){ | ||
+ | xRotationEnabled = event.currentTarget.checked; | ||
+ | } | ||
+ | |||
+ | function changeRotationY(event){ | ||
+ | yRotationEnabled = event.currentTarget.checked; | ||
+ | } | ||
+ | |||
+ | function changeRotationZ(event){ | ||
+ | zRotationEnabled = event.currentTarget.checked; | ||
+ | } | ||
+ | |||
+ | |||
+ | function changeRotationSpeedFactor(event){ | ||
+ | rotationSpeedFactor = Number(event.currentTarget.value); | ||
+ | } | ||
+ | |||
+ | function resetScene(){ | ||
+ | scene.rotation.set(0, | ||
+ | camera.position.set(0, | ||
+ | camera.up.set(0, | ||
+ | } | ||
+ | |||
+ | function showSettings(event){ | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | settingsShown = true; | ||
+ | } | ||
+ | |||
+ | function hideSettings(event){ | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | settingsShown = false; | ||
+ | } | ||
+ | |||
+ | |||
+ | |||
+ | var pos = 150* Math.PI; | ||
+ | |||
+ | function updateFactor() { | ||
+ | pos++; | ||
+ | return Math.sin(.01*pos)+1; | ||
+ | } | ||
+ | |||
+ | // ------------------------ FOLDING ------------------------------------------------ | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | // rotate point p around axis defined by points p1 and p2 by given angle | ||
+ | function rotate(p, p1, p2, angle ){ | ||
+ | angle = -angle; | ||
+ | var x = p.x, y = p.y, z = p.z, | ||
+ | a = p1.x, b = p1.y, c = p1.z, | ||
+ | u = p2.x-p1.x, v = p2.y-p1.y, w = p2.z-p1.z; | ||
+ | var result = []; | ||
+ | var L = u*u + v*v + w*w; | ||
+ | var sqrt = Math.sqrt; | ||
+ | var cos = Math.cos; | ||
+ | var sin = Math.sin; | ||
+ | |||
+ | result[0] = ((a*(v*v+w*w)-u*(b*v+c*w-u*x-v*y-w*z))*(1-cos(angle))+L*x*cos(angle)+sqrt(L)*(-c*v+b*w-w*y+v*z)*sin(angle))/ | ||
+ | result[1] = ((b*(u*u+w*w)-v*(a*u+c*w-u*x-v*y-w*z))*(1-cos(angle))+L*y*cos(angle)+sqrt(L)*(c*u-a*w+w*x-u*z)*sin(angle))/ | ||
+ | result[2] = ((c*(u*u+v*v)-w*(a*u+b*v-u*x-v*y-w*z))*(1-cos(angle))+L*z*cos(angle)+sqrt(L)*(-b*u+a*v-v*x+u*y)*sin(angle))/ | ||
+ | |||
+ | return result; | ||
+ | } | ||
+ | |||
+ | var fold = function(event){ | ||
+ | var obj = foldables[Number(event.currentTarget.name)]; | ||
+ | var foldvalue = Number(event.currentTarget.value); | ||
+ | var scale = foldvalue - obj.userData.oldscale; | ||
+ | |||
+ | for (var j=0; j< | ||
+ | rotateVertices(obj, | ||
+ | } | ||
+ | update(obj); | ||
+ | obj.userData.oldscale += scale; | ||
+ | lookAtBarycenter(obj); | ||
+ | } | ||
+ | |||
+ | function lookAtBarycenter(obj){ | ||
+ | control.target = barycenter(obj); | ||
+ | } | ||
+ | |||
+ | function barycenter(obj) { | ||
+ | var center = new THREE.Vector3(0, | ||
+ | var points = obj.userData.points; | ||
+ | for (var i=0; i< | ||
+ | center.add(points[i].vector); | ||
+ | } | ||
+ | center.divideScalar(points.length); | ||
+ | return center; | ||
+ | } | ||
+ | |||
+ | function rotateVertices(obj, | ||
+ | var axes = obj.userData.axes; | ||
+ | var subtrees = obj.userData.subtrees; | ||
+ | var points = obj.userData.points; | ||
+ | var angles = obj.userData.angles; | ||
+ | if (edge < axes.length){ | ||
+ | for (var j=0; j< | ||
+ | var rotP = rotate(points[subtrees[edge][j]].vector, | ||
+ | points[subtrees[edge][j]].set(rotP[0], | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function update(obj) { | ||
+ | | ||
+ | | ||
+ | } | ||
+ | |||
+ | if (foldables.length) { | ||
+ | var settings = document.getElementById(' | ||
+ | var foldDiv = document.createElement(' | ||
+ | foldDiv.id = ' | ||
+ | var title = document.createElement(' | ||
+ | title.innerHTML = ' | ||
+ | foldDiv.appendChild(title); | ||
+ | foldDiv.className = ' | ||
+ | for (var i=0; i< | ||
+ | var range = document.createElement(' | ||
+ | range.type = ' | ||
+ | range.min = 0; | ||
+ | range.max = 1; | ||
+ | range.value = 0; | ||
+ | range.step = 0.001; | ||
+ | range.name = String(i); | ||
+ | range.oninput = fold; | ||
+ | foldDiv.appendChild(range); | ||
+ | } | ||
+ | lookAtBarycenter(foldables[0]); | ||
+ | settings.insertBefore(foldDiv, | ||
+ | } | ||
+ | |||
+ | | ||
+ | // ---------------------- EXPLOSION ------------------------------------------------ | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | |||
+ | if (explodableModel) { | ||
+ | for (var i=0; i< | ||
+ | obj = scene.children[i]; | ||
+ | if ( obj.userData.explodable ) { | ||
+ | computeCentroid(obj); | ||
+ | } | ||
+ | } | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | explode(0.000001); | ||
+ | } | ||
+ | |||
+ | function computeCentroid(obj) { | ||
+ | centroid = new THREE.Vector3(); | ||
+ | obj.userData.points.forEach(function(pmpoint) { | ||
+ | centroid.add(pmpoint.vector); | ||
+ | }); | ||
+ | centroid.divideScalar(obj.userData.points.length); | ||
+ | obj.userData.centroid = centroid; | ||
+ | } | ||
+ | |||
+ | function explode(factor) { | ||
+ | for (var i=0; i< | ||
+ | var obj = scene.children[i]; | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | var c = obj.userData.centroid; | ||
+ | obj.position.set(c.x*factor, | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function triggerExplode(event){ | ||
+ | explodeScale = Number(event.currentTarget.value); | ||
+ | explode(explodeScale); | ||
+ | } | ||
+ | |||
+ | function setExplodingSpeed(event){ | ||
+ | explodingSpeed = Number(event.currentTarget.value); | ||
+ | } | ||
+ | |||
+ | function triggerAutomaticExplode(event){ | ||
+ | if (event.currentTarget.checked){ | ||
+ | startExploding(); | ||
+ | } else { | ||
+ | clearIntervals(); | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function startExploding(){ | ||
+ | intervals.push(setInterval(explodingInterval, | ||
+ | } | ||
+ | |||
+ | |||
+ | function explodingInterval(){ | ||
+ | explodeScale += explodingSpeed; | ||
+ | if (explodeScale <= 6){ | ||
+ | explode(explodeScale); | ||
+ | } | ||
+ | else{ | ||
+ | explode(6); | ||
+ | explodeScale = 6; | ||
+ | clearIntervals(); | ||
+ | timeouts.push(setTimeout(startUnexploding, | ||
+ | } | ||
+ | document.getElementById(' | ||
+ | } | ||
+ | |||
+ | |||
+ | function startUnexploding(){ | ||
+ | intervals.push(setInterval(unexplodingInterval, | ||
+ | } | ||
+ | |||
+ | function unexplodingInterval(){ | ||
+ | explodeScale -= explodingSpeed; | ||
+ | if (explodeScale >= 0){ | ||
+ | explode(explodeScale); | ||
+ | } | ||
+ | else { | ||
+ | explode(0); | ||
+ | explodeScale = 0; | ||
+ | clearIntervals(); | ||
+ | timeouts.push(setTimeout(startExploding, | ||
+ | } | ||
+ | document.getElementById(' | ||
+ | } | ||
+ | |||
+ | function clearIntervals(){ | ||
+ | intervals.forEach(function(interval){ | ||
+ | clearInterval(interval); | ||
+ | }); | ||
+ | intervals = []; | ||
+ | timeouts.forEach(function(timeout){ | ||
+ | clearTimeout(timeout); | ||
+ | }); | ||
+ | timeouts = []; | ||
+ | } | ||
+ | |||
+ | // ---------------------- DISPLAY -------------------------------------------------- | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | |||
+ | const objectTypeInnerHTMLs = { points: " | ||
+ | const objectTypeVisible = {}; | ||
+ | Object.assign(objectTypeVisible, | ||
+ | const sortedObjectTypeKeys = Object.keys(objectTypeInnerHTMLs).sort(); | ||
+ | const shownObjectTypesList = document.getElementById(' | ||
+ | |||
+ | function setVisibility(bool, | ||
+ | for (var i=0; i< | ||
+ | var obj = scene.children[i].getObjectByName(objname); | ||
+ | if (obj) { | ||
+ | obj.visible = bool; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function toggleObjectTypeVisibility(event){ | ||
+ | var name = event.currentTarget.name; | ||
+ | var checked = event.currentTarget.checked; | ||
+ | objectTypeVisible[name] = checked; | ||
+ | if (name == " | ||
+ | setVisibility(checked," | ||
+ | setVisibility(checked," | ||
+ | } else { | ||
+ | setVisibility(checked, | ||
+ | } | ||
+ | } | ||
+ | |||
+ | for (var i=0; i< | ||
+ | var key = sortedObjectTypeKeys[i]; | ||
+ | if (modelContains[key]) { | ||
+ | var objTypeNode = document.createElement(' | ||
+ | objTypeNode.innerHTML = objectTypeInnerHTMLs[key] + '< | ||
+ | var checkbox = document.createElement(' | ||
+ | checkbox.type = ' | ||
+ | checkbox.checked = true; | ||
+ | checkbox.name = key; | ||
+ | checkbox.onchange = toggleObjectTypeVisibility; | ||
+ | shownObjectTypesList.appendChild(checkbox); | ||
+ | shownObjectTypesList.appendChild(objTypeNode); | ||
+ | } | ||
+ | } | ||
+ | |||
+ | // ------------------------------------------------------ | ||
+ | |||
+ | function toggleObjectVisibility(event){ | ||
+ | var nr = Number(event.currentTarget.name); | ||
+ | scene.children[nr].visible = event.currentTarget.checked; | ||
+ | } | ||
+ | |||
+ | // append checkboxes for displaying or hiding objects | ||
+ | var shownObjectsList = document.getElementById(' | ||
+ | for (var i=0; i< | ||
+ | obj = scene.children[i]; | ||
+ | var objNode = document.createElement(' | ||
+ | objNode.innerHTML = obj.name + '< | ||
+ | var checkbox = document.createElement(' | ||
+ | checkbox.type = ' | ||
+ | checkbox.checked = true; | ||
+ | checkbox.name = String(i); | ||
+ | checkbox.onchange = toggleObjectVisibility; | ||
+ | shownObjectsList.appendChild(checkbox); | ||
+ | shownObjectsList.appendChild(objNode); | ||
+ | } | ||
+ | |||
+ | // ---------------------- SVG ------------------------------------------------------ | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | |||
+ | function takeSvgScreenshot() { | ||
+ | if (objectTypeVisible[" | ||
+ | setVisibility(false," | ||
+ | } | ||
+ | if (objectTypeVisible[" | ||
+ | setVisibility(false," | ||
+ | } | ||
+ | svgRenderer.render(scene, | ||
+ | svgElement = XMLS.serializeToString(svgRenderer.domElement); | ||
+ | | ||
+ | if (objectTypeVisible[" | ||
+ | setVisibility(true," | ||
+ | } | ||
+ | if (objectTypeVisible[" | ||
+ | setVisibility(true," | ||
+ | } | ||
+ | |||
+ | if (document.getElementById(' | ||
+ | //show in new tab | ||
+ | var myWindow = window.open("","" | ||
+ | myWindow.document.body.innerHTML = svgElement; | ||
+ | } else{ | ||
+ | // download svg file | ||
+ | download(" | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function download(filename, | ||
+ | var element = document.createElement(' | ||
+ | element.setAttribute(' | ||
+ | element.setAttribute(' | ||
+ | |||
+ | element.style.display = ' | ||
+ | document.body.appendChild(element); | ||
+ | |||
+ | element.click(); | ||
+ | |||
+ | document.body.removeChild(element); | ||
+ | } | ||
+ | |||
+ | |||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | |||
+ | |||
+ | // ------------------ SHORTCUTS -------------------------------------------- | ||
+ | // ------------------------------------------------------------------------- | ||
+ | |||
+ | /** | ||
+ | * http:// | ||
+ | * Version : 2.01.B | ||
+ | * By Binny V A | ||
+ | * License : BSD | ||
+ | */ | ||
+ | shortcut = { | ||
+ | ' | ||
+ | ' | ||
+ | //Provide a set of default options | ||
+ | var default_options = { | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | } | ||
+ | if(!opt) opt = default_options; | ||
+ | else { | ||
+ | for(var dfo in default_options) { | ||
+ | if(typeof opt[dfo] == ' | ||
+ | } | ||
+ | } | ||
+ | |||
+ | var ele = opt.target; | ||
+ | if(typeof opt.target == ' | ||
+ | var ths = this; | ||
+ | shortcut_combination = shortcut_combination.toLowerCase(); | ||
+ | |||
+ | //The function to be called at keypress | ||
+ | var func = function(e) { | ||
+ | e = e || window.event; | ||
+ | |||
+ | if(opt[' | ||
+ | var element; | ||
+ | if(e.target) element=e.target; | ||
+ | else if(e.srcElement) element=e.srcElement; | ||
+ | if(element.nodeType==3) element=element.parentNode; | ||
+ | |||
+ | if(element.tagName == ' | ||
+ | } | ||
+ | |||
+ | //Find Which key is pressed | ||
+ | if (e.keyCode) code = e.keyCode; | ||
+ | else if (e.which) code = e.which; | ||
+ | var character = String.fromCharCode(code).toLowerCase(); | ||
+ | |||
+ | if(code == 188) character=","; | ||
+ | if(code == 190) character=" | ||
+ | |||
+ | var keys = shortcut_combination.split(" | ||
+ | //Key Pressed - counts the number of valid keypresses - if it is same as the number of keys, the shortcut function is invoked | ||
+ | var kp = 0; | ||
+ | |||
+ | //Work around for stupid Shift key bug created by using lowercase - as a result the shift+num combination was broken | ||
+ | var shift_nums = { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | ";":":", | ||
+ | "'":" | ||
+ | ",":"<", | ||
+ | " | ||
+ | "/":"?", | ||
+ | " | ||
+ | } | ||
+ | // | ||
+ | var special_keys = { | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | } | ||
+ | |||
+ | var modifiers = { | ||
+ | shift: { wanted: | ||
+ | ctrl : { wanted: | ||
+ | alt | ||
+ | meta : { wanted: | ||
+ | }; | ||
+ | | ||
+ | if(e.ctrlKey) modifiers.ctrl.pressed = true; | ||
+ | if(e.shiftKey) modifiers.shift.pressed = true; | ||
+ | if(e.altKey) modifiers.alt.pressed = true; | ||
+ | if(e.metaKey) | ||
+ | | ||
+ | for(var i=0; k=keys[i], | ||
+ | // | ||
+ | if(k == ' | ||
+ | kp++; | ||
+ | modifiers.ctrl.wanted = true; | ||
+ | |||
+ | } else if(k == ' | ||
+ | kp++; | ||
+ | modifiers.shift.wanted = true; | ||
+ | |||
+ | } else if(k == ' | ||
+ | kp++; | ||
+ | modifiers.alt.wanted = true; | ||
+ | } else if(k == ' | ||
+ | kp++; | ||
+ | modifiers.meta.wanted = true; | ||
+ | } else if(k.length > 1) { //If it is a special key | ||
+ | if(special_keys[k] == code) kp++; | ||
+ | |||
+ | } else if(opt[' | ||
+ | if(opt[' | ||
+ | |||
+ | } else { //The special keys did not match | ||
+ | if(character == k) kp++; | ||
+ | else { | ||
+ | if(shift_nums[character] && e.shiftKey) { //Stupid Shift key bug created by using lowercase | ||
+ | character = shift_nums[character]; | ||
+ | if(character == k) kp++; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | if(kp == keys.length && | ||
+ | modifiers.ctrl.pressed == modifiers.ctrl.wanted && | ||
+ | modifiers.shift.pressed == modifiers.shift.wanted && | ||
+ | modifiers.alt.pressed == modifiers.alt.wanted && | ||
+ | modifiers.meta.pressed == modifiers.meta.wanted) { | ||
+ | callback(e); | ||
+ | |||
+ | if(!opt[' | ||
+ | // | ||
+ | e.cancelBubble = true; | ||
+ | e.returnValue = false; | ||
+ | |||
+ | // | ||
+ | if (e.stopPropagation) { | ||
+ | e.stopPropagation(); | ||
+ | e.preventDefault(); | ||
+ | } | ||
+ | return false; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | this.all_shortcuts[shortcut_combination] = { | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | }; | ||
+ | //Attach the function with the event | ||
+ | if(ele.addEventListener) ele.addEventListener(opt[' | ||
+ | else if(ele.attachEvent) ele.attachEvent(' | ||
+ | else ele[' | ||
+ | }, | ||
+ | |||
+ | //Remove the shortcut - just specify the shortcut and I will remove the binding | ||
+ | ' | ||
+ | shortcut_combination = shortcut_combination.toLowerCase(); | ||
+ | var binding = this.all_shortcuts[shortcut_combination]; | ||
+ | delete(this.all_shortcuts[shortcut_combination]) | ||
+ | if(!binding) return; | ||
+ | var type = binding[' | ||
+ | var ele = binding[' | ||
+ | var callback = binding[' | ||
+ | |||
+ | if(ele.detachEvent) ele.detachEvent(' | ||
+ | else if(ele.removeEventListener) ele.removeEventListener(type, | ||
+ | else ele[' | ||
+ | } | ||
+ | } | ||
+ | |||
+ | shortcut.add(" | ||
+ | var event = new Event(' | ||
+ | if (settingsShown){ | ||
+ | document.getElementById(' | ||
+ | } else { | ||
+ | document.getElementById(' | ||
+ | } | ||
+ | }); | ||
+ | |||
+ | |||
+ | // COMMON_CODE_BLOCK_END | ||
+ | |||
+ | });}); | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | ==== Example 2: a hyperbolic torus with three cusps ==== | ||
+ | |||
+ | <code perl> | ||
+ | > $T3 = new Matrix< | ||
+ | > $s = new HyperbolicSurface(DCEL=> | ||
+ | </ | ||
+ | < | ||
+ | |||
+ | <code perl> | ||
+ | > $f = $s-> | ||
+ | > $f-> | ||
+ | </ | ||
+ | < | ||
+ | <!-- | ||
+ | polymake for knusper | ||
+ | Thu Mar 3 00:31:41 2022 | ||
+ | fan: | ||
+ | --> | ||
+ | |||
+ | |||
+ | < | ||
+ | < | ||
+ | <meta charset=utf-8> | ||
+ | < | ||
+ | < | ||
+ | /* | ||
+ | // COMMON_CODE_BLOCK_BEGIN | ||
+ | */ | ||
+ | html {overflow: scroll;} | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | # | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | } | ||
+ | /* | ||
+ | // COMMON_CODE_BLOCK_END | ||
+ | */ | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | <div id=' | ||
+ | <div class=group id=' | ||
+ | < | ||
+ | < | ||
+ | <div class=indented>< | ||
+ | <div class=suboption> | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | <div class=group id=' | ||
+ | < | ||
+ | < | ||
+ | <div class=indented>< | ||
+ | </ | ||
+ | |||
+ | <div class=group id=' | ||
+ | < | ||
+ | <div class=indented> | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | <div class=suboption> | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | |||
+ | <div class=group id=' | ||
+ | < | ||
+ | <div class=indented> | ||
+ | < | ||
+ | </ | ||
+ | <div class=suboption> | ||
+ | <div class=indented> | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | < | ||
+ | <div class=indented> | ||
+ | < | ||
+ | <select id=" | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | <div class=group id=' | ||
+ | < | ||
+ | <div class=indented> | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | </ | ||
+ | <img id=' | ||
+ | <img id=' | ||
+ | <div id=" | ||
+ | </ | ||
+ | < | ||
+ | requirejs.config({ | ||
+ | paths: { | ||
+ | three: '/ | ||
+ | TrackballControls: | ||
+ | OrbitControls: | ||
+ | Projector: '/ | ||
+ | SVGRenderer: | ||
+ | WEBGL: '/ | ||
+ | }, | ||
+ | shim: { | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | } | ||
+ | }); | ||
+ | | ||
+ | require([' | ||
+ | window.THREE = THREE; | ||
+ | require([' | ||
+ | | ||
+ | THREE.TrackballControls = TrackballControls; | ||
+ | THREE.OrbitControls = OrbitControls; | ||
+ | THREE.Projector = Projector; | ||
+ | THREE.SVGRenderer = SVGRenderer; | ||
+ | THREE.WEBGL = WEBGL; | ||
+ | |||
+ | // COMMON_CODE_BLOCK_BEGIN | ||
+ | |||
+ | const intervalLength = 25; // for automatic animations | ||
+ | const explodableModel = true; | ||
+ | const modelContains = { points: false, pointlabels: | ||
+ | const foldables = []; | ||
+ | |||
+ | var three = document.getElementById(" | ||
+ | var scene = new THREE.Scene(); | ||
+ | var renderer = new THREE.WebGLRenderer( { antialias: true } ); | ||
+ | var svgRenderer = new THREE.SVGRenderer( { antialias: true } ); | ||
+ | renderer.setPixelRatio( window.devicePixelRatio ); | ||
+ | renderer.setClearColor(0xFFFFFF, | ||
+ | svgRenderer.setClearColor(0xFFFFFF, | ||
+ | three.appendChild(renderer.domElement); | ||
+ | |||
+ | var frustumSize = 4; | ||
+ | var cameras = [new THREE.PerspectiveCamera(75, | ||
+ | cameras.forEach(function(cam) { | ||
+ | cam.position.set(0, | ||
+ | cam.lookAt(0, | ||
+ | cam.up.set(0, | ||
+ | }); | ||
+ | var controls = [new THREE.TrackballControls(cameras[0], | ||
+ | var camera, control; | ||
+ | |||
+ | controls[0].zoomSpeed = 0.2; | ||
+ | controls[0].rotateSpeed = 4; | ||
+ | |||
+ | |||
+ | // class to allow move points together with labels and spheres | ||
+ | var PMPoint = function (x,y,z) { | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | PMPoint.prototype.addLabel = function(labelsprite) { | ||
+ | | ||
+ | | ||
+ | } | ||
+ | PMPoint.prototype.addSphere = function(spheremesh) { | ||
+ | | ||
+ | | ||
+ | } | ||
+ | PMPoint.prototype.set = function(x, | ||
+ | | ||
+ | if (this.sprite) { | ||
+ | this.sprite.position.copy(this.vector); | ||
+ | } | ||
+ | if (this.sphere) { | ||
+ | this.sphere.position.copy(this.vector); | ||
+ | } | ||
+ | } | ||
+ | PMPoint.prototype.radius = function() { | ||
+ | if (this.sphere) { | ||
+ | return this.sphere.geometry.parameters.radius; | ||
+ | } else { | ||
+ | return 0; | ||
+ | } | ||
+ | }; | ||
+ | // select the target node | ||
+ | var target = document.querySelector('# | ||
+ | |||
+ | // create an observer instance | ||
+ | var observer = new MutationObserver(function(mutations) { | ||
+ | | ||
+ | if (mutation.removedNodes && mutation.removedNodes.length > 0) { | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | }); | ||
+ | }); | ||
+ | |||
+ | // configuration of the observer: | ||
+ | var config = { childList: true, characterData: | ||
+ | |||
+ | // pass in the target node, as well as the observer options | ||
+ | while (target) { | ||
+ | if (target.className==" | ||
+ | observer.observe(target, | ||
+ | break; | ||
+ | } | ||
+ | | ||
+ | } | ||
+ | |||
+ | // COMMON_CODE_BLOCK_END | ||
+ | |||
+ | var obj0 = new THREE.Object3D(); | ||
+ | obj0.name = " | ||
+ | obj0.userData.explodable = 0; | ||
+ | obj0.userData.points = []; | ||
+ | obj0.userData.points.push(new PMPoint(0, 0, 0)); | ||
+ | obj0.userData.points.push(new PMPoint(0, 0.529999, 0.847998)); | ||
+ | obj0.userData.points.push(new PMPoint(0.451039, | ||
+ | obj0.userData.points.push(new PMPoint(0.529999, | ||
+ | obj0.userData.points.push(new PMPoint(0.751731, | ||
+ | obj0.userData.points.push(new PMPoint(0.707107, | ||
+ | obj0.userData.points.push(new PMPoint(0.846499, | ||
+ | obj0.userData.points.push(new PMPoint(0, 0, 1)); | ||
+ | obj0.userData.points.push(new PMPoint(0.282166, | ||
+ | obj0.userData.points.push(new PMPoint(0.882353, | ||
+ | obj0.userData.points.push(new PMPoint(0, 0.882353, 0.470588)); | ||
+ | obj0.userData.points.push(new PMPoint(0.948683, | ||
+ | obj0.userData.points.push(new PMPoint(0.316228, | ||
+ | obj0.userData.points.push(new PMPoint(1, 0, 0)); | ||
+ | obj0.userData.points.push(new PMPoint(0, 1, 0)); | ||
+ | |||
+ | obj0.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj0.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj0.userData.pointlabels = [" ", " | ||
+ | obj0.userData.edgeindices = [1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0, 8, 0, 9, 0, 10, 0, 11, 0, 12, 0, 13, 0, 14, 0]; | ||
+ | < | ||
+ | obj0.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | init_object(obj0); | ||
+ | scene.add(obj0); | ||
+ | |||
+ | var obj1 = new THREE.Object3D(); | ||
+ | obj1.name = " | ||
+ | obj1.userData.explodable = 1; | ||
+ | obj1.userData.points = []; | ||
+ | obj1.userData.points.push(new PMPoint(0, 0.529999, 0.847998)); | ||
+ | obj1.userData.points.push(new PMPoint(0.451039, | ||
+ | obj1.userData.points.push(new PMPoint(0.529999, | ||
+ | obj1.userData.points.push(new PMPoint(0.751731, | ||
+ | obj1.userData.points.push(new PMPoint(0, 0, 0)); | ||
+ | |||
+ | obj1.userData.edgeindices = [0, 1, 0, 2, 1, 3, 2, 3, 0, 4, 1, 4, 2, 4, 3, 4]; | ||
+ | < | ||
+ | obj1.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj1.userData.facets = [[4, 2, 0], [3, 2, 4], [1, 3, 4], [4, 0, 1], [0, 2, 3, 1]]; | ||
+ | < | ||
+ | obj1.userData.facetmaterial = [new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj1); | ||
+ | scene.add(obj1); | ||
+ | |||
+ | var obj2 = new THREE.Object3D(); | ||
+ | obj2.name = " | ||
+ | obj2.userData.explodable = 1; | ||
+ | obj2.userData.points = []; | ||
+ | obj2.userData.points.push(new PMPoint(0.451039, | ||
+ | obj2.userData.points.push(new PMPoint(0.751731, | ||
+ | obj2.userData.points.push(new PMPoint(0.707107, | ||
+ | obj2.userData.points.push(new PMPoint(0, 0, 0)); | ||
+ | |||
+ | obj2.userData.edgeindices = [0, 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3]; | ||
+ | < | ||
+ | obj2.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj2.userData.facets = [[1, 3, 2], [0, 3, 1], [2, 3, 0], [1, 2, 0]]; | ||
+ | < | ||
+ | obj2.userData.facetmaterial = [new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj2); | ||
+ | scene.add(obj2); | ||
+ | |||
+ | var obj3 = new THREE.Object3D(); | ||
+ | obj3.name = " | ||
+ | obj3.userData.explodable = 1; | ||
+ | obj3.userData.points = []; | ||
+ | obj3.userData.points.push(new PMPoint(0.529999, | ||
+ | obj3.userData.points.push(new PMPoint(0.751731, | ||
+ | obj3.userData.points.push(new PMPoint(0.846499, | ||
+ | obj3.userData.points.push(new PMPoint(0, 0, 0)); | ||
+ | |||
+ | obj3.userData.edgeindices = [0, 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3]; | ||
+ | < | ||
+ | obj3.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj3.userData.facets = [[1, 3, 0], [2, 3, 1], [0, 3, 2], [1, 0, 2]]; | ||
+ | < | ||
+ | obj3.userData.facetmaterial = [new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj3); | ||
+ | scene.add(obj3); | ||
+ | |||
+ | var obj4 = new THREE.Object3D(); | ||
+ | obj4.name = " | ||
+ | obj4.userData.explodable = 1; | ||
+ | obj4.userData.points = []; | ||
+ | obj4.userData.points.push(new PMPoint(0, 0.529999, 0.847998)); | ||
+ | obj4.userData.points.push(new PMPoint(0.529999, | ||
+ | obj4.userData.points.push(new PMPoint(0, 0, 1)); | ||
+ | obj4.userData.points.push(new PMPoint(0, 0, 0)); | ||
+ | |||
+ | obj4.userData.edgeindices = [0, 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3]; | ||
+ | < | ||
+ | obj4.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj4.userData.facets = [[3, 0, 1], [2, 0, 3], [3, 1, 2], [1, 0, 2]]; | ||
+ | < | ||
+ | obj4.userData.facetmaterial = [new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj4); | ||
+ | scene.add(obj4); | ||
+ | |||
+ | var obj5 = new THREE.Object3D(); | ||
+ | obj5.name = " | ||
+ | obj5.userData.explodable = 1; | ||
+ | obj5.userData.points = []; | ||
+ | obj5.userData.points.push(new PMPoint(0, 0.529999, 0.847998)); | ||
+ | obj5.userData.points.push(new PMPoint(0.451039, | ||
+ | obj5.userData.points.push(new PMPoint(0.282166, | ||
+ | obj5.userData.points.push(new PMPoint(0, 0, 0)); | ||
+ | |||
+ | obj5.userData.edgeindices = [0, 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3]; | ||
+ | < | ||
+ | obj5.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj5.userData.facets = [[1, 3, 2], [0, 3, 1], [2, 3, 0], [1, 2, 0]]; | ||
+ | < | ||
+ | obj5.userData.facetmaterial = [new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj5); | ||
+ | scene.add(obj5); | ||
+ | |||
+ | var obj6 = new THREE.Object3D(); | ||
+ | obj6.name = " | ||
+ | obj6.userData.explodable = 1; | ||
+ | obj6.userData.points = []; | ||
+ | obj6.userData.points.push(new PMPoint(0.751731, | ||
+ | obj6.userData.points.push(new PMPoint(0.707107, | ||
+ | obj6.userData.points.push(new PMPoint(0.846499, | ||
+ | obj6.userData.points.push(new PMPoint(0, 0, 0)); | ||
+ | |||
+ | obj6.userData.edgeindices = [0, 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3]; | ||
+ | < | ||
+ | obj6.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj6.userData.facets = [[3, 0, 1], [2, 0, 3], [3, 1, 2], [1, 0, 2]]; | ||
+ | < | ||
+ | obj6.userData.facetmaterial = [new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj6); | ||
+ | scene.add(obj6); | ||
+ | |||
+ | var obj7 = new THREE.Object3D(); | ||
+ | obj7.name = " | ||
+ | obj7.userData.explodable = 1; | ||
+ | obj7.userData.points = []; | ||
+ | obj7.userData.points.push(new PMPoint(0.451039, | ||
+ | obj7.userData.points.push(new PMPoint(0.707107, | ||
+ | obj7.userData.points.push(new PMPoint(0.282166, | ||
+ | obj7.userData.points.push(new PMPoint(0, 0, 0)); | ||
+ | |||
+ | obj7.userData.edgeindices = [0, 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3]; | ||
+ | < | ||
+ | obj7.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj7.userData.facets = [[3, 0, 2], [1, 0, 3], [3, 2, 1], [2, 0, 1]]; | ||
+ | < | ||
+ | obj7.userData.facetmaterial = [new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj7); | ||
+ | scene.add(obj7); | ||
+ | |||
+ | var obj8 = new THREE.Object3D(); | ||
+ | obj8.name = " | ||
+ | obj8.userData.explodable = 1; | ||
+ | obj8.userData.points = []; | ||
+ | obj8.userData.points.push(new PMPoint(0.529999, | ||
+ | obj8.userData.points.push(new PMPoint(0.846499, | ||
+ | obj8.userData.points.push(new PMPoint(0.882353, | ||
+ | obj8.userData.points.push(new PMPoint(0, 0, 0)); | ||
+ | |||
+ | obj8.userData.edgeindices = [0, 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3]; | ||
+ | < | ||
+ | obj8.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj8.userData.facets = [[3, 0, 1], [2, 0, 3], [3, 1, 2], [1, 0, 2]]; | ||
+ | < | ||
+ | obj8.userData.facetmaterial = [new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj8); | ||
+ | scene.add(obj8); | ||
+ | |||
+ | var obj9 = new THREE.Object3D(); | ||
+ | obj9.name = " | ||
+ | obj9.userData.explodable = 1; | ||
+ | obj9.userData.points = []; | ||
+ | obj9.userData.points.push(new PMPoint(0, 0.529999, 0.847998)); | ||
+ | obj9.userData.points.push(new PMPoint(0.282166, | ||
+ | obj9.userData.points.push(new PMPoint(0, 0.882353, 0.470588)); | ||
+ | obj9.userData.points.push(new PMPoint(0, 0, 0)); | ||
+ | |||
+ | obj9.userData.edgeindices = [0, 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3]; | ||
+ | < | ||
+ | obj9.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj9.userData.facets = [[3, 0, 2], [1, 0, 3], [3, 2, 1], [2, 0, 1]]; | ||
+ | < | ||
+ | obj9.userData.facetmaterial = [new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj9); | ||
+ | scene.add(obj9); | ||
+ | |||
+ | var obj10 = new THREE.Object3D(); | ||
+ | obj10.name = " | ||
+ | obj10.userData.explodable = 1; | ||
+ | obj10.userData.points = []; | ||
+ | obj10.userData.points.push(new PMPoint(0.707107, | ||
+ | obj10.userData.points.push(new PMPoint(0.846499, | ||
+ | obj10.userData.points.push(new PMPoint(0.948683, | ||
+ | obj10.userData.points.push(new PMPoint(0, 0, 0)); | ||
+ | |||
+ | obj10.userData.edgeindices = [0, 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3]; | ||
+ | < | ||
+ | obj10.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj10.userData.facets = [[3, 1, 0], [2, 1, 3], [3, 0, 2], [0, 1, 2]]; | ||
+ | < | ||
+ | obj10.userData.facetmaterial = [new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj10); | ||
+ | scene.add(obj10); | ||
+ | |||
+ | var obj11 = new THREE.Object3D(); | ||
+ | obj11.name = " | ||
+ | obj11.userData.explodable = 1; | ||
+ | obj11.userData.points = []; | ||
+ | obj11.userData.points.push(new PMPoint(0.707107, | ||
+ | obj11.userData.points.push(new PMPoint(0.282166, | ||
+ | obj11.userData.points.push(new PMPoint(0.316228, | ||
+ | obj11.userData.points.push(new PMPoint(0, 0, 0)); | ||
+ | |||
+ | obj11.userData.edgeindices = [0, 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3]; | ||
+ | < | ||
+ | obj11.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj11.userData.facets = [[3, 0, 1], [2, 0, 3], [3, 1, 2], [1, 0, 2]]; | ||
+ | < | ||
+ | obj11.userData.facetmaterial = [new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj11); | ||
+ | scene.add(obj11); | ||
+ | |||
+ | var obj12 = new THREE.Object3D(); | ||
+ | obj12.name = " | ||
+ | obj12.userData.explodable = 1; | ||
+ | obj12.userData.points = []; | ||
+ | obj12.userData.points.push(new PMPoint(0.846499, | ||
+ | obj12.userData.points.push(new PMPoint(0.882353, | ||
+ | obj12.userData.points.push(new PMPoint(0.948683, | ||
+ | obj12.userData.points.push(new PMPoint(1, 0, 0)); | ||
+ | obj12.userData.points.push(new PMPoint(0, 0, 0)); | ||
+ | |||
+ | obj12.userData.edgeindices = [0, 1, 0, 2, 1, 3, 2, 3, 0, 4, 1, 4, 2, 4, 3, 4]; | ||
+ | < | ||
+ | obj12.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj12.userData.facets = [[1, 4, 3], [1, 0, 4], [2, 4, 0], [3, 4, 2], [1, 3, 2, 0]]; | ||
+ | < | ||
+ | obj12.userData.facetmaterial = [new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj12); | ||
+ | scene.add(obj12); | ||
+ | |||
+ | var obj13 = new THREE.Object3D(); | ||
+ | obj13.name = " | ||
+ | obj13.userData.explodable = 1; | ||
+ | obj13.userData.points = []; | ||
+ | obj13.userData.points.push(new PMPoint(0.282166, | ||
+ | obj13.userData.points.push(new PMPoint(0, 0.882353, 0.470588)); | ||
+ | obj13.userData.points.push(new PMPoint(0.316228, | ||
+ | obj13.userData.points.push(new PMPoint(0, 1, 0)); | ||
+ | obj13.userData.points.push(new PMPoint(0, 0, 0)); | ||
+ | |||
+ | obj13.userData.edgeindices = [0, 1, 0, 2, 1, 3, 2, 3, 0, 4, 1, 4, 2, 4, 3, 4]; | ||
+ | < | ||
+ | obj13.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj13.userData.facets = [[4, 1, 3], [0, 1, 4], [4, 3, 2], [2, 0, 4], [3, 1, 0, 2]]; | ||
+ | < | ||
+ | obj13.userData.facetmaterial = [new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj13); | ||
+ | scene.add(obj13); | ||
+ | |||
+ | // COMMON_CODE_BLOCK_BEGIN | ||
+ | function textSpriteMaterial(message, | ||
+ | if ( parameters === undefined ) parameters = {}; | ||
+ | var fontface = " | ||
+ | var fontsize = parameters.hasOwnProperty(" | ||
+ | fontsize = fontsize*10; | ||
+ | var lines = message.split(' | ||
+ | var size = 512; | ||
+ | for(var i = 0; i< | ||
+ | var tmp = lines[i].length; | ||
+ | while(tmp*fontsize > size){ | ||
+ | | ||
+ | } | ||
+ | } | ||
+ | | ||
+ | var canvas = document.createElement(' | ||
+ | canvas.width = size; | ||
+ | canvas.height = size; | ||
+ | var context = canvas.getContext(' | ||
+ | context.fillStyle = " | ||
+ | context.fill(); | ||
+ | context.font = fontsize + "px " + fontface; | ||
+ | | ||
+ | // text color | ||
+ | context.fillStyle = " | ||
+ | | ||
+ | context.fillText(lines[i], | ||
+ | } | ||
+ | | ||
+ | // canvas contents will be used for a texture | ||
+ | var texture = new THREE.Texture(canvas); | ||
+ | texture.needsUpdate = true; | ||
+ | | ||
+ | var spriteMaterial = new THREE.SpriteMaterial({map: | ||
+ | return spriteMaterial; | ||
+ | } | ||
+ | |||
+ | |||
+ | // ---------------------- INITIALIZING OBJECTS-------------------------------------- | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | |||
+ | function init_object(obj) { | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_points(obj); | ||
+ | modelContains.points = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_pointlabels(obj); | ||
+ | modelContains.pointlabels = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_lines(obj); | ||
+ | modelContains.lines = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_edgelabels(obj); | ||
+ | modelContains.edgelabels = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_arrowheads(obj); | ||
+ | modelContains.arrowheads = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_faces(obj); | ||
+ | modelContains.faces = true; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function init_points(obj) { | ||
+ | var pointgroup = new THREE.Group(); | ||
+ | pointgroup.name = " | ||
+ | var points = obj.userData.points; | ||
+ | var radii = obj.userData.pointradii; | ||
+ | var materials = obj.userData.pointmaterial; | ||
+ | var geometry, | ||
+ | if (!Array.isArray(radii)) { | ||
+ | geometry = new THREE.SphereBufferGeometry(radii); | ||
+ | } | ||
+ | if (!Array.isArray(materials)) { | ||
+ | material = materials; | ||
+ | } | ||
+ | for (var i=0; i< | ||
+ | var point = points[i]; | ||
+ | if (Array.isArray(radii)) { | ||
+ | if (radii[i] == 0) { | ||
+ | continue; | ||
+ | } | ||
+ | geometry = new THREE.SphereBufferGeometry(radii[i]); | ||
+ | } | ||
+ | if (Array.isArray(materials)) { | ||
+ | material = materials[i]; | ||
+ | } | ||
+ | var sphere = new THREE.Mesh(geometry, | ||
+ | point.addSphere(sphere); | ||
+ | pointgroup.add(sphere); | ||
+ | } | ||
+ | obj.add(pointgroup); | ||
+ | } | ||
+ | |||
+ | function init_pointlabels(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var labels = obj.userData.pointlabels; | ||
+ | var pointlabels = new THREE.Group(); | ||
+ | pointlabels.name = " | ||
+ | if (Array.isArray(labels)) { | ||
+ | for (var i=0; i< | ||
+ | var point = points[i]; | ||
+ | var spriteMaterial = textSpriteMaterial( labels[i] ); | ||
+ | var sprite = new THREE.Sprite(spriteMaterial); | ||
+ | point.addLabel(sprite); | ||
+ | pointlabels.add(sprite); | ||
+ | } | ||
+ | } else { | ||
+ | var spriteMaterial = textSpriteMaterial( labels ); | ||
+ | for (var i=0; i< | ||
+ | var point = points[i]; | ||
+ | var sprite = new THREE.Sprite(spriteMaterial); | ||
+ | point.addLabel(sprite); | ||
+ | pointlabels.add(sprite); | ||
+ | } | ||
+ | } | ||
+ | obj.add(pointlabels); | ||
+ | } | ||
+ | |||
+ | function init_lines(obj) { | ||
+ | var edgeindices = obj.userData.edgeindices; | ||
+ | var points = obj.userData.points; | ||
+ | var materials = obj.userData.edgematerial; | ||
+ | var geometry = new THREE.BufferGeometry(); | ||
+ | var bufarr = new Float32Array( obj.userData.edgeindices.length * 3 ); | ||
+ | var bufattr = new THREE.Float32BufferAttribute( bufarr, 3 ); | ||
+ | var geometry = new THREE.BufferGeometry(); | ||
+ | geometry.setAttribute(' | ||
+ | if (Array.isArray(materials)) { | ||
+ | for (var i=0; i< | ||
+ | geometry.addGroup(2*i, | ||
+ | } | ||
+ | } | ||
+ | var lines = new THREE.LineSegments(geometry, | ||
+ | lines.name = " | ||
+ | obj.add(lines); | ||
+ | updateEdgesPosition(obj); | ||
+ | } | ||
+ | |||
+ | function init_edgelabels(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var edgeindices = obj.userData.edgeindices; | ||
+ | var labels = obj.userData.edgelabels; | ||
+ | var edgelabels = new THREE.Group(); | ||
+ | edgelabels.name = " | ||
+ | if (Array.isArray(labels)) { | ||
+ | for (var i=0; i< | ||
+ | var spriteMaterial = textSpriteMaterial( labels[i] ); | ||
+ | var sprite = new THREE.Sprite(spriteMaterial); | ||
+ | sprite.position.copy(new THREE.Vector3().addVectors(points[edgeindices[2*i]].vector, | ||
+ | edgelabels.add(sprite); | ||
+ | } | ||
+ | } else { | ||
+ | var spriteMaterial = textSpriteMaterial( labels ); | ||
+ | for (var i=0; i< | ||
+ | var sprite = new THREE.Sprite(spriteMaterial); | ||
+ | sprite.position.copy(new THREE.Vector3().addVectors(points[edgeindices[2*i]].vector, | ||
+ | edgelabels.add(sprite); | ||
+ | } | ||
+ | } | ||
+ | obj.add(edgelabels); | ||
+ | } | ||
+ | |||
+ | function init_arrowheads(obj) { | ||
+ | var arrowheads = new THREE.Group(); | ||
+ | arrowheads.name = " | ||
+ | var arrowstyle = obj.userData.arrowstyle; | ||
+ | var edgeindices = obj.userData.edgeindices; | ||
+ | var edgematerials = obj.userData.edgematerial; | ||
+ | var points = obj.userData.points; | ||
+ | var material; | ||
+ | if (!Array.isArray(edgematerials)) { | ||
+ | material = new THREE.MeshBasicMaterial( {color: edgematerials.color} ); | ||
+ | } | ||
+ | |||
+ | for (var i=0; i< | ||
+ | var start = points[edgeindices[i]]; | ||
+ | var end = points[edgeindices[i+1]]; | ||
+ | var dist = start.vector.distanceTo( end.vector ) - start.radius() - end.radius(); | ||
+ | if (dist <= 0) { | ||
+ | continue; | ||
+ | } | ||
+ | var dir = new THREE.Vector3().subVectors(end.vector, | ||
+ | dir.normalize(); | ||
+ | var axis = new THREE.Vector3().set(dir.z, | ||
+ | axis.normalize(); | ||
+ | var radians = Math.acos( dir.y ); | ||
+ | var radius = dist/25; | ||
+ | var height = dist/5; | ||
+ | var geometry = new THREE.ConeBufferGeometry(radius, | ||
+ | var position = new THREE.Vector3().addVectors(start.vector, | ||
+ | if (Array.isArray(edgematerials)) { | ||
+ | material = new THREE.MeshBasicMaterial( {color: edgematerials[i].color} ); | ||
+ | } | ||
+ | var cone = new THREE.Mesh( geometry, material ); | ||
+ | cone.quaternion.setFromAxisAngle(axis, | ||
+ | cone.position.copy(position);; | ||
+ | arrowheads.add(cone); | ||
+ | } | ||
+ | obj.add(arrowheads); | ||
+ | } | ||
+ | |||
+ | function init_faces(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var facets = obj.userData.facets; | ||
+ | obj.userData.triangleindices = []; | ||
+ | for (var i=0; i< | ||
+ | facet = facets[i]; | ||
+ | for (var t=0; t< | ||
+ | obj.userData.triangleindices.push(facet[0], | ||
+ | } | ||
+ | } | ||
+ | var bufarr = new Float32Array( obj.userData.triangleindices.length * 3 ); | ||
+ | var bufattr = new THREE.Float32BufferAttribute(bufarr, | ||
+ | | ||
+ | var materials = obj.userData.facetmaterial; | ||
+ | var geometry = new THREE.BufferGeometry(); | ||
+ | var frontmaterials = []; | ||
+ | var backmaterials = []; | ||
+ | geometry.setAttribute(' | ||
+ | if (Array.isArray(materials)) { | ||
+ | var tricount = 0; | ||
+ | var facet; | ||
+ | for (var i=0; i< | ||
+ | facet = facets[i]; | ||
+ | geometry.addGroup(tricount, | ||
+ | tricount += (facet.length-2)*3; | ||
+ | } | ||
+ | for (var j=0; j< | ||
+ | var fmat = materials[j].clone() | ||
+ | fmat.side = THREE.FrontSide; | ||
+ | frontmaterials.push(fmat); | ||
+ | var bmat = materials[j].clone() | ||
+ | bmat.side = THREE.BackSide; | ||
+ | backmaterials.push(bmat); | ||
+ | obj.userData.facetmaterial = frontmaterials.concat(backmaterials); | ||
+ | } | ||
+ | } else if (materials instanceof THREE.Material) { | ||
+ | frontmaterials = materials.clone() | ||
+ | frontmaterials.side = THREE.FrontSide; | ||
+ | backmaterials = materials.clone() | ||
+ | backmaterials.side = THREE.BackSide; | ||
+ | obj.userData.facetmaterial = [frontmaterials, | ||
+ | } | ||
+ | // duplicating the object with front and back should avoid transparency issues | ||
+ | var backmesh = new THREE.Mesh(geometry, | ||
+ | // meshname is used to show/hide objects | ||
+ | backmesh.name = " | ||
+ | obj.add(backmesh); | ||
+ | var frontmesh = new THREE.Mesh(geometry, | ||
+ | frontmesh.name = " | ||
+ | obj.add(frontmesh); | ||
+ | updateFacesPosition(obj); | ||
+ | } | ||
+ | // // | ||
+ | |||
+ | |||
+ | function updateFacesPosition(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var indices = obj.userData.triangleindices; | ||
+ | var faces = obj.getObjectByName(" | ||
+ | var ba = faces.geometry.getAttribute(" | ||
+ | for (var i=0; i< | ||
+ | ba.setXYZ(i, | ||
+ | } | ||
+ | faces.geometry.attributes.position.needsUpdate = true; | ||
+ | | ||
+ | } | ||
+ | |||
+ | function updateEdgesPosition(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var indices = obj.userData.edgeindices; | ||
+ | var lines = obj.getObjectByName(" | ||
+ | var ba = lines.geometry.getAttribute(" | ||
+ | for (var i=0; i< | ||
+ | ba.setXYZ(i, | ||
+ | } | ||
+ | lines.geometry.attributes.position.needsUpdate = true; | ||
+ | } | ||
+ | |||
+ | function onWindowResize() { | ||
+ | renderer.setSize( three.clientWidth, | ||
+ | svgRenderer.setSize( three.clientWidth, | ||
+ | updateCamera(); | ||
+ | } | ||
+ | |||
+ | function updateCamera() { | ||
+ | var width = three.clientWidth; | ||
+ | var height = three.clientHeight; | ||
+ | var aspect = width / height; | ||
+ | if (camera.type == " | ||
+ | camera.left = frustumSize * aspect / - 2; | ||
+ | camera.right = frustumSize * aspect / 2; | ||
+ | camera.top = frustumSize / 2; | ||
+ | camera.bottom = - frustumSize / 2; | ||
+ | } else if (camera.type == " | ||
+ | camera.aspect = aspect; | ||
+ | } | ||
+ | camera.updateProjectionMatrix(); | ||
+ | } | ||
+ | |||
+ | function changeCamera(event) { | ||
+ | var selindex = event.currentTarget.selectedIndex; | ||
+ | camera = cameras[selindex]; | ||
+ | control = controls[selindex]; | ||
+ | control.enabled = true; | ||
+ | for (var i=0; i< | ||
+ | if (i!=selindex) { | ||
+ | controls[i].enabled = false; | ||
+ | } | ||
+ | } | ||
+ | updateCamera(); | ||
+ | } | ||
+ | |||
+ | var camtypenode = document.getElementById(' | ||
+ | camtypenode.onchange = changeCamera; | ||
+ | camtypenode.dispatchEvent(new Event(' | ||
+ | |||
+ | onWindowResize(); | ||
+ | window.addEventListener(' | ||
+ | |||
+ | |||
+ | var xRotationEnabled = false; | ||
+ | var yRotationEnabled = false; | ||
+ | var zRotationEnabled = false; | ||
+ | var rotationSpeedFactor = 1; | ||
+ | var settingsShown = false; | ||
+ | var labelsShown = true; | ||
+ | var intervals = []; | ||
+ | var timeouts = []; | ||
+ | var explodingSpeed = 0.05; | ||
+ | var explodeScale = 0.000001; | ||
+ | var XMLS = new XMLSerializer(); | ||
+ | var svgElement; | ||
+ | var renderId; | ||
+ | |||
+ | var render = function () { | ||
+ | |||
+ | renderId = requestAnimationFrame(render); | ||
+ | |||
+ | // comment in for automatic explosion | ||
+ | // | ||
+ | |||
+ | var phi = 0.02 * rotationSpeedFactor; | ||
+ | |||
+ | if (xRotationEnabled) { | ||
+ | scene.rotation.x += phi; | ||
+ | } | ||
+ | if (yRotationEnabled) { | ||
+ | scene.rotation.y += phi; | ||
+ | } | ||
+ | if (zRotationEnabled) { | ||
+ | scene.rotation.z += phi; | ||
+ | } | ||
+ | |||
+ | control.update(); | ||
+ | renderer.render(scene, | ||
+ | }; | ||
+ | |||
+ | if ( THREE.WEBGL.isWebGLAvailable() ) { | ||
+ | render(); | ||
+ | } else { | ||
+ | var warning = WEBGL.getWebGLErrorMessage(); | ||
+ | three.appendChild( warning ); | ||
+ | } | ||
+ | | ||
+ | function changeTransparency() { | ||
+ | var opacity = 1-Number(event.currentTarget.value); | ||
+ | for (var i=0; i< | ||
+ | child = scene.children[i]; | ||
+ | if ( child.userData.hasOwnProperty(" | ||
+ | if (Array.isArray(child.userData.facetmaterial)) { | ||
+ | for (var j=0; j< | ||
+ | child.userData.facetmaterial[j].opacity = opacity; | ||
+ | } | ||
+ | } else { | ||
+ | child.userData.facetmaterial.opacity = opacity; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function toggleDepthWrite(event) { | ||
+ | depthwrite = event.currentTarget.checked; | ||
+ | for (var i=0; i< | ||
+ | child = scene.children[i]; | ||
+ | if ( child.userData.hasOwnProperty(" | ||
+ | if (Array.isArray(child.userData.facetmaterial)) { | ||
+ | for (var j=0; j< | ||
+ | child.userData.facetmaterial[j].depthWrite = depthwrite; | ||
+ | } | ||
+ | } else { | ||
+ | child.userData.facetmaterial.depthWrite = depthWrite; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function changeRotationX(event){ | ||
+ | xRotationEnabled = event.currentTarget.checked; | ||
+ | } | ||
+ | |||
+ | function changeRotationY(event){ | ||
+ | yRotationEnabled = event.currentTarget.checked; | ||
+ | } | ||
+ | |||
+ | function changeRotationZ(event){ | ||
+ | zRotationEnabled = event.currentTarget.checked; | ||
+ | } | ||
+ | |||
+ | |||
+ | function changeRotationSpeedFactor(event){ | ||
+ | rotationSpeedFactor = Number(event.currentTarget.value); | ||
+ | } | ||
+ | |||
+ | function resetScene(){ | ||
+ | scene.rotation.set(0, | ||
+ | camera.position.set(0, | ||
+ | camera.up.set(0, | ||
+ | } | ||
+ | |||
+ | function showSettings(event){ | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | settingsShown = true; | ||
+ | } | ||
+ | |||
+ | function hideSettings(event){ | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | settingsShown = false; | ||
+ | } | ||
+ | |||
+ | |||
+ | |||
+ | var pos = 150* Math.PI; | ||
+ | |||
+ | function updateFactor() { | ||
+ | pos++; | ||
+ | return Math.sin(.01*pos)+1; | ||
+ | } | ||
+ | |||
+ | // ------------------------ FOLDING ------------------------------------------------ | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | // rotate point p around axis defined by points p1 and p2 by given angle | ||
+ | function rotate(p, p1, p2, angle ){ | ||
+ | angle = -angle; | ||
+ | var x = p.x, y = p.y, z = p.z, | ||
+ | a = p1.x, b = p1.y, c = p1.z, | ||
+ | u = p2.x-p1.x, v = p2.y-p1.y, w = p2.z-p1.z; | ||
+ | var result = []; | ||
+ | var L = u*u + v*v + w*w; | ||
+ | var sqrt = Math.sqrt; | ||
+ | var cos = Math.cos; | ||
+ | var sin = Math.sin; | ||
+ | |||
+ | result[0] = ((a*(v*v+w*w)-u*(b*v+c*w-u*x-v*y-w*z))*(1-cos(angle))+L*x*cos(angle)+sqrt(L)*(-c*v+b*w-w*y+v*z)*sin(angle))/ | ||
+ | result[1] = ((b*(u*u+w*w)-v*(a*u+c*w-u*x-v*y-w*z))*(1-cos(angle))+L*y*cos(angle)+sqrt(L)*(c*u-a*w+w*x-u*z)*sin(angle))/ | ||
+ | result[2] = ((c*(u*u+v*v)-w*(a*u+b*v-u*x-v*y-w*z))*(1-cos(angle))+L*z*cos(angle)+sqrt(L)*(-b*u+a*v-v*x+u*y)*sin(angle))/ | ||
+ | |||
+ | return result; | ||
+ | } | ||
+ | |||
+ | var fold = function(event){ | ||
+ | var obj = foldables[Number(event.currentTarget.name)]; | ||
+ | var foldvalue = Number(event.currentTarget.value); | ||
+ | var scale = foldvalue - obj.userData.oldscale; | ||
+ | |||
+ | for (var j=0; j< | ||
+ | rotateVertices(obj, | ||
+ | } | ||
+ | update(obj); | ||
+ | obj.userData.oldscale += scale; | ||
+ | lookAtBarycenter(obj); | ||
+ | } | ||
+ | |||
+ | function lookAtBarycenter(obj){ | ||
+ | control.target = barycenter(obj); | ||
+ | } | ||
+ | |||
+ | function barycenter(obj) { | ||
+ | var center = new THREE.Vector3(0, | ||
+ | var points = obj.userData.points; | ||
+ | for (var i=0; i< | ||
+ | center.add(points[i].vector); | ||
+ | } | ||
+ | center.divideScalar(points.length); | ||
+ | return center; | ||
+ | } | ||
+ | |||
+ | function rotateVertices(obj, | ||
+ | var axes = obj.userData.axes; | ||
+ | var subtrees = obj.userData.subtrees; | ||
+ | var points = obj.userData.points; | ||
+ | var angles = obj.userData.angles; | ||
+ | if (edge < axes.length){ | ||
+ | for (var j=0; j< | ||
+ | var rotP = rotate(points[subtrees[edge][j]].vector, | ||
+ | points[subtrees[edge][j]].set(rotP[0], | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function update(obj) { | ||
+ | | ||
+ | | ||
+ | } | ||
+ | |||
+ | if (foldables.length) { | ||
+ | var settings = document.getElementById(' | ||
+ | var foldDiv = document.createElement(' | ||
+ | foldDiv.id = ' | ||
+ | var title = document.createElement(' | ||
+ | title.innerHTML = ' | ||
+ | foldDiv.appendChild(title); | ||
+ | foldDiv.className = ' | ||
+ | for (var i=0; i< | ||
+ | var range = document.createElement(' | ||
+ | range.type = ' | ||
+ | range.min = 0; | ||
+ | range.max = 1; | ||
+ | range.value = 0; | ||
+ | range.step = 0.001; | ||
+ | range.name = String(i); | ||
+ | range.oninput = fold; | ||
+ | foldDiv.appendChild(range); | ||
+ | } | ||
+ | lookAtBarycenter(foldables[0]); | ||
+ | settings.insertBefore(foldDiv, | ||
+ | } | ||
+ | |||
+ | | ||
+ | // ---------------------- EXPLOSION ------------------------------------------------ | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | |||
+ | if (explodableModel) { | ||
+ | for (var i=0; i< | ||
+ | obj = scene.children[i]; | ||
+ | if ( obj.userData.explodable ) { | ||
+ | computeCentroid(obj); | ||
+ | } | ||
+ | } | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | explode(0.000001); | ||
+ | } | ||
+ | |||
+ | function computeCentroid(obj) { | ||
+ | centroid = new THREE.Vector3(); | ||
+ | obj.userData.points.forEach(function(pmpoint) { | ||
+ | centroid.add(pmpoint.vector); | ||
+ | }); | ||
+ | centroid.divideScalar(obj.userData.points.length); | ||
+ | obj.userData.centroid = centroid; | ||
+ | } | ||
+ | |||
+ | function explode(factor) { | ||
+ | for (var i=0; i< | ||
+ | var obj = scene.children[i]; | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | var c = obj.userData.centroid; | ||
+ | obj.position.set(c.x*factor, | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function triggerExplode(event){ | ||
+ | explodeScale = Number(event.currentTarget.value); | ||
+ | explode(explodeScale); | ||
+ | } | ||
+ | |||
+ | function setExplodingSpeed(event){ | ||
+ | explodingSpeed = Number(event.currentTarget.value); | ||
+ | } | ||
+ | |||
+ | function triggerAutomaticExplode(event){ | ||
+ | if (event.currentTarget.checked){ | ||
+ | startExploding(); | ||
+ | } else { | ||
+ | clearIntervals(); | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function startExploding(){ | ||
+ | intervals.push(setInterval(explodingInterval, | ||
+ | } | ||
+ | |||
+ | |||
+ | function explodingInterval(){ | ||
+ | explodeScale += explodingSpeed; | ||
+ | if (explodeScale <= 6){ | ||
+ | explode(explodeScale); | ||
+ | } | ||
+ | else{ | ||
+ | explode(6); | ||
+ | explodeScale = 6; | ||
+ | clearIntervals(); | ||
+ | timeouts.push(setTimeout(startUnexploding, | ||
+ | } | ||
+ | document.getElementById(' | ||
+ | } | ||
+ | |||
+ | |||
+ | function startUnexploding(){ | ||
+ | intervals.push(setInterval(unexplodingInterval, | ||
+ | } | ||
+ | |||
+ | function unexplodingInterval(){ | ||
+ | explodeScale -= explodingSpeed; | ||
+ | if (explodeScale >= 0){ | ||
+ | explode(explodeScale); | ||
+ | } | ||
+ | else { | ||
+ | explode(0); | ||
+ | explodeScale = 0; | ||
+ | clearIntervals(); | ||
+ | timeouts.push(setTimeout(startExploding, | ||
+ | } | ||
+ | document.getElementById(' | ||
+ | } | ||
+ | |||
+ | function clearIntervals(){ | ||
+ | intervals.forEach(function(interval){ | ||
+ | clearInterval(interval); | ||
+ | }); | ||
+ | intervals = []; | ||
+ | timeouts.forEach(function(timeout){ | ||
+ | clearTimeout(timeout); | ||
+ | }); | ||
+ | timeouts = []; | ||
+ | } | ||
+ | |||
+ | // ---------------------- DISPLAY -------------------------------------------------- | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | |||
+ | const objectTypeInnerHTMLs = { points: " | ||
+ | const objectTypeVisible = {}; | ||
+ | Object.assign(objectTypeVisible, | ||
+ | const sortedObjectTypeKeys = Object.keys(objectTypeInnerHTMLs).sort(); | ||
+ | const shownObjectTypesList = document.getElementById(' | ||
+ | |||
+ | function setVisibility(bool, | ||
+ | for (var i=0; i< | ||
+ | var obj = scene.children[i].getObjectByName(objname); | ||
+ | if (obj) { | ||
+ | obj.visible = bool; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function toggleObjectTypeVisibility(event){ | ||
+ | var name = event.currentTarget.name; | ||
+ | var checked = event.currentTarget.checked; | ||
+ | objectTypeVisible[name] = checked; | ||
+ | if (name == " | ||
+ | setVisibility(checked," | ||
+ | setVisibility(checked," | ||
+ | } else { | ||
+ | setVisibility(checked, | ||
+ | } | ||
+ | } | ||
+ | |||
+ | for (var i=0; i< | ||
+ | var key = sortedObjectTypeKeys[i]; | ||
+ | if (modelContains[key]) { | ||
+ | var objTypeNode = document.createElement(' | ||
+ | objTypeNode.innerHTML = objectTypeInnerHTMLs[key] + '< | ||
+ | var checkbox = document.createElement(' | ||
+ | checkbox.type = ' | ||
+ | checkbox.checked = true; | ||
+ | checkbox.name = key; | ||
+ | checkbox.onchange = toggleObjectTypeVisibility; | ||
+ | shownObjectTypesList.appendChild(checkbox); | ||
+ | shownObjectTypesList.appendChild(objTypeNode); | ||
+ | } | ||
+ | } | ||
+ | |||
+ | // ------------------------------------------------------ | ||
+ | |||
+ | function toggleObjectVisibility(event){ | ||
+ | var nr = Number(event.currentTarget.name); | ||
+ | scene.children[nr].visible = event.currentTarget.checked; | ||
+ | } | ||
+ | |||
+ | // append checkboxes for displaying or hiding objects | ||
+ | var shownObjectsList = document.getElementById(' | ||
+ | for (var i=0; i< | ||
+ | obj = scene.children[i]; | ||
+ | var objNode = document.createElement(' | ||
+ | objNode.innerHTML = obj.name + '< | ||
+ | var checkbox = document.createElement(' | ||
+ | checkbox.type = ' | ||
+ | checkbox.checked = true; | ||
+ | checkbox.name = String(i); | ||
+ | checkbox.onchange = toggleObjectVisibility; | ||
+ | shownObjectsList.appendChild(checkbox); | ||
+ | shownObjectsList.appendChild(objNode); | ||
+ | } | ||
+ | |||
+ | // ---------------------- SVG ------------------------------------------------------ | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | |||
+ | function takeSvgScreenshot() { | ||
+ | if (objectTypeVisible[" | ||
+ | setVisibility(false," | ||
+ | } | ||
+ | if (objectTypeVisible[" | ||
+ | setVisibility(false," | ||
+ | } | ||
+ | svgRenderer.render(scene, | ||
+ | svgElement = XMLS.serializeToString(svgRenderer.domElement); | ||
+ | | ||
+ | if (objectTypeVisible[" | ||
+ | setVisibility(true," | ||
+ | } | ||
+ | if (objectTypeVisible[" | ||
+ | setVisibility(true," | ||
+ | } | ||
+ | |||
+ | if (document.getElementById(' | ||
+ | //show in new tab | ||
+ | var myWindow = window.open("","" | ||
+ | myWindow.document.body.innerHTML = svgElement; | ||
+ | } else{ | ||
+ | // download svg file | ||
+ | download(" | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function download(filename, | ||
+ | var element = document.createElement(' | ||
+ | element.setAttribute(' | ||
+ | element.setAttribute(' | ||
+ | |||
+ | element.style.display = ' | ||
+ | document.body.appendChild(element); | ||
+ | |||
+ | element.click(); | ||
+ | |||
+ | document.body.removeChild(element); | ||
+ | } | ||
+ | |||
+ | |||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | |||
+ | |||
+ | // ------------------ SHORTCUTS -------------------------------------------- | ||
+ | // ------------------------------------------------------------------------- | ||
+ | |||
+ | /** | ||
+ | * http:// | ||
+ | * Version : 2.01.B | ||
+ | * By Binny V A | ||
+ | * License : BSD | ||
+ | */ | ||
+ | shortcut = { | ||
+ | ' | ||
+ | ' | ||
+ | //Provide a set of default options | ||
+ | var default_options = { | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | } | ||
+ | if(!opt) opt = default_options; | ||
+ | else { | ||
+ | for(var dfo in default_options) { | ||
+ | if(typeof opt[dfo] == ' | ||
+ | } | ||
+ | } | ||
+ | |||
+ | var ele = opt.target; | ||
+ | if(typeof opt.target == ' | ||
+ | var ths = this; | ||
+ | shortcut_combination = shortcut_combination.toLowerCase(); | ||
+ | |||
+ | //The function to be called at keypress | ||
+ | var func = function(e) { | ||
+ | e = e || window.event; | ||
+ | |||
+ | if(opt[' | ||
+ | var element; | ||
+ | if(e.target) element=e.target; | ||
+ | else if(e.srcElement) element=e.srcElement; | ||
+ | if(element.nodeType==3) element=element.parentNode; | ||
+ | |||
+ | if(element.tagName == ' | ||
+ | } | ||
+ | |||
+ | //Find Which key is pressed | ||
+ | if (e.keyCode) code = e.keyCode; | ||
+ | else if (e.which) code = e.which; | ||
+ | var character = String.fromCharCode(code).toLowerCase(); | ||
+ | |||
+ | if(code == 188) character=","; | ||
+ | if(code == 190) character=" | ||
+ | |||
+ | var keys = shortcut_combination.split(" | ||
+ | //Key Pressed - counts the number of valid keypresses - if it is same as the number of keys, the shortcut function is invoked | ||
+ | var kp = 0; | ||
+ | |||
+ | //Work around for stupid Shift key bug created by using lowercase - as a result the shift+num combination was broken | ||
+ | var shift_nums = { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | ";":":", | ||
+ | "'":" | ||
+ | ",":"<", | ||
+ | " | ||
+ | "/":"?", | ||
+ | " | ||
+ | } | ||
+ | // | ||
+ | var special_keys = { | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | } | ||
+ | |||
+ | var modifiers = { | ||
+ | shift: { wanted: | ||
+ | ctrl : { wanted: | ||
+ | alt | ||
+ | meta : { wanted: | ||
+ | }; | ||
+ | | ||
+ | if(e.ctrlKey) modifiers.ctrl.pressed = true; | ||
+ | if(e.shiftKey) modifiers.shift.pressed = true; | ||
+ | if(e.altKey) modifiers.alt.pressed = true; | ||
+ | if(e.metaKey) | ||
+ | | ||
+ | for(var i=0; k=keys[i], | ||
+ | // | ||
+ | if(k == ' | ||
+ | kp++; | ||
+ | modifiers.ctrl.wanted = true; | ||
+ | |||
+ | } else if(k == ' | ||
+ | kp++; | ||
+ | modifiers.shift.wanted = true; | ||
+ | |||
+ | } else if(k == ' | ||
+ | kp++; | ||
+ | modifiers.alt.wanted = true; | ||
+ | } else if(k == ' | ||
+ | kp++; | ||
+ | modifiers.meta.wanted = true; | ||
+ | } else if(k.length > 1) { //If it is a special key | ||
+ | if(special_keys[k] == code) kp++; | ||
+ | |||
+ | } else if(opt[' | ||
+ | if(opt[' | ||
+ | |||
+ | } else { //The special keys did not match | ||
+ | if(character == k) kp++; | ||
+ | else { | ||
+ | if(shift_nums[character] && e.shiftKey) { //Stupid Shift key bug created by using lowercase | ||
+ | character = shift_nums[character]; | ||
+ | if(character == k) kp++; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | if(kp == keys.length && | ||
+ | modifiers.ctrl.pressed == modifiers.ctrl.wanted && | ||
+ | modifiers.shift.pressed == modifiers.shift.wanted && | ||
+ | modifiers.alt.pressed == modifiers.alt.wanted && | ||
+ | modifiers.meta.pressed == modifiers.meta.wanted) { | ||
+ | callback(e); | ||
+ | |||
+ | if(!opt[' | ||
+ | // | ||
+ | e.cancelBubble = true; | ||
+ | e.returnValue = false; | ||
+ | |||
+ | // | ||
+ | if (e.stopPropagation) { | ||
+ | e.stopPropagation(); | ||
+ | e.preventDefault(); | ||
+ | } | ||
+ | return false; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | this.all_shortcuts[shortcut_combination] = { | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | }; | ||
+ | //Attach the function with the event | ||
+ | if(ele.addEventListener) ele.addEventListener(opt[' | ||
+ | else if(ele.attachEvent) ele.attachEvent(' | ||
+ | else ele[' | ||
+ | }, | ||
+ | |||
+ | //Remove the shortcut - just specify the shortcut and I will remove the binding | ||
+ | ' | ||
+ | shortcut_combination = shortcut_combination.toLowerCase(); | ||
+ | var binding = this.all_shortcuts[shortcut_combination]; | ||
+ | delete(this.all_shortcuts[shortcut_combination]) | ||
+ | if(!binding) return; | ||
+ | var type = binding[' | ||
+ | var ele = binding[' | ||
+ | var callback = binding[' | ||
+ | |||
+ | if(ele.detachEvent) ele.detachEvent(' | ||
+ | else if(ele.removeEventListener) ele.removeEventListener(type, | ||
+ | else ele[' | ||
+ | } | ||
+ | } | ||
+ | |||
+ | shortcut.add(" | ||
+ | var event = new Event(' | ||
+ | if (settingsShown){ | ||
+ | document.getElementById(' | ||
+ | } else { | ||
+ | document.getElementById(' | ||
+ | } | ||
+ | }); | ||
+ | |||
+ | |||
+ | // COMMON_CODE_BLOCK_END | ||
+ | |||
+ | });}); | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | <code perl> | ||
+ | > $s-> | ||
+ | name: s | ||
+ | type: HyperbolicSurface | ||
+ | |||
+ | DCEL | ||
+ | N_vertices: 3 | ||
+ | Halfedges list: (edgeIndex: twinIndex nextIndex prevIndex headIndex) | ||
+ | 0: 1 2 4 1 (0 ---> 1) | ||
+ | 1: 0 17 11 0 (1 ---> 0) | ||
+ | 2: 3 4 0 2 (1 ---> 2) | ||
+ | 3: 2 14 13 1 (2 ---> 1) | ||
+ | 4: 5 0 2 0 (2 ---> 0) | ||
+ | 5: 4 6 8 2 (0 ---> 2) | ||
+ | 6: 7 8 5 1 (2 ---> 1) | ||
+ | 7: 6 16 15 2 (1 ---> 2) | ||
+ | 8: 9 5 6 0 (1 ---> 0) | ||
+ | 9: 8 10 12 1 (0 ---> 1) | ||
+ | 10: 11 12 9 2 (1 ---> 2) | ||
+ | 11: 10 1 17 1 (2 ---> 1) | ||
+ | 12: 13 9 10 0 (2 ---> 0) | ||
+ | 13: 12 3 14 2 (0 ---> 2) | ||
+ | 14: 15 13 3 0 (1 ---> 0) | ||
+ | 15: 14 7 16 1 (0 ---> 1) | ||
+ | 16: 17 15 7 0 (2 ---> 0) | ||
+ | 17: 16 11 1 2 (0 ---> 2) | ||
+ | |||
+ | |||
+ | FLIP_WORDS | ||
+ | {0} | ||
+ | {} | ||
+ | {0 3} | ||
+ | {0 4 7} | ||
+ | {0 6} | ||
+ | {3} | ||
+ | {6} | ||
+ | {0 3 1 5} | ||
+ | {0 6 2 8} | ||
+ | {3 1 5} | ||
+ | {6 2 8} | ||
+ | {0 3 1 5 0 1} | ||
+ | {0 6 2 8 0 2} | ||
+ | |||
+ | |||
+ | PENNER_COORDINATES | ||
+ | 2 1 1 1 1 1 1 1 1 | ||
+ | |||
+ | SECONDARY_FAN | ||
+ | type: PolyhedralFan< | ||
+ | |||
+ | SPECIAL_POINT | ||
+ | 1 0 | ||
+ | > $p = secondary_polyhedron($s, | ||
+ | > $p-> | ||
+ | </ | ||
+ | < | ||
+ | <!-- | ||
+ | polymake for knusper | ||
+ | Thu Mar 3 00:31:41 2022 | ||
+ | p_bounded | ||
+ | --> | ||
+ | |||
+ | |||
+ | < | ||
+ | < | ||
+ | <meta charset=utf-8> | ||
+ | < | ||
+ | < | ||
+ | /* | ||
+ | // COMMON_CODE_BLOCK_BEGIN | ||
+ | */ | ||
+ | html {overflow: scroll;} | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | # | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | } | ||
+ | /* | ||
+ | // COMMON_CODE_BLOCK_END | ||
+ | */ | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | <div id=' | ||
+ | <div class=group id=' | ||
+ | < | ||
+ | < | ||
+ | <div class=indented>< | ||
+ | </ | ||
+ | |||
+ | <div class=group id=' | ||
+ | < | ||
+ | <div class=indented> | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | <div class=suboption> | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | |||
+ | <div class=group id=' | ||
+ | < | ||
+ | <div class=indented> | ||
+ | < | ||
+ | </ | ||
+ | <div class=suboption> | ||
+ | <div class=indented> | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | < | ||
+ | <div class=indented> | ||
+ | < | ||
+ | <select id=" | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | <div class=group id=' | ||
+ | < | ||
+ | <div class=indented> | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | </ | ||
+ | <img id=' | ||
+ | <img id=' | ||
+ | <div id=" | ||
+ | </ | ||
+ | < | ||
+ | requirejs.config({ | ||
+ | paths: { | ||
+ | three: '/ | ||
+ | TrackballControls: | ||
+ | OrbitControls: | ||
+ | Projector: '/ | ||
+ | SVGRenderer: | ||
+ | WEBGL: '/ | ||
+ | }, | ||
+ | shim: { | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | } | ||
+ | }); | ||
+ | | ||
+ | require([' | ||
+ | window.THREE = THREE; | ||
+ | require([' | ||
+ | | ||
+ | THREE.TrackballControls = TrackballControls; | ||
+ | THREE.OrbitControls = OrbitControls; | ||
+ | THREE.Projector = Projector; | ||
+ | THREE.SVGRenderer = SVGRenderer; | ||
+ | THREE.WEBGL = WEBGL; | ||
+ | |||
+ | // COMMON_CODE_BLOCK_BEGIN | ||
+ | |||
+ | const intervalLength = 25; // for automatic animations | ||
+ | const explodableModel = false; | ||
+ | const modelContains = { points: false, pointlabels: | ||
+ | const foldables = []; | ||
+ | |||
+ | var three = document.getElementById(" | ||
+ | var scene = new THREE.Scene(); | ||
+ | var renderer = new THREE.WebGLRenderer( { antialias: true } ); | ||
+ | var svgRenderer = new THREE.SVGRenderer( { antialias: true } ); | ||
+ | renderer.setPixelRatio( window.devicePixelRatio ); | ||
+ | renderer.setClearColor(0xFFFFFF, | ||
+ | svgRenderer.setClearColor(0xFFFFFF, | ||
+ | three.appendChild(renderer.domElement); | ||
+ | |||
+ | var frustumSize = 4; | ||
+ | var cameras = [new THREE.PerspectiveCamera(75, | ||
+ | cameras.forEach(function(cam) { | ||
+ | cam.position.set(0, | ||
+ | cam.lookAt(0, | ||
+ | cam.up.set(0, | ||
+ | }); | ||
+ | var controls = [new THREE.TrackballControls(cameras[0], | ||
+ | var camera, control; | ||
+ | |||
+ | controls[0].zoomSpeed = 0.2; | ||
+ | controls[0].rotateSpeed = 4; | ||
+ | |||
+ | |||
+ | // class to allow move points together with labels and spheres | ||
+ | var PMPoint = function (x,y,z) { | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | PMPoint.prototype.addLabel = function(labelsprite) { | ||
+ | | ||
+ | | ||
+ | } | ||
+ | PMPoint.prototype.addSphere = function(spheremesh) { | ||
+ | | ||
+ | | ||
+ | } | ||
+ | PMPoint.prototype.set = function(x, | ||
+ | | ||
+ | if (this.sprite) { | ||
+ | this.sprite.position.copy(this.vector); | ||
+ | } | ||
+ | if (this.sphere) { | ||
+ | this.sphere.position.copy(this.vector); | ||
+ | } | ||
+ | } | ||
+ | PMPoint.prototype.radius = function() { | ||
+ | if (this.sphere) { | ||
+ | return this.sphere.geometry.parameters.radius; | ||
+ | } else { | ||
+ | return 0; | ||
+ | } | ||
+ | }; | ||
+ | // select the target node | ||
+ | var target = document.querySelector('# | ||
+ | |||
+ | // create an observer instance | ||
+ | var observer = new MutationObserver(function(mutations) { | ||
+ | | ||
+ | if (mutation.removedNodes && mutation.removedNodes.length > 0) { | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | }); | ||
+ | }); | ||
+ | |||
+ | // configuration of the observer: | ||
+ | var config = { childList: true, characterData: | ||
+ | |||
+ | // pass in the target node, as well as the observer options | ||
+ | while (target) { | ||
+ | if (target.className==" | ||
+ | observer.observe(target, | ||
+ | break; | ||
+ | } | ||
+ | | ||
+ | } | ||
+ | |||
+ | // COMMON_CODE_BLOCK_END | ||
+ | |||
+ | var obj0 = new THREE.Object3D(); | ||
+ | obj0.name = " | ||
+ | obj0.userData.explodable = 1; | ||
+ | obj0.userData.points = []; | ||
+ | obj0.userData.points.push(new PMPoint(0.562776, | ||
+ | obj0.userData.points.push(new PMPoint(0.562802, | ||
+ | obj0.userData.points.push(new PMPoint(0.677206, | ||
+ | obj0.userData.points.push(new PMPoint(0.677206, | ||
+ | obj0.userData.points.push(new PMPoint(0.553167, | ||
+ | obj0.userData.points.push(new PMPoint(0.448757, | ||
+ | obj0.userData.points.push(new PMPoint(0.507199, | ||
+ | obj0.userData.points.push(new PMPoint(0.506217, | ||
+ | obj0.userData.points.push(new PMPoint(0.448813, | ||
+ | obj0.userData.points.push(new PMPoint(0.61824, | ||
+ | obj0.userData.points.push(new PMPoint(0.569479, | ||
+ | obj0.userData.points.push(new PMPoint(-0.468309, | ||
+ | obj0.userData.points.push(new PMPoint(-0.468309, | ||
+ | obj0.userData.points.push(new PMPoint(0.499967, | ||
+ | obj0.userData.points.push(new PMPoint(0.156563, | ||
+ | obj0.userData.points.push(new PMPoint(-0.468309, | ||
+ | obj0.userData.points.push(new PMPoint(-0.468309, | ||
+ | obj0.userData.points.push(new PMPoint(0.415509, | ||
+ | obj0.userData.points.push(new PMPoint(0.415143, | ||
+ | obj0.userData.points.push(new PMPoint(0.562545, | ||
+ | obj0.userData.points.push(new PMPoint(0.677206, | ||
+ | obj0.userData.points.push(new PMPoint(0.156563, | ||
+ | obj0.userData.points.push(new PMPoint(0.156563, | ||
+ | obj0.userData.points.push(new PMPoint(-0.468309, | ||
+ | obj0.userData.points.push(new PMPoint(-0.468309, | ||
+ | obj0.userData.points.push(new PMPoint(0.15657, | ||
+ | obj0.userData.points.push(new PMPoint(0.666751, | ||
+ | obj0.userData.points.push(new PMPoint(0.677206, | ||
+ | obj0.userData.points.push(new PMPoint(0.666638, | ||
+ | obj0.userData.points.push(new PMPoint(0.677206, | ||
+ | |||
+ | obj0.userData.pointradii = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; | ||
+ | < | ||
+ | obj0.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj0.userData.pointlabels = [" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "]; | ||
+ | obj0.userData.edgeindices = [0, 1, 1, 2, 0, 3, 2, 3, 0, 4, 1, 5, 4, 6, 6, 7, 5, 8, 7, 8, 4, 9, 6, 10, 9, 10, 5, 11, 8, 12, 11, 12, 7, 13, 14, 15, 11, 16, 15, 16, 14, 18, 17, 18, 10, 19, 13, 19, 17, 19, 2, 20, 16, 20, 14, 21, 13, 22, 15, 23, 21, 23, 12, 24, 22, 24, 23, 24, 17, 25, 21, 25, 22, 25, 18, 26, 20, 27, 26, 27, 9, 28, 26, 28, 3, 29, 27, 29, 28, 29]; | ||
+ | < | ||
+ | obj0.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj0.userData.facets = [[7, 13, 22, 24, 12, 8], [19, 13, 7, 6, 10], [7, 8, 5, 1, 0, 4, 6], [6, 4, 9, 10], [17, 19, 10, 9, 28, 26, 18], [4, 0, 3, 29, 28, 9], [8, 12, 11, 5], [22, 13, 19, 17, 25], [0, 1, 2, 3], [24, 22, 25, 21, 23], [26, 28, 29, 27], [25, 17, 18, 14, 21], [20, 27, 29, 3, 2], [23, 21, 14, 15], [12, 24, 23, 15, 16, 11], [11, 16, 20, 2, 1, 5], [16, 15, 14, 18, 26, 27, 20]]; | ||
+ | < | ||
+ | obj0.userData.facetmaterial = [new THREE.MeshBasicMaterial( { color: 0xFFB450, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFFB450, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFFB450, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFFB450, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFFB450, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFFB450, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFFB450, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFFB450, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFFB450, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFFB450, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFFB450, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFFB450, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFFB450, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFFB450, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj0); | ||
+ | scene.add(obj0); | ||
+ | |||
+ | // COMMON_CODE_BLOCK_BEGIN | ||
+ | function textSpriteMaterial(message, | ||
+ | if ( parameters === undefined ) parameters = {}; | ||
+ | var fontface = " | ||
+ | var fontsize = parameters.hasOwnProperty(" | ||
+ | fontsize = fontsize*10; | ||
+ | var lines = message.split(' | ||
+ | var size = 512; | ||
+ | for(var i = 0; i< | ||
+ | var tmp = lines[i].length; | ||
+ | while(tmp*fontsize > size){ | ||
+ | | ||
+ | } | ||
+ | } | ||
+ | | ||
+ | var canvas = document.createElement(' | ||
+ | canvas.width = size; | ||
+ | canvas.height = size; | ||
+ | var context = canvas.getContext(' | ||
+ | context.fillStyle = " | ||
+ | context.fill(); | ||
+ | context.font = fontsize + "px " + fontface; | ||
+ | | ||
+ | // text color | ||
+ | context.fillStyle = " | ||
+ | | ||
+ | context.fillText(lines[i], | ||
+ | } | ||
+ | | ||
+ | // canvas contents will be used for a texture | ||
+ | var texture = new THREE.Texture(canvas); | ||
+ | texture.needsUpdate = true; | ||
+ | | ||
+ | var spriteMaterial = new THREE.SpriteMaterial({map: | ||
+ | return spriteMaterial; | ||
+ | } | ||
+ | |||
+ | |||
+ | // ---------------------- INITIALIZING OBJECTS-------------------------------------- | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | |||
+ | function init_object(obj) { | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_points(obj); | ||
+ | modelContains.points = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_pointlabels(obj); | ||
+ | modelContains.pointlabels = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_lines(obj); | ||
+ | modelContains.lines = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_edgelabels(obj); | ||
+ | modelContains.edgelabels = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_arrowheads(obj); | ||
+ | modelContains.arrowheads = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_faces(obj); | ||
+ | modelContains.faces = true; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function init_points(obj) { | ||
+ | var pointgroup = new THREE.Group(); | ||
+ | pointgroup.name = " | ||
+ | var points = obj.userData.points; | ||
+ | var radii = obj.userData.pointradii; | ||
+ | var materials = obj.userData.pointmaterial; | ||
+ | var geometry, | ||
+ | if (!Array.isArray(radii)) { | ||
+ | geometry = new THREE.SphereBufferGeometry(radii); | ||
+ | } | ||
+ | if (!Array.isArray(materials)) { | ||
+ | material = materials; | ||
+ | } | ||
+ | for (var i=0; i< | ||
+ | var point = points[i]; | ||
+ | if (Array.isArray(radii)) { | ||
+ | if (radii[i] == 0) { | ||
+ | continue; | ||
+ | } | ||
+ | geometry = new THREE.SphereBufferGeometry(radii[i]); | ||
+ | } | ||
+ | if (Array.isArray(materials)) { | ||
+ | material = materials[i]; | ||
+ | } | ||
+ | var sphere = new THREE.Mesh(geometry, | ||
+ | point.addSphere(sphere); | ||
+ | pointgroup.add(sphere); | ||
+ | } | ||
+ | obj.add(pointgroup); | ||
+ | } | ||
+ | |||
+ | function init_pointlabels(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var labels = obj.userData.pointlabels; | ||
+ | var pointlabels = new THREE.Group(); | ||
+ | pointlabels.name = " | ||
+ | if (Array.isArray(labels)) { | ||
+ | for (var i=0; i< | ||
+ | var point = points[i]; | ||
+ | var spriteMaterial = textSpriteMaterial( labels[i] ); | ||
+ | var sprite = new THREE.Sprite(spriteMaterial); | ||
+ | point.addLabel(sprite); | ||
+ | pointlabels.add(sprite); | ||
+ | } | ||
+ | } else { | ||
+ | var spriteMaterial = textSpriteMaterial( labels ); | ||
+ | for (var i=0; i< | ||
+ | var point = points[i]; | ||
+ | var sprite = new THREE.Sprite(spriteMaterial); | ||
+ | point.addLabel(sprite); | ||
+ | pointlabels.add(sprite); | ||
+ | } | ||
+ | } | ||
+ | obj.add(pointlabels); | ||
+ | } | ||
+ | |||
+ | function init_lines(obj) { | ||
+ | var edgeindices = obj.userData.edgeindices; | ||
+ | var points = obj.userData.points; | ||
+ | var materials = obj.userData.edgematerial; | ||
+ | var geometry = new THREE.BufferGeometry(); | ||
+ | var bufarr = new Float32Array( obj.userData.edgeindices.length * 3 ); | ||
+ | var bufattr = new THREE.Float32BufferAttribute( bufarr, 3 ); | ||
+ | var geometry = new THREE.BufferGeometry(); | ||
+ | geometry.setAttribute(' | ||
+ | if (Array.isArray(materials)) { | ||
+ | for (var i=0; i< | ||
+ | geometry.addGroup(2*i, | ||
+ | } | ||
+ | } | ||
+ | var lines = new THREE.LineSegments(geometry, | ||
+ | lines.name = " | ||
+ | obj.add(lines); | ||
+ | updateEdgesPosition(obj); | ||
+ | } | ||
+ | |||
+ | function init_edgelabels(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var edgeindices = obj.userData.edgeindices; | ||
+ | var labels = obj.userData.edgelabels; | ||
+ | var edgelabels = new THREE.Group(); | ||
+ | edgelabels.name = " | ||
+ | if (Array.isArray(labels)) { | ||
+ | for (var i=0; i< | ||
+ | var spriteMaterial = textSpriteMaterial( labels[i] ); | ||
+ | var sprite = new THREE.Sprite(spriteMaterial); | ||
+ | sprite.position.copy(new THREE.Vector3().addVectors(points[edgeindices[2*i]].vector, | ||
+ | edgelabels.add(sprite); | ||
+ | } | ||
+ | } else { | ||
+ | var spriteMaterial = textSpriteMaterial( labels ); | ||
+ | for (var i=0; i< | ||
+ | var sprite = new THREE.Sprite(spriteMaterial); | ||
+ | sprite.position.copy(new THREE.Vector3().addVectors(points[edgeindices[2*i]].vector, | ||
+ | edgelabels.add(sprite); | ||
+ | } | ||
+ | } | ||
+ | obj.add(edgelabels); | ||
+ | } | ||
+ | |||
+ | function init_arrowheads(obj) { | ||
+ | var arrowheads = new THREE.Group(); | ||
+ | arrowheads.name = " | ||
+ | var arrowstyle = obj.userData.arrowstyle; | ||
+ | var edgeindices = obj.userData.edgeindices; | ||
+ | var edgematerials = obj.userData.edgematerial; | ||
+ | var points = obj.userData.points; | ||
+ | var material; | ||
+ | if (!Array.isArray(edgematerials)) { | ||
+ | material = new THREE.MeshBasicMaterial( {color: edgematerials.color} ); | ||
+ | } | ||
+ | |||
+ | for (var i=0; i< | ||
+ | var start = points[edgeindices[i]]; | ||
+ | var end = points[edgeindices[i+1]]; | ||
+ | var dist = start.vector.distanceTo( end.vector ) - start.radius() - end.radius(); | ||
+ | if (dist <= 0) { | ||
+ | continue; | ||
+ | } | ||
+ | var dir = new THREE.Vector3().subVectors(end.vector, | ||
+ | dir.normalize(); | ||
+ | var axis = new THREE.Vector3().set(dir.z, | ||
+ | axis.normalize(); | ||
+ | var radians = Math.acos( dir.y ); | ||
+ | var radius = dist/25; | ||
+ | var height = dist/5; | ||
+ | var geometry = new THREE.ConeBufferGeometry(radius, | ||
+ | var position = new THREE.Vector3().addVectors(start.vector, | ||
+ | if (Array.isArray(edgematerials)) { | ||
+ | material = new THREE.MeshBasicMaterial( {color: edgematerials[i].color} ); | ||
+ | } | ||
+ | var cone = new THREE.Mesh( geometry, material ); | ||
+ | cone.quaternion.setFromAxisAngle(axis, | ||
+ | cone.position.copy(position);; | ||
+ | arrowheads.add(cone); | ||
+ | } | ||
+ | obj.add(arrowheads); | ||
+ | } | ||
+ | |||
+ | function init_faces(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var facets = obj.userData.facets; | ||
+ | obj.userData.triangleindices = []; | ||
+ | for (var i=0; i< | ||
+ | facet = facets[i]; | ||
+ | for (var t=0; t< | ||
+ | obj.userData.triangleindices.push(facet[0], | ||
+ | } | ||
+ | } | ||
+ | var bufarr = new Float32Array( obj.userData.triangleindices.length * 3 ); | ||
+ | var bufattr = new THREE.Float32BufferAttribute(bufarr, | ||
+ | | ||
+ | var materials = obj.userData.facetmaterial; | ||
+ | var geometry = new THREE.BufferGeometry(); | ||
+ | var frontmaterials = []; | ||
+ | var backmaterials = []; | ||
+ | geometry.setAttribute(' | ||
+ | if (Array.isArray(materials)) { | ||
+ | var tricount = 0; | ||
+ | var facet; | ||
+ | for (var i=0; i< | ||
+ | facet = facets[i]; | ||
+ | geometry.addGroup(tricount, | ||
+ | tricount += (facet.length-2)*3; | ||
+ | } | ||
+ | for (var j=0; j< | ||
+ | var fmat = materials[j].clone() | ||
+ | fmat.side = THREE.FrontSide; | ||
+ | frontmaterials.push(fmat); | ||
+ | var bmat = materials[j].clone() | ||
+ | bmat.side = THREE.BackSide; | ||
+ | backmaterials.push(bmat); | ||
+ | obj.userData.facetmaterial = frontmaterials.concat(backmaterials); | ||
+ | } | ||
+ | } else if (materials instanceof THREE.Material) { | ||
+ | frontmaterials = materials.clone() | ||
+ | frontmaterials.side = THREE.FrontSide; | ||
+ | backmaterials = materials.clone() | ||
+ | backmaterials.side = THREE.BackSide; | ||
+ | obj.userData.facetmaterial = [frontmaterials, | ||
+ | } | ||
+ | // duplicating the object with front and back should avoid transparency issues | ||
+ | var backmesh = new THREE.Mesh(geometry, | ||
+ | // meshname is used to show/hide objects | ||
+ | backmesh.name = " | ||
+ | obj.add(backmesh); | ||
+ | var frontmesh = new THREE.Mesh(geometry, | ||
+ | frontmesh.name = " | ||
+ | obj.add(frontmesh); | ||
+ | updateFacesPosition(obj); | ||
+ | } | ||
+ | // // | ||
+ | |||
+ | |||
+ | function updateFacesPosition(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var indices = obj.userData.triangleindices; | ||
+ | var faces = obj.getObjectByName(" | ||
+ | var ba = faces.geometry.getAttribute(" | ||
+ | for (var i=0; i< | ||
+ | ba.setXYZ(i, | ||
+ | } | ||
+ | faces.geometry.attributes.position.needsUpdate = true; | ||
+ | | ||
+ | } | ||
+ | |||
+ | function updateEdgesPosition(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var indices = obj.userData.edgeindices; | ||
+ | var lines = obj.getObjectByName(" | ||
+ | var ba = lines.geometry.getAttribute(" | ||
+ | for (var i=0; i< | ||
+ | ba.setXYZ(i, | ||
+ | } | ||
+ | lines.geometry.attributes.position.needsUpdate = true; | ||
+ | } | ||
+ | |||
+ | function onWindowResize() { | ||
+ | renderer.setSize( three.clientWidth, | ||
+ | svgRenderer.setSize( three.clientWidth, | ||
+ | updateCamera(); | ||
+ | } | ||
+ | |||
+ | function updateCamera() { | ||
+ | var width = three.clientWidth; | ||
+ | var height = three.clientHeight; | ||
+ | var aspect = width / height; | ||
+ | if (camera.type == " | ||
+ | camera.left = frustumSize * aspect / - 2; | ||
+ | camera.right = frustumSize * aspect / 2; | ||
+ | camera.top = frustumSize / 2; | ||
+ | camera.bottom = - frustumSize / 2; | ||
+ | } else if (camera.type == " | ||
+ | camera.aspect = aspect; | ||
+ | } | ||
+ | camera.updateProjectionMatrix(); | ||
+ | } | ||
+ | |||
+ | function changeCamera(event) { | ||
+ | var selindex = event.currentTarget.selectedIndex; | ||
+ | camera = cameras[selindex]; | ||
+ | control = controls[selindex]; | ||
+ | control.enabled = true; | ||
+ | for (var i=0; i< | ||
+ | if (i!=selindex) { | ||
+ | controls[i].enabled = false; | ||
+ | } | ||
+ | } | ||
+ | updateCamera(); | ||
+ | } | ||
+ | |||
+ | var camtypenode = document.getElementById(' | ||
+ | camtypenode.onchange = changeCamera; | ||
+ | camtypenode.dispatchEvent(new Event(' | ||
+ | |||
+ | onWindowResize(); | ||
+ | window.addEventListener(' | ||
+ | |||
+ | |||
+ | var xRotationEnabled = false; | ||
+ | var yRotationEnabled = false; | ||
+ | var zRotationEnabled = false; | ||
+ | var rotationSpeedFactor = 1; | ||
+ | var settingsShown = false; | ||
+ | var labelsShown = true; | ||
+ | var intervals = []; | ||
+ | var timeouts = []; | ||
+ | var explodingSpeed = 0.05; | ||
+ | var explodeScale = 0.000001; | ||
+ | var XMLS = new XMLSerializer(); | ||
+ | var svgElement; | ||
+ | var renderId; | ||
+ | |||
+ | var render = function () { | ||
+ | |||
+ | renderId = requestAnimationFrame(render); | ||
+ | |||
+ | // comment in for automatic explosion | ||
+ | // | ||
+ | |||
+ | var phi = 0.02 * rotationSpeedFactor; | ||
+ | |||
+ | if (xRotationEnabled) { | ||
+ | scene.rotation.x += phi; | ||
+ | } | ||
+ | if (yRotationEnabled) { | ||
+ | scene.rotation.y += phi; | ||
+ | } | ||
+ | if (zRotationEnabled) { | ||
+ | scene.rotation.z += phi; | ||
+ | } | ||
+ | |||
+ | control.update(); | ||
+ | renderer.render(scene, | ||
+ | }; | ||
+ | |||
+ | if ( THREE.WEBGL.isWebGLAvailable() ) { | ||
+ | render(); | ||
+ | } else { | ||
+ | var warning = WEBGL.getWebGLErrorMessage(); | ||
+ | three.appendChild( warning ); | ||
+ | } | ||
+ | | ||
+ | function changeTransparency() { | ||
+ | var opacity = 1-Number(event.currentTarget.value); | ||
+ | for (var i=0; i< | ||
+ | child = scene.children[i]; | ||
+ | if ( child.userData.hasOwnProperty(" | ||
+ | if (Array.isArray(child.userData.facetmaterial)) { | ||
+ | for (var j=0; j< | ||
+ | child.userData.facetmaterial[j].opacity = opacity; | ||
+ | } | ||
+ | } else { | ||
+ | child.userData.facetmaterial.opacity = opacity; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function toggleDepthWrite(event) { | ||
+ | depthwrite = event.currentTarget.checked; | ||
+ | for (var i=0; i< | ||
+ | child = scene.children[i]; | ||
+ | if ( child.userData.hasOwnProperty(" | ||
+ | if (Array.isArray(child.userData.facetmaterial)) { | ||
+ | for (var j=0; j< | ||
+ | child.userData.facetmaterial[j].depthWrite = depthwrite; | ||
+ | } | ||
+ | } else { | ||
+ | child.userData.facetmaterial.depthWrite = depthWrite; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function changeRotationX(event){ | ||
+ | xRotationEnabled = event.currentTarget.checked; | ||
+ | } | ||
+ | |||
+ | function changeRotationY(event){ | ||
+ | yRotationEnabled = event.currentTarget.checked; | ||
+ | } | ||
+ | |||
+ | function changeRotationZ(event){ | ||
+ | zRotationEnabled = event.currentTarget.checked; | ||
+ | } | ||
+ | |||
+ | |||
+ | function changeRotationSpeedFactor(event){ | ||
+ | rotationSpeedFactor = Number(event.currentTarget.value); | ||
+ | } | ||
+ | |||
+ | function resetScene(){ | ||
+ | scene.rotation.set(0, | ||
+ | camera.position.set(0, | ||
+ | camera.up.set(0, | ||
+ | } | ||
+ | |||
+ | function showSettings(event){ | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | settingsShown = true; | ||
+ | } | ||
+ | |||
+ | function hideSettings(event){ | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | settingsShown = false; | ||
+ | } | ||
+ | |||
+ | |||
+ | |||
+ | var pos = 150* Math.PI; | ||
+ | |||
+ | function updateFactor() { | ||
+ | pos++; | ||
+ | return Math.sin(.01*pos)+1; | ||
+ | } | ||
+ | |||
+ | // ------------------------ FOLDING ------------------------------------------------ | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | // rotate point p around axis defined by points p1 and p2 by given angle | ||
+ | function rotate(p, p1, p2, angle ){ | ||
+ | angle = -angle; | ||
+ | var x = p.x, y = p.y, z = p.z, | ||
+ | a = p1.x, b = p1.y, c = p1.z, | ||
+ | u = p2.x-p1.x, v = p2.y-p1.y, w = p2.z-p1.z; | ||
+ | var result = []; | ||
+ | var L = u*u + v*v + w*w; | ||
+ | var sqrt = Math.sqrt; | ||
+ | var cos = Math.cos; | ||
+ | var sin = Math.sin; | ||
+ | |||
+ | result[0] = ((a*(v*v+w*w)-u*(b*v+c*w-u*x-v*y-w*z))*(1-cos(angle))+L*x*cos(angle)+sqrt(L)*(-c*v+b*w-w*y+v*z)*sin(angle))/ | ||
+ | result[1] = ((b*(u*u+w*w)-v*(a*u+c*w-u*x-v*y-w*z))*(1-cos(angle))+L*y*cos(angle)+sqrt(L)*(c*u-a*w+w*x-u*z)*sin(angle))/ | ||
+ | result[2] = ((c*(u*u+v*v)-w*(a*u+b*v-u*x-v*y-w*z))*(1-cos(angle))+L*z*cos(angle)+sqrt(L)*(-b*u+a*v-v*x+u*y)*sin(angle))/ | ||
+ | |||
+ | return result; | ||
+ | } | ||
+ | |||
+ | var fold = function(event){ | ||
+ | var obj = foldables[Number(event.currentTarget.name)]; | ||
+ | var foldvalue = Number(event.currentTarget.value); | ||
+ | var scale = foldvalue - obj.userData.oldscale; | ||
+ | |||
+ | for (var j=0; j< | ||
+ | rotateVertices(obj, | ||
+ | } | ||
+ | update(obj); | ||
+ | obj.userData.oldscale += scale; | ||
+ | lookAtBarycenter(obj); | ||
+ | } | ||
+ | |||
+ | function lookAtBarycenter(obj){ | ||
+ | control.target = barycenter(obj); | ||
+ | } | ||
+ | |||
+ | function barycenter(obj) { | ||
+ | var center = new THREE.Vector3(0, | ||
+ | var points = obj.userData.points; | ||
+ | for (var i=0; i< | ||
+ | center.add(points[i].vector); | ||
+ | } | ||
+ | center.divideScalar(points.length); | ||
+ | return center; | ||
+ | } | ||
+ | |||
+ | function rotateVertices(obj, | ||
+ | var axes = obj.userData.axes; | ||
+ | var subtrees = obj.userData.subtrees; | ||
+ | var points = obj.userData.points; | ||
+ | var angles = obj.userData.angles; | ||
+ | if (edge < axes.length){ | ||
+ | for (var j=0; j< | ||
+ | var rotP = rotate(points[subtrees[edge][j]].vector, | ||
+ | points[subtrees[edge][j]].set(rotP[0], | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function update(obj) { | ||
+ | | ||
+ | | ||
+ | } | ||
+ | |||
+ | if (foldables.length) { | ||
+ | var settings = document.getElementById(' | ||
+ | var foldDiv = document.createElement(' | ||
+ | foldDiv.id = ' | ||
+ | var title = document.createElement(' | ||
+ | title.innerHTML = ' | ||
+ | foldDiv.appendChild(title); | ||
+ | foldDiv.className = ' | ||
+ | for (var i=0; i< | ||
+ | var range = document.createElement(' | ||
+ | range.type = ' | ||
+ | range.min = 0; | ||
+ | range.max = 1; | ||
+ | range.value = 0; | ||
+ | range.step = 0.001; | ||
+ | range.name = String(i); | ||
+ | range.oninput = fold; | ||
+ | foldDiv.appendChild(range); | ||
+ | } | ||
+ | lookAtBarycenter(foldables[0]); | ||
+ | settings.insertBefore(foldDiv, | ||
+ | } | ||
+ | |||
+ | | ||
+ | // ---------------------- EXPLOSION ------------------------------------------------ | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | |||
+ | if (explodableModel) { | ||
+ | for (var i=0; i< | ||
+ | obj = scene.children[i]; | ||
+ | if ( obj.userData.explodable ) { | ||
+ | computeCentroid(obj); | ||
+ | } | ||
+ | } | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | explode(0.000001); | ||
+ | } | ||
+ | |||
+ | function computeCentroid(obj) { | ||
+ | centroid = new THREE.Vector3(); | ||
+ | obj.userData.points.forEach(function(pmpoint) { | ||
+ | centroid.add(pmpoint.vector); | ||
+ | }); | ||
+ | centroid.divideScalar(obj.userData.points.length); | ||
+ | obj.userData.centroid = centroid; | ||
+ | } | ||
+ | |||
+ | function explode(factor) { | ||
+ | for (var i=0; i< | ||
+ | var obj = scene.children[i]; | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | var c = obj.userData.centroid; | ||
+ | obj.position.set(c.x*factor, | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function triggerExplode(event){ | ||
+ | explodeScale = Number(event.currentTarget.value); | ||
+ | explode(explodeScale); | ||
+ | } | ||
+ | |||
+ | function setExplodingSpeed(event){ | ||
+ | explodingSpeed = Number(event.currentTarget.value); | ||
+ | } | ||
+ | |||
+ | function triggerAutomaticExplode(event){ | ||
+ | if (event.currentTarget.checked){ | ||
+ | startExploding(); | ||
+ | } else { | ||
+ | clearIntervals(); | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function startExploding(){ | ||
+ | intervals.push(setInterval(explodingInterval, | ||
+ | } | ||
+ | |||
+ | |||
+ | function explodingInterval(){ | ||
+ | explodeScale += explodingSpeed; | ||
+ | if (explodeScale <= 6){ | ||
+ | explode(explodeScale); | ||
+ | } | ||
+ | else{ | ||
+ | explode(6); | ||
+ | explodeScale = 6; | ||
+ | clearIntervals(); | ||
+ | timeouts.push(setTimeout(startUnexploding, | ||
+ | } | ||
+ | document.getElementById(' | ||
+ | } | ||
+ | |||
+ | |||
+ | function startUnexploding(){ | ||
+ | intervals.push(setInterval(unexplodingInterval, | ||
+ | } | ||
+ | |||
+ | function unexplodingInterval(){ | ||
+ | explodeScale -= explodingSpeed; | ||
+ | if (explodeScale >= 0){ | ||
+ | explode(explodeScale); | ||
+ | } | ||
+ | else { | ||
+ | explode(0); | ||
+ | explodeScale = 0; | ||
+ | clearIntervals(); | ||
+ | timeouts.push(setTimeout(startExploding, | ||
+ | } | ||
+ | document.getElementById(' | ||
+ | } | ||
+ | |||
+ | function clearIntervals(){ | ||
+ | intervals.forEach(function(interval){ | ||
+ | clearInterval(interval); | ||
+ | }); | ||
+ | intervals = []; | ||
+ | timeouts.forEach(function(timeout){ | ||
+ | clearTimeout(timeout); | ||
+ | }); | ||
+ | timeouts = []; | ||
+ | } | ||
+ | |||
+ | // ---------------------- DISPLAY -------------------------------------------------- | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | |||
+ | const objectTypeInnerHTMLs = { points: " | ||
+ | const objectTypeVisible = {}; | ||
+ | Object.assign(objectTypeVisible, | ||
+ | const sortedObjectTypeKeys = Object.keys(objectTypeInnerHTMLs).sort(); | ||
+ | const shownObjectTypesList = document.getElementById(' | ||
+ | |||
+ | function setVisibility(bool, | ||
+ | for (var i=0; i< | ||
+ | var obj = scene.children[i].getObjectByName(objname); | ||
+ | if (obj) { | ||
+ | obj.visible = bool; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function toggleObjectTypeVisibility(event){ | ||
+ | var name = event.currentTarget.name; | ||
+ | var checked = event.currentTarget.checked; | ||
+ | objectTypeVisible[name] = checked; | ||
+ | if (name == " | ||
+ | setVisibility(checked," | ||
+ | setVisibility(checked," | ||
+ | } else { | ||
+ | setVisibility(checked, | ||
+ | } | ||
+ | } | ||
+ | |||
+ | for (var i=0; i< | ||
+ | var key = sortedObjectTypeKeys[i]; | ||
+ | if (modelContains[key]) { | ||
+ | var objTypeNode = document.createElement(' | ||
+ | objTypeNode.innerHTML = objectTypeInnerHTMLs[key] + '< | ||
+ | var checkbox = document.createElement(' | ||
+ | checkbox.type = ' | ||
+ | checkbox.checked = true; | ||
+ | checkbox.name = key; | ||
+ | checkbox.onchange = toggleObjectTypeVisibility; | ||
+ | shownObjectTypesList.appendChild(checkbox); | ||
+ | shownObjectTypesList.appendChild(objTypeNode); | ||
+ | } | ||
+ | } | ||
+ | |||
+ | // ------------------------------------------------------ | ||
+ | |||
+ | function toggleObjectVisibility(event){ | ||
+ | var nr = Number(event.currentTarget.name); | ||
+ | scene.children[nr].visible = event.currentTarget.checked; | ||
+ | } | ||
+ | |||
+ | // append checkboxes for displaying or hiding objects | ||
+ | var shownObjectsList = document.getElementById(' | ||
+ | for (var i=0; i< | ||
+ | obj = scene.children[i]; | ||
+ | var objNode = document.createElement(' | ||
+ | objNode.innerHTML = obj.name + '< | ||
+ | var checkbox = document.createElement(' | ||
+ | checkbox.type = ' | ||
+ | checkbox.checked = true; | ||
+ | checkbox.name = String(i); | ||
+ | checkbox.onchange = toggleObjectVisibility; | ||
+ | shownObjectsList.appendChild(checkbox); | ||
+ | shownObjectsList.appendChild(objNode); | ||
+ | } | ||
+ | |||
+ | // ---------------------- SVG ------------------------------------------------------ | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | |||
+ | function takeSvgScreenshot() { | ||
+ | if (objectTypeVisible[" | ||
+ | setVisibility(false," | ||
+ | } | ||
+ | if (objectTypeVisible[" | ||
+ | setVisibility(false," | ||
+ | } | ||
+ | svgRenderer.render(scene, | ||
+ | svgElement = XMLS.serializeToString(svgRenderer.domElement); | ||
+ | | ||
+ | if (objectTypeVisible[" | ||
+ | setVisibility(true," | ||
+ | } | ||
+ | if (objectTypeVisible[" | ||
+ | setVisibility(true," | ||
+ | } | ||
+ | |||
+ | if (document.getElementById(' | ||
+ | //show in new tab | ||
+ | var myWindow = window.open("","" | ||
+ | myWindow.document.body.innerHTML = svgElement; | ||
+ | } else{ | ||
+ | // download svg file | ||
+ | download(" | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function download(filename, | ||
+ | var element = document.createElement(' | ||
+ | element.setAttribute(' | ||
+ | element.setAttribute(' | ||
+ | |||
+ | element.style.display = ' | ||
+ | document.body.appendChild(element); | ||
+ | |||
+ | element.click(); | ||
+ | |||
+ | document.body.removeChild(element); | ||
+ | } | ||
+ | |||
+ | |||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | |||
+ | |||
+ | // ------------------ SHORTCUTS -------------------------------------------- | ||
+ | // ------------------------------------------------------------------------- | ||
+ | |||
+ | /** | ||
+ | * http:// | ||
+ | * Version : 2.01.B | ||
+ | * By Binny V A | ||
+ | * License : BSD | ||
+ | */ | ||
+ | shortcut = { | ||
+ | ' | ||
+ | ' | ||
+ | //Provide a set of default options | ||
+ | var default_options = { | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | } | ||
+ | if(!opt) opt = default_options; | ||
+ | else { | ||
+ | for(var dfo in default_options) { | ||
+ | if(typeof opt[dfo] == ' | ||
+ | } | ||
+ | } | ||
+ | |||
+ | var ele = opt.target; | ||
+ | if(typeof opt.target == ' | ||
+ | var ths = this; | ||
+ | shortcut_combination = shortcut_combination.toLowerCase(); | ||
+ | |||
+ | //The function to be called at keypress | ||
+ | var func = function(e) { | ||
+ | e = e || window.event; | ||
+ | |||
+ | if(opt[' | ||
+ | var element; | ||
+ | if(e.target) element=e.target; | ||
+ | else if(e.srcElement) element=e.srcElement; | ||
+ | if(element.nodeType==3) element=element.parentNode; | ||
+ | |||
+ | if(element.tagName == ' | ||
+ | } | ||
+ | |||
+ | //Find Which key is pressed | ||
+ | if (e.keyCode) code = e.keyCode; | ||
+ | else if (e.which) code = e.which; | ||
+ | var character = String.fromCharCode(code).toLowerCase(); | ||
+ | |||
+ | if(code == 188) character=","; | ||
+ | if(code == 190) character=" | ||
+ | |||
+ | var keys = shortcut_combination.split(" | ||
+ | //Key Pressed - counts the number of valid keypresses - if it is same as the number of keys, the shortcut function is invoked | ||
+ | var kp = 0; | ||
+ | |||
+ | //Work around for stupid Shift key bug created by using lowercase - as a result the shift+num combination was broken | ||
+ | var shift_nums = { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | ";":":", | ||
+ | "'":" | ||
+ | ",":"<", | ||
+ | " | ||
+ | "/":"?", | ||
+ | " | ||
+ | } | ||
+ | // | ||
+ | var special_keys = { | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | } | ||
+ | |||
+ | var modifiers = { | ||
+ | shift: { wanted: | ||
+ | ctrl : { wanted: | ||
+ | alt | ||
+ | meta : { wanted: | ||
+ | }; | ||
+ | | ||
+ | if(e.ctrlKey) modifiers.ctrl.pressed = true; | ||
+ | if(e.shiftKey) modifiers.shift.pressed = true; | ||
+ | if(e.altKey) modifiers.alt.pressed = true; | ||
+ | if(e.metaKey) | ||
+ | | ||
+ | for(var i=0; k=keys[i], | ||
+ | // | ||
+ | if(k == ' | ||
+ | kp++; | ||
+ | modifiers.ctrl.wanted = true; | ||
+ | |||
+ | } else if(k == ' | ||
+ | kp++; | ||
+ | modifiers.shift.wanted = true; | ||
+ | |||
+ | } else if(k == ' | ||
+ | kp++; | ||
+ | modifiers.alt.wanted = true; | ||
+ | } else if(k == ' | ||
+ | kp++; | ||
+ | modifiers.meta.wanted = true; | ||
+ | } else if(k.length > 1) { //If it is a special key | ||
+ | if(special_keys[k] == code) kp++; | ||
+ | |||
+ | } else if(opt[' | ||
+ | if(opt[' | ||
+ | |||
+ | } else { //The special keys did not match | ||
+ | if(character == k) kp++; | ||
+ | else { | ||
+ | if(shift_nums[character] && e.shiftKey) { //Stupid Shift key bug created by using lowercase | ||
+ | character = shift_nums[character]; | ||
+ | if(character == k) kp++; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | if(kp == keys.length && | ||
+ | modifiers.ctrl.pressed == modifiers.ctrl.wanted && | ||
+ | modifiers.shift.pressed == modifiers.shift.wanted && | ||
+ | modifiers.alt.pressed == modifiers.alt.wanted && | ||
+ | modifiers.meta.pressed == modifiers.meta.wanted) { | ||
+ | callback(e); | ||
+ | |||
+ | if(!opt[' | ||
+ | // | ||
+ | e.cancelBubble = true; | ||
+ | e.returnValue = false; | ||
+ | |||
+ | // | ||
+ | if (e.stopPropagation) { | ||
+ | e.stopPropagation(); | ||
+ | e.preventDefault(); | ||
+ | } | ||
+ | return false; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | this.all_shortcuts[shortcut_combination] = { | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | }; | ||
+ | //Attach the function with the event | ||
+ | if(ele.addEventListener) ele.addEventListener(opt[' | ||
+ | else if(ele.attachEvent) ele.attachEvent(' | ||
+ | else ele[' | ||
+ | }, | ||
+ | |||
+ | //Remove the shortcut - just specify the shortcut and I will remove the binding | ||
+ | ' | ||
+ | shortcut_combination = shortcut_combination.toLowerCase(); | ||
+ | var binding = this.all_shortcuts[shortcut_combination]; | ||
+ | delete(this.all_shortcuts[shortcut_combination]) | ||
+ | if(!binding) return; | ||
+ | var type = binding[' | ||
+ | var ele = binding[' | ||
+ | var callback = binding[' | ||
+ | |||
+ | if(ele.detachEvent) ele.detachEvent(' | ||
+ | else if(ele.removeEventListener) ele.removeEventListener(type, | ||
+ | else ele[' | ||
+ | } | ||
+ | } | ||
+ | |||
+ | shortcut.add(" | ||
+ | var event = new Event(' | ||
+ | if (settingsShown){ | ||
+ | document.getElementById(' | ||
+ | } else { | ||
+ | document.getElementById(' | ||
+ | } | ||
+ | }); | ||
+ | |||
+ | |||
+ | // COMMON_CODE_BLOCK_END | ||
+ | |||
+ | });}); | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | <code perl> | ||
+ | > $d0 = $s-> | ||
+ | > $d0-> | ||
+ | </ | ||
+ | < | ||
+ | <!-- | ||
+ | polymake for knusper | ||
+ | Thu Mar 3 00:31:44 2022 | ||
+ | pcom:d0 | ||
+ | --> | ||
+ | |||
+ | |||
+ | < | ||
+ | < | ||
+ | <meta charset=utf-8> | ||
+ | < | ||
+ | < | ||
+ | /* | ||
+ | // COMMON_CODE_BLOCK_BEGIN | ||
+ | */ | ||
+ | html {overflow: scroll;} | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | # | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | } | ||
+ | /* | ||
+ | // COMMON_CODE_BLOCK_END | ||
+ | */ | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | <div id=' | ||
+ | <div class=group id=' | ||
+ | < | ||
+ | < | ||
+ | <div class=indented>< | ||
+ | <div class=suboption> | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | <div class=group id=' | ||
+ | < | ||
+ | < | ||
+ | <div class=indented>< | ||
+ | </ | ||
+ | |||
+ | <div class=group id=' | ||
+ | < | ||
+ | <div class=indented> | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | <div class=suboption> | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | |||
+ | <div class=group id=' | ||
+ | < | ||
+ | <div class=indented> | ||
+ | < | ||
+ | </ | ||
+ | <div class=suboption> | ||
+ | <div class=indented> | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | < | ||
+ | <div class=indented> | ||
+ | < | ||
+ | <select id=" | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | <div class=group id=' | ||
+ | < | ||
+ | <div class=indented> | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | </ | ||
+ | <img id=' | ||
+ | <img id=' | ||
+ | <div id=" | ||
+ | </ | ||
+ | < | ||
+ | requirejs.config({ | ||
+ | paths: { | ||
+ | three: '/ | ||
+ | TrackballControls: | ||
+ | OrbitControls: | ||
+ | Projector: '/ | ||
+ | SVGRenderer: | ||
+ | WEBGL: '/ | ||
+ | }, | ||
+ | shim: { | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | } | ||
+ | }); | ||
+ | | ||
+ | require([' | ||
+ | window.THREE = THREE; | ||
+ | require([' | ||
+ | | ||
+ | THREE.TrackballControls = TrackballControls; | ||
+ | THREE.OrbitControls = OrbitControls; | ||
+ | THREE.Projector = Projector; | ||
+ | THREE.SVGRenderer = SVGRenderer; | ||
+ | THREE.WEBGL = WEBGL; | ||
+ | |||
+ | // COMMON_CODE_BLOCK_BEGIN | ||
+ | |||
+ | const intervalLength = 25; // for automatic animations | ||
+ | const explodableModel = true; | ||
+ | const modelContains = { points: false, pointlabels: | ||
+ | const foldables = []; | ||
+ | |||
+ | var three = document.getElementById(" | ||
+ | var scene = new THREE.Scene(); | ||
+ | var renderer = new THREE.WebGLRenderer( { antialias: true } ); | ||
+ | var svgRenderer = new THREE.SVGRenderer( { antialias: true } ); | ||
+ | renderer.setPixelRatio( window.devicePixelRatio ); | ||
+ | renderer.setClearColor(0xFFFFFF, | ||
+ | svgRenderer.setClearColor(0xFFFFFF, | ||
+ | three.appendChild(renderer.domElement); | ||
+ | |||
+ | var frustumSize = 4; | ||
+ | var cameras = [new THREE.PerspectiveCamera(75, | ||
+ | cameras.forEach(function(cam) { | ||
+ | cam.position.set(0, | ||
+ | cam.lookAt(0, | ||
+ | cam.up.set(0, | ||
+ | }); | ||
+ | var controls = [new THREE.TrackballControls(cameras[0], | ||
+ | var camera, control; | ||
+ | |||
+ | controls[0].zoomSpeed = 0.2; | ||
+ | controls[0].rotateSpeed = 4; | ||
+ | |||
+ | |||
+ | // class to allow move points together with labels and spheres | ||
+ | var PMPoint = function (x,y,z) { | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | PMPoint.prototype.addLabel = function(labelsprite) { | ||
+ | | ||
+ | | ||
+ | } | ||
+ | PMPoint.prototype.addSphere = function(spheremesh) { | ||
+ | | ||
+ | | ||
+ | } | ||
+ | PMPoint.prototype.set = function(x, | ||
+ | | ||
+ | if (this.sprite) { | ||
+ | this.sprite.position.copy(this.vector); | ||
+ | } | ||
+ | if (this.sphere) { | ||
+ | this.sphere.position.copy(this.vector); | ||
+ | } | ||
+ | } | ||
+ | PMPoint.prototype.radius = function() { | ||
+ | if (this.sphere) { | ||
+ | return this.sphere.geometry.parameters.radius; | ||
+ | } else { | ||
+ | return 0; | ||
+ | } | ||
+ | }; | ||
+ | // select the target node | ||
+ | var target = document.querySelector('# | ||
+ | |||
+ | // create an observer instance | ||
+ | var observer = new MutationObserver(function(mutations) { | ||
+ | | ||
+ | if (mutation.removedNodes && mutation.removedNodes.length > 0) { | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | }); | ||
+ | }); | ||
+ | |||
+ | // configuration of the observer: | ||
+ | var config = { childList: true, characterData: | ||
+ | |||
+ | // pass in the target node, as well as the observer options | ||
+ | while (target) { | ||
+ | if (target.className==" | ||
+ | observer.observe(target, | ||
+ | break; | ||
+ | } | ||
+ | | ||
+ | } | ||
+ | |||
+ | // COMMON_CODE_BLOCK_END | ||
+ | |||
+ | var obj0 = new THREE.Object3D(); | ||
+ | obj0.name = " | ||
+ | obj0.userData.explodable = 1; | ||
+ | obj0.userData.points = []; | ||
+ | obj0.userData.points.push(new PMPoint(0.6, | ||
+ | obj0.userData.points.push(new PMPoint(0.6, | ||
+ | obj0.userData.points.push(new PMPoint(-1, 0, 0.2)); | ||
+ | |||
+ | obj0.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj0.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj0.userData.pointlabels = [" | ||
+ | obj0.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj0.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj0.userData.facets = [[0, 2, 1]]; | ||
+ | < | ||
+ | obj0.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj0); | ||
+ | scene.add(obj0); | ||
+ | |||
+ | var obj1 = new THREE.Object3D(); | ||
+ | obj1.name = " | ||
+ | obj1.userData.explodable = 1; | ||
+ | obj1.userData.points = []; | ||
+ | obj1.userData.points.push(new PMPoint(0.6, | ||
+ | obj1.userData.points.push(new PMPoint(0.6, | ||
+ | obj1.userData.points.push(new PMPoint(1, 0, 0.0125)); | ||
+ | |||
+ | obj1.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj1.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj1.userData.pointlabels = [" | ||
+ | obj1.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj1.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj1.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj1.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj1); | ||
+ | scene.add(obj1); | ||
+ | |||
+ | var obj2 = new THREE.Object3D(); | ||
+ | obj2.name = " | ||
+ | obj2.userData.explodable = 1; | ||
+ | obj2.userData.points = []; | ||
+ | obj2.userData.points.push(new PMPoint(0.6, | ||
+ | obj2.userData.points.push(new PMPoint(-1, 0, 0.2)); | ||
+ | obj2.userData.points.push(new PMPoint(-0.384615, | ||
+ | |||
+ | obj2.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj2.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj2.userData.pointlabels = [" | ||
+ | obj2.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj2.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj2.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj2.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj2); | ||
+ | scene.add(obj2); | ||
+ | |||
+ | var obj3 = new THREE.Object3D(); | ||
+ | obj3.name = " | ||
+ | obj3.userData.explodable = 1; | ||
+ | obj3.userData.points = []; | ||
+ | obj3.userData.points.push(new PMPoint(0.6, | ||
+ | obj3.userData.points.push(new PMPoint(-1, 0, 0.2)); | ||
+ | obj3.userData.points.push(new PMPoint(-0.384615, | ||
+ | |||
+ | obj3.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj3.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj3.userData.pointlabels = [" | ||
+ | obj3.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj3.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj3.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj3.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj3); | ||
+ | scene.add(obj3); | ||
+ | |||
+ | var obj4 = new THREE.Object3D(); | ||
+ | obj4.name = " | ||
+ | obj4.userData.explodable = 1; | ||
+ | obj4.userData.points = []; | ||
+ | obj4.userData.points.push(new PMPoint(0.6, | ||
+ | obj4.userData.points.push(new PMPoint(1, 0, 0.0125)); | ||
+ | obj4.userData.points.push(new PMPoint(0.945946, | ||
+ | |||
+ | obj4.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj4.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj4.userData.pointlabels = [" | ||
+ | obj4.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj4.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj4.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj4.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj4); | ||
+ | scene.add(obj4); | ||
+ | |||
+ | var obj5 = new THREE.Object3D(); | ||
+ | obj5.name = " | ||
+ | obj5.userData.explodable = 1; | ||
+ | obj5.userData.points = []; | ||
+ | obj5.userData.points.push(new PMPoint(0.6, | ||
+ | obj5.userData.points.push(new PMPoint(1, 0, 0.0125)); | ||
+ | obj5.userData.points.push(new PMPoint(0.945946, | ||
+ | |||
+ | obj5.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj5.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj5.userData.pointlabels = [" | ||
+ | obj5.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj5.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj5.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj5.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj5); | ||
+ | scene.add(obj5); | ||
+ | |||
+ | var obj6 = new THREE.Object3D(); | ||
+ | obj6.name = " | ||
+ | obj6.userData.explodable = 1; | ||
+ | obj6.userData.points = []; | ||
+ | obj6.userData.points.push(new PMPoint(0.6, | ||
+ | obj6.userData.points.push(new PMPoint(-0.384615, | ||
+ | obj6.userData.points.push(new PMPoint(0, 1, 0.003125)); | ||
+ | |||
+ | obj6.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj6.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj6.userData.pointlabels = [" | ||
+ | obj6.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj6.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj6.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj6.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj6); | ||
+ | scene.add(obj6); | ||
+ | |||
+ | var obj7 = new THREE.Object3D(); | ||
+ | obj7.name = " | ||
+ | obj7.userData.explodable = 1; | ||
+ | obj7.userData.points = []; | ||
+ | obj7.userData.points.push(new PMPoint(-1, 0, 0.2)); | ||
+ | obj7.userData.points.push(new PMPoint(-0.384615, | ||
+ | obj7.userData.points.push(new PMPoint(-0.724138, | ||
+ | |||
+ | obj7.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj7.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj7.userData.pointlabels = [" | ||
+ | obj7.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj7.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj7.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj7.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj7); | ||
+ | scene.add(obj7); | ||
+ | |||
+ | var obj8 = new THREE.Object3D(); | ||
+ | obj8.name = " | ||
+ | obj8.userData.explodable = 1; | ||
+ | obj8.userData.points = []; | ||
+ | obj8.userData.points.push(new PMPoint(-1, 0, 0.2)); | ||
+ | obj8.userData.points.push(new PMPoint(-0.384615, | ||
+ | obj8.userData.points.push(new PMPoint(-0.724138, | ||
+ | |||
+ | obj8.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj8.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj8.userData.pointlabels = [" | ||
+ | obj8.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj8.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj8.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj8.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj8); | ||
+ | scene.add(obj8); | ||
+ | |||
+ | var obj9 = new THREE.Object3D(); | ||
+ | obj9.name = " | ||
+ | obj9.userData.explodable = 1; | ||
+ | obj9.userData.points = []; | ||
+ | obj9.userData.points.push(new PMPoint(0.6, | ||
+ | obj9.userData.points.push(new PMPoint(-0.384615, | ||
+ | obj9.userData.points.push(new PMPoint(0, -1, 0.003125)); | ||
+ | |||
+ | obj9.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj9.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj9.userData.pointlabels = [" | ||
+ | obj9.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj9.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj9.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj9.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj9); | ||
+ | scene.add(obj9); | ||
+ | |||
+ | var obj10 = new THREE.Object3D(); | ||
+ | obj10.name = " | ||
+ | obj10.userData.explodable = 1; | ||
+ | obj10.userData.points = []; | ||
+ | obj10.userData.points.push(new PMPoint(0.6, | ||
+ | obj10.userData.points.push(new PMPoint(0.945946, | ||
+ | obj10.userData.points.push(new PMPoint(0.882353, | ||
+ | |||
+ | obj10.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj10.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj10.userData.pointlabels = [" | ||
+ | obj10.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj10.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj10.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj10.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj10); | ||
+ | scene.add(obj10); | ||
+ | |||
+ | var obj11 = new THREE.Object3D(); | ||
+ | obj11.name = " | ||
+ | obj11.userData.explodable = 1; | ||
+ | obj11.userData.points = []; | ||
+ | obj11.userData.points.push(new PMPoint(1, 0, 0.0125)); | ||
+ | obj11.userData.points.push(new PMPoint(0.945946, | ||
+ | obj11.userData.points.push(new PMPoint(0.980198, | ||
+ | |||
+ | obj11.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj11.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj11.userData.pointlabels = [" | ||
+ | obj11.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj11.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj11.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj11.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj11); | ||
+ | scene.add(obj11); | ||
+ | |||
+ | var obj12 = new THREE.Object3D(); | ||
+ | obj12.name = " | ||
+ | obj12.userData.explodable = 1; | ||
+ | obj12.userData.points = []; | ||
+ | obj12.userData.points.push(new PMPoint(1, 0, 0.0125)); | ||
+ | obj12.userData.points.push(new PMPoint(0.945946, | ||
+ | obj12.userData.points.push(new PMPoint(0.980198, | ||
+ | |||
+ | obj12.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj12.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj12.userData.pointlabels = [" | ||
+ | obj12.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj12.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj12.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj12.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj12); | ||
+ | scene.add(obj12); | ||
+ | |||
+ | var obj13 = new THREE.Object3D(); | ||
+ | obj13.name = " | ||
+ | obj13.userData.explodable = 1; | ||
+ | obj13.userData.points = []; | ||
+ | obj13.userData.points.push(new PMPoint(0.6, | ||
+ | obj13.userData.points.push(new PMPoint(0.945946, | ||
+ | obj13.userData.points.push(new PMPoint(0.882353, | ||
+ | |||
+ | obj13.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj13.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj13.userData.pointlabels = [" | ||
+ | obj13.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj13.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj13.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj13.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj13); | ||
+ | scene.add(obj13); | ||
+ | |||
+ | var obj14 = new THREE.Object3D(); | ||
+ | obj14.name = " | ||
+ | obj14.userData.explodable = 1; | ||
+ | obj14.userData.points = []; | ||
+ | obj14.userData.points.push(new PMPoint(0.6, | ||
+ | obj14.userData.points.push(new PMPoint(0, 1, 0.003125)); | ||
+ | obj14.userData.points.push(new PMPoint(0.180328, | ||
+ | |||
+ | obj14.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj14.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj14.userData.pointlabels = [" | ||
+ | obj14.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj14.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj14.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj14.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj14); | ||
+ | scene.add(obj14); | ||
+ | |||
+ | var obj15 = new THREE.Object3D(); | ||
+ | obj15.name = " | ||
+ | obj15.userData.explodable = 1; | ||
+ | obj15.userData.points = []; | ||
+ | obj15.userData.points.push(new PMPoint(-0.384615, | ||
+ | obj15.userData.points.push(new PMPoint(0, 1, 0.003125)); | ||
+ | obj15.userData.points.push(new PMPoint(-0.152941, | ||
+ | |||
+ | obj15.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj15.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj15.userData.pointlabels = [" | ||
+ | obj15.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj15.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj15.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj15.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj15); | ||
+ | scene.add(obj15); | ||
+ | |||
+ | var obj16 = new THREE.Object3D(); | ||
+ | obj16.name = " | ||
+ | obj16.userData.explodable = 1; | ||
+ | obj16.userData.points = []; | ||
+ | obj16.userData.points.push(new PMPoint(-0.384615, | ||
+ | obj16.userData.points.push(new PMPoint(-0.724138, | ||
+ | obj16.userData.points.push(new PMPoint(-0.6, | ||
+ | |||
+ | obj16.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj16.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj16.userData.pointlabels = [" | ||
+ | obj16.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj16.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj16.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj16.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj16); | ||
+ | scene.add(obj16); | ||
+ | |||
+ | var obj17 = new THREE.Object3D(); | ||
+ | obj17.name = " | ||
+ | obj17.userData.explodable = 1; | ||
+ | obj17.userData.points = []; | ||
+ | obj17.userData.points.push(new PMPoint(-1, 0, 0.2)); | ||
+ | obj17.userData.points.push(new PMPoint(-0.724138, | ||
+ | obj17.userData.points.push(new PMPoint(-0.849057, | ||
+ | |||
+ | obj17.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj17.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj17.userData.pointlabels = [" | ||
+ | obj17.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj17.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj17.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj17.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj17); | ||
+ | scene.add(obj17); | ||
+ | |||
+ | var obj18 = new THREE.Object3D(); | ||
+ | obj18.name = " | ||
+ | obj18.userData.explodable = 1; | ||
+ | obj18.userData.points = []; | ||
+ | obj18.userData.points.push(new PMPoint(-1, 0, 0.2)); | ||
+ | obj18.userData.points.push(new PMPoint(-0.724138, | ||
+ | obj18.userData.points.push(new PMPoint(-0.849057, | ||
+ | |||
+ | obj18.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj18.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj18.userData.pointlabels = [" | ||
+ | obj18.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj18.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj18.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj18.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj18); | ||
+ | scene.add(obj18); | ||
+ | |||
+ | var obj19 = new THREE.Object3D(); | ||
+ | obj19.name = " | ||
+ | obj19.userData.explodable = 1; | ||
+ | obj19.userData.points = []; | ||
+ | obj19.userData.points.push(new PMPoint(-0.384615, | ||
+ | obj19.userData.points.push(new PMPoint(-0.724138, | ||
+ | obj19.userData.points.push(new PMPoint(-0.6, | ||
+ | |||
+ | obj19.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj19.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj19.userData.pointlabels = [" | ||
+ | obj19.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj19.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj19.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj19.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj19); | ||
+ | scene.add(obj19); | ||
+ | |||
+ | var obj20 = new THREE.Object3D(); | ||
+ | obj20.name = " | ||
+ | obj20.userData.explodable = 1; | ||
+ | obj20.userData.points = []; | ||
+ | obj20.userData.points.push(new PMPoint(-0.384615, | ||
+ | obj20.userData.points.push(new PMPoint(0, -1, 0.003125)); | ||
+ | obj20.userData.points.push(new PMPoint(-0.152941, | ||
+ | |||
+ | obj20.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj20.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj20.userData.pointlabels = [" | ||
+ | obj20.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj20.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj20.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj20.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj20); | ||
+ | scene.add(obj20); | ||
+ | |||
+ | var obj21 = new THREE.Object3D(); | ||
+ | obj21.name = " | ||
+ | obj21.userData.explodable = 1; | ||
+ | obj21.userData.points = []; | ||
+ | obj21.userData.points.push(new PMPoint(0.6, | ||
+ | obj21.userData.points.push(new PMPoint(0, -1, 0.003125)); | ||
+ | obj21.userData.points.push(new PMPoint(0.180328, | ||
+ | |||
+ | obj21.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj21.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj21.userData.pointlabels = [" | ||
+ | obj21.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj21.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj21.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj21.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj21); | ||
+ | scene.add(obj21); | ||
+ | |||
+ | var obj22 = new THREE.Object3D(); | ||
+ | obj22.name = " | ||
+ | obj22.userData.explodable = 1; | ||
+ | obj22.userData.points = []; | ||
+ | obj22.userData.points.push(new PMPoint(0.6, | ||
+ | obj22.userData.points.push(new PMPoint(0.882353, | ||
+ | obj22.userData.points.push(new PMPoint(0.834862, | ||
+ | |||
+ | obj22.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj22.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj22.userData.pointlabels = [" | ||
+ | obj22.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj22.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj22.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj22.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj22); | ||
+ | scene.add(obj22); | ||
+ | |||
+ | var obj23 = new THREE.Object3D(); | ||
+ | obj23.name = " | ||
+ | obj23.userData.explodable = 1; | ||
+ | obj23.userData.points = []; | ||
+ | obj23.userData.points.push(new PMPoint(0.945946, | ||
+ | obj23.userData.points.push(new PMPoint(0.882353, | ||
+ | obj23.userData.points.push(new PMPoint(0.912195, | ||
+ | |||
+ | obj23.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj23.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj23.userData.pointlabels = [" | ||
+ | obj23.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj23.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj23.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj23.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj23); | ||
+ | scene.add(obj23); | ||
+ | |||
+ | var obj24 = new THREE.Object3D(); | ||
+ | obj24.name = " | ||
+ | obj24.userData.explodable = 1; | ||
+ | obj24.userData.points = []; | ||
+ | obj24.userData.points.push(new PMPoint(0.945946, | ||
+ | obj24.userData.points.push(new PMPoint(0.980198, | ||
+ | obj24.userData.points.push(new PMPoint(0.969231, | ||
+ | |||
+ | obj24.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj24.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj24.userData.pointlabels = [" | ||
+ | obj24.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj24.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj24.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj24.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj24); | ||
+ | scene.add(obj24); | ||
+ | |||
+ | var obj25 = new THREE.Object3D(); | ||
+ | obj25.name = " | ||
+ | obj25.userData.explodable = 1; | ||
+ | obj25.userData.points = []; | ||
+ | obj25.userData.points.push(new PMPoint(1, 0, 0.0125)); | ||
+ | obj25.userData.points.push(new PMPoint(0.980198, | ||
+ | obj25.userData.points.push(new PMPoint(0.989848, | ||
+ | |||
+ | obj25.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj25.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj25.userData.pointlabels = [" | ||
+ | obj25.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj25.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj25.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj25.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj25); | ||
+ | scene.add(obj25); | ||
+ | |||
+ | var obj26 = new THREE.Object3D(); | ||
+ | obj26.name = " | ||
+ | obj26.userData.explodable = 1; | ||
+ | obj26.userData.points = []; | ||
+ | obj26.userData.points.push(new PMPoint(1, 0, 0.0125)); | ||
+ | obj26.userData.points.push(new PMPoint(0.980198, | ||
+ | obj26.userData.points.push(new PMPoint(0.989848, | ||
+ | |||
+ | obj26.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj26.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj26.userData.pointlabels = [" | ||
+ | obj26.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj26.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj26.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj26.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj26); | ||
+ | scene.add(obj26); | ||
+ | |||
+ | var obj27 = new THREE.Object3D(); | ||
+ | obj27.name = " | ||
+ | obj27.userData.explodable = 1; | ||
+ | obj27.userData.points = []; | ||
+ | obj27.userData.points.push(new PMPoint(0.945946, | ||
+ | obj27.userData.points.push(new PMPoint(0.980198, | ||
+ | obj27.userData.points.push(new PMPoint(0.969231, | ||
+ | |||
+ | obj27.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj27.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj27.userData.pointlabels = [" | ||
+ | obj27.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj27.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj27.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj27.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj27); | ||
+ | scene.add(obj27); | ||
+ | |||
+ | var obj28 = new THREE.Object3D(); | ||
+ | obj28.name = " | ||
+ | obj28.userData.explodable = 1; | ||
+ | obj28.userData.points = []; | ||
+ | obj28.userData.points.push(new PMPoint(0.945946, | ||
+ | obj28.userData.points.push(new PMPoint(0.882353, | ||
+ | obj28.userData.points.push(new PMPoint(0.912195, | ||
+ | |||
+ | obj28.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj28.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj28.userData.pointlabels = [" | ||
+ | obj28.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj28.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj28.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj28.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj28); | ||
+ | scene.add(obj28); | ||
+ | |||
+ | var obj29 = new THREE.Object3D(); | ||
+ | obj29.name = " | ||
+ | obj29.userData.explodable = 1; | ||
+ | obj29.userData.points = []; | ||
+ | obj29.userData.points.push(new PMPoint(0.6, | ||
+ | obj29.userData.points.push(new PMPoint(0.882353, | ||
+ | obj29.userData.points.push(new PMPoint(0.834862, | ||
+ | |||
+ | obj29.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj29.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj29.userData.pointlabels = [" | ||
+ | obj29.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj29.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj29.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj29.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj29); | ||
+ | scene.add(obj29); | ||
+ | |||
+ | var obj30 = new THREE.Object3D(); | ||
+ | obj30.name = " | ||
+ | obj30.userData.explodable = 1; | ||
+ | obj30.userData.points = []; | ||
+ | obj30.userData.points.push(new PMPoint(0.6, | ||
+ | obj30.userData.points.push(new PMPoint(0.180328, | ||
+ | obj30.userData.points.push(new PMPoint(0.28, | ||
+ | |||
+ | obj30.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj30.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj30.userData.pointlabels = [" | ||
+ | obj30.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj30.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj30.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj30.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj30); | ||
+ | scene.add(obj30); | ||
+ | |||
+ | var obj31 = new THREE.Object3D(); | ||
+ | obj31.name = " | ||
+ | obj31.userData.explodable = 1; | ||
+ | obj31.userData.points = []; | ||
+ | obj31.userData.points.push(new PMPoint(0, 1, 0.003125)); | ||
+ | obj31.userData.points.push(new PMPoint(0.180328, | ||
+ | obj31.userData.points.push(new PMPoint(0.104972, | ||
+ | |||
+ | obj31.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj31.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj31.userData.pointlabels = [" | ||
+ | obj31.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj31.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj31.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj31.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj31); | ||
+ | scene.add(obj31); | ||
+ | |||
+ | var obj32 = new THREE.Object3D(); | ||
+ | obj32.name = " | ||
+ | obj32.userData.explodable = 1; | ||
+ | obj32.userData.points = []; | ||
+ | obj32.userData.points.push(new PMPoint(0, 1, 0.003125)); | ||
+ | obj32.userData.points.push(new PMPoint(-0.152941, | ||
+ | obj32.userData.points.push(new PMPoint(-0.0950226, | ||
+ | |||
+ | obj32.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj32.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj32.userData.pointlabels = [" | ||
+ | obj32.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj32.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj32.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj32.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj32); | ||
+ | scene.add(obj32); | ||
+ | |||
+ | var obj33 = new THREE.Object3D(); | ||
+ | obj33.name = " | ||
+ | obj33.userData.explodable = 1; | ||
+ | obj33.userData.points = []; | ||
+ | obj33.userData.points.push(new PMPoint(-0.384615, | ||
+ | obj33.userData.points.push(new PMPoint(-0.152941, | ||
+ | obj33.userData.points.push(new PMPoint(-0.219512, | ||
+ | |||
+ | obj33.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj33.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj33.userData.pointlabels = [" | ||
+ | obj33.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj33.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj33.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj33.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj33); | ||
+ | scene.add(obj33); | ||
+ | |||
+ | var obj34 = new THREE.Object3D(); | ||
+ | obj34.name = " | ||
+ | obj34.userData.explodable = 1; | ||
+ | obj34.userData.points = []; | ||
+ | obj34.userData.points.push(new PMPoint(-0.384615, | ||
+ | obj34.userData.points.push(new PMPoint(-0.6, | ||
+ | obj34.userData.points.push(new PMPoint(-0.541401, | ||
+ | |||
+ | obj34.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj34.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj34.userData.pointlabels = [" | ||
+ | obj34.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj34.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj34.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj34.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj34); | ||
+ | scene.add(obj34); | ||
+ | |||
+ | var obj35 = new THREE.Object3D(); | ||
+ | obj35.name = " | ||
+ | obj35.userData.explodable = 1; | ||
+ | obj35.userData.points = []; | ||
+ | obj35.userData.points.push(new PMPoint(-0.724138, | ||
+ | obj35.userData.points.push(new PMPoint(-0.6, | ||
+ | obj35.userData.points.push(new PMPoint(-0.64878, | ||
+ | |||
+ | obj35.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj35.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj35.userData.pointlabels = [" | ||
+ | obj35.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj35.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj35.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj35.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj35); | ||
+ | scene.add(obj35); | ||
+ | |||
+ | var obj36 = new THREE.Object3D(); | ||
+ | obj36.name = " | ||
+ | obj36.userData.explodable = 1; | ||
+ | obj36.userData.points = []; | ||
+ | obj36.userData.points.push(new PMPoint(-0.724138, | ||
+ | obj36.userData.points.push(new PMPoint(-0.849057, | ||
+ | obj36.userData.points.push(new PMPoint(-0.8, | ||
+ | |||
+ | obj36.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj36.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj36.userData.pointlabels = [" | ||
+ | obj36.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj36.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj36.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj36.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj36); | ||
+ | scene.add(obj36); | ||
+ | |||
+ | var obj37 = new THREE.Object3D(); | ||
+ | obj37.name = " | ||
+ | obj37.userData.explodable = 1; | ||
+ | obj37.userData.points = []; | ||
+ | obj37.userData.points.push(new PMPoint(-1, 0, 0.2)); | ||
+ | obj37.userData.points.push(new PMPoint(-0.849057, | ||
+ | obj37.userData.points.push(new PMPoint(-0.905882, | ||
+ | |||
+ | obj37.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj37.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj37.userData.pointlabels = [" | ||
+ | obj37.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj37.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj37.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj37.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj37); | ||
+ | scene.add(obj37); | ||
+ | |||
+ | var obj38 = new THREE.Object3D(); | ||
+ | obj38.name = " | ||
+ | obj38.userData.explodable = 1; | ||
+ | obj38.userData.points = []; | ||
+ | obj38.userData.points.push(new PMPoint(-1, 0, 0.2)); | ||
+ | obj38.userData.points.push(new PMPoint(-0.849057, | ||
+ | obj38.userData.points.push(new PMPoint(-0.905882, | ||
+ | |||
+ | obj38.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj38.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj38.userData.pointlabels = [" | ||
+ | obj38.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj38.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj38.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj38.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj38); | ||
+ | scene.add(obj38); | ||
+ | |||
+ | var obj39 = new THREE.Object3D(); | ||
+ | obj39.name = " | ||
+ | obj39.userData.explodable = 1; | ||
+ | obj39.userData.points = []; | ||
+ | obj39.userData.points.push(new PMPoint(-0.724138, | ||
+ | obj39.userData.points.push(new PMPoint(-0.849057, | ||
+ | obj39.userData.points.push(new PMPoint(-0.8, | ||
+ | |||
+ | obj39.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj39.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj39.userData.pointlabels = [" | ||
+ | obj39.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj39.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj39.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj39.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj39); | ||
+ | scene.add(obj39); | ||
+ | |||
+ | var obj40 = new THREE.Object3D(); | ||
+ | obj40.name = " | ||
+ | obj40.userData.explodable = 1; | ||
+ | obj40.userData.points = []; | ||
+ | obj40.userData.points.push(new PMPoint(-0.724138, | ||
+ | obj40.userData.points.push(new PMPoint(-0.6, | ||
+ | obj40.userData.points.push(new PMPoint(-0.64878, | ||
+ | |||
+ | obj40.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj40.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj40.userData.pointlabels = [" | ||
+ | obj40.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj40.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj40.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj40.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj40); | ||
+ | scene.add(obj40); | ||
+ | |||
+ | var obj41 = new THREE.Object3D(); | ||
+ | obj41.name = " | ||
+ | obj41.userData.explodable = 1; | ||
+ | obj41.userData.points = []; | ||
+ | obj41.userData.points.push(new PMPoint(-0.384615, | ||
+ | obj41.userData.points.push(new PMPoint(-0.6, | ||
+ | obj41.userData.points.push(new PMPoint(-0.541401, | ||
+ | |||
+ | obj41.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj41.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj41.userData.pointlabels = [" | ||
+ | obj41.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj41.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj41.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj41.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj41); | ||
+ | scene.add(obj41); | ||
+ | |||
+ | var obj42 = new THREE.Object3D(); | ||
+ | obj42.name = " | ||
+ | obj42.userData.explodable = 1; | ||
+ | obj42.userData.points = []; | ||
+ | obj42.userData.points.push(new PMPoint(-0.384615, | ||
+ | obj42.userData.points.push(new PMPoint(-0.152941, | ||
+ | obj42.userData.points.push(new PMPoint(-0.219512, | ||
+ | |||
+ | obj42.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj42.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj42.userData.pointlabels = [" | ||
+ | obj42.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj42.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj42.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj42.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj42); | ||
+ | scene.add(obj42); | ||
+ | |||
+ | var obj43 = new THREE.Object3D(); | ||
+ | obj43.name = " | ||
+ | obj43.userData.explodable = 1; | ||
+ | obj43.userData.points = []; | ||
+ | obj43.userData.points.push(new PMPoint(0, -1, 0.003125)); | ||
+ | obj43.userData.points.push(new PMPoint(-0.152941, | ||
+ | obj43.userData.points.push(new PMPoint(-0.0950226, | ||
+ | |||
+ | obj43.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj43.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj43.userData.pointlabels = [" | ||
+ | obj43.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj43.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj43.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj43.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj43); | ||
+ | scene.add(obj43); | ||
+ | |||
+ | var obj44 = new THREE.Object3D(); | ||
+ | obj44.name = " | ||
+ | obj44.userData.explodable = 1; | ||
+ | obj44.userData.points = []; | ||
+ | obj44.userData.points.push(new PMPoint(0, -1, 0.003125)); | ||
+ | obj44.userData.points.push(new PMPoint(0.180328, | ||
+ | obj44.userData.points.push(new PMPoint(0.104972, | ||
+ | |||
+ | obj44.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj44.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj44.userData.pointlabels = [" | ||
+ | obj44.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj44.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj44.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj44.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj44); | ||
+ | scene.add(obj44); | ||
+ | |||
+ | var obj45 = new THREE.Object3D(); | ||
+ | obj45.name = " | ||
+ | obj45.userData.explodable = 1; | ||
+ | obj45.userData.points = []; | ||
+ | obj45.userData.points.push(new PMPoint(0.6, | ||
+ | obj45.userData.points.push(new PMPoint(0.180328, | ||
+ | obj45.userData.points.push(new PMPoint(0.28, | ||
+ | |||
+ | obj45.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj45.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj45.userData.pointlabels = [" | ||
+ | obj45.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj45.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj45.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj45.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj45); | ||
+ | scene.add(obj45); | ||
+ | |||
+ | var obj46 = new THREE.Object3D(); | ||
+ | obj46.name = " | ||
+ | obj46.userData.explodable = 1; | ||
+ | obj46.userData.points = []; | ||
+ | obj46.userData.points.push(new PMPoint(0.6, | ||
+ | obj46.userData.points.push(new PMPoint(0.834862, | ||
+ | obj46.userData.points.push(new PMPoint(0.8, | ||
+ | |||
+ | obj46.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj46.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj46.userData.pointlabels = [" | ||
+ | obj46.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj46.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj46.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj46.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj46); | ||
+ | scene.add(obj46); | ||
+ | |||
+ | var obj47 = new THREE.Object3D(); | ||
+ | obj47.name = " | ||
+ | obj47.userData.explodable = 1; | ||
+ | obj47.userData.points = []; | ||
+ | obj47.userData.points.push(new PMPoint(0.882353, | ||
+ | obj47.userData.points.push(new PMPoint(0.834862, | ||
+ | obj47.userData.points.push(new PMPoint(0.856734, | ||
+ | |||
+ | obj47.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj47.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj47.userData.pointlabels = [" | ||
+ | obj47.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj47.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj47.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj47.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj47); | ||
+ | scene.add(obj47); | ||
+ | |||
+ | var obj48 = new THREE.Object3D(); | ||
+ | obj48.name = " | ||
+ | obj48.userData.explodable = 1; | ||
+ | obj48.userData.points = []; | ||
+ | obj48.userData.points.push(new PMPoint(0.882353, | ||
+ | obj48.userData.points.push(new PMPoint(0.912195, | ||
+ | obj48.userData.points.push(new PMPoint(0.901768, | ||
+ | |||
+ | obj48.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj48.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj48.userData.pointlabels = [" | ||
+ | obj48.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj48.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj48.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj48.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj48); | ||
+ | scene.add(obj48); | ||
+ | |||
+ | var obj49 = new THREE.Object3D(); | ||
+ | obj49.name = " | ||
+ | obj49.userData.explodable = 1; | ||
+ | obj49.userData.points = []; | ||
+ | obj49.userData.points.push(new PMPoint(0.945946, | ||
+ | obj49.userData.points.push(new PMPoint(0.912195, | ||
+ | obj49.userData.points.push(new PMPoint(0.923077, | ||
+ | |||
+ | obj49.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj49.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj49.userData.pointlabels = [" | ||
+ | obj49.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj49.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj49.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj49.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj49); | ||
+ | scene.add(obj49); | ||
+ | |||
+ | var obj50 = new THREE.Object3D(); | ||
+ | obj50.name = " | ||
+ | obj50.userData.explodable = 1; | ||
+ | obj50.userData.points = []; | ||
+ | obj50.userData.points.push(new PMPoint(0.945946, | ||
+ | obj50.userData.points.push(new PMPoint(0.969231, | ||
+ | obj50.userData.points.push(new PMPoint(0.963489, | ||
+ | |||
+ | obj50.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj50.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj50.userData.pointlabels = [" | ||
+ | obj50.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj50.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj50.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj50.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj50); | ||
+ | scene.add(obj50); | ||
+ | |||
+ | var obj51 = new THREE.Object3D(); | ||
+ | obj51.name = " | ||
+ | obj51.userData.explodable = 1; | ||
+ | obj51.userData.points = []; | ||
+ | obj51.userData.points.push(new PMPoint(0.980198, | ||
+ | obj51.userData.points.push(new PMPoint(0.969231, | ||
+ | obj51.userData.points.push(new PMPoint(0.973723, | ||
+ | |||
+ | obj51.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj51.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj51.userData.pointlabels = [" | ||
+ | obj51.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj51.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj51.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj51.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj51); | ||
+ | scene.add(obj51); | ||
+ | |||
+ | var obj52 = new THREE.Object3D(); | ||
+ | obj52.name = " | ||
+ | obj52.userData.explodable = 1; | ||
+ | obj52.userData.points = []; | ||
+ | obj52.userData.points.push(new PMPoint(0.980198, | ||
+ | obj52.userData.points.push(new PMPoint(0.989848, | ||
+ | obj52.userData.points.push(new PMPoint(0.986207, | ||
+ | |||
+ | obj52.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj52.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj52.userData.pointlabels = [" | ||
+ | obj52.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj52.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj52.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj52.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj52); | ||
+ | scene.add(obj52); | ||
+ | |||
+ | var obj53 = new THREE.Object3D(); | ||
+ | obj53.name = " | ||
+ | obj53.userData.explodable = 1; | ||
+ | obj53.userData.points = []; | ||
+ | obj53.userData.points.push(new PMPoint(1, 0, 0.0125)); | ||
+ | obj53.userData.points.push(new PMPoint(0.989848, | ||
+ | obj53.userData.points.push(new PMPoint(0.993846, | ||
+ | |||
+ | obj53.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj53.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj53.userData.pointlabels = [" | ||
+ | obj53.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj53.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj53.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj53.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj53); | ||
+ | scene.add(obj53); | ||
+ | |||
+ | var obj54 = new THREE.Object3D(); | ||
+ | obj54.name = " | ||
+ | obj54.userData.explodable = 1; | ||
+ | obj54.userData.points = []; | ||
+ | obj54.userData.points.push(new PMPoint(1, 0, 0.0125)); | ||
+ | obj54.userData.points.push(new PMPoint(0.989848, | ||
+ | obj54.userData.points.push(new PMPoint(0.993846, | ||
+ | |||
+ | obj54.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj54.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj54.userData.pointlabels = [" | ||
+ | obj54.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj54.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj54.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj54.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj54); | ||
+ | scene.add(obj54); | ||
+ | |||
+ | var obj55 = new THREE.Object3D(); | ||
+ | obj55.name = " | ||
+ | obj55.userData.explodable = 1; | ||
+ | obj55.userData.points = []; | ||
+ | obj55.userData.points.push(new PMPoint(0.980198, | ||
+ | obj55.userData.points.push(new PMPoint(0.989848, | ||
+ | obj55.userData.points.push(new PMPoint(0.986207, | ||
+ | |||
+ | obj55.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj55.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj55.userData.pointlabels = [" | ||
+ | obj55.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj55.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj55.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj55.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj55); | ||
+ | scene.add(obj55); | ||
+ | |||
+ | var obj56 = new THREE.Object3D(); | ||
+ | obj56.name = " | ||
+ | obj56.userData.explodable = 1; | ||
+ | obj56.userData.points = []; | ||
+ | obj56.userData.points.push(new PMPoint(0.980198, | ||
+ | obj56.userData.points.push(new PMPoint(0.969231, | ||
+ | obj56.userData.points.push(new PMPoint(0.973723, | ||
+ | |||
+ | obj56.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj56.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj56.userData.pointlabels = [" | ||
+ | obj56.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj56.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj56.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj56.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj56); | ||
+ | scene.add(obj56); | ||
+ | |||
+ | var obj57 = new THREE.Object3D(); | ||
+ | obj57.name = " | ||
+ | obj57.userData.explodable = 1; | ||
+ | obj57.userData.points = []; | ||
+ | obj57.userData.points.push(new PMPoint(0.945946, | ||
+ | obj57.userData.points.push(new PMPoint(0.969231, | ||
+ | obj57.userData.points.push(new PMPoint(0.963489, | ||
+ | |||
+ | obj57.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj57.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj57.userData.pointlabels = [" | ||
+ | obj57.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj57.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj57.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj57.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj57); | ||
+ | scene.add(obj57); | ||
+ | |||
+ | var obj58 = new THREE.Object3D(); | ||
+ | obj58.name = " | ||
+ | obj58.userData.explodable = 1; | ||
+ | obj58.userData.points = []; | ||
+ | obj58.userData.points.push(new PMPoint(0.945946, | ||
+ | obj58.userData.points.push(new PMPoint(0.912195, | ||
+ | obj58.userData.points.push(new PMPoint(0.923077, | ||
+ | |||
+ | obj58.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj58.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj58.userData.pointlabels = [" | ||
+ | obj58.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj58.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj58.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj58.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj58); | ||
+ | scene.add(obj58); | ||
+ | |||
+ | var obj59 = new THREE.Object3D(); | ||
+ | obj59.name = " | ||
+ | obj59.userData.explodable = 1; | ||
+ | obj59.userData.points = []; | ||
+ | obj59.userData.points.push(new PMPoint(0.882353, | ||
+ | obj59.userData.points.push(new PMPoint(0.912195, | ||
+ | obj59.userData.points.push(new PMPoint(0.901768, | ||
+ | |||
+ | obj59.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj59.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj59.userData.pointlabels = [" | ||
+ | obj59.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj59.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj59.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj59.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj59); | ||
+ | scene.add(obj59); | ||
+ | |||
+ | var obj60 = new THREE.Object3D(); | ||
+ | obj60.name = " | ||
+ | obj60.userData.explodable = 1; | ||
+ | obj60.userData.points = []; | ||
+ | obj60.userData.points.push(new PMPoint(0.882353, | ||
+ | obj60.userData.points.push(new PMPoint(0.834862, | ||
+ | obj60.userData.points.push(new PMPoint(0.856734, | ||
+ | |||
+ | obj60.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj60.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj60.userData.pointlabels = [" | ||
+ | obj60.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj60.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj60.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj60.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj60); | ||
+ | scene.add(obj60); | ||
+ | |||
+ | var obj61 = new THREE.Object3D(); | ||
+ | obj61.name = " | ||
+ | obj61.userData.explodable = 1; | ||
+ | obj61.userData.points = []; | ||
+ | obj61.userData.points.push(new PMPoint(0.6, | ||
+ | obj61.userData.points.push(new PMPoint(0.834862, | ||
+ | obj61.userData.points.push(new PMPoint(0.8, | ||
+ | |||
+ | obj61.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj61.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj61.userData.pointlabels = [" | ||
+ | obj61.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj61.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj61.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj61.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj61); | ||
+ | scene.add(obj61); | ||
+ | |||
+ | var obj62 = new THREE.Object3D(); | ||
+ | obj62.name = " | ||
+ | obj62.userData.explodable = 1; | ||
+ | obj62.userData.points = []; | ||
+ | obj62.userData.points.push(new PMPoint(0.6, | ||
+ | obj62.userData.points.push(new PMPoint(0.28, | ||
+ | obj62.userData.points.push(new PMPoint(0.342282, | ||
+ | |||
+ | obj62.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj62.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj62.userData.pointlabels = [" | ||
+ | obj62.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj62.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj62.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj62.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj62); | ||
+ | scene.add(obj62); | ||
+ | |||
+ | var obj63 = new THREE.Object3D(); | ||
+ | obj63.name = " | ||
+ | obj63.userData.explodable = 1; | ||
+ | obj63.userData.points = []; | ||
+ | obj63.userData.points.push(new PMPoint(0.180328, | ||
+ | obj63.userData.points.push(new PMPoint(0.28, | ||
+ | obj63.userData.points.push(new PMPoint(0.236593, | ||
+ | |||
+ | obj63.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj63.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj63.userData.pointlabels = [" | ||
+ | obj63.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj63.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj63.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj63.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj63); | ||
+ | scene.add(obj63); | ||
+ | |||
+ | var obj64 = new THREE.Object3D(); | ||
+ | obj64.name = " | ||
+ | obj64.userData.explodable = 1; | ||
+ | obj64.userData.points = []; | ||
+ | obj64.userData.points.push(new PMPoint(0.180328, | ||
+ | obj64.userData.points.push(new PMPoint(0.104972, | ||
+ | obj64.userData.points.push(new PMPoint(0.132743, | ||
+ | |||
+ | obj64.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj64.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj64.userData.pointlabels = [" | ||
+ | obj64.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj64.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj64.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj64.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj64); | ||
+ | scene.add(obj64); | ||
+ | |||
+ | var obj65 = new THREE.Object3D(); | ||
+ | obj65.name = " | ||
+ | obj65.userData.explodable = 1; | ||
+ | obj65.userData.points = []; | ||
+ | obj65.userData.points.push(new PMPoint(0, 1, 0.003125)); | ||
+ | obj65.userData.points.push(new PMPoint(0.104972, | ||
+ | obj65.userData.points.push(new PMPoint(0.0739726, | ||
+ | |||
+ | obj65.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj65.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj65.userData.pointlabels = [" | ||
+ | obj65.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj65.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj65.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj65.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj65); | ||
+ | scene.add(obj65); | ||
+ | |||
+ | var obj66 = new THREE.Object3D(); | ||
+ | obj66.name = " | ||
+ | obj66.userData.explodable = 1; | ||
+ | obj66.userData.points = []; | ||
+ | obj66.userData.points.push(new PMPoint(0, 1, 0.003125)); | ||
+ | obj66.userData.points.push(new PMPoint(-0.0950226, | ||
+ | obj66.userData.points.push(new PMPoint(-0.0688836, | ||
+ | |||
+ | obj66.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj66.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj66.userData.pointlabels = [" | ||
+ | obj66.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj66.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj66.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj66.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj66); | ||
+ | scene.add(obj66); | ||
+ | |||
+ | var obj67 = new THREE.Object3D(); | ||
+ | obj67.name = " | ||
+ | obj67.userData.explodable = 1; | ||
+ | obj67.userData.points = []; | ||
+ | obj67.userData.points.push(new PMPoint(-0.152941, | ||
+ | obj67.userData.points.push(new PMPoint(-0.0950226, | ||
+ | obj67.userData.points.push(new PMPoint(-0.117241, | ||
+ | |||
+ | obj67.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj67.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj67.userData.pointlabels = [" | ||
+ | obj67.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj67.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj67.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj67.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj67); | ||
+ | scene.add(obj67); | ||
+ | |||
+ | var obj68 = new THREE.Object3D(); | ||
+ | obj68.name = " | ||
+ | obj68.userData.explodable = 1; | ||
+ | obj68.userData.points = []; | ||
+ | obj68.userData.points.push(new PMPoint(-0.152941, | ||
+ | obj68.userData.points.push(new PMPoint(-0.219512, | ||
+ | obj68.userData.points.push(new PMPoint(-0.191753, | ||
+ | |||
+ | obj68.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj68.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj68.userData.pointlabels = [" | ||
+ | obj68.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj68.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj68.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj68.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj68); | ||
+ | scene.add(obj68); | ||
+ | |||
+ | var obj69 = new THREE.Object3D(); | ||
+ | obj69.name = " | ||
+ | obj69.userData.explodable = 1; | ||
+ | obj69.userData.points = []; | ||
+ | obj69.userData.points.push(new PMPoint(-0.384615, | ||
+ | obj69.userData.points.push(new PMPoint(-0.219512, | ||
+ | obj69.userData.points.push(new PMPoint(-0.256506, | ||
+ | |||
+ | obj69.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj69.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj69.userData.pointlabels = [" | ||
+ | obj69.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj69.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj69.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj69.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj69); | ||
+ | scene.add(obj69); | ||
+ | |||
+ | var obj70 = new THREE.Object3D(); | ||
+ | obj70.name = " | ||
+ | obj70.userData.explodable = 1; | ||
+ | obj70.userData.points = []; | ||
+ | obj70.userData.points.push(new PMPoint(-0.384615, | ||
+ | obj70.userData.points.push(new PMPoint(-0.541401, | ||
+ | obj70.userData.points.push(new PMPoint(-0.507692, | ||
+ | |||
+ | obj70.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj70.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj70.userData.pointlabels = [" | ||
+ | obj70.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj70.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj70.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj70.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj70); | ||
+ | scene.add(obj70); | ||
+ | |||
+ | var obj71 = new THREE.Object3D(); | ||
+ | obj71.name = " | ||
+ | obj71.userData.explodable = 1; | ||
+ | obj71.userData.points = []; | ||
+ | obj71.userData.points.push(new PMPoint(-0.6, | ||
+ | obj71.userData.points.push(new PMPoint(-0.541401, | ||
+ | obj71.userData.points.push(new PMPoint(-0.566161, | ||
+ | |||
+ | obj71.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj71.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj71.userData.pointlabels = [" | ||
+ | obj71.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj71.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj71.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj71.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj71); | ||
+ | scene.add(obj71); | ||
+ | |||
+ | var obj72 = new THREE.Object3D(); | ||
+ | obj72.name = " | ||
+ | obj72.userData.explodable = 1; | ||
+ | obj72.userData.points = []; | ||
+ | obj72.userData.points.push(new PMPoint(-0.6, | ||
+ | obj72.userData.points.push(new PMPoint(-0.64878, | ||
+ | obj72.userData.points.push(new PMPoint(-0.630314, | ||
+ | |||
+ | obj72.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj72.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj72.userData.pointlabels = [" | ||
+ | obj72.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj72.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj72.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj72.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj72); | ||
+ | scene.add(obj72); | ||
+ | |||
+ | var obj73 = new THREE.Object3D(); | ||
+ | obj73.name = " | ||
+ | obj73.userData.explodable = 1; | ||
+ | obj73.userData.points = []; | ||
+ | obj73.userData.points.push(new PMPoint(-0.724138, | ||
+ | obj73.userData.points.push(new PMPoint(-0.64878, | ||
+ | obj73.userData.points.push(new PMPoint(-0.670103, | ||
+ | |||
+ | obj73.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj73.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj73.userData.pointlabels = [" | ||
+ | obj73.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj73.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj73.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj73.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj73); | ||
+ | scene.add(obj73); | ||
+ | |||
+ | var obj74 = new THREE.Object3D(); | ||
+ | obj74.name = " | ||
+ | obj74.userData.explodable = 1; | ||
+ | obj74.userData.points = []; | ||
+ | obj74.userData.points.push(new PMPoint(-0.724138, | ||
+ | obj74.userData.points.push(new PMPoint(-0.8, | ||
+ | obj74.userData.points.push(new PMPoint(-0.778462, | ||
+ | |||
+ | obj74.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj74.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj74.userData.pointlabels = [" | ||
+ | obj74.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj74.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj74.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj74.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj74); | ||
+ | scene.add(obj74); | ||
+ | |||
+ | var obj75 = new THREE.Object3D(); | ||
+ | obj75.name = " | ||
+ | obj75.userData.explodable = 1; | ||
+ | obj75.userData.points = []; | ||
+ | obj75.userData.points.push(new PMPoint(-0.849057, | ||
+ | obj75.userData.points.push(new PMPoint(-0.8, | ||
+ | obj75.userData.points.push(new PMPoint(-0.81864, | ||
+ | |||
+ | obj75.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj75.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj75.userData.pointlabels = [" | ||
+ | obj75.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj75.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj75.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj75.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj75); | ||
+ | scene.add(obj75); | ||
+ | |||
+ | var obj76 = new THREE.Object3D(); | ||
+ | obj76.name = " | ||
+ | obj76.userData.explodable = 1; | ||
+ | obj76.userData.points = []; | ||
+ | obj76.userData.points.push(new PMPoint(-0.849057, | ||
+ | obj76.userData.points.push(new PMPoint(-0.905882, | ||
+ | obj76.userData.points.push(new PMPoint(-0.882353, | ||
+ | |||
+ | obj76.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj76.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj76.userData.pointlabels = [" | ||
+ | obj76.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj76.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj76.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj76.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj76); | ||
+ | scene.add(obj76); | ||
+ | |||
+ | var obj77 = new THREE.Object3D(); | ||
+ | obj77.name = " | ||
+ | obj77.userData.explodable = 1; | ||
+ | obj77.userData.points = []; | ||
+ | obj77.userData.points.push(new PMPoint(-1, 0, 0.2)); | ||
+ | obj77.userData.points.push(new PMPoint(-0.905882, | ||
+ | obj77.userData.points.push(new PMPoint(-0.936, | ||
+ | |||
+ | obj77.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj77.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj77.userData.pointlabels = [" | ||
+ | obj77.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj77.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj77.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj77.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj77); | ||
+ | scene.add(obj77); | ||
+ | |||
+ | var obj78 = new THREE.Object3D(); | ||
+ | obj78.name = " | ||
+ | obj78.userData.explodable = 1; | ||
+ | obj78.userData.points = []; | ||
+ | obj78.userData.points.push(new PMPoint(-1, 0, 0.2)); | ||
+ | obj78.userData.points.push(new PMPoint(-0.905882, | ||
+ | obj78.userData.points.push(new PMPoint(-0.936, | ||
+ | |||
+ | obj78.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj78.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj78.userData.pointlabels = [" | ||
+ | obj78.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj78.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj78.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj78.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj78); | ||
+ | scene.add(obj78); | ||
+ | |||
+ | var obj79 = new THREE.Object3D(); | ||
+ | obj79.name = " | ||
+ | obj79.userData.explodable = 1; | ||
+ | obj79.userData.points = []; | ||
+ | obj79.userData.points.push(new PMPoint(-0.849057, | ||
+ | obj79.userData.points.push(new PMPoint(-0.905882, | ||
+ | obj79.userData.points.push(new PMPoint(-0.882353, | ||
+ | |||
+ | obj79.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj79.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj79.userData.pointlabels = [" | ||
+ | obj79.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj79.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj79.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj79.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj79); | ||
+ | scene.add(obj79); | ||
+ | |||
+ | var obj80 = new THREE.Object3D(); | ||
+ | obj80.name = " | ||
+ | obj80.userData.explodable = 1; | ||
+ | obj80.userData.points = []; | ||
+ | obj80.userData.points.push(new PMPoint(-0.849057, | ||
+ | obj80.userData.points.push(new PMPoint(-0.8, | ||
+ | obj80.userData.points.push(new PMPoint(-0.81864, | ||
+ | |||
+ | obj80.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj80.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj80.userData.pointlabels = [" | ||
+ | obj80.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj80.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj80.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj80.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj80); | ||
+ | scene.add(obj80); | ||
+ | |||
+ | var obj81 = new THREE.Object3D(); | ||
+ | obj81.name = " | ||
+ | obj81.userData.explodable = 1; | ||
+ | obj81.userData.points = []; | ||
+ | obj81.userData.points.push(new PMPoint(-0.724138, | ||
+ | obj81.userData.points.push(new PMPoint(-0.8, | ||
+ | obj81.userData.points.push(new PMPoint(-0.778462, | ||
+ | |||
+ | obj81.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj81.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj81.userData.pointlabels = [" | ||
+ | obj81.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj81.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj81.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj81.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj81); | ||
+ | scene.add(obj81); | ||
+ | |||
+ | var obj82 = new THREE.Object3D(); | ||
+ | obj82.name = " | ||
+ | obj82.userData.explodable = 1; | ||
+ | obj82.userData.points = []; | ||
+ | obj82.userData.points.push(new PMPoint(-0.724138, | ||
+ | obj82.userData.points.push(new PMPoint(-0.64878, | ||
+ | obj82.userData.points.push(new PMPoint(-0.670103, | ||
+ | |||
+ | obj82.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj82.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj82.userData.pointlabels = [" | ||
+ | obj82.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj82.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj82.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj82.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj82); | ||
+ | scene.add(obj82); | ||
+ | |||
+ | var obj83 = new THREE.Object3D(); | ||
+ | obj83.name = " | ||
+ | obj83.userData.explodable = 1; | ||
+ | obj83.userData.points = []; | ||
+ | obj83.userData.points.push(new PMPoint(-0.6, | ||
+ | obj83.userData.points.push(new PMPoint(-0.64878, | ||
+ | obj83.userData.points.push(new PMPoint(-0.630314, | ||
+ | |||
+ | obj83.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj83.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj83.userData.pointlabels = [" | ||
+ | obj83.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj83.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj83.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj83.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj83); | ||
+ | scene.add(obj83); | ||
+ | |||
+ | var obj84 = new THREE.Object3D(); | ||
+ | obj84.name = " | ||
+ | obj84.userData.explodable = 1; | ||
+ | obj84.userData.points = []; | ||
+ | obj84.userData.points.push(new PMPoint(-0.6, | ||
+ | obj84.userData.points.push(new PMPoint(-0.541401, | ||
+ | obj84.userData.points.push(new PMPoint(-0.566161, | ||
+ | |||
+ | obj84.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj84.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj84.userData.pointlabels = [" | ||
+ | obj84.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj84.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj84.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj84.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj84); | ||
+ | scene.add(obj84); | ||
+ | |||
+ | var obj85 = new THREE.Object3D(); | ||
+ | obj85.name = " | ||
+ | obj85.userData.explodable = 1; | ||
+ | obj85.userData.points = []; | ||
+ | obj85.userData.points.push(new PMPoint(-0.384615, | ||
+ | obj85.userData.points.push(new PMPoint(-0.541401, | ||
+ | obj85.userData.points.push(new PMPoint(-0.507692, | ||
+ | |||
+ | obj85.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj85.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj85.userData.pointlabels = [" | ||
+ | obj85.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj85.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj85.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj85.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj85); | ||
+ | scene.add(obj85); | ||
+ | |||
+ | var obj86 = new THREE.Object3D(); | ||
+ | obj86.name = " | ||
+ | obj86.userData.explodable = 1; | ||
+ | obj86.userData.points = []; | ||
+ | obj86.userData.points.push(new PMPoint(-0.384615, | ||
+ | obj86.userData.points.push(new PMPoint(-0.219512, | ||
+ | obj86.userData.points.push(new PMPoint(-0.256506, | ||
+ | |||
+ | obj86.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj86.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj86.userData.pointlabels = [" | ||
+ | obj86.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj86.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj86.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj86.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj86); | ||
+ | scene.add(obj86); | ||
+ | |||
+ | var obj87 = new THREE.Object3D(); | ||
+ | obj87.name = " | ||
+ | obj87.userData.explodable = 1; | ||
+ | obj87.userData.points = []; | ||
+ | obj87.userData.points.push(new PMPoint(-0.152941, | ||
+ | obj87.userData.points.push(new PMPoint(-0.219512, | ||
+ | obj87.userData.points.push(new PMPoint(-0.191753, | ||
+ | |||
+ | obj87.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj87.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj87.userData.pointlabels = [" | ||
+ | obj87.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj87.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj87.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj87.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj87); | ||
+ | scene.add(obj87); | ||
+ | |||
+ | var obj88 = new THREE.Object3D(); | ||
+ | obj88.name = " | ||
+ | obj88.userData.explodable = 1; | ||
+ | obj88.userData.points = []; | ||
+ | obj88.userData.points.push(new PMPoint(-0.152941, | ||
+ | obj88.userData.points.push(new PMPoint(-0.0950226, | ||
+ | obj88.userData.points.push(new PMPoint(-0.117241, | ||
+ | |||
+ | obj88.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj88.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj88.userData.pointlabels = [" | ||
+ | obj88.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj88.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj88.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj88.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj88); | ||
+ | scene.add(obj88); | ||
+ | |||
+ | var obj89 = new THREE.Object3D(); | ||
+ | obj89.name = " | ||
+ | obj89.userData.explodable = 1; | ||
+ | obj89.userData.points = []; | ||
+ | obj89.userData.points.push(new PMPoint(0, -1, 0.003125)); | ||
+ | obj89.userData.points.push(new PMPoint(-0.0950226, | ||
+ | obj89.userData.points.push(new PMPoint(-0.0688836, | ||
+ | |||
+ | obj89.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj89.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj89.userData.pointlabels = [" | ||
+ | obj89.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj89.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj89.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj89.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj89); | ||
+ | scene.add(obj89); | ||
+ | |||
+ | var obj90 = new THREE.Object3D(); | ||
+ | obj90.name = " | ||
+ | obj90.userData.explodable = 1; | ||
+ | obj90.userData.points = []; | ||
+ | obj90.userData.points.push(new PMPoint(0, -1, 0.003125)); | ||
+ | obj90.userData.points.push(new PMPoint(0.104972, | ||
+ | obj90.userData.points.push(new PMPoint(0.0739726, | ||
+ | |||
+ | obj90.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj90.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj90.userData.pointlabels = [" | ||
+ | obj90.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj90.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj90.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj90.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj90); | ||
+ | scene.add(obj90); | ||
+ | |||
+ | var obj91 = new THREE.Object3D(); | ||
+ | obj91.name = " | ||
+ | obj91.userData.explodable = 1; | ||
+ | obj91.userData.points = []; | ||
+ | obj91.userData.points.push(new PMPoint(0.180328, | ||
+ | obj91.userData.points.push(new PMPoint(0.104972, | ||
+ | obj91.userData.points.push(new PMPoint(0.132743, | ||
+ | |||
+ | obj91.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj91.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj91.userData.pointlabels = [" | ||
+ | obj91.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj91.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj91.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj91.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj91); | ||
+ | scene.add(obj91); | ||
+ | |||
+ | var obj92 = new THREE.Object3D(); | ||
+ | obj92.name = " | ||
+ | obj92.userData.explodable = 1; | ||
+ | obj92.userData.points = []; | ||
+ | obj92.userData.points.push(new PMPoint(0.180328, | ||
+ | obj92.userData.points.push(new PMPoint(0.28, | ||
+ | obj92.userData.points.push(new PMPoint(0.236593, | ||
+ | |||
+ | obj92.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj92.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj92.userData.pointlabels = [" | ||
+ | obj92.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj92.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj92.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj92.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj92); | ||
+ | scene.add(obj92); | ||
+ | |||
+ | var obj93 = new THREE.Object3D(); | ||
+ | obj93.name = " | ||
+ | obj93.userData.explodable = 1; | ||
+ | obj93.userData.points = []; | ||
+ | obj93.userData.points.push(new PMPoint(0.6, | ||
+ | obj93.userData.points.push(new PMPoint(0.28, | ||
+ | obj93.userData.points.push(new PMPoint(0.342282, | ||
+ | |||
+ | obj93.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj93.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj93.userData.pointlabels = [" | ||
+ | obj93.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj93.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj93.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj93.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj93); | ||
+ | scene.add(obj93); | ||
+ | |||
+ | // COMMON_CODE_BLOCK_BEGIN | ||
+ | function textSpriteMaterial(message, | ||
+ | if ( parameters === undefined ) parameters = {}; | ||
+ | var fontface = " | ||
+ | var fontsize = parameters.hasOwnProperty(" | ||
+ | fontsize = fontsize*10; | ||
+ | var lines = message.split(' | ||
+ | var size = 512; | ||
+ | for(var i = 0; i< | ||
+ | var tmp = lines[i].length; | ||
+ | while(tmp*fontsize > size){ | ||
+ | | ||
+ | } | ||
+ | } | ||
+ | | ||
+ | var canvas = document.createElement(' | ||
+ | canvas.width = size; | ||
+ | canvas.height = size; | ||
+ | var context = canvas.getContext(' | ||
+ | context.fillStyle = " | ||
+ | context.fill(); | ||
+ | context.font = fontsize + "px " + fontface; | ||
+ | | ||
+ | // text color | ||
+ | context.fillStyle = " | ||
+ | | ||
+ | context.fillText(lines[i], | ||
+ | } | ||
+ | | ||
+ | // canvas contents will be used for a texture | ||
+ | var texture = new THREE.Texture(canvas); | ||
+ | texture.needsUpdate = true; | ||
+ | | ||
+ | var spriteMaterial = new THREE.SpriteMaterial({map: | ||
+ | return spriteMaterial; | ||
+ | } | ||
+ | |||
+ | |||
+ | // ---------------------- INITIALIZING OBJECTS-------------------------------------- | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | |||
+ | function init_object(obj) { | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_points(obj); | ||
+ | modelContains.points = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_pointlabels(obj); | ||
+ | modelContains.pointlabels = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_lines(obj); | ||
+ | modelContains.lines = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_edgelabels(obj); | ||
+ | modelContains.edgelabels = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_arrowheads(obj); | ||
+ | modelContains.arrowheads = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_faces(obj); | ||
+ | modelContains.faces = true; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function init_points(obj) { | ||
+ | var pointgroup = new THREE.Group(); | ||
+ | pointgroup.name = " | ||
+ | var points = obj.userData.points; | ||
+ | var radii = obj.userData.pointradii; | ||
+ | var materials = obj.userData.pointmaterial; | ||
+ | var geometry, | ||
+ | if (!Array.isArray(radii)) { | ||
+ | geometry = new THREE.SphereBufferGeometry(radii); | ||
+ | } | ||
+ | if (!Array.isArray(materials)) { | ||
+ | material = materials; | ||
+ | } | ||
+ | for (var i=0; i< | ||
+ | var point = points[i]; | ||
+ | if (Array.isArray(radii)) { | ||
+ | if (radii[i] == 0) { | ||
+ | continue; | ||
+ | } | ||
+ | geometry = new THREE.SphereBufferGeometry(radii[i]); | ||
+ | } | ||
+ | if (Array.isArray(materials)) { | ||
+ | material = materials[i]; | ||
+ | } | ||
+ | var sphere = new THREE.Mesh(geometry, | ||
+ | point.addSphere(sphere); | ||
+ | pointgroup.add(sphere); | ||
+ | } | ||
+ | obj.add(pointgroup); | ||
+ | } | ||
+ | |||
+ | function init_pointlabels(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var labels = obj.userData.pointlabels; | ||
+ | var pointlabels = new THREE.Group(); | ||
+ | pointlabels.name = " | ||
+ | if (Array.isArray(labels)) { | ||
+ | for (var i=0; i< | ||
+ | var point = points[i]; | ||
+ | var spriteMaterial = textSpriteMaterial( labels[i] ); | ||
+ | var sprite = new THREE.Sprite(spriteMaterial); | ||
+ | point.addLabel(sprite); | ||
+ | pointlabels.add(sprite); | ||
+ | } | ||
+ | } else { | ||
+ | var spriteMaterial = textSpriteMaterial( labels ); | ||
+ | for (var i=0; i< | ||
+ | var point = points[i]; | ||
+ | var sprite = new THREE.Sprite(spriteMaterial); | ||
+ | point.addLabel(sprite); | ||
+ | pointlabels.add(sprite); | ||
+ | } | ||
+ | } | ||
+ | obj.add(pointlabels); | ||
+ | } | ||
+ | |||
+ | function init_lines(obj) { | ||
+ | var edgeindices = obj.userData.edgeindices; | ||
+ | var points = obj.userData.points; | ||
+ | var materials = obj.userData.edgematerial; | ||
+ | var geometry = new THREE.BufferGeometry(); | ||
+ | var bufarr = new Float32Array( obj.userData.edgeindices.length * 3 ); | ||
+ | var bufattr = new THREE.Float32BufferAttribute( bufarr, 3 ); | ||
+ | var geometry = new THREE.BufferGeometry(); | ||
+ | geometry.setAttribute(' | ||
+ | if (Array.isArray(materials)) { | ||
+ | for (var i=0; i< | ||
+ | geometry.addGroup(2*i, | ||
+ | } | ||
+ | } | ||
+ | var lines = new THREE.LineSegments(geometry, | ||
+ | lines.name = " | ||
+ | obj.add(lines); | ||
+ | updateEdgesPosition(obj); | ||
+ | } | ||
+ | |||
+ | function init_edgelabels(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var edgeindices = obj.userData.edgeindices; | ||
+ | var labels = obj.userData.edgelabels; | ||
+ | var edgelabels = new THREE.Group(); | ||
+ | edgelabels.name = " | ||
+ | if (Array.isArray(labels)) { | ||
+ | for (var i=0; i< | ||
+ | var spriteMaterial = textSpriteMaterial( labels[i] ); | ||
+ | var sprite = new THREE.Sprite(spriteMaterial); | ||
+ | sprite.position.copy(new THREE.Vector3().addVectors(points[edgeindices[2*i]].vector, | ||
+ | edgelabels.add(sprite); | ||
+ | } | ||
+ | } else { | ||
+ | var spriteMaterial = textSpriteMaterial( labels ); | ||
+ | for (var i=0; i< | ||
+ | var sprite = new THREE.Sprite(spriteMaterial); | ||
+ | sprite.position.copy(new THREE.Vector3().addVectors(points[edgeindices[2*i]].vector, | ||
+ | edgelabels.add(sprite); | ||
+ | } | ||
+ | } | ||
+ | obj.add(edgelabels); | ||
+ | } | ||
+ | |||
+ | function init_arrowheads(obj) { | ||
+ | var arrowheads = new THREE.Group(); | ||
+ | arrowheads.name = " | ||
+ | var arrowstyle = obj.userData.arrowstyle; | ||
+ | var edgeindices = obj.userData.edgeindices; | ||
+ | var edgematerials = obj.userData.edgematerial; | ||
+ | var points = obj.userData.points; | ||
+ | var material; | ||
+ | if (!Array.isArray(edgematerials)) { | ||
+ | material = new THREE.MeshBasicMaterial( {color: edgematerials.color} ); | ||
+ | } | ||
+ | |||
+ | for (var i=0; i< | ||
+ | var start = points[edgeindices[i]]; | ||
+ | var end = points[edgeindices[i+1]]; | ||
+ | var dist = start.vector.distanceTo( end.vector ) - start.radius() - end.radius(); | ||
+ | if (dist <= 0) { | ||
+ | continue; | ||
+ | } | ||
+ | var dir = new THREE.Vector3().subVectors(end.vector, | ||
+ | dir.normalize(); | ||
+ | var axis = new THREE.Vector3().set(dir.z, | ||
+ | axis.normalize(); | ||
+ | var radians = Math.acos( dir.y ); | ||
+ | var radius = dist/25; | ||
+ | var height = dist/5; | ||
+ | var geometry = new THREE.ConeBufferGeometry(radius, | ||
+ | var position = new THREE.Vector3().addVectors(start.vector, | ||
+ | if (Array.isArray(edgematerials)) { | ||
+ | material = new THREE.MeshBasicMaterial( {color: edgematerials[i].color} ); | ||
+ | } | ||
+ | var cone = new THREE.Mesh( geometry, material ); | ||
+ | cone.quaternion.setFromAxisAngle(axis, | ||
+ | cone.position.copy(position);; | ||
+ | arrowheads.add(cone); | ||
+ | } | ||
+ | obj.add(arrowheads); | ||
+ | } | ||
+ | |||
+ | function init_faces(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var facets = obj.userData.facets; | ||
+ | obj.userData.triangleindices = []; | ||
+ | for (var i=0; i< | ||
+ | facet = facets[i]; | ||
+ | for (var t=0; t< | ||
+ | obj.userData.triangleindices.push(facet[0], | ||
+ | } | ||
+ | } | ||
+ | var bufarr = new Float32Array( obj.userData.triangleindices.length * 3 ); | ||
+ | var bufattr = new THREE.Float32BufferAttribute(bufarr, | ||
+ | | ||
+ | var materials = obj.userData.facetmaterial; | ||
+ | var geometry = new THREE.BufferGeometry(); | ||
+ | var frontmaterials = []; | ||
+ | var backmaterials = []; | ||
+ | geometry.setAttribute(' | ||
+ | if (Array.isArray(materials)) { | ||
+ | var tricount = 0; | ||
+ | var facet; | ||
+ | for (var i=0; i< | ||
+ | facet = facets[i]; | ||
+ | geometry.addGroup(tricount, | ||
+ | tricount += (facet.length-2)*3; | ||
+ | } | ||
+ | for (var j=0; j< | ||
+ | var fmat = materials[j].clone() | ||
+ | fmat.side = THREE.FrontSide; | ||
+ | frontmaterials.push(fmat); | ||
+ | var bmat = materials[j].clone() | ||
+ | bmat.side = THREE.BackSide; | ||
+ | backmaterials.push(bmat); | ||
+ | obj.userData.facetmaterial = frontmaterials.concat(backmaterials); | ||
+ | } | ||
+ | } else if (materials instanceof THREE.Material) { | ||
+ | frontmaterials = materials.clone() | ||
+ | frontmaterials.side = THREE.FrontSide; | ||
+ | backmaterials = materials.clone() | ||
+ | backmaterials.side = THREE.BackSide; | ||
+ | obj.userData.facetmaterial = [frontmaterials, | ||
+ | } | ||
+ | // duplicating the object with front and back should avoid transparency issues | ||
+ | var backmesh = new THREE.Mesh(geometry, | ||
+ | // meshname is used to show/hide objects | ||
+ | backmesh.name = " | ||
+ | obj.add(backmesh); | ||
+ | var frontmesh = new THREE.Mesh(geometry, | ||
+ | frontmesh.name = " | ||
+ | obj.add(frontmesh); | ||
+ | updateFacesPosition(obj); | ||
+ | } | ||
+ | // // | ||
+ | |||
+ | |||
+ | function updateFacesPosition(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var indices = obj.userData.triangleindices; | ||
+ | var faces = obj.getObjectByName(" | ||
+ | var ba = faces.geometry.getAttribute(" | ||
+ | for (var i=0; i< | ||
+ | ba.setXYZ(i, | ||
+ | } | ||
+ | faces.geometry.attributes.position.needsUpdate = true; | ||
+ | | ||
+ | } | ||
+ | |||
+ | function updateEdgesPosition(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var indices = obj.userData.edgeindices; | ||
+ | var lines = obj.getObjectByName(" | ||
+ | var ba = lines.geometry.getAttribute(" | ||
+ | for (var i=0; i< | ||
+ | ba.setXYZ(i, | ||
+ | } | ||
+ | lines.geometry.attributes.position.needsUpdate = true; | ||
+ | } | ||
+ | |||
+ | function onWindowResize() { | ||
+ | renderer.setSize( three.clientWidth, | ||
+ | svgRenderer.setSize( three.clientWidth, | ||
+ | updateCamera(); | ||
+ | } | ||
+ | |||
+ | function updateCamera() { | ||
+ | var width = three.clientWidth; | ||
+ | var height = three.clientHeight; | ||
+ | var aspect = width / height; | ||
+ | if (camera.type == " | ||
+ | camera.left = frustumSize * aspect / - 2; | ||
+ | camera.right = frustumSize * aspect / 2; | ||
+ | camera.top = frustumSize / 2; | ||
+ | camera.bottom = - frustumSize / 2; | ||
+ | } else if (camera.type == " | ||
+ | camera.aspect = aspect; | ||
+ | } | ||
+ | camera.updateProjectionMatrix(); | ||
+ | } | ||
+ | |||
+ | function changeCamera(event) { | ||
+ | var selindex = event.currentTarget.selectedIndex; | ||
+ | camera = cameras[selindex]; | ||
+ | control = controls[selindex]; | ||
+ | control.enabled = true; | ||
+ | for (var i=0; i< | ||
+ | if (i!=selindex) { | ||
+ | controls[i].enabled = false; | ||
+ | } | ||
+ | } | ||
+ | updateCamera(); | ||
+ | } | ||
+ | |||
+ | var camtypenode = document.getElementById(' | ||
+ | camtypenode.onchange = changeCamera; | ||
+ | camtypenode.dispatchEvent(new Event(' | ||
+ | |||
+ | onWindowResize(); | ||
+ | window.addEventListener(' | ||
+ | |||
+ | |||
+ | var xRotationEnabled = false; | ||
+ | var yRotationEnabled = false; | ||
+ | var zRotationEnabled = false; | ||
+ | var rotationSpeedFactor = 1; | ||
+ | var settingsShown = false; | ||
+ | var labelsShown = true; | ||
+ | var intervals = []; | ||
+ | var timeouts = []; | ||
+ | var explodingSpeed = 0.05; | ||
+ | var explodeScale = 0.000001; | ||
+ | var XMLS = new XMLSerializer(); | ||
+ | var svgElement; | ||
+ | var renderId; | ||
+ | |||
+ | var render = function () { | ||
+ | |||
+ | renderId = requestAnimationFrame(render); | ||
+ | |||
+ | // comment in for automatic explosion | ||
+ | // | ||
+ | |||
+ | var phi = 0.02 * rotationSpeedFactor; | ||
+ | |||
+ | if (xRotationEnabled) { | ||
+ | scene.rotation.x += phi; | ||
+ | } | ||
+ | if (yRotationEnabled) { | ||
+ | scene.rotation.y += phi; | ||
+ | } | ||
+ | if (zRotationEnabled) { | ||
+ | scene.rotation.z += phi; | ||
+ | } | ||
+ | |||
+ | control.update(); | ||
+ | renderer.render(scene, | ||
+ | }; | ||
+ | |||
+ | if ( THREE.WEBGL.isWebGLAvailable() ) { | ||
+ | render(); | ||
+ | } else { | ||
+ | var warning = WEBGL.getWebGLErrorMessage(); | ||
+ | three.appendChild( warning ); | ||
+ | } | ||
+ | | ||
+ | function changeTransparency() { | ||
+ | var opacity = 1-Number(event.currentTarget.value); | ||
+ | for (var i=0; i< | ||
+ | child = scene.children[i]; | ||
+ | if ( child.userData.hasOwnProperty(" | ||
+ | if (Array.isArray(child.userData.facetmaterial)) { | ||
+ | for (var j=0; j< | ||
+ | child.userData.facetmaterial[j].opacity = opacity; | ||
+ | } | ||
+ | } else { | ||
+ | child.userData.facetmaterial.opacity = opacity; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function toggleDepthWrite(event) { | ||
+ | depthwrite = event.currentTarget.checked; | ||
+ | for (var i=0; i< | ||
+ | child = scene.children[i]; | ||
+ | if ( child.userData.hasOwnProperty(" | ||
+ | if (Array.isArray(child.userData.facetmaterial)) { | ||
+ | for (var j=0; j< | ||
+ | child.userData.facetmaterial[j].depthWrite = depthwrite; | ||
+ | } | ||
+ | } else { | ||
+ | child.userData.facetmaterial.depthWrite = depthWrite; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function changeRotationX(event){ | ||
+ | xRotationEnabled = event.currentTarget.checked; | ||
+ | } | ||
+ | |||
+ | function changeRotationY(event){ | ||
+ | yRotationEnabled = event.currentTarget.checked; | ||
+ | } | ||
+ | |||
+ | function changeRotationZ(event){ | ||
+ | zRotationEnabled = event.currentTarget.checked; | ||
+ | } | ||
+ | |||
+ | |||
+ | function changeRotationSpeedFactor(event){ | ||
+ | rotationSpeedFactor = Number(event.currentTarget.value); | ||
+ | } | ||
+ | |||
+ | function resetScene(){ | ||
+ | scene.rotation.set(0, | ||
+ | camera.position.set(0, | ||
+ | camera.up.set(0, | ||
+ | } | ||
+ | |||
+ | function showSettings(event){ | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | settingsShown = true; | ||
+ | } | ||
+ | |||
+ | function hideSettings(event){ | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | settingsShown = false; | ||
+ | } | ||
+ | |||
+ | |||
+ | |||
+ | var pos = 150* Math.PI; | ||
+ | |||
+ | function updateFactor() { | ||
+ | pos++; | ||
+ | return Math.sin(.01*pos)+1; | ||
+ | } | ||
+ | |||
+ | // ------------------------ FOLDING ------------------------------------------------ | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | // rotate point p around axis defined by points p1 and p2 by given angle | ||
+ | function rotate(p, p1, p2, angle ){ | ||
+ | angle = -angle; | ||
+ | var x = p.x, y = p.y, z = p.z, | ||
+ | a = p1.x, b = p1.y, c = p1.z, | ||
+ | u = p2.x-p1.x, v = p2.y-p1.y, w = p2.z-p1.z; | ||
+ | var result = []; | ||
+ | var L = u*u + v*v + w*w; | ||
+ | var sqrt = Math.sqrt; | ||
+ | var cos = Math.cos; | ||
+ | var sin = Math.sin; | ||
+ | |||
+ | result[0] = ((a*(v*v+w*w)-u*(b*v+c*w-u*x-v*y-w*z))*(1-cos(angle))+L*x*cos(angle)+sqrt(L)*(-c*v+b*w-w*y+v*z)*sin(angle))/ | ||
+ | result[1] = ((b*(u*u+w*w)-v*(a*u+c*w-u*x-v*y-w*z))*(1-cos(angle))+L*y*cos(angle)+sqrt(L)*(c*u-a*w+w*x-u*z)*sin(angle))/ | ||
+ | result[2] = ((c*(u*u+v*v)-w*(a*u+b*v-u*x-v*y-w*z))*(1-cos(angle))+L*z*cos(angle)+sqrt(L)*(-b*u+a*v-v*x+u*y)*sin(angle))/ | ||
+ | |||
+ | return result; | ||
+ | } | ||
+ | |||
+ | var fold = function(event){ | ||
+ | var obj = foldables[Number(event.currentTarget.name)]; | ||
+ | var foldvalue = Number(event.currentTarget.value); | ||
+ | var scale = foldvalue - obj.userData.oldscale; | ||
+ | |||
+ | for (var j=0; j< | ||
+ | rotateVertices(obj, | ||
+ | } | ||
+ | update(obj); | ||
+ | obj.userData.oldscale += scale; | ||
+ | lookAtBarycenter(obj); | ||
+ | } | ||
+ | |||
+ | function lookAtBarycenter(obj){ | ||
+ | control.target = barycenter(obj); | ||
+ | } | ||
+ | |||
+ | function barycenter(obj) { | ||
+ | var center = new THREE.Vector3(0, | ||
+ | var points = obj.userData.points; | ||
+ | for (var i=0; i< | ||
+ | center.add(points[i].vector); | ||
+ | } | ||
+ | center.divideScalar(points.length); | ||
+ | return center; | ||
+ | } | ||
+ | |||
+ | function rotateVertices(obj, | ||
+ | var axes = obj.userData.axes; | ||
+ | var subtrees = obj.userData.subtrees; | ||
+ | var points = obj.userData.points; | ||
+ | var angles = obj.userData.angles; | ||
+ | if (edge < axes.length){ | ||
+ | for (var j=0; j< | ||
+ | var rotP = rotate(points[subtrees[edge][j]].vector, | ||
+ | points[subtrees[edge][j]].set(rotP[0], | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function update(obj) { | ||
+ | | ||
+ | | ||
+ | } | ||
+ | |||
+ | if (foldables.length) { | ||
+ | var settings = document.getElementById(' | ||
+ | var foldDiv = document.createElement(' | ||
+ | foldDiv.id = ' | ||
+ | var title = document.createElement(' | ||
+ | title.innerHTML = ' | ||
+ | foldDiv.appendChild(title); | ||
+ | foldDiv.className = ' | ||
+ | for (var i=0; i< | ||
+ | var range = document.createElement(' | ||
+ | range.type = ' | ||
+ | range.min = 0; | ||
+ | range.max = 1; | ||
+ | range.value = 0; | ||
+ | range.step = 0.001; | ||
+ | range.name = String(i); | ||
+ | range.oninput = fold; | ||
+ | foldDiv.appendChild(range); | ||
+ | } | ||
+ | lookAtBarycenter(foldables[0]); | ||
+ | settings.insertBefore(foldDiv, | ||
+ | } | ||
+ | |||
+ | | ||
+ | // ---------------------- EXPLOSION ------------------------------------------------ | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | |||
+ | if (explodableModel) { | ||
+ | for (var i=0; i< | ||
+ | obj = scene.children[i]; | ||
+ | if ( obj.userData.explodable ) { | ||
+ | computeCentroid(obj); | ||
+ | } | ||
+ | } | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | explode(0.000001); | ||
+ | } | ||
+ | |||
+ | function computeCentroid(obj) { | ||
+ | centroid = new THREE.Vector3(); | ||
+ | obj.userData.points.forEach(function(pmpoint) { | ||
+ | centroid.add(pmpoint.vector); | ||
+ | }); | ||
+ | centroid.divideScalar(obj.userData.points.length); | ||
+ | obj.userData.centroid = centroid; | ||
+ | } | ||
+ | |||
+ | function explode(factor) { | ||
+ | for (var i=0; i< | ||
+ | var obj = scene.children[i]; | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | var c = obj.userData.centroid; | ||
+ | obj.position.set(c.x*factor, | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function triggerExplode(event){ | ||
+ | explodeScale = Number(event.currentTarget.value); | ||
+ | explode(explodeScale); | ||
+ | } | ||
+ | |||
+ | function setExplodingSpeed(event){ | ||
+ | explodingSpeed = Number(event.currentTarget.value); | ||
+ | } | ||
+ | |||
+ | function triggerAutomaticExplode(event){ | ||
+ | if (event.currentTarget.checked){ | ||
+ | startExploding(); | ||
+ | } else { | ||
+ | clearIntervals(); | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function startExploding(){ | ||
+ | intervals.push(setInterval(explodingInterval, | ||
+ | } | ||
+ | |||
+ | |||
+ | function explodingInterval(){ | ||
+ | explodeScale += explodingSpeed; | ||
+ | if (explodeScale <= 6){ | ||
+ | explode(explodeScale); | ||
+ | } | ||
+ | else{ | ||
+ | explode(6); | ||
+ | explodeScale = 6; | ||
+ | clearIntervals(); | ||
+ | timeouts.push(setTimeout(startUnexploding, | ||
+ | } | ||
+ | document.getElementById(' | ||
+ | } | ||
+ | |||
+ | |||
+ | function startUnexploding(){ | ||
+ | intervals.push(setInterval(unexplodingInterval, | ||
+ | } | ||
+ | |||
+ | function unexplodingInterval(){ | ||
+ | explodeScale -= explodingSpeed; | ||
+ | if (explodeScale >= 0){ | ||
+ | explode(explodeScale); | ||
+ | } | ||
+ | else { | ||
+ | explode(0); | ||
+ | explodeScale = 0; | ||
+ | clearIntervals(); | ||
+ | timeouts.push(setTimeout(startExploding, | ||
+ | } | ||
+ | document.getElementById(' | ||
+ | } | ||
+ | |||
+ | function clearIntervals(){ | ||
+ | intervals.forEach(function(interval){ | ||
+ | clearInterval(interval); | ||
+ | }); | ||
+ | intervals = []; | ||
+ | timeouts.forEach(function(timeout){ | ||
+ | clearTimeout(timeout); | ||
+ | }); | ||
+ | timeouts = []; | ||
+ | } | ||
+ | |||
+ | // ---------------------- DISPLAY -------------------------------------------------- | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | |||
+ | const objectTypeInnerHTMLs = { points: " | ||
+ | const objectTypeVisible = {}; | ||
+ | Object.assign(objectTypeVisible, | ||
+ | const sortedObjectTypeKeys = Object.keys(objectTypeInnerHTMLs).sort(); | ||
+ | const shownObjectTypesList = document.getElementById(' | ||
+ | |||
+ | function setVisibility(bool, | ||
+ | for (var i=0; i< | ||
+ | var obj = scene.children[i].getObjectByName(objname); | ||
+ | if (obj) { | ||
+ | obj.visible = bool; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function toggleObjectTypeVisibility(event){ | ||
+ | var name = event.currentTarget.name; | ||
+ | var checked = event.currentTarget.checked; | ||
+ | objectTypeVisible[name] = checked; | ||
+ | if (name == " | ||
+ | setVisibility(checked," | ||
+ | setVisibility(checked," | ||
+ | } else { | ||
+ | setVisibility(checked, | ||
+ | } | ||
+ | } | ||
+ | |||
+ | for (var i=0; i< | ||
+ | var key = sortedObjectTypeKeys[i]; | ||
+ | if (modelContains[key]) { | ||
+ | var objTypeNode = document.createElement(' | ||
+ | objTypeNode.innerHTML = objectTypeInnerHTMLs[key] + '< | ||
+ | var checkbox = document.createElement(' | ||
+ | checkbox.type = ' | ||
+ | checkbox.checked = true; | ||
+ | checkbox.name = key; | ||
+ | checkbox.onchange = toggleObjectTypeVisibility; | ||
+ | shownObjectTypesList.appendChild(checkbox); | ||
+ | shownObjectTypesList.appendChild(objTypeNode); | ||
+ | } | ||
+ | } | ||
+ | |||
+ | // ------------------------------------------------------ | ||
+ | |||
+ | function toggleObjectVisibility(event){ | ||
+ | var nr = Number(event.currentTarget.name); | ||
+ | scene.children[nr].visible = event.currentTarget.checked; | ||
+ | } | ||
+ | |||
+ | // append checkboxes for displaying or hiding objects | ||
+ | var shownObjectsList = document.getElementById(' | ||
+ | for (var i=0; i< | ||
+ | obj = scene.children[i]; | ||
+ | var objNode = document.createElement(' | ||
+ | objNode.innerHTML = obj.name + '< | ||
+ | var checkbox = document.createElement(' | ||
+ | checkbox.type = ' | ||
+ | checkbox.checked = true; | ||
+ | checkbox.name = String(i); | ||
+ | checkbox.onchange = toggleObjectVisibility; | ||
+ | shownObjectsList.appendChild(checkbox); | ||
+ | shownObjectsList.appendChild(objNode); | ||
+ | } | ||
+ | |||
+ | // ---------------------- SVG ------------------------------------------------------ | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | |||
+ | function takeSvgScreenshot() { | ||
+ | if (objectTypeVisible[" | ||
+ | setVisibility(false," | ||
+ | } | ||
+ | if (objectTypeVisible[" | ||
+ | setVisibility(false," | ||
+ | } | ||
+ | svgRenderer.render(scene, | ||
+ | svgElement = XMLS.serializeToString(svgRenderer.domElement); | ||
+ | | ||
+ | if (objectTypeVisible[" | ||
+ | setVisibility(true," | ||
+ | } | ||
+ | if (objectTypeVisible[" | ||
+ | setVisibility(true," | ||
+ | } | ||
+ | |||
+ | if (document.getElementById(' | ||
+ | //show in new tab | ||
+ | var myWindow = window.open("","" | ||
+ | myWindow.document.body.innerHTML = svgElement; | ||
+ | } else{ | ||
+ | // download svg file | ||
+ | download(" | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function download(filename, | ||
+ | var element = document.createElement(' | ||
+ | element.setAttribute(' | ||
+ | element.setAttribute(' | ||
+ | |||
+ | element.style.display = ' | ||
+ | document.body.appendChild(element); | ||
+ | |||
+ | element.click(); | ||
+ | |||
+ | document.body.removeChild(element); | ||
+ | } | ||
+ | |||
+ | |||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | |||
+ | |||
+ | // ------------------ SHORTCUTS -------------------------------------------- | ||
+ | // ------------------------------------------------------------------------- | ||
+ | |||
+ | /** | ||
+ | * http:// | ||
+ | * Version : 2.01.B | ||
+ | * By Binny V A | ||
+ | * License : BSD | ||
+ | */ | ||
+ | shortcut = { | ||
+ | ' | ||
+ | ' | ||
+ | //Provide a set of default options | ||
+ | var default_options = { | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | } | ||
+ | if(!opt) opt = default_options; | ||
+ | else { | ||
+ | for(var dfo in default_options) { | ||
+ | if(typeof opt[dfo] == ' | ||
+ | } | ||
+ | } | ||
+ | |||
+ | var ele = opt.target; | ||
+ | if(typeof opt.target == ' | ||
+ | var ths = this; | ||
+ | shortcut_combination = shortcut_combination.toLowerCase(); | ||
+ | |||
+ | //The function to be called at keypress | ||
+ | var func = function(e) { | ||
+ | e = e || window.event; | ||
+ | |||
+ | if(opt[' | ||
+ | var element; | ||
+ | if(e.target) element=e.target; | ||
+ | else if(e.srcElement) element=e.srcElement; | ||
+ | if(element.nodeType==3) element=element.parentNode; | ||
+ | |||
+ | if(element.tagName == ' | ||
+ | } | ||
+ | |||
+ | //Find Which key is pressed | ||
+ | if (e.keyCode) code = e.keyCode; | ||
+ | else if (e.which) code = e.which; | ||
+ | var character = String.fromCharCode(code).toLowerCase(); | ||
+ | |||
+ | if(code == 188) character=","; | ||
+ | if(code == 190) character=" | ||
+ | |||
+ | var keys = shortcut_combination.split(" | ||
+ | //Key Pressed - counts the number of valid keypresses - if it is same as the number of keys, the shortcut function is invoked | ||
+ | var kp = 0; | ||
+ | |||
+ | //Work around for stupid Shift key bug created by using lowercase - as a result the shift+num combination was broken | ||
+ | var shift_nums = { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | ";":":", | ||
+ | "'":" | ||
+ | ",":"<", | ||
+ | " | ||
+ | "/":"?", | ||
+ | " | ||
+ | } | ||
+ | // | ||
+ | var special_keys = { | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | } | ||
+ | |||
+ | var modifiers = { | ||
+ | shift: { wanted: | ||
+ | ctrl : { wanted: | ||
+ | alt | ||
+ | meta : { wanted: | ||
+ | }; | ||
+ | | ||
+ | if(e.ctrlKey) modifiers.ctrl.pressed = true; | ||
+ | if(e.shiftKey) modifiers.shift.pressed = true; | ||
+ | if(e.altKey) modifiers.alt.pressed = true; | ||
+ | if(e.metaKey) | ||
+ | | ||
+ | for(var i=0; k=keys[i], | ||
+ | // | ||
+ | if(k == ' | ||
+ | kp++; | ||
+ | modifiers.ctrl.wanted = true; | ||
+ | |||
+ | } else if(k == ' | ||
+ | kp++; | ||
+ | modifiers.shift.wanted = true; | ||
+ | |||
+ | } else if(k == ' | ||
+ | kp++; | ||
+ | modifiers.alt.wanted = true; | ||
+ | } else if(k == ' | ||
+ | kp++; | ||
+ | modifiers.meta.wanted = true; | ||
+ | } else if(k.length > 1) { //If it is a special key | ||
+ | if(special_keys[k] == code) kp++; | ||
+ | |||
+ | } else if(opt[' | ||
+ | if(opt[' | ||
+ | |||
+ | } else { //The special keys did not match | ||
+ | if(character == k) kp++; | ||
+ | else { | ||
+ | if(shift_nums[character] && e.shiftKey) { //Stupid Shift key bug created by using lowercase | ||
+ | character = shift_nums[character]; | ||
+ | if(character == k) kp++; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | if(kp == keys.length && | ||
+ | modifiers.ctrl.pressed == modifiers.ctrl.wanted && | ||
+ | modifiers.shift.pressed == modifiers.shift.wanted && | ||
+ | modifiers.alt.pressed == modifiers.alt.wanted && | ||
+ | modifiers.meta.pressed == modifiers.meta.wanted) { | ||
+ | callback(e); | ||
+ | |||
+ | if(!opt[' | ||
+ | // | ||
+ | e.cancelBubble = true; | ||
+ | e.returnValue = false; | ||
+ | |||
+ | // | ||
+ | if (e.stopPropagation) { | ||
+ | e.stopPropagation(); | ||
+ | e.preventDefault(); | ||
+ | } | ||
+ | return false; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | this.all_shortcuts[shortcut_combination] = { | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | }; | ||
+ | //Attach the function with the event | ||
+ | if(ele.addEventListener) ele.addEventListener(opt[' | ||
+ | else if(ele.attachEvent) ele.attachEvent(' | ||
+ | else ele[' | ||
+ | }, | ||
+ | |||
+ | //Remove the shortcut - just specify the shortcut and I will remove the binding | ||
+ | ' | ||
+ | shortcut_combination = shortcut_combination.toLowerCase(); | ||
+ | var binding = this.all_shortcuts[shortcut_combination]; | ||
+ | delete(this.all_shortcuts[shortcut_combination]) | ||
+ | if(!binding) return; | ||
+ | var type = binding[' | ||
+ | var ele = binding[' | ||
+ | var callback = binding[' | ||
+ | |||
+ | if(ele.detachEvent) ele.detachEvent(' | ||
+ | else if(ele.removeEventListener) ele.removeEventListener(type, | ||
+ | else ele[' | ||
+ | } | ||
+ | } | ||
+ | |||
+ | shortcut.add(" | ||
+ | var event = new Event(' | ||
+ | if (settingsShown){ | ||
+ | document.getElementById(' | ||
+ | } else { | ||
+ | document.getElementById(' | ||
+ | } | ||
+ | }); | ||
+ | |||
+ | |||
+ | // COMMON_CODE_BLOCK_END | ||
+ | |||
+ | });}); | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | <code perl> | ||
+ | > $s = new HyperbolicSurface(DCEL=> | ||
+ | > $p = secondary_polyhedron($s, | ||
+ | > $p-> | ||
+ | </ | ||
+ | < | ||
+ | <!-- | ||
+ | polymake for knusper | ||
+ | Thu Mar 3 00:31:46 2022 | ||
+ | p_bounded | ||
+ | --> | ||
+ | |||
+ | |||
+ | < | ||
+ | < | ||
+ | <meta charset=utf-8> | ||
+ | < | ||
+ | < | ||
+ | /* | ||
+ | // COMMON_CODE_BLOCK_BEGIN | ||
+ | */ | ||
+ | html {overflow: scroll;} | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | # | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | } | ||
+ | /* | ||
+ | // COMMON_CODE_BLOCK_END | ||
+ | */ | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | <div id=' | ||
+ | <div class=group id=' | ||
+ | < | ||
+ | < | ||
+ | <div class=indented>< | ||
+ | </ | ||
+ | |||
+ | <div class=group id=' | ||
+ | < | ||
+ | <div class=indented> | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | <div class=suboption> | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | |||
+ | <div class=group id=' | ||
+ | < | ||
+ | <div class=indented> | ||
+ | < | ||
+ | </ | ||
+ | <div class=suboption> | ||
+ | <div class=indented> | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | < | ||
+ | <div class=indented> | ||
+ | < | ||
+ | <select id=" | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | <div class=group id=' | ||
+ | < | ||
+ | <div class=indented> | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | </ | ||
+ | <img id=' | ||
+ | <img id=' | ||
+ | <div id=" | ||
+ | </ | ||
+ | < | ||
+ | requirejs.config({ | ||
+ | paths: { | ||
+ | three: '/ | ||
+ | TrackballControls: | ||
+ | OrbitControls: | ||
+ | Projector: '/ | ||
+ | SVGRenderer: | ||
+ | WEBGL: '/ | ||
+ | }, | ||
+ | shim: { | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | } | ||
+ | }); | ||
+ | | ||
+ | require([' | ||
+ | window.THREE = THREE; | ||
+ | require([' | ||
+ | | ||
+ | THREE.TrackballControls = TrackballControls; | ||
+ | THREE.OrbitControls = OrbitControls; | ||
+ | THREE.Projector = Projector; | ||
+ | THREE.SVGRenderer = SVGRenderer; | ||
+ | THREE.WEBGL = WEBGL; | ||
+ | |||
+ | // COMMON_CODE_BLOCK_BEGIN | ||
+ | |||
+ | const intervalLength = 25; // for automatic animations | ||
+ | const explodableModel = false; | ||
+ | const modelContains = { points: false, pointlabels: | ||
+ | const foldables = []; | ||
+ | |||
+ | var three = document.getElementById(" | ||
+ | var scene = new THREE.Scene(); | ||
+ | var renderer = new THREE.WebGLRenderer( { antialias: true } ); | ||
+ | var svgRenderer = new THREE.SVGRenderer( { antialias: true } ); | ||
+ | renderer.setPixelRatio( window.devicePixelRatio ); | ||
+ | renderer.setClearColor(0xFFFFFF, | ||
+ | svgRenderer.setClearColor(0xFFFFFF, | ||
+ | three.appendChild(renderer.domElement); | ||
+ | |||
+ | var frustumSize = 4; | ||
+ | var cameras = [new THREE.PerspectiveCamera(75, | ||
+ | cameras.forEach(function(cam) { | ||
+ | cam.position.set(0, | ||
+ | cam.lookAt(0, | ||
+ | cam.up.set(0, | ||
+ | }); | ||
+ | var controls = [new THREE.TrackballControls(cameras[0], | ||
+ | var camera, control; | ||
+ | |||
+ | controls[0].zoomSpeed = 0.2; | ||
+ | controls[0].rotateSpeed = 4; | ||
+ | |||
+ | |||
+ | // class to allow move points together with labels and spheres | ||
+ | var PMPoint = function (x,y,z) { | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | PMPoint.prototype.addLabel = function(labelsprite) { | ||
+ | | ||
+ | | ||
+ | } | ||
+ | PMPoint.prototype.addSphere = function(spheremesh) { | ||
+ | | ||
+ | | ||
+ | } | ||
+ | PMPoint.prototype.set = function(x, | ||
+ | | ||
+ | if (this.sprite) { | ||
+ | this.sprite.position.copy(this.vector); | ||
+ | } | ||
+ | if (this.sphere) { | ||
+ | this.sphere.position.copy(this.vector); | ||
+ | } | ||
+ | } | ||
+ | PMPoint.prototype.radius = function() { | ||
+ | if (this.sphere) { | ||
+ | return this.sphere.geometry.parameters.radius; | ||
+ | } else { | ||
+ | return 0; | ||
+ | } | ||
+ | }; | ||
+ | // select the target node | ||
+ | var target = document.querySelector('# | ||
+ | |||
+ | // create an observer instance | ||
+ | var observer = new MutationObserver(function(mutations) { | ||
+ | | ||
+ | if (mutation.removedNodes && mutation.removedNodes.length > 0) { | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | }); | ||
+ | }); | ||
+ | |||
+ | // configuration of the observer: | ||
+ | var config = { childList: true, characterData: | ||
+ | |||
+ | // pass in the target node, as well as the observer options | ||
+ | while (target) { | ||
+ | if (target.className==" | ||
+ | observer.observe(target, | ||
+ | break; | ||
+ | } | ||
+ | | ||
+ | } | ||
+ | |||
+ | // COMMON_CODE_BLOCK_END | ||
+ | |||
+ | var obj0 = new THREE.Object3D(); | ||
+ | obj0.name = " | ||
+ | obj0.userData.explodable = 1; | ||
+ | obj0.userData.points = []; | ||
+ | obj0.userData.points.push(new PMPoint(0.120339, | ||
+ | obj0.userData.points.push(new PMPoint(0.150264, | ||
+ | obj0.userData.points.push(new PMPoint(0.22754, | ||
+ | obj0.userData.points.push(new PMPoint(0.22748, | ||
+ | obj0.userData.points.push(new PMPoint(0.120167, | ||
+ | obj0.userData.points.push(new PMPoint(0.174312, | ||
+ | obj0.userData.points.push(new PMPoint(0.390909, | ||
+ | obj0.userData.points.push(new PMPoint(0.202302, | ||
+ | obj0.userData.points.push(new PMPoint(0.0823926, | ||
+ | obj0.userData.points.push(new PMPoint(0.225353, | ||
+ | obj0.userData.points.push(new PMPoint(-0.437693, | ||
+ | obj0.userData.points.push(new PMPoint(-0.437693, | ||
+ | obj0.userData.points.push(new PMPoint(0.0823657, | ||
+ | obj0.userData.points.push(new PMPoint(0.0142733, | ||
+ | obj0.userData.points.push(new PMPoint(0.390909, | ||
+ | obj0.userData.points.push(new PMPoint(0.248336, | ||
+ | obj0.userData.points.push(new PMPoint(-0.437693, | ||
+ | obj0.userData.points.push(new PMPoint(-0.437693, | ||
+ | obj0.userData.points.push(new PMPoint(0.0142733, | ||
+ | obj0.userData.points.push(new PMPoint(0.0144763, | ||
+ | obj0.userData.points.push(new PMPoint(0.12563, | ||
+ | obj0.userData.points.push(new PMPoint(0.150263, | ||
+ | obj0.userData.points.push(new PMPoint(-0.437693, | ||
+ | obj0.userData.points.push(new PMPoint(0.013813, | ||
+ | obj0.userData.points.push(new PMPoint(-0.437693, | ||
+ | obj0.userData.points.push(new PMPoint(0.368344, | ||
+ | obj0.userData.points.push(new PMPoint(0.390909, | ||
+ | obj0.userData.points.push(new PMPoint(0.368335, | ||
+ | obj0.userData.points.push(new PMPoint(0.390909, | ||
+ | obj0.userData.points.push(new PMPoint(0.390814, | ||
+ | |||
+ | obj0.userData.pointradii = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; | ||
+ | < | ||
+ | obj0.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj0.userData.pointlabels = [" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "]; | ||
+ | obj0.userData.edgeindices = [0, 1, 2, 3, 0, 4, 2, 4, 1, 5, 3, 5, 2, 6, 7, 8, 7, 9, 10, 11, 8, 12, 11, 13, 12, 13, 6, 14, 10, 14, 5, 15, 9, 15, 4, 16, 10, 16, 11, 17, 13, 18, 17, 18, 8, 19, 18, 19, 7, 20, 1, 21, 9, 21, 20, 21, 0, 22, 16, 22, 19, 23, 20, 23, 17, 24, 22, 24, 23, 24, 12, 25, 14, 26, 25, 26, 15, 27, 25, 27, 6, 28, 26, 28, 3, 29, 27, 29, 28, 29]; | ||
+ | < | ||
+ | obj0.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj0.userData.facets = [[21, 20, 23, 24, 22, 0, 1], [7, 20, 21, 9], [1, 0, 4, 2, 3, 5], [21, 1, 5, 15, 9], [8, 7, 9, 15, 27, 25, 12], [5, 3, 29, 27, 15], [0, 22, 16, 4], [23, 20, 7, 8, 19], [3, 2, 6, 28, 29], [24, 23, 19, 18, 17], [25, 27, 29, 28, 26], [19, 8, 12, 13, 18], [14, 26, 28, 6], [17, 18, 13, 11], [22, 24, 17, 11, 10, 16], [16, 10, 14, 6, 2, 4], [10, 11, 13, 12, 25, 26, 14]]; | ||
+ | < | ||
+ | obj0.userData.facetmaterial = [new THREE.MeshBasicMaterial( { color: 0xFFB450, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFFB450, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFFB450, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFFB450, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFFB450, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFFB450, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFFB450, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFFB450, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFFB450, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFFB450, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFFB450, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFFB450, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFFB450, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFFB450, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj0); | ||
+ | scene.add(obj0); | ||
+ | |||
+ | // COMMON_CODE_BLOCK_BEGIN | ||
+ | function textSpriteMaterial(message, | ||
+ | if ( parameters === undefined ) parameters = {}; | ||
+ | var fontface = " | ||
+ | var fontsize = parameters.hasOwnProperty(" | ||
+ | fontsize = fontsize*10; | ||
+ | var lines = message.split(' | ||
+ | var size = 512; | ||
+ | for(var i = 0; i< | ||
+ | var tmp = lines[i].length; | ||
+ | while(tmp*fontsize > size){ | ||
+ | | ||
+ | } | ||
+ | } | ||
+ | | ||
+ | var canvas = document.createElement(' | ||
+ | canvas.width = size; | ||
+ | canvas.height = size; | ||
+ | var context = canvas.getContext(' | ||
+ | context.fillStyle = " | ||
+ | context.fill(); | ||
+ | context.font = fontsize + "px " + fontface; | ||
+ | | ||
+ | // text color | ||
+ | context.fillStyle = " | ||
+ | | ||
+ | context.fillText(lines[i], | ||
+ | } | ||
+ | | ||
+ | // canvas contents will be used for a texture | ||
+ | var texture = new THREE.Texture(canvas); | ||
+ | texture.needsUpdate = true; | ||
+ | | ||
+ | var spriteMaterial = new THREE.SpriteMaterial({map: | ||
+ | return spriteMaterial; | ||
+ | } | ||
+ | |||
+ | |||
+ | // ---------------------- INITIALIZING OBJECTS-------------------------------------- | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | |||
+ | function init_object(obj) { | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_points(obj); | ||
+ | modelContains.points = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_pointlabels(obj); | ||
+ | modelContains.pointlabels = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_lines(obj); | ||
+ | modelContains.lines = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_edgelabels(obj); | ||
+ | modelContains.edgelabels = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_arrowheads(obj); | ||
+ | modelContains.arrowheads = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_faces(obj); | ||
+ | modelContains.faces = true; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function init_points(obj) { | ||
+ | var pointgroup = new THREE.Group(); | ||
+ | pointgroup.name = " | ||
+ | var points = obj.userData.points; | ||
+ | var radii = obj.userData.pointradii; | ||
+ | var materials = obj.userData.pointmaterial; | ||
+ | var geometry, | ||
+ | if (!Array.isArray(radii)) { | ||
+ | geometry = new THREE.SphereBufferGeometry(radii); | ||
+ | } | ||
+ | if (!Array.isArray(materials)) { | ||
+ | material = materials; | ||
+ | } | ||
+ | for (var i=0; i< | ||
+ | var point = points[i]; | ||
+ | if (Array.isArray(radii)) { | ||
+ | if (radii[i] == 0) { | ||
+ | continue; | ||
+ | } | ||
+ | geometry = new THREE.SphereBufferGeometry(radii[i]); | ||
+ | } | ||
+ | if (Array.isArray(materials)) { | ||
+ | material = materials[i]; | ||
+ | } | ||
+ | var sphere = new THREE.Mesh(geometry, | ||
+ | point.addSphere(sphere); | ||
+ | pointgroup.add(sphere); | ||
+ | } | ||
+ | obj.add(pointgroup); | ||
+ | } | ||
+ | |||
+ | function init_pointlabels(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var labels = obj.userData.pointlabels; | ||
+ | var pointlabels = new THREE.Group(); | ||
+ | pointlabels.name = " | ||
+ | if (Array.isArray(labels)) { | ||
+ | for (var i=0; i< | ||
+ | var point = points[i]; | ||
+ | var spriteMaterial = textSpriteMaterial( labels[i] ); | ||
+ | var sprite = new THREE.Sprite(spriteMaterial); | ||
+ | point.addLabel(sprite); | ||
+ | pointlabels.add(sprite); | ||
+ | } | ||
+ | } else { | ||
+ | var spriteMaterial = textSpriteMaterial( labels ); | ||
+ | for (var i=0; i< | ||
+ | var point = points[i]; | ||
+ | var sprite = new THREE.Sprite(spriteMaterial); | ||
+ | point.addLabel(sprite); | ||
+ | pointlabels.add(sprite); | ||
+ | } | ||
+ | } | ||
+ | obj.add(pointlabels); | ||
+ | } | ||
+ | |||
+ | function init_lines(obj) { | ||
+ | var edgeindices = obj.userData.edgeindices; | ||
+ | var points = obj.userData.points; | ||
+ | var materials = obj.userData.edgematerial; | ||
+ | var geometry = new THREE.BufferGeometry(); | ||
+ | var bufarr = new Float32Array( obj.userData.edgeindices.length * 3 ); | ||
+ | var bufattr = new THREE.Float32BufferAttribute( bufarr, 3 ); | ||
+ | var geometry = new THREE.BufferGeometry(); | ||
+ | geometry.setAttribute(' | ||
+ | if (Array.isArray(materials)) { | ||
+ | for (var i=0; i< | ||
+ | geometry.addGroup(2*i, | ||
+ | } | ||
+ | } | ||
+ | var lines = new THREE.LineSegments(geometry, | ||
+ | lines.name = " | ||
+ | obj.add(lines); | ||
+ | updateEdgesPosition(obj); | ||
+ | } | ||
+ | |||
+ | function init_edgelabels(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var edgeindices = obj.userData.edgeindices; | ||
+ | var labels = obj.userData.edgelabels; | ||
+ | var edgelabels = new THREE.Group(); | ||
+ | edgelabels.name = " | ||
+ | if (Array.isArray(labels)) { | ||
+ | for (var i=0; i< | ||
+ | var spriteMaterial = textSpriteMaterial( labels[i] ); | ||
+ | var sprite = new THREE.Sprite(spriteMaterial); | ||
+ | sprite.position.copy(new THREE.Vector3().addVectors(points[edgeindices[2*i]].vector, | ||
+ | edgelabels.add(sprite); | ||
+ | } | ||
+ | } else { | ||
+ | var spriteMaterial = textSpriteMaterial( labels ); | ||
+ | for (var i=0; i< | ||
+ | var sprite = new THREE.Sprite(spriteMaterial); | ||
+ | sprite.position.copy(new THREE.Vector3().addVectors(points[edgeindices[2*i]].vector, | ||
+ | edgelabels.add(sprite); | ||
+ | } | ||
+ | } | ||
+ | obj.add(edgelabels); | ||
+ | } | ||
+ | |||
+ | function init_arrowheads(obj) { | ||
+ | var arrowheads = new THREE.Group(); | ||
+ | arrowheads.name = " | ||
+ | var arrowstyle = obj.userData.arrowstyle; | ||
+ | var edgeindices = obj.userData.edgeindices; | ||
+ | var edgematerials = obj.userData.edgematerial; | ||
+ | var points = obj.userData.points; | ||
+ | var material; | ||
+ | if (!Array.isArray(edgematerials)) { | ||
+ | material = new THREE.MeshBasicMaterial( {color: edgematerials.color} ); | ||
+ | } | ||
+ | |||
+ | for (var i=0; i< | ||
+ | var start = points[edgeindices[i]]; | ||
+ | var end = points[edgeindices[i+1]]; | ||
+ | var dist = start.vector.distanceTo( end.vector ) - start.radius() - end.radius(); | ||
+ | if (dist <= 0) { | ||
+ | continue; | ||
+ | } | ||
+ | var dir = new THREE.Vector3().subVectors(end.vector, | ||
+ | dir.normalize(); | ||
+ | var axis = new THREE.Vector3().set(dir.z, | ||
+ | axis.normalize(); | ||
+ | var radians = Math.acos( dir.y ); | ||
+ | var radius = dist/25; | ||
+ | var height = dist/5; | ||
+ | var geometry = new THREE.ConeBufferGeometry(radius, | ||
+ | var position = new THREE.Vector3().addVectors(start.vector, | ||
+ | if (Array.isArray(edgematerials)) { | ||
+ | material = new THREE.MeshBasicMaterial( {color: edgematerials[i].color} ); | ||
+ | } | ||
+ | var cone = new THREE.Mesh( geometry, material ); | ||
+ | cone.quaternion.setFromAxisAngle(axis, | ||
+ | cone.position.copy(position);; | ||
+ | arrowheads.add(cone); | ||
+ | } | ||
+ | obj.add(arrowheads); | ||
+ | } | ||
+ | |||
+ | function init_faces(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var facets = obj.userData.facets; | ||
+ | obj.userData.triangleindices = []; | ||
+ | for (var i=0; i< | ||
+ | facet = facets[i]; | ||
+ | for (var t=0; t< | ||
+ | obj.userData.triangleindices.push(facet[0], | ||
+ | } | ||
+ | } | ||
+ | var bufarr = new Float32Array( obj.userData.triangleindices.length * 3 ); | ||
+ | var bufattr = new THREE.Float32BufferAttribute(bufarr, | ||
+ | | ||
+ | var materials = obj.userData.facetmaterial; | ||
+ | var geometry = new THREE.BufferGeometry(); | ||
+ | var frontmaterials = []; | ||
+ | var backmaterials = []; | ||
+ | geometry.setAttribute(' | ||
+ | if (Array.isArray(materials)) { | ||
+ | var tricount = 0; | ||
+ | var facet; | ||
+ | for (var i=0; i< | ||
+ | facet = facets[i]; | ||
+ | geometry.addGroup(tricount, | ||
+ | tricount += (facet.length-2)*3; | ||
+ | } | ||
+ | for (var j=0; j< | ||
+ | var fmat = materials[j].clone() | ||
+ | fmat.side = THREE.FrontSide; | ||
+ | frontmaterials.push(fmat); | ||
+ | var bmat = materials[j].clone() | ||
+ | bmat.side = THREE.BackSide; | ||
+ | backmaterials.push(bmat); | ||
+ | obj.userData.facetmaterial = frontmaterials.concat(backmaterials); | ||
+ | } | ||
+ | } else if (materials instanceof THREE.Material) { | ||
+ | frontmaterials = materials.clone() | ||
+ | frontmaterials.side = THREE.FrontSide; | ||
+ | backmaterials = materials.clone() | ||
+ | backmaterials.side = THREE.BackSide; | ||
+ | obj.userData.facetmaterial = [frontmaterials, | ||
+ | } | ||
+ | // duplicating the object with front and back should avoid transparency issues | ||
+ | var backmesh = new THREE.Mesh(geometry, | ||
+ | // meshname is used to show/hide objects | ||
+ | backmesh.name = " | ||
+ | obj.add(backmesh); | ||
+ | var frontmesh = new THREE.Mesh(geometry, | ||
+ | frontmesh.name = " | ||
+ | obj.add(frontmesh); | ||
+ | updateFacesPosition(obj); | ||
+ | } | ||
+ | // // | ||
+ | |||
+ | |||
+ | function updateFacesPosition(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var indices = obj.userData.triangleindices; | ||
+ | var faces = obj.getObjectByName(" | ||
+ | var ba = faces.geometry.getAttribute(" | ||
+ | for (var i=0; i< | ||
+ | ba.setXYZ(i, | ||
+ | } | ||
+ | faces.geometry.attributes.position.needsUpdate = true; | ||
+ | | ||
+ | } | ||
+ | |||
+ | function updateEdgesPosition(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var indices = obj.userData.edgeindices; | ||
+ | var lines = obj.getObjectByName(" | ||
+ | var ba = lines.geometry.getAttribute(" | ||
+ | for (var i=0; i< | ||
+ | ba.setXYZ(i, | ||
+ | } | ||
+ | lines.geometry.attributes.position.needsUpdate = true; | ||
+ | } | ||
+ | |||
+ | function onWindowResize() { | ||
+ | renderer.setSize( three.clientWidth, | ||
+ | svgRenderer.setSize( three.clientWidth, | ||
+ | updateCamera(); | ||
+ | } | ||
+ | |||
+ | function updateCamera() { | ||
+ | var width = three.clientWidth; | ||
+ | var height = three.clientHeight; | ||
+ | var aspect = width / height; | ||
+ | if (camera.type == " | ||
+ | camera.left = frustumSize * aspect / - 2; | ||
+ | camera.right = frustumSize * aspect / 2; | ||
+ | camera.top = frustumSize / 2; | ||
+ | camera.bottom = - frustumSize / 2; | ||
+ | } else if (camera.type == " | ||
+ | camera.aspect = aspect; | ||
+ | } | ||
+ | camera.updateProjectionMatrix(); | ||
+ | } | ||
+ | |||
+ | function changeCamera(event) { | ||
+ | var selindex = event.currentTarget.selectedIndex; | ||
+ | camera = cameras[selindex]; | ||
+ | control = controls[selindex]; | ||
+ | control.enabled = true; | ||
+ | for (var i=0; i< | ||
+ | if (i!=selindex) { | ||
+ | controls[i].enabled = false; | ||
+ | } | ||
+ | } | ||
+ | updateCamera(); | ||
+ | } | ||
+ | |||
+ | var camtypenode = document.getElementById(' | ||
+ | camtypenode.onchange = changeCamera; | ||
+ | camtypenode.dispatchEvent(new Event(' | ||
+ | |||
+ | onWindowResize(); | ||
+ | window.addEventListener(' | ||
+ | |||
+ | |||
+ | var xRotationEnabled = false; | ||
+ | var yRotationEnabled = false; | ||
+ | var zRotationEnabled = false; | ||
+ | var rotationSpeedFactor = 1; | ||
+ | var settingsShown = false; | ||
+ | var labelsShown = true; | ||
+ | var intervals = []; | ||
+ | var timeouts = []; | ||
+ | var explodingSpeed = 0.05; | ||
+ | var explodeScale = 0.000001; | ||
+ | var XMLS = new XMLSerializer(); | ||
+ | var svgElement; | ||
+ | var renderId; | ||
+ | |||
+ | var render = function () { | ||
+ | |||
+ | renderId = requestAnimationFrame(render); | ||
+ | |||
+ | // comment in for automatic explosion | ||
+ | // | ||
+ | |||
+ | var phi = 0.02 * rotationSpeedFactor; | ||
+ | |||
+ | if (xRotationEnabled) { | ||
+ | scene.rotation.x += phi; | ||
+ | } | ||
+ | if (yRotationEnabled) { | ||
+ | scene.rotation.y += phi; | ||
+ | } | ||
+ | if (zRotationEnabled) { | ||
+ | scene.rotation.z += phi; | ||
+ | } | ||
+ | |||
+ | control.update(); | ||
+ | renderer.render(scene, | ||
+ | }; | ||
+ | |||
+ | if ( THREE.WEBGL.isWebGLAvailable() ) { | ||
+ | render(); | ||
+ | } else { | ||
+ | var warning = WEBGL.getWebGLErrorMessage(); | ||
+ | three.appendChild( warning ); | ||
+ | } | ||
+ | | ||
+ | function changeTransparency() { | ||
+ | var opacity = 1-Number(event.currentTarget.value); | ||
+ | for (var i=0; i< | ||
+ | child = scene.children[i]; | ||
+ | if ( child.userData.hasOwnProperty(" | ||
+ | if (Array.isArray(child.userData.facetmaterial)) { | ||
+ | for (var j=0; j< | ||
+ | child.userData.facetmaterial[j].opacity = opacity; | ||
+ | } | ||
+ | } else { | ||
+ | child.userData.facetmaterial.opacity = opacity; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function toggleDepthWrite(event) { | ||
+ | depthwrite = event.currentTarget.checked; | ||
+ | for (var i=0; i< | ||
+ | child = scene.children[i]; | ||
+ | if ( child.userData.hasOwnProperty(" | ||
+ | if (Array.isArray(child.userData.facetmaterial)) { | ||
+ | for (var j=0; j< | ||
+ | child.userData.facetmaterial[j].depthWrite = depthwrite; | ||
+ | } | ||
+ | } else { | ||
+ | child.userData.facetmaterial.depthWrite = depthWrite; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function changeRotationX(event){ | ||
+ | xRotationEnabled = event.currentTarget.checked; | ||
+ | } | ||
+ | |||
+ | function changeRotationY(event){ | ||
+ | yRotationEnabled = event.currentTarget.checked; | ||
+ | } | ||
+ | |||
+ | function changeRotationZ(event){ | ||
+ | zRotationEnabled = event.currentTarget.checked; | ||
+ | } | ||
+ | |||
+ | |||
+ | function changeRotationSpeedFactor(event){ | ||
+ | rotationSpeedFactor = Number(event.currentTarget.value); | ||
+ | } | ||
+ | |||
+ | function resetScene(){ | ||
+ | scene.rotation.set(0, | ||
+ | camera.position.set(0, | ||
+ | camera.up.set(0, | ||
+ | } | ||
+ | |||
+ | function showSettings(event){ | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | settingsShown = true; | ||
+ | } | ||
+ | |||
+ | function hideSettings(event){ | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | settingsShown = false; | ||
+ | } | ||
+ | |||
+ | |||
+ | |||
+ | var pos = 150* Math.PI; | ||
+ | |||
+ | function updateFactor() { | ||
+ | pos++; | ||
+ | return Math.sin(.01*pos)+1; | ||
+ | } | ||
+ | |||
+ | // ------------------------ FOLDING ------------------------------------------------ | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | // rotate point p around axis defined by points p1 and p2 by given angle | ||
+ | function rotate(p, p1, p2, angle ){ | ||
+ | angle = -angle; | ||
+ | var x = p.x, y = p.y, z = p.z, | ||
+ | a = p1.x, b = p1.y, c = p1.z, | ||
+ | u = p2.x-p1.x, v = p2.y-p1.y, w = p2.z-p1.z; | ||
+ | var result = []; | ||
+ | var L = u*u + v*v + w*w; | ||
+ | var sqrt = Math.sqrt; | ||
+ | var cos = Math.cos; | ||
+ | var sin = Math.sin; | ||
+ | |||
+ | result[0] = ((a*(v*v+w*w)-u*(b*v+c*w-u*x-v*y-w*z))*(1-cos(angle))+L*x*cos(angle)+sqrt(L)*(-c*v+b*w-w*y+v*z)*sin(angle))/ | ||
+ | result[1] = ((b*(u*u+w*w)-v*(a*u+c*w-u*x-v*y-w*z))*(1-cos(angle))+L*y*cos(angle)+sqrt(L)*(c*u-a*w+w*x-u*z)*sin(angle))/ | ||
+ | result[2] = ((c*(u*u+v*v)-w*(a*u+b*v-u*x-v*y-w*z))*(1-cos(angle))+L*z*cos(angle)+sqrt(L)*(-b*u+a*v-v*x+u*y)*sin(angle))/ | ||
+ | |||
+ | return result; | ||
+ | } | ||
+ | |||
+ | var fold = function(event){ | ||
+ | var obj = foldables[Number(event.currentTarget.name)]; | ||
+ | var foldvalue = Number(event.currentTarget.value); | ||
+ | var scale = foldvalue - obj.userData.oldscale; | ||
+ | |||
+ | for (var j=0; j< | ||
+ | rotateVertices(obj, | ||
+ | } | ||
+ | update(obj); | ||
+ | obj.userData.oldscale += scale; | ||
+ | lookAtBarycenter(obj); | ||
+ | } | ||
+ | |||
+ | function lookAtBarycenter(obj){ | ||
+ | control.target = barycenter(obj); | ||
+ | } | ||
+ | |||
+ | function barycenter(obj) { | ||
+ | var center = new THREE.Vector3(0, | ||
+ | var points = obj.userData.points; | ||
+ | for (var i=0; i< | ||
+ | center.add(points[i].vector); | ||
+ | } | ||
+ | center.divideScalar(points.length); | ||
+ | return center; | ||
+ | } | ||
+ | |||
+ | function rotateVertices(obj, | ||
+ | var axes = obj.userData.axes; | ||
+ | var subtrees = obj.userData.subtrees; | ||
+ | var points = obj.userData.points; | ||
+ | var angles = obj.userData.angles; | ||
+ | if (edge < axes.length){ | ||
+ | for (var j=0; j< | ||
+ | var rotP = rotate(points[subtrees[edge][j]].vector, | ||
+ | points[subtrees[edge][j]].set(rotP[0], | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function update(obj) { | ||
+ | | ||
+ | | ||
+ | } | ||
+ | |||
+ | if (foldables.length) { | ||
+ | var settings = document.getElementById(' | ||
+ | var foldDiv = document.createElement(' | ||
+ | foldDiv.id = ' | ||
+ | var title = document.createElement(' | ||
+ | title.innerHTML = ' | ||
+ | foldDiv.appendChild(title); | ||
+ | foldDiv.className = ' | ||
+ | for (var i=0; i< | ||
+ | var range = document.createElement(' | ||
+ | range.type = ' | ||
+ | range.min = 0; | ||
+ | range.max = 1; | ||
+ | range.value = 0; | ||
+ | range.step = 0.001; | ||
+ | range.name = String(i); | ||
+ | range.oninput = fold; | ||
+ | foldDiv.appendChild(range); | ||
+ | } | ||
+ | lookAtBarycenter(foldables[0]); | ||
+ | settings.insertBefore(foldDiv, | ||
+ | } | ||
+ | |||
+ | | ||
+ | // ---------------------- EXPLOSION ------------------------------------------------ | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | |||
+ | if (explodableModel) { | ||
+ | for (var i=0; i< | ||
+ | obj = scene.children[i]; | ||
+ | if ( obj.userData.explodable ) { | ||
+ | computeCentroid(obj); | ||
+ | } | ||
+ | } | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | explode(0.000001); | ||
+ | } | ||
+ | |||
+ | function computeCentroid(obj) { | ||
+ | centroid = new THREE.Vector3(); | ||
+ | obj.userData.points.forEach(function(pmpoint) { | ||
+ | centroid.add(pmpoint.vector); | ||
+ | }); | ||
+ | centroid.divideScalar(obj.userData.points.length); | ||
+ | obj.userData.centroid = centroid; | ||
+ | } | ||
+ | |||
+ | function explode(factor) { | ||
+ | for (var i=0; i< | ||
+ | var obj = scene.children[i]; | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | var c = obj.userData.centroid; | ||
+ | obj.position.set(c.x*factor, | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function triggerExplode(event){ | ||
+ | explodeScale = Number(event.currentTarget.value); | ||
+ | explode(explodeScale); | ||
+ | } | ||
+ | |||
+ | function setExplodingSpeed(event){ | ||
+ | explodingSpeed = Number(event.currentTarget.value); | ||
+ | } | ||
+ | |||
+ | function triggerAutomaticExplode(event){ | ||
+ | if (event.currentTarget.checked){ | ||
+ | startExploding(); | ||
+ | } else { | ||
+ | clearIntervals(); | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function startExploding(){ | ||
+ | intervals.push(setInterval(explodingInterval, | ||
+ | } | ||
+ | |||
+ | |||
+ | function explodingInterval(){ | ||
+ | explodeScale += explodingSpeed; | ||
+ | if (explodeScale <= 6){ | ||
+ | explode(explodeScale); | ||
+ | } | ||
+ | else{ | ||
+ | explode(6); | ||
+ | explodeScale = 6; | ||
+ | clearIntervals(); | ||
+ | timeouts.push(setTimeout(startUnexploding, | ||
+ | } | ||
+ | document.getElementById(' | ||
+ | } | ||
+ | |||
+ | |||
+ | function startUnexploding(){ | ||
+ | intervals.push(setInterval(unexplodingInterval, | ||
+ | } | ||
+ | |||
+ | function unexplodingInterval(){ | ||
+ | explodeScale -= explodingSpeed; | ||
+ | if (explodeScale >= 0){ | ||
+ | explode(explodeScale); | ||
+ | } | ||
+ | else { | ||
+ | explode(0); | ||
+ | explodeScale = 0; | ||
+ | clearIntervals(); | ||
+ | timeouts.push(setTimeout(startExploding, | ||
+ | } | ||
+ | document.getElementById(' | ||
+ | } | ||
+ | |||
+ | function clearIntervals(){ | ||
+ | intervals.forEach(function(interval){ | ||
+ | clearInterval(interval); | ||
+ | }); | ||
+ | intervals = []; | ||
+ | timeouts.forEach(function(timeout){ | ||
+ | clearTimeout(timeout); | ||
+ | }); | ||
+ | timeouts = []; | ||
+ | } | ||
+ | |||
+ | // ---------------------- DISPLAY -------------------------------------------------- | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | |||
+ | const objectTypeInnerHTMLs = { points: " | ||
+ | const objectTypeVisible = {}; | ||
+ | Object.assign(objectTypeVisible, | ||
+ | const sortedObjectTypeKeys = Object.keys(objectTypeInnerHTMLs).sort(); | ||
+ | const shownObjectTypesList = document.getElementById(' | ||
+ | |||
+ | function setVisibility(bool, | ||
+ | for (var i=0; i< | ||
+ | var obj = scene.children[i].getObjectByName(objname); | ||
+ | if (obj) { | ||
+ | obj.visible = bool; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function toggleObjectTypeVisibility(event){ | ||
+ | var name = event.currentTarget.name; | ||
+ | var checked = event.currentTarget.checked; | ||
+ | objectTypeVisible[name] = checked; | ||
+ | if (name == " | ||
+ | setVisibility(checked," | ||
+ | setVisibility(checked," | ||
+ | } else { | ||
+ | setVisibility(checked, | ||
+ | } | ||
+ | } | ||
+ | |||
+ | for (var i=0; i< | ||
+ | var key = sortedObjectTypeKeys[i]; | ||
+ | if (modelContains[key]) { | ||
+ | var objTypeNode = document.createElement(' | ||
+ | objTypeNode.innerHTML = objectTypeInnerHTMLs[key] + '< | ||
+ | var checkbox = document.createElement(' | ||
+ | checkbox.type = ' | ||
+ | checkbox.checked = true; | ||
+ | checkbox.name = key; | ||
+ | checkbox.onchange = toggleObjectTypeVisibility; | ||
+ | shownObjectTypesList.appendChild(checkbox); | ||
+ | shownObjectTypesList.appendChild(objTypeNode); | ||
+ | } | ||
+ | } | ||
+ | |||
+ | // ------------------------------------------------------ | ||
+ | |||
+ | function toggleObjectVisibility(event){ | ||
+ | var nr = Number(event.currentTarget.name); | ||
+ | scene.children[nr].visible = event.currentTarget.checked; | ||
+ | } | ||
+ | |||
+ | // append checkboxes for displaying or hiding objects | ||
+ | var shownObjectsList = document.getElementById(' | ||
+ | for (var i=0; i< | ||
+ | obj = scene.children[i]; | ||
+ | var objNode = document.createElement(' | ||
+ | objNode.innerHTML = obj.name + '< | ||
+ | var checkbox = document.createElement(' | ||
+ | checkbox.type = ' | ||
+ | checkbox.checked = true; | ||
+ | checkbox.name = String(i); | ||
+ | checkbox.onchange = toggleObjectVisibility; | ||
+ | shownObjectsList.appendChild(checkbox); | ||
+ | shownObjectsList.appendChild(objNode); | ||
+ | } | ||
+ | |||
+ | // ---------------------- SVG ------------------------------------------------------ | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | |||
+ | function takeSvgScreenshot() { | ||
+ | if (objectTypeVisible[" | ||
+ | setVisibility(false," | ||
+ | } | ||
+ | if (objectTypeVisible[" | ||
+ | setVisibility(false," | ||
+ | } | ||
+ | svgRenderer.render(scene, | ||
+ | svgElement = XMLS.serializeToString(svgRenderer.domElement); | ||
+ | | ||
+ | if (objectTypeVisible[" | ||
+ | setVisibility(true," | ||
+ | } | ||
+ | if (objectTypeVisible[" | ||
+ | setVisibility(true," | ||
+ | } | ||
+ | |||
+ | if (document.getElementById(' | ||
+ | //show in new tab | ||
+ | var myWindow = window.open("","" | ||
+ | myWindow.document.body.innerHTML = svgElement; | ||
+ | } else{ | ||
+ | // download svg file | ||
+ | download(" | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function download(filename, | ||
+ | var element = document.createElement(' | ||
+ | element.setAttribute(' | ||
+ | element.setAttribute(' | ||
+ | |||
+ | element.style.display = ' | ||
+ | document.body.appendChild(element); | ||
+ | |||
+ | element.click(); | ||
+ | |||
+ | document.body.removeChild(element); | ||
+ | } | ||
+ | |||
+ | |||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | |||
+ | |||
+ | // ------------------ SHORTCUTS -------------------------------------------- | ||
+ | // ------------------------------------------------------------------------- | ||
+ | |||
+ | /** | ||
+ | * http:// | ||
+ | * Version : 2.01.B | ||
+ | * By Binny V A | ||
+ | * License : BSD | ||
+ | */ | ||
+ | shortcut = { | ||
+ | ' | ||
+ | ' | ||
+ | //Provide a set of default options | ||
+ | var default_options = { | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | } | ||
+ | if(!opt) opt = default_options; | ||
+ | else { | ||
+ | for(var dfo in default_options) { | ||
+ | if(typeof opt[dfo] == ' | ||
+ | } | ||
+ | } | ||
+ | |||
+ | var ele = opt.target; | ||
+ | if(typeof opt.target == ' | ||
+ | var ths = this; | ||
+ | shortcut_combination = shortcut_combination.toLowerCase(); | ||
+ | |||
+ | //The function to be called at keypress | ||
+ | var func = function(e) { | ||
+ | e = e || window.event; | ||
+ | |||
+ | if(opt[' | ||
+ | var element; | ||
+ | if(e.target) element=e.target; | ||
+ | else if(e.srcElement) element=e.srcElement; | ||
+ | if(element.nodeType==3) element=element.parentNode; | ||
+ | |||
+ | if(element.tagName == ' | ||
+ | } | ||
+ | |||
+ | //Find Which key is pressed | ||
+ | if (e.keyCode) code = e.keyCode; | ||
+ | else if (e.which) code = e.which; | ||
+ | var character = String.fromCharCode(code).toLowerCase(); | ||
+ | |||
+ | if(code == 188) character=","; | ||
+ | if(code == 190) character=" | ||
+ | |||
+ | var keys = shortcut_combination.split(" | ||
+ | //Key Pressed - counts the number of valid keypresses - if it is same as the number of keys, the shortcut function is invoked | ||
+ | var kp = 0; | ||
+ | |||
+ | //Work around for stupid Shift key bug created by using lowercase - as a result the shift+num combination was broken | ||
+ | var shift_nums = { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | ";":":", | ||
+ | "'":" | ||
+ | ",":"<", | ||
+ | " | ||
+ | "/":"?", | ||
+ | " | ||
+ | } | ||
+ | // | ||
+ | var special_keys = { | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | } | ||
+ | |||
+ | var modifiers = { | ||
+ | shift: { wanted: | ||
+ | ctrl : { wanted: | ||
+ | alt | ||
+ | meta : { wanted: | ||
+ | }; | ||
+ | | ||
+ | if(e.ctrlKey) modifiers.ctrl.pressed = true; | ||
+ | if(e.shiftKey) modifiers.shift.pressed = true; | ||
+ | if(e.altKey) modifiers.alt.pressed = true; | ||
+ | if(e.metaKey) | ||
+ | | ||
+ | for(var i=0; k=keys[i], | ||
+ | // | ||
+ | if(k == ' | ||
+ | kp++; | ||
+ | modifiers.ctrl.wanted = true; | ||
+ | |||
+ | } else if(k == ' | ||
+ | kp++; | ||
+ | modifiers.shift.wanted = true; | ||
+ | |||
+ | } else if(k == ' | ||
+ | kp++; | ||
+ | modifiers.alt.wanted = true; | ||
+ | } else if(k == ' | ||
+ | kp++; | ||
+ | modifiers.meta.wanted = true; | ||
+ | } else if(k.length > 1) { //If it is a special key | ||
+ | if(special_keys[k] == code) kp++; | ||
+ | |||
+ | } else if(opt[' | ||
+ | if(opt[' | ||
+ | |||
+ | } else { //The special keys did not match | ||
+ | if(character == k) kp++; | ||
+ | else { | ||
+ | if(shift_nums[character] && e.shiftKey) { //Stupid Shift key bug created by using lowercase | ||
+ | character = shift_nums[character]; | ||
+ | if(character == k) kp++; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | if(kp == keys.length && | ||
+ | modifiers.ctrl.pressed == modifiers.ctrl.wanted && | ||
+ | modifiers.shift.pressed == modifiers.shift.wanted && | ||
+ | modifiers.alt.pressed == modifiers.alt.wanted && | ||
+ | modifiers.meta.pressed == modifiers.meta.wanted) { | ||
+ | callback(e); | ||
+ | |||
+ | if(!opt[' | ||
+ | // | ||
+ | e.cancelBubble = true; | ||
+ | e.returnValue = false; | ||
+ | |||
+ | // | ||
+ | if (e.stopPropagation) { | ||
+ | e.stopPropagation(); | ||
+ | e.preventDefault(); | ||
+ | } | ||
+ | return false; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | this.all_shortcuts[shortcut_combination] = { | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | }; | ||
+ | //Attach the function with the event | ||
+ | if(ele.addEventListener) ele.addEventListener(opt[' | ||
+ | else if(ele.attachEvent) ele.attachEvent(' | ||
+ | else ele[' | ||
+ | }, | ||
+ | |||
+ | //Remove the shortcut - just specify the shortcut and I will remove the binding | ||
+ | ' | ||
+ | shortcut_combination = shortcut_combination.toLowerCase(); | ||
+ | var binding = this.all_shortcuts[shortcut_combination]; | ||
+ | delete(this.all_shortcuts[shortcut_combination]) | ||
+ | if(!binding) return; | ||
+ | var type = binding[' | ||
+ | var ele = binding[' | ||
+ | var callback = binding[' | ||
+ | |||
+ | if(ele.detachEvent) ele.detachEvent(' | ||
+ | else if(ele.removeEventListener) ele.removeEventListener(type, | ||
+ | else ele[' | ||
+ | } | ||
+ | } | ||
+ | |||
+ | shortcut.add(" | ||
+ | var event = new Event(' | ||
+ | if (settingsShown){ | ||
+ | document.getElementById(' | ||
+ | } else { | ||
+ | document.getElementById(' | ||
+ | } | ||
+ | }); | ||
+ | |||
+ | |||
+ | // COMMON_CODE_BLOCK_END | ||
+ | |||
+ | });}); | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | <code perl> | ||
+ | > $d0 = $s-> | ||
+ | > $d0-> | ||
+ | </ | ||
+ | < | ||
+ | <!-- | ||
+ | polymake for knusper | ||
+ | Thu Mar 3 00:31:49 2022 | ||
+ | pcom:d0 | ||
+ | --> | ||
+ | |||
+ | |||
+ | < | ||
+ | < | ||
+ | <meta charset=utf-8> | ||
+ | < | ||
+ | < | ||
+ | /* | ||
+ | // COMMON_CODE_BLOCK_BEGIN | ||
+ | */ | ||
+ | html {overflow: scroll;} | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | # | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | } | ||
+ | /* | ||
+ | // COMMON_CODE_BLOCK_END | ||
+ | */ | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | <div id=' | ||
+ | <div class=group id=' | ||
+ | < | ||
+ | < | ||
+ | <div class=indented>< | ||
+ | <div class=suboption> | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | <div class=group id=' | ||
+ | < | ||
+ | < | ||
+ | <div class=indented>< | ||
+ | </ | ||
+ | |||
+ | <div class=group id=' | ||
+ | < | ||
+ | <div class=indented> | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | <div class=suboption> | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | |||
+ | <div class=group id=' | ||
+ | < | ||
+ | <div class=indented> | ||
+ | < | ||
+ | </ | ||
+ | <div class=suboption> | ||
+ | <div class=indented> | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | < | ||
+ | <div class=indented> | ||
+ | < | ||
+ | <select id=" | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | <div class=group id=' | ||
+ | < | ||
+ | <div class=indented> | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | </ | ||
+ | <img id=' | ||
+ | <img id=' | ||
+ | <div id=" | ||
+ | </ | ||
+ | < | ||
+ | requirejs.config({ | ||
+ | paths: { | ||
+ | three: '/ | ||
+ | TrackballControls: | ||
+ | OrbitControls: | ||
+ | Projector: '/ | ||
+ | SVGRenderer: | ||
+ | WEBGL: '/ | ||
+ | }, | ||
+ | shim: { | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | } | ||
+ | }); | ||
+ | | ||
+ | require([' | ||
+ | window.THREE = THREE; | ||
+ | require([' | ||
+ | | ||
+ | THREE.TrackballControls = TrackballControls; | ||
+ | THREE.OrbitControls = OrbitControls; | ||
+ | THREE.Projector = Projector; | ||
+ | THREE.SVGRenderer = SVGRenderer; | ||
+ | THREE.WEBGL = WEBGL; | ||
+ | |||
+ | // COMMON_CODE_BLOCK_BEGIN | ||
+ | |||
+ | const intervalLength = 25; // for automatic animations | ||
+ | const explodableModel = true; | ||
+ | const modelContains = { points: false, pointlabels: | ||
+ | const foldables = []; | ||
+ | |||
+ | var three = document.getElementById(" | ||
+ | var scene = new THREE.Scene(); | ||
+ | var renderer = new THREE.WebGLRenderer( { antialias: true } ); | ||
+ | var svgRenderer = new THREE.SVGRenderer( { antialias: true } ); | ||
+ | renderer.setPixelRatio( window.devicePixelRatio ); | ||
+ | renderer.setClearColor(0xFFFFFF, | ||
+ | svgRenderer.setClearColor(0xFFFFFF, | ||
+ | three.appendChild(renderer.domElement); | ||
+ | |||
+ | var frustumSize = 4; | ||
+ | var cameras = [new THREE.PerspectiveCamera(75, | ||
+ | cameras.forEach(function(cam) { | ||
+ | cam.position.set(0, | ||
+ | cam.lookAt(0, | ||
+ | cam.up.set(0, | ||
+ | }); | ||
+ | var controls = [new THREE.TrackballControls(cameras[0], | ||
+ | var camera, control; | ||
+ | |||
+ | controls[0].zoomSpeed = 0.2; | ||
+ | controls[0].rotateSpeed = 4; | ||
+ | |||
+ | |||
+ | // class to allow move points together with labels and spheres | ||
+ | var PMPoint = function (x,y,z) { | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | PMPoint.prototype.addLabel = function(labelsprite) { | ||
+ | | ||
+ | | ||
+ | } | ||
+ | PMPoint.prototype.addSphere = function(spheremesh) { | ||
+ | | ||
+ | | ||
+ | } | ||
+ | PMPoint.prototype.set = function(x, | ||
+ | | ||
+ | if (this.sprite) { | ||
+ | this.sprite.position.copy(this.vector); | ||
+ | } | ||
+ | if (this.sphere) { | ||
+ | this.sphere.position.copy(this.vector); | ||
+ | } | ||
+ | } | ||
+ | PMPoint.prototype.radius = function() { | ||
+ | if (this.sphere) { | ||
+ | return this.sphere.geometry.parameters.radius; | ||
+ | } else { | ||
+ | return 0; | ||
+ | } | ||
+ | }; | ||
+ | // select the target node | ||
+ | var target = document.querySelector('# | ||
+ | |||
+ | // create an observer instance | ||
+ | var observer = new MutationObserver(function(mutations) { | ||
+ | | ||
+ | if (mutation.removedNodes && mutation.removedNodes.length > 0) { | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | }); | ||
+ | }); | ||
+ | |||
+ | // configuration of the observer: | ||
+ | var config = { childList: true, characterData: | ||
+ | |||
+ | // pass in the target node, as well as the observer options | ||
+ | while (target) { | ||
+ | if (target.className==" | ||
+ | observer.observe(target, | ||
+ | break; | ||
+ | } | ||
+ | | ||
+ | } | ||
+ | |||
+ | // COMMON_CODE_BLOCK_END | ||
+ | |||
+ | var obj0 = new THREE.Object3D(); | ||
+ | obj0.name = " | ||
+ | obj0.userData.explodable = 1; | ||
+ | obj0.userData.points = []; | ||
+ | obj0.userData.points.push(new PMPoint(-0.5, | ||
+ | obj0.userData.points.push(new PMPoint(0.5, | ||
+ | obj0.userData.points.push(new PMPoint(-1, 0, 0.0375)); | ||
+ | |||
+ | obj0.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj0.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj0.userData.pointlabels = [" | ||
+ | obj0.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj0.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj0.userData.facets = [[0, 2, 1]]; | ||
+ | < | ||
+ | obj0.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj0); | ||
+ | scene.add(obj0); | ||
+ | |||
+ | var obj1 = new THREE.Object3D(); | ||
+ | obj1.name = " | ||
+ | obj1.userData.explodable = 1; | ||
+ | obj1.userData.points = []; | ||
+ | obj1.userData.points.push(new PMPoint(-0.5, | ||
+ | obj1.userData.points.push(new PMPoint(0.5, | ||
+ | obj1.userData.points.push(new PMPoint(0.5, | ||
+ | |||
+ | obj1.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj1.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj1.userData.pointlabels = [" | ||
+ | obj1.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj1.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj1.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj1.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj1); | ||
+ | scene.add(obj1); | ||
+ | |||
+ | var obj2 = new THREE.Object3D(); | ||
+ | obj2.name = " | ||
+ | obj2.userData.explodable = 1; | ||
+ | obj2.userData.points = []; | ||
+ | obj2.userData.points.push(new PMPoint(0.5, | ||
+ | obj2.userData.points.push(new PMPoint(-1, 0, 0.0375)); | ||
+ | obj2.userData.points.push(new PMPoint(-0.785714, | ||
+ | |||
+ | obj2.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj2.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj2.userData.pointlabels = [" | ||
+ | obj2.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj2.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj2.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj2.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj2); | ||
+ | scene.add(obj2); | ||
+ | |||
+ | var obj3 = new THREE.Object3D(); | ||
+ | obj3.name = " | ||
+ | obj3.userData.explodable = 1; | ||
+ | obj3.userData.points = []; | ||
+ | obj3.userData.points.push(new PMPoint(-0.5, | ||
+ | obj3.userData.points.push(new PMPoint(-1, 0, 0.0375)); | ||
+ | obj3.userData.points.push(new PMPoint(-0.884615, | ||
+ | |||
+ | obj3.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj3.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj3.userData.pointlabels = [" | ||
+ | obj3.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj3.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj3.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj3.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj3); | ||
+ | scene.add(obj3); | ||
+ | |||
+ | var obj4 = new THREE.Object3D(); | ||
+ | obj4.name = " | ||
+ | obj4.userData.explodable = 1; | ||
+ | obj4.userData.points = []; | ||
+ | obj4.userData.points.push(new PMPoint(-0.5, | ||
+ | obj4.userData.points.push(new PMPoint(0.5, | ||
+ | obj4.userData.points.push(new PMPoint(0.0384615, | ||
+ | |||
+ | obj4.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj4.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj4.userData.pointlabels = [" | ||
+ | obj4.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj4.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj4.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj4.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj4); | ||
+ | scene.add(obj4); | ||
+ | |||
+ | var obj5 = new THREE.Object3D(); | ||
+ | obj5.name = " | ||
+ | obj5.userData.explodable = 1; | ||
+ | obj5.userData.points = []; | ||
+ | obj5.userData.points.push(new PMPoint(0.5, | ||
+ | obj5.userData.points.push(new PMPoint(0.5, | ||
+ | obj5.userData.points.push(new PMPoint(0.928571, | ||
+ | |||
+ | obj5.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj5.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj5.userData.pointlabels = [" | ||
+ | obj5.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj5.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj5.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj5.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj5); | ||
+ | scene.add(obj5); | ||
+ | |||
+ | var obj6 = new THREE.Object3D(); | ||
+ | obj6.name = " | ||
+ | obj6.userData.explodable = 1; | ||
+ | obj6.userData.points = []; | ||
+ | obj6.userData.points.push(new PMPoint(0.5, | ||
+ | obj6.userData.points.push(new PMPoint(-0.785714, | ||
+ | obj6.userData.points.push(new PMPoint(-0.5, | ||
+ | |||
+ | obj6.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj6.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj6.userData.pointlabels = [" | ||
+ | obj6.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj6.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj6.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj6.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj6); | ||
+ | scene.add(obj6); | ||
+ | |||
+ | var obj7 = new THREE.Object3D(); | ||
+ | obj7.name = " | ||
+ | obj7.userData.explodable = 1; | ||
+ | obj7.userData.points = []; | ||
+ | obj7.userData.points.push(new PMPoint(-1, 0, 0.0375)); | ||
+ | obj7.userData.points.push(new PMPoint(-0.785714, | ||
+ | obj7.userData.points.push(new PMPoint(-0.928571, | ||
+ | |||
+ | obj7.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj7.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj7.userData.pointlabels = [" | ||
+ | obj7.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj7.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj7.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj7.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj7); | ||
+ | scene.add(obj7); | ||
+ | |||
+ | var obj8 = new THREE.Object3D(); | ||
+ | obj8.name = " | ||
+ | obj8.userData.explodable = 1; | ||
+ | obj8.userData.points = []; | ||
+ | obj8.userData.points.push(new PMPoint(-1, 0, 0.0375)); | ||
+ | obj8.userData.points.push(new PMPoint(-0.884615, | ||
+ | obj8.userData.points.push(new PMPoint(-0.951613, | ||
+ | |||
+ | obj8.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj8.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj8.userData.pointlabels = [" | ||
+ | obj8.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj8.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj8.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj8.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj8); | ||
+ | scene.add(obj8); | ||
+ | |||
+ | var obj9 = new THREE.Object3D(); | ||
+ | obj9.name = " | ||
+ | obj9.userData.explodable = 1; | ||
+ | obj9.userData.points = []; | ||
+ | obj9.userData.points.push(new PMPoint(-0.5, | ||
+ | obj9.userData.points.push(new PMPoint(-0.884615, | ||
+ | obj9.userData.points.push(new PMPoint(-0.785714, | ||
+ | |||
+ | obj9.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj9.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj9.userData.pointlabels = [" | ||
+ | obj9.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj9.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj9.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj9.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj9); | ||
+ | scene.add(obj9); | ||
+ | |||
+ | var obj10 = new THREE.Object3D(); | ||
+ | obj10.name = " | ||
+ | obj10.userData.explodable = 1; | ||
+ | obj10.userData.points = []; | ||
+ | obj10.userData.points.push(new PMPoint(-0.5, | ||
+ | obj10.userData.points.push(new PMPoint(0.0384615, | ||
+ | obj10.userData.points.push(new PMPoint(-0.142857, | ||
+ | |||
+ | obj10.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj10.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj10.userData.pointlabels = [" | ||
+ | obj10.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj10.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj10.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj10.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj10); | ||
+ | scene.add(obj10); | ||
+ | |||
+ | var obj11 = new THREE.Object3D(); | ||
+ | obj11.name = " | ||
+ | obj11.userData.explodable = 1; | ||
+ | obj11.userData.points = []; | ||
+ | obj11.userData.points.push(new PMPoint(0.5, | ||
+ | obj11.userData.points.push(new PMPoint(0.0384615, | ||
+ | obj11.userData.points.push(new PMPoint(0.209677, | ||
+ | |||
+ | obj11.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj11.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj11.userData.pointlabels = [" | ||
+ | obj11.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj11.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj11.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj11.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj11); | ||
+ | scene.add(obj11); | ||
+ | |||
+ | var obj12 = new THREE.Object3D(); | ||
+ | obj12.name = " | ||
+ | obj12.userData.explodable = 1; | ||
+ | obj12.userData.points = []; | ||
+ | obj12.userData.points.push(new PMPoint(0.5, | ||
+ | obj12.userData.points.push(new PMPoint(0.928571, | ||
+ | obj12.userData.points.push(new PMPoint(0.785714, | ||
+ | |||
+ | obj12.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj12.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj12.userData.pointlabels = [" | ||
+ | obj12.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj12.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj12.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj12.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj12); | ||
+ | scene.add(obj12); | ||
+ | |||
+ | var obj13 = new THREE.Object3D(); | ||
+ | obj13.name = " | ||
+ | obj13.userData.explodable = 1; | ||
+ | obj13.userData.points = []; | ||
+ | obj13.userData.points.push(new PMPoint(0.5, | ||
+ | obj13.userData.points.push(new PMPoint(0.928571, | ||
+ | obj13.userData.points.push(new PMPoint(1, 0, 0.00416667)); | ||
+ | |||
+ | obj13.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj13.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj13.userData.pointlabels = [" | ||
+ | obj13.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj13.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj13.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj13.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj13); | ||
+ | scene.add(obj13); | ||
+ | |||
+ | var obj14 = new THREE.Object3D(); | ||
+ | obj14.name = " | ||
+ | obj14.userData.explodable = 1; | ||
+ | obj14.userData.points = []; | ||
+ | obj14.userData.points.push(new PMPoint(0.5, | ||
+ | obj14.userData.points.push(new PMPoint(-0.5, | ||
+ | obj14.userData.points.push(new PMPoint(-0.289474, | ||
+ | |||
+ | obj14.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj14.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj14.userData.pointlabels = [" | ||
+ | obj14.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj14.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj14.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj14.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj14); | ||
+ | scene.add(obj14); | ||
+ | |||
+ | var obj15 = new THREE.Object3D(); | ||
+ | obj15.name = " | ||
+ | obj15.userData.explodable = 1; | ||
+ | obj15.userData.points = []; | ||
+ | obj15.userData.points.push(new PMPoint(-0.785714, | ||
+ | obj15.userData.points.push(new PMPoint(-0.5, | ||
+ | obj15.userData.points.push(new PMPoint(-0.635135, | ||
+ | |||
+ | obj15.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj15.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj15.userData.pointlabels = [" | ||
+ | obj15.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj15.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj15.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj15.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj15); | ||
+ | scene.add(obj15); | ||
+ | |||
+ | var obj16 = new THREE.Object3D(); | ||
+ | obj16.name = " | ||
+ | obj16.userData.explodable = 1; | ||
+ | obj16.userData.points = []; | ||
+ | obj16.userData.points.push(new PMPoint(-0.785714, | ||
+ | obj16.userData.points.push(new PMPoint(-0.928571, | ||
+ | obj16.userData.points.push(new PMPoint(-0.884615, | ||
+ | |||
+ | obj16.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj16.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj16.userData.pointlabels = [" | ||
+ | obj16.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj16.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj16.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj16.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj16); | ||
+ | scene.add(obj16); | ||
+ | |||
+ | var obj17 = new THREE.Object3D(); | ||
+ | obj17.name = " | ||
+ | obj17.userData.explodable = 1; | ||
+ | obj17.userData.points = []; | ||
+ | obj17.userData.points.push(new PMPoint(-1, 0, 0.0375)); | ||
+ | obj17.userData.points.push(new PMPoint(-0.928571, | ||
+ | obj17.userData.points.push(new PMPoint(-0.965116, | ||
+ | |||
+ | obj17.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj17.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj17.userData.pointlabels = [" | ||
+ | obj17.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj17.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj17.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj17.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj17); | ||
+ | scene.add(obj17); | ||
+ | |||
+ | var obj18 = new THREE.Object3D(); | ||
+ | obj18.name = " | ||
+ | obj18.userData.explodable = 1; | ||
+ | obj18.userData.points = []; | ||
+ | obj18.userData.points.push(new PMPoint(-1, 0, 0.0375)); | ||
+ | obj18.userData.points.push(new PMPoint(-0.951613, | ||
+ | obj18.userData.points.push(new PMPoint(-0.973684, | ||
+ | |||
+ | obj18.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj18.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj18.userData.pointlabels = [" | ||
+ | obj18.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj18.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj18.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj18.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj18); | ||
+ | scene.add(obj18); | ||
+ | |||
+ | var obj19 = new THREE.Object3D(); | ||
+ | obj19.name = " | ||
+ | obj19.userData.explodable = 1; | ||
+ | obj19.userData.points = []; | ||
+ | obj19.userData.points.push(new PMPoint(-0.884615, | ||
+ | obj19.userData.points.push(new PMPoint(-0.951613, | ||
+ | obj19.userData.points.push(new PMPoint(-0.928571, | ||
+ | |||
+ | obj19.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj19.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj19.userData.pointlabels = [" | ||
+ | obj19.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj19.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj19.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj19.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj19); | ||
+ | scene.add(obj19); | ||
+ | |||
+ | var obj20 = new THREE.Object3D(); | ||
+ | obj20.name = " | ||
+ | obj20.userData.explodable = 1; | ||
+ | obj20.userData.points = []; | ||
+ | obj20.userData.points.push(new PMPoint(-0.884615, | ||
+ | obj20.userData.points.push(new PMPoint(-0.785714, | ||
+ | obj20.userData.points.push(new PMPoint(-0.829114, | ||
+ | |||
+ | obj20.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj20.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj20.userData.pointlabels = [" | ||
+ | obj20.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj20.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj20.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj20.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj20); | ||
+ | scene.add(obj20); | ||
+ | |||
+ | var obj21 = new THREE.Object3D(); | ||
+ | obj21.name = " | ||
+ | obj21.userData.explodable = 1; | ||
+ | obj21.userData.points = []; | ||
+ | obj21.userData.points.push(new PMPoint(-0.5, | ||
+ | obj21.userData.points.push(new PMPoint(-0.785714, | ||
+ | obj21.userData.points.push(new PMPoint(-0.72449, | ||
+ | |||
+ | obj21.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj21.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj21.userData.pointlabels = [" | ||
+ | obj21.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj21.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj21.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj21.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj21); | ||
+ | scene.add(obj21); | ||
+ | |||
+ | var obj22 = new THREE.Object3D(); | ||
+ | obj22.name = " | ||
+ | obj22.userData.explodable = 1; | ||
+ | obj22.userData.points = []; | ||
+ | obj22.userData.points.push(new PMPoint(-0.5, | ||
+ | obj22.userData.points.push(new PMPoint(-0.142857, | ||
+ | obj22.userData.points.push(new PMPoint(-0.234694, | ||
+ | |||
+ | obj22.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj22.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj22.userData.pointlabels = [" | ||
+ | obj22.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj22.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj22.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj22.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj22); | ||
+ | scene.add(obj22); | ||
+ | |||
+ | var obj23 = new THREE.Object3D(); | ||
+ | obj23.name = " | ||
+ | obj23.userData.explodable = 1; | ||
+ | obj23.userData.points = []; | ||
+ | obj23.userData.points.push(new PMPoint(0.0384615, | ||
+ | obj23.userData.points.push(new PMPoint(-0.142857, | ||
+ | obj23.userData.points.push(new PMPoint(-0.0696203, | ||
+ | |||
+ | obj23.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj23.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj23.userData.pointlabels = [" | ||
+ | obj23.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj23.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj23.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj23.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj23); | ||
+ | scene.add(obj23); | ||
+ | |||
+ | var obj24 = new THREE.Object3D(); | ||
+ | obj24.name = " | ||
+ | obj24.userData.explodable = 1; | ||
+ | obj24.userData.points = []; | ||
+ | obj24.userData.points.push(new PMPoint(0.0384615, | ||
+ | obj24.userData.points.push(new PMPoint(0.209677, | ||
+ | obj24.userData.points.push(new PMPoint(0.142857, | ||
+ | |||
+ | obj24.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj24.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj24.userData.pointlabels = [" | ||
+ | obj24.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj24.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj24.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj24.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj24); | ||
+ | scene.add(obj24); | ||
+ | |||
+ | var obj25 = new THREE.Object3D(); | ||
+ | obj25.name = " | ||
+ | obj25.userData.explodable = 1; | ||
+ | obj25.userData.points = []; | ||
+ | obj25.userData.points.push(new PMPoint(0.5, | ||
+ | obj25.userData.points.push(new PMPoint(0.209677, | ||
+ | obj25.userData.points.push(new PMPoint(0.289474, | ||
+ | |||
+ | obj25.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj25.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj25.userData.pointlabels = [" | ||
+ | obj25.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj25.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj25.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj25.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj25); | ||
+ | scene.add(obj25); | ||
+ | |||
+ | var obj26 = new THREE.Object3D(); | ||
+ | obj26.name = " | ||
+ | obj26.userData.explodable = 1; | ||
+ | obj26.userData.points = []; | ||
+ | obj26.userData.points.push(new PMPoint(0.5, | ||
+ | obj26.userData.points.push(new PMPoint(0.785714, | ||
+ | obj26.userData.points.push(new PMPoint(0.709302, | ||
+ | |||
+ | obj26.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj26.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj26.userData.pointlabels = [" | ||
+ | obj26.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj26.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj26.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj26.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj26); | ||
+ | scene.add(obj26); | ||
+ | |||
+ | var obj27 = new THREE.Object3D(); | ||
+ | obj27.name = " | ||
+ | obj27.userData.explodable = 1; | ||
+ | obj27.userData.points = []; | ||
+ | obj27.userData.points.push(new PMPoint(0.928571, | ||
+ | obj27.userData.points.push(new PMPoint(0.785714, | ||
+ | obj27.userData.points.push(new PMPoint(0.846154, | ||
+ | |||
+ | obj27.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj27.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj27.userData.pointlabels = [" | ||
+ | obj27.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj27.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj27.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj27.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj27); | ||
+ | scene.add(obj27); | ||
+ | |||
+ | var obj28 = new THREE.Object3D(); | ||
+ | obj28.name = " | ||
+ | obj28.userData.explodable = 1; | ||
+ | obj28.userData.points = []; | ||
+ | obj28.userData.points.push(new PMPoint(0.928571, | ||
+ | obj28.userData.points.push(new PMPoint(1, 0, 0.00416667)); | ||
+ | obj28.userData.points.push(new PMPoint(0.986486, | ||
+ | |||
+ | obj28.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj28.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj28.userData.pointlabels = [" | ||
+ | obj28.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj28.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj28.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj28.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj28); | ||
+ | scene.add(obj28); | ||
+ | |||
+ | var obj29 = new THREE.Object3D(); | ||
+ | obj29.name = " | ||
+ | obj29.userData.explodable = 1; | ||
+ | obj29.userData.points = []; | ||
+ | obj29.userData.points.push(new PMPoint(0.5, | ||
+ | obj29.userData.points.push(new PMPoint(1, 0, 0.00416667)); | ||
+ | obj29.userData.points.push(new PMPoint(0.973684, | ||
+ | |||
+ | obj29.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj29.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj29.userData.pointlabels = [" | ||
+ | obj29.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj29.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj29.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj29.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj29); | ||
+ | scene.add(obj29); | ||
+ | |||
+ | var obj30 = new THREE.Object3D(); | ||
+ | obj30.name = " | ||
+ | obj30.userData.explodable = 1; | ||
+ | obj30.userData.points = []; | ||
+ | obj30.userData.points.push(new PMPoint(0.5, | ||
+ | obj30.userData.points.push(new PMPoint(-0.289474, | ||
+ | obj30.userData.points.push(new PMPoint(-0.142857, | ||
+ | |||
+ | obj30.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj30.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj30.userData.pointlabels = [" | ||
+ | obj30.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj30.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj30.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj30.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj30); | ||
+ | scene.add(obj30); | ||
+ | |||
+ | var obj31 = new THREE.Object3D(); | ||
+ | obj31.name = " | ||
+ | obj31.userData.explodable = 1; | ||
+ | obj31.userData.points = []; | ||
+ | obj31.userData.points.push(new PMPoint(-0.5, | ||
+ | obj31.userData.points.push(new PMPoint(-0.289474, | ||
+ | obj31.userData.points.push(new PMPoint(-0.385246, | ||
+ | |||
+ | obj31.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj31.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj31.userData.pointlabels = [" | ||
+ | obj31.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj31.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj31.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj31.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj31); | ||
+ | scene.add(obj31); | ||
+ | |||
+ | var obj32 = new THREE.Object3D(); | ||
+ | obj32.name = " | ||
+ | obj32.userData.explodable = 1; | ||
+ | obj32.userData.points = []; | ||
+ | obj32.userData.points.push(new PMPoint(-0.5, | ||
+ | obj32.userData.points.push(new PMPoint(-0.635135, | ||
+ | obj32.userData.points.push(new PMPoint(-0.587912, | ||
+ | |||
+ | obj32.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj32.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj32.userData.pointlabels = [" | ||
+ | obj32.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj32.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj32.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj32.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj32); | ||
+ | scene.add(obj32); | ||
+ | |||
+ | var obj33 = new THREE.Object3D(); | ||
+ | obj33.name = " | ||
+ | obj33.userData.explodable = 1; | ||
+ | obj33.userData.points = []; | ||
+ | obj33.userData.points.push(new PMPoint(-0.785714, | ||
+ | obj33.userData.points.push(new PMPoint(-0.635135, | ||
+ | obj33.userData.points.push(new PMPoint(-0.684211, | ||
+ | |||
+ | obj33.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj33.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj33.userData.pointlabels = [" | ||
+ | obj33.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj33.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj33.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj33.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj33); | ||
+ | scene.add(obj33); | ||
+ | |||
+ | var obj34 = new THREE.Object3D(); | ||
+ | obj34.name = " | ||
+ | obj34.userData.explodable = 1; | ||
+ | obj34.userData.points = []; | ||
+ | obj34.userData.points.push(new PMPoint(-0.785714, | ||
+ | obj34.userData.points.push(new PMPoint(-0.884615, | ||
+ | obj34.userData.points.push(new PMPoint(-0.860825, | ||
+ | |||
+ | obj34.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj34.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj34.userData.pointlabels = [" | ||
+ | obj34.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj34.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj34.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj34.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj34); | ||
+ | scene.add(obj34); | ||
+ | |||
+ | var obj35 = new THREE.Object3D(); | ||
+ | obj35.name = " | ||
+ | obj35.userData.explodable = 1; | ||
+ | obj35.userData.points = []; | ||
+ | obj35.userData.points.push(new PMPoint(-0.928571, | ||
+ | obj35.userData.points.push(new PMPoint(-0.884615, | ||
+ | obj35.userData.points.push(new PMPoint(-0.902878, | ||
+ | |||
+ | obj35.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj35.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj35.userData.pointlabels = [" | ||
+ | obj35.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj35.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj35.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj35.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj35); | ||
+ | scene.add(obj35); | ||
+ | |||
+ | var obj36 = new THREE.Object3D(); | ||
+ | obj36.name = " | ||
+ | obj36.userData.explodable = 1; | ||
+ | obj36.userData.points = []; | ||
+ | obj36.userData.points.push(new PMPoint(-0.928571, | ||
+ | obj36.userData.points.push(new PMPoint(-0.965116, | ||
+ | obj36.userData.points.push(new PMPoint(-0.951613, | ||
+ | |||
+ | obj36.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj36.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj36.userData.pointlabels = [" | ||
+ | obj36.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj36.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj36.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj36.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj36); | ||
+ | scene.add(obj36); | ||
+ | |||
+ | var obj37 = new THREE.Object3D(); | ||
+ | obj37.name = " | ||
+ | obj37.userData.explodable = 1; | ||
+ | obj37.userData.points = []; | ||
+ | obj37.userData.points.push(new PMPoint(-1, 0, 0.0375)); | ||
+ | obj37.userData.points.push(new PMPoint(-0.965116, | ||
+ | obj37.userData.points.push(new PMPoint(-0.979452, | ||
+ | |||
+ | obj37.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj37.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj37.userData.pointlabels = [" | ||
+ | obj37.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj37.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj37.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj37.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj37); | ||
+ | scene.add(obj37); | ||
+ | |||
+ | var obj38 = new THREE.Object3D(); | ||
+ | obj38.name = " | ||
+ | obj38.userData.explodable = 1; | ||
+ | obj38.userData.points = []; | ||
+ | obj38.userData.points.push(new PMPoint(-1, 0, 0.0375)); | ||
+ | obj38.userData.points.push(new PMPoint(-0.973684, | ||
+ | obj38.userData.points.push(new PMPoint(-0.983516, | ||
+ | |||
+ | obj38.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj38.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj38.userData.pointlabels = [" | ||
+ | obj38.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj38.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj38.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj38.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj38); | ||
+ | scene.add(obj38); | ||
+ | |||
+ | var obj39 = new THREE.Object3D(); | ||
+ | obj39.name = " | ||
+ | obj39.userData.explodable = 1; | ||
+ | obj39.userData.points = []; | ||
+ | obj39.userData.points.push(new PMPoint(-0.951613, | ||
+ | obj39.userData.points.push(new PMPoint(-0.973684, | ||
+ | obj39.userData.points.push(new PMPoint(-0.965116, | ||
+ | |||
+ | obj39.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj39.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj39.userData.pointlabels = [" | ||
+ | obj39.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj39.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj39.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj39.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj39); | ||
+ | scene.add(obj39); | ||
+ | |||
+ | var obj40 = new THREE.Object3D(); | ||
+ | obj40.name = " | ||
+ | obj40.userData.explodable = 1; | ||
+ | obj40.userData.points = []; | ||
+ | obj40.userData.points.push(new PMPoint(-0.951613, | ||
+ | obj40.userData.points.push(new PMPoint(-0.928571, | ||
+ | obj40.userData.points.push(new PMPoint(-0.937788, | ||
+ | |||
+ | obj40.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj40.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj40.userData.pointlabels = [" | ||
+ | obj40.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj40.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj40.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj40.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj40); | ||
+ | scene.add(obj40); | ||
+ | |||
+ | var obj41 = new THREE.Object3D(); | ||
+ | obj41.name = " | ||
+ | obj41.userData.explodable = 1; | ||
+ | obj41.userData.points = []; | ||
+ | obj41.userData.points.push(new PMPoint(-0.884615, | ||
+ | obj41.userData.points.push(new PMPoint(-0.928571, | ||
+ | obj41.userData.points.push(new PMPoint(-0.917178, | ||
+ | |||
+ | obj41.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj41.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj41.userData.pointlabels = [" | ||
+ | obj41.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj41.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj41.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj41.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj41); | ||
+ | scene.add(obj41); | ||
+ | |||
+ | var obj42 = new THREE.Object3D(); | ||
+ | obj42.name = " | ||
+ | obj42.userData.explodable = 1; | ||
+ | obj42.userData.points = []; | ||
+ | obj42.userData.points.push(new PMPoint(-0.884615, | ||
+ | obj42.userData.points.push(new PMPoint(-0.829114, | ||
+ | obj42.userData.points.push(new PMPoint(-0.846154, | ||
+ | |||
+ | obj42.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj42.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj42.userData.pointlabels = [" | ||
+ | obj42.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj42.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj42.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj42.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj42); | ||
+ | scene.add(obj42); | ||
+ | |||
+ | var obj43 = new THREE.Object3D(); | ||
+ | obj43.name = " | ||
+ | obj43.userData.explodable = 1; | ||
+ | obj43.userData.points = []; | ||
+ | obj43.userData.points.push(new PMPoint(-0.785714, | ||
+ | obj43.userData.points.push(new PMPoint(-0.829114, | ||
+ | obj43.userData.points.push(new PMPoint(-0.813433, | ||
+ | |||
+ | obj43.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj43.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj43.userData.pointlabels = [" | ||
+ | obj43.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj43.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj43.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj43.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj43); | ||
+ | scene.add(obj43); | ||
+ | |||
+ | var obj44 = new THREE.Object3D(); | ||
+ | obj44.name = " | ||
+ | obj44.userData.explodable = 1; | ||
+ | obj44.userData.points = []; | ||
+ | obj44.userData.points.push(new PMPoint(-0.785714, | ||
+ | obj44.userData.points.push(new PMPoint(-0.72449, | ||
+ | obj44.userData.points.push(new PMPoint(-0.751656, | ||
+ | |||
+ | obj44.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj44.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj44.userData.pointlabels = [" | ||
+ | obj44.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj44.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj44.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj44.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj44); | ||
+ | scene.add(obj44); | ||
+ | |||
+ | var obj45 = new THREE.Object3D(); | ||
+ | obj45.name = " | ||
+ | obj45.userData.explodable = 1; | ||
+ | obj45.userData.points = []; | ||
+ | obj45.userData.points.push(new PMPoint(-0.5, | ||
+ | obj45.userData.points.push(new PMPoint(-0.72449, | ||
+ | obj45.userData.points.push(new PMPoint(-0.684211, | ||
+ | |||
+ | obj45.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj45.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj45.userData.pointlabels = [" | ||
+ | obj45.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj45.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj45.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj45.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj45); | ||
+ | scene.add(obj45); | ||
+ | |||
+ | var obj46 = new THREE.Object3D(); | ||
+ | obj46.name = " | ||
+ | obj46.userData.explodable = 1; | ||
+ | obj46.userData.points = []; | ||
+ | obj46.userData.points.push(new PMPoint(-0.5, | ||
+ | obj46.userData.points.push(new PMPoint(-0.234694, | ||
+ | obj46.userData.points.push(new PMPoint(-0.289474, | ||
+ | |||
+ | obj46.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj46.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj46.userData.pointlabels = [" | ||
+ | obj46.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj46.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj46.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj46.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj46); | ||
+ | scene.add(obj46); | ||
+ | |||
+ | var obj47 = new THREE.Object3D(); | ||
+ | obj47.name = " | ||
+ | obj47.userData.explodable = 1; | ||
+ | obj47.userData.points = []; | ||
+ | obj47.userData.points.push(new PMPoint(-0.142857, | ||
+ | obj47.userData.points.push(new PMPoint(-0.234694, | ||
+ | obj47.userData.points.push(new PMPoint(-0.195364, | ||
+ | |||
+ | obj47.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj47.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj47.userData.pointlabels = [" | ||
+ | obj47.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj47.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj47.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj47.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj47); | ||
+ | scene.add(obj47); | ||
+ | |||
+ | var obj48 = new THREE.Object3D(); | ||
+ | obj48.name = " | ||
+ | obj48.userData.explodable = 1; | ||
+ | obj48.userData.points = []; | ||
+ | obj48.userData.points.push(new PMPoint(-0.142857, | ||
+ | obj48.userData.points.push(new PMPoint(-0.0696203, | ||
+ | obj48.userData.points.push(new PMPoint(-0.097015, | ||
+ | |||
+ | obj48.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj48.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj48.userData.pointlabels = [" | ||
+ | obj48.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj48.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj48.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj48.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj48); | ||
+ | scene.add(obj48); | ||
+ | |||
+ | var obj49 = new THREE.Object3D(); | ||
+ | obj49.name = " | ||
+ | obj49.userData.explodable = 1; | ||
+ | obj49.userData.points = []; | ||
+ | obj49.userData.points.push(new PMPoint(0.0384615, | ||
+ | obj49.userData.points.push(new PMPoint(-0.0696203, | ||
+ | obj49.userData.points.push(new PMPoint(-0.0384616, | ||
+ | |||
+ | obj49.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj49.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj49.userData.pointlabels = [" | ||
+ | obj49.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj49.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj49.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj49.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj49); | ||
+ | scene.add(obj49); | ||
+ | |||
+ | var obj50 = new THREE.Object3D(); | ||
+ | obj50.name = " | ||
+ | obj50.userData.explodable = 1; | ||
+ | obj50.userData.points = []; | ||
+ | obj50.userData.points.push(new PMPoint(0.0384615, | ||
+ | obj50.userData.points.push(new PMPoint(0.142857, | ||
+ | obj50.userData.points.push(new PMPoint(0.113497, | ||
+ | |||
+ | obj50.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj50.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj50.userData.pointlabels = [" | ||
+ | obj50.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj50.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj50.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj50.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj50); | ||
+ | scene.add(obj50); | ||
+ | |||
+ | var obj51 = new THREE.Object3D(); | ||
+ | obj51.name = " | ||
+ | obj51.userData.explodable = 1; | ||
+ | obj51.userData.points = []; | ||
+ | obj51.userData.points.push(new PMPoint(0.209677, | ||
+ | obj51.userData.points.push(new PMPoint(0.142857, | ||
+ | obj51.userData.points.push(new PMPoint(0.168203, | ||
+ | |||
+ | obj51.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj51.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj51.userData.pointlabels = [" | ||
+ | obj51.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj51.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj51.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj51.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj51); | ||
+ | scene.add(obj51); | ||
+ | |||
+ | var obj52 = new THREE.Object3D(); | ||
+ | obj52.name = " | ||
+ | obj52.userData.explodable = 1; | ||
+ | obj52.userData.points = []; | ||
+ | obj52.userData.points.push(new PMPoint(0.209677, | ||
+ | obj52.userData.points.push(new PMPoint(0.289474, | ||
+ | obj52.userData.points.push(new PMPoint(0.255814, | ||
+ | |||
+ | obj52.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj52.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj52.userData.pointlabels = [" | ||
+ | obj52.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj52.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj52.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj52.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj52); | ||
+ | scene.add(obj52); | ||
+ | |||
+ | var obj53 = new THREE.Object3D(); | ||
+ | obj53.name = " | ||
+ | obj53.userData.explodable = 1; | ||
+ | obj53.userData.points = []; | ||
+ | obj53.userData.points.push(new PMPoint(0.5, | ||
+ | obj53.userData.points.push(new PMPoint(0.289474, | ||
+ | obj53.userData.points.push(new PMPoint(0.335165, | ||
+ | |||
+ | obj53.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj53.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj53.userData.pointlabels = [" | ||
+ | obj53.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj53.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj53.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj53.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj53); | ||
+ | scene.add(obj53); | ||
+ | |||
+ | var obj54 = new THREE.Object3D(); | ||
+ | obj54.name = " | ||
+ | obj54.userData.explodable = 1; | ||
+ | obj54.userData.points = []; | ||
+ | obj54.userData.points.push(new PMPoint(0.5, | ||
+ | obj54.userData.points.push(new PMPoint(0.709302, | ||
+ | obj54.userData.points.push(new PMPoint(0.664384, | ||
+ | |||
+ | obj54.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj54.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj54.userData.pointlabels = [" | ||
+ | obj54.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj54.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj54.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj54.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj54); | ||
+ | scene.add(obj54); | ||
+ | |||
+ | var obj55 = new THREE.Object3D(); | ||
+ | obj55.name = " | ||
+ | obj55.userData.explodable = 1; | ||
+ | obj55.userData.points = []; | ||
+ | obj55.userData.points.push(new PMPoint(0.785714, | ||
+ | obj55.userData.points.push(new PMPoint(0.709302, | ||
+ | obj55.userData.points.push(new PMPoint(0.741935, | ||
+ | |||
+ | obj55.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj55.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj55.userData.pointlabels = [" | ||
+ | obj55.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj55.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj55.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj55.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj55); | ||
+ | scene.add(obj55); | ||
+ | |||
+ | var obj56 = new THREE.Object3D(); | ||
+ | obj56.name = " | ||
+ | obj56.userData.explodable = 1; | ||
+ | obj56.userData.points = []; | ||
+ | obj56.userData.points.push(new PMPoint(0.785714, | ||
+ | obj56.userData.points.push(new PMPoint(0.846154, | ||
+ | obj56.userData.points.push(new PMPoint(0.823741, | ||
+ | |||
+ | obj56.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj56.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj56.userData.pointlabels = [" | ||
+ | obj56.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj56.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj56.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj56.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj56); | ||
+ | scene.add(obj56); | ||
+ | |||
+ | var obj57 = new THREE.Object3D(); | ||
+ | obj57.name = " | ||
+ | obj57.userData.explodable = 1; | ||
+ | obj57.userData.points = []; | ||
+ | obj57.userData.points.push(new PMPoint(0.928571, | ||
+ | obj57.userData.points.push(new PMPoint(0.846154, | ||
+ | obj57.userData.points.push(new PMPoint(0.871134, | ||
+ | |||
+ | obj57.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj57.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj57.userData.pointlabels = [" | ||
+ | obj57.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj57.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj57.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj57.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj57); | ||
+ | scene.add(obj57); | ||
+ | |||
+ | var obj58 = new THREE.Object3D(); | ||
+ | obj58.name = " | ||
+ | obj58.userData.explodable = 1; | ||
+ | obj58.userData.points = []; | ||
+ | obj58.userData.points.push(new PMPoint(0.928571, | ||
+ | obj58.userData.points.push(new PMPoint(0.986486, | ||
+ | obj58.userData.points.push(new PMPoint(0.973684, | ||
+ | |||
+ | obj58.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj58.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj58.userData.pointlabels = [" | ||
+ | obj58.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj58.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj58.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj58.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj58); | ||
+ | scene.add(obj58); | ||
+ | |||
+ | var obj59 = new THREE.Object3D(); | ||
+ | obj59.name = " | ||
+ | obj59.userData.explodable = 1; | ||
+ | obj59.userData.points = []; | ||
+ | obj59.userData.points.push(new PMPoint(1, 0, 0.00416667)); | ||
+ | obj59.userData.points.push(new PMPoint(0.986486, | ||
+ | obj59.userData.points.push(new PMPoint(0.994505, | ||
+ | |||
+ | obj59.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj59.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj59.userData.pointlabels = [" | ||
+ | obj59.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj59.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj59.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj59.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj59); | ||
+ | scene.add(obj59); | ||
+ | |||
+ | var obj60 = new THREE.Object3D(); | ||
+ | obj60.name = " | ||
+ | obj60.userData.explodable = 1; | ||
+ | obj60.userData.points = []; | ||
+ | obj60.userData.points.push(new PMPoint(1, 0, 0.00416667)); | ||
+ | obj60.userData.points.push(new PMPoint(0.973684, | ||
+ | obj60.userData.points.push(new PMPoint(0.991803, | ||
+ | |||
+ | obj60.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj60.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj60.userData.pointlabels = [" | ||
+ | obj60.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj60.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj60.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj60.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj60); | ||
+ | scene.add(obj60); | ||
+ | |||
+ | var obj61 = new THREE.Object3D(); | ||
+ | obj61.name = " | ||
+ | obj61.userData.explodable = 1; | ||
+ | obj61.userData.points = []; | ||
+ | obj61.userData.points.push(new PMPoint(0.5, | ||
+ | obj61.userData.points.push(new PMPoint(0.973684, | ||
+ | obj61.userData.points.push(new PMPoint(0.928571, | ||
+ | |||
+ | obj61.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj61.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj61.userData.pointlabels = [" | ||
+ | obj61.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj61.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj61.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj61.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj61); | ||
+ | scene.add(obj61); | ||
+ | |||
+ | var obj62 = new THREE.Object3D(); | ||
+ | obj62.name = " | ||
+ | obj62.userData.explodable = 1; | ||
+ | obj62.userData.points = []; | ||
+ | obj62.userData.points.push(new PMPoint(0.5, | ||
+ | obj62.userData.points.push(new PMPoint(-0.142857, | ||
+ | obj62.userData.points.push(new PMPoint(-0.0384616, | ||
+ | |||
+ | obj62.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj62.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj62.userData.pointlabels = [" | ||
+ | obj62.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj62.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj62.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj62.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj62); | ||
+ | scene.add(obj62); | ||
+ | |||
+ | var obj63 = new THREE.Object3D(); | ||
+ | obj63.name = " | ||
+ | obj63.userData.explodable = 1; | ||
+ | obj63.userData.points = []; | ||
+ | obj63.userData.points.push(new PMPoint(-0.289474, | ||
+ | obj63.userData.points.push(new PMPoint(-0.142857, | ||
+ | obj63.userData.points.push(new PMPoint(-0.209677, | ||
+ | |||
+ | obj63.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj63.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj63.userData.pointlabels = [" | ||
+ | obj63.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj63.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj63.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj63.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj63); | ||
+ | scene.add(obj63); | ||
+ | |||
+ | var obj64 = new THREE.Object3D(); | ||
+ | obj64.name = " | ||
+ | obj64.userData.explodable = 1; | ||
+ | obj64.userData.points = []; | ||
+ | obj64.userData.points.push(new PMPoint(-0.289474, | ||
+ | obj64.userData.points.push(new PMPoint(-0.385246, | ||
+ | obj64.userData.points.push(new PMPoint(-0.351351, | ||
+ | |||
+ | obj64.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj64.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj64.userData.pointlabels = [" | ||
+ | obj64.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj64.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj64.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj64.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj64); | ||
+ | scene.add(obj64); | ||
+ | |||
+ | var obj65 = new THREE.Object3D(); | ||
+ | obj65.name = " | ||
+ | obj65.userData.explodable = 1; | ||
+ | obj65.userData.points = []; | ||
+ | obj65.userData.points.push(new PMPoint(-0.5, | ||
+ | obj65.userData.points.push(new PMPoint(-0.385246, | ||
+ | obj65.userData.points.push(new PMPoint(-0.42126, | ||
+ | |||
+ | obj65.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj65.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj65.userData.pointlabels = [" | ||
+ | obj65.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj65.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj65.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj65.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj65); | ||
+ | scene.add(obj65); | ||
+ | |||
+ | var obj66 = new THREE.Object3D(); | ||
+ | obj66.name = " | ||
+ | obj66.userData.explodable = 1; | ||
+ | obj66.userData.points = []; | ||
+ | obj66.userData.points.push(new PMPoint(-0.5, | ||
+ | obj66.userData.points.push(new PMPoint(-0.587912, | ||
+ | obj66.userData.points.push(new PMPoint(-0.565089, | ||
+ | |||
+ | obj66.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj66.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj66.userData.pointlabels = [" | ||
+ | obj66.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj66.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj66.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj66.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj66); | ||
+ | scene.add(obj66); | ||
+ | |||
+ | var obj67 = new THREE.Object3D(); | ||
+ | obj67.name = " | ||
+ | obj67.userData.explodable = 1; | ||
+ | obj67.userData.points = []; | ||
+ | obj67.userData.points.push(new PMPoint(-0.635135, | ||
+ | obj67.userData.points.push(new PMPoint(-0.587912, | ||
+ | obj67.userData.points.push(new PMPoint(-0.606557, | ||
+ | |||
+ | obj67.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj67.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj67.userData.pointlabels = [" | ||
+ | obj67.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj67.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj67.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj67.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj67); | ||
+ | scene.add(obj67); | ||
+ | |||
+ | var obj68 = new THREE.Object3D(); | ||
+ | obj68.name = " | ||
+ | obj68.userData.explodable = 1; | ||
+ | obj68.userData.points = []; | ||
+ | obj68.userData.points.push(new PMPoint(-0.635135, | ||
+ | obj68.userData.points.push(new PMPoint(-0.684211, | ||
+ | obj68.userData.points.push(new PMPoint(-0.664384, | ||
+ | |||
+ | obj68.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj68.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj68.userData.pointlabels = [" | ||
+ | obj68.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj68.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj68.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj68.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj68); | ||
+ | scene.add(obj68); | ||
+ | |||
+ | var obj69 = new THREE.Object3D(); | ||
+ | obj69.name = " | ||
+ | obj69.userData.explodable = 1; | ||
+ | obj69.userData.points = []; | ||
+ | obj69.userData.points.push(new PMPoint(-0.785714, | ||
+ | obj69.userData.points.push(new PMPoint(-0.684211, | ||
+ | obj69.userData.points.push(new PMPoint(-0.709302, | ||
+ | |||
+ | obj69.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj69.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj69.userData.pointlabels = [" | ||
+ | obj69.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj69.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj69.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj69.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj69); | ||
+ | scene.add(obj69); | ||
+ | |||
+ | var obj70 = new THREE.Object3D(); | ||
+ | obj70.name = " | ||
+ | obj70.userData.explodable = 1; | ||
+ | obj70.userData.points = []; | ||
+ | obj70.userData.points.push(new PMPoint(-0.785714, | ||
+ | obj70.userData.points.push(new PMPoint(-0.860825, | ||
+ | obj70.userData.points.push(new PMPoint(-0.846154, | ||
+ | |||
+ | obj70.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj70.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj70.userData.pointlabels = [" | ||
+ | obj70.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj70.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj70.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj70.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj70); | ||
+ | scene.add(obj70); | ||
+ | |||
+ | var obj71 = new THREE.Object3D(); | ||
+ | obj71.name = " | ||
+ | obj71.userData.explodable = 1; | ||
+ | obj71.userData.points = []; | ||
+ | obj71.userData.points.push(new PMPoint(-0.884615, | ||
+ | obj71.userData.points.push(new PMPoint(-0.860825, | ||
+ | obj71.userData.points.push(new PMPoint(-0.871134, | ||
+ | |||
+ | obj71.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj71.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj71.userData.pointlabels = [" | ||
+ | obj71.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj71.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj71.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj71.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj71); | ||
+ | scene.add(obj71); | ||
+ | |||
+ | var obj72 = new THREE.Object3D(); | ||
+ | obj72.name = " | ||
+ | obj72.userData.explodable = 1; | ||
+ | obj72.userData.points = []; | ||
+ | obj72.userData.points.push(new PMPoint(-0.884615, | ||
+ | obj72.userData.points.push(new PMPoint(-0.902878, | ||
+ | obj72.userData.points.push(new PMPoint(-0.896122, | ||
+ | |||
+ | obj72.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj72.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj72.userData.pointlabels = [" | ||
+ | obj72.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj72.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj72.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj72.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj72); | ||
+ | scene.add(obj72); | ||
+ | |||
+ | var obj73 = new THREE.Object3D(); | ||
+ | obj73.name = " | ||
+ | obj73.userData.explodable = 1; | ||
+ | obj73.userData.points = []; | ||
+ | obj73.userData.points.push(new PMPoint(-0.928571, | ||
+ | obj73.userData.points.push(new PMPoint(-0.902878, | ||
+ | obj73.userData.points.push(new PMPoint(-0.910448, | ||
+ | |||
+ | obj73.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj73.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj73.userData.pointlabels = [" | ||
+ | obj73.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj73.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj73.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj73.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj73); | ||
+ | scene.add(obj73); | ||
+ | |||
+ | var obj74 = new THREE.Object3D(); | ||
+ | obj74.name = " | ||
+ | obj74.userData.explodable = 1; | ||
+ | obj74.userData.points = []; | ||
+ | obj74.userData.points.push(new PMPoint(-0.928571, | ||
+ | obj74.userData.points.push(new PMPoint(-0.951613, | ||
+ | obj74.userData.points.push(new PMPoint(-0.945344, | ||
+ | |||
+ | obj74.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj74.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj74.userData.pointlabels = [" | ||
+ | obj74.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj74.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj74.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj74.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj74); | ||
+ | scene.add(obj74); | ||
+ | |||
+ | var obj75 = new THREE.Object3D(); | ||
+ | obj75.name = " | ||
+ | obj75.userData.explodable = 1; | ||
+ | obj75.userData.points = []; | ||
+ | obj75.userData.points.push(new PMPoint(-0.965116, | ||
+ | obj75.userData.points.push(new PMPoint(-0.951613, | ||
+ | obj75.userData.points.push(new PMPoint(-0.956869, | ||
+ | |||
+ | obj75.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj75.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj75.userData.pointlabels = [" | ||
+ | obj75.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj75.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj75.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj75.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj75); | ||
+ | scene.add(obj75); | ||
+ | |||
+ | var obj76 = new THREE.Object3D(); | ||
+ | obj76.name = " | ||
+ | obj76.userData.explodable = 1; | ||
+ | obj76.userData.points = []; | ||
+ | obj76.userData.points.push(new PMPoint(-0.965116, | ||
+ | obj76.userData.points.push(new PMPoint(-0.979452, | ||
+ | obj76.userData.points.push(new PMPoint(-0.973684, | ||
+ | |||
+ | obj76.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj76.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj76.userData.pointlabels = [" | ||
+ | obj76.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj76.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj76.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj76.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj76); | ||
+ | scene.add(obj76); | ||
+ | |||
+ | var obj77 = new THREE.Object3D(); | ||
+ | obj77.name = " | ||
+ | obj77.userData.explodable = 1; | ||
+ | obj77.userData.points = []; | ||
+ | obj77.userData.points.push(new PMPoint(-1, 0, 0.0375)); | ||
+ | obj77.userData.points.push(new PMPoint(-0.979452, | ||
+ | obj77.userData.points.push(new PMPoint(-0.986486, | ||
+ | |||
+ | obj77.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj77.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj77.userData.pointlabels = [" | ||
+ | obj77.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj77.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj77.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj77.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj77); | ||
+ | scene.add(obj77); | ||
+ | |||
+ | var obj78 = new THREE.Object3D(); | ||
+ | obj78.name = " | ||
+ | obj78.userData.explodable = 1; | ||
+ | obj78.userData.points = []; | ||
+ | obj78.userData.points.push(new PMPoint(-1, 0, 0.0375)); | ||
+ | obj78.userData.points.push(new PMPoint(-0.983516, | ||
+ | obj78.userData.points.push(new PMPoint(-0.988722, | ||
+ | |||
+ | obj78.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj78.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj78.userData.pointlabels = [" | ||
+ | obj78.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj78.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj78.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj78.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj78); | ||
+ | scene.add(obj78); | ||
+ | |||
+ | var obj79 = new THREE.Object3D(); | ||
+ | obj79.name = " | ||
+ | obj79.userData.explodable = 1; | ||
+ | obj79.userData.points = []; | ||
+ | obj79.userData.points.push(new PMPoint(-0.973684, | ||
+ | obj79.userData.points.push(new PMPoint(-0.983516, | ||
+ | obj79.userData.points.push(new PMPoint(-0.979452, | ||
+ | |||
+ | obj79.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj79.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj79.userData.pointlabels = [" | ||
+ | obj79.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj79.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj79.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj79.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj79); | ||
+ | scene.add(obj79); | ||
+ | |||
+ | var obj80 = new THREE.Object3D(); | ||
+ | obj80.name = " | ||
+ | obj80.userData.explodable = 1; | ||
+ | obj80.userData.points = []; | ||
+ | obj80.userData.points.push(new PMPoint(-0.973684, | ||
+ | obj80.userData.points.push(new PMPoint(-0.965116, | ||
+ | obj80.userData.points.push(new PMPoint(-0.968384, | ||
+ | |||
+ | obj80.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj80.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj80.userData.pointlabels = [" | ||
+ | obj80.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj80.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj80.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj80.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj80); | ||
+ | scene.add(obj80); | ||
+ | |||
+ | var obj81 = new THREE.Object3D(); | ||
+ | obj81.name = " | ||
+ | obj81.userData.explodable = 1; | ||
+ | obj81.userData.points = []; | ||
+ | obj81.userData.points.push(new PMPoint(-0.951613, | ||
+ | obj81.userData.points.push(new PMPoint(-0.965116, | ||
+ | obj81.userData.points.push(new PMPoint(-0.961318, | ||
+ | |||
+ | obj81.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj81.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj81.userData.pointlabels = [" | ||
+ | obj81.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj81.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj81.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj81.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj81); | ||
+ | scene.add(obj81); | ||
+ | |||
+ | var obj82 = new THREE.Object3D(); | ||
+ | obj82.name = " | ||
+ | obj82.userData.explodable = 1; | ||
+ | obj82.userData.points = []; | ||
+ | obj82.userData.points.push(new PMPoint(-0.951613, | ||
+ | obj82.userData.points.push(new PMPoint(-0.937788, | ||
+ | obj82.userData.points.push(new PMPoint(-0.941748, | ||
+ | |||
+ | obj82.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj82.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj82.userData.pointlabels = [" | ||
+ | obj82.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj82.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj82.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj82.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj82); | ||
+ | scene.add(obj82); | ||
+ | |||
+ | var obj83 = new THREE.Object3D(); | ||
+ | obj83.name = " | ||
+ | obj83.userData.explodable = 1; | ||
+ | obj83.userData.points = []; | ||
+ | obj83.userData.points.push(new PMPoint(-0.928571, | ||
+ | obj83.userData.points.push(new PMPoint(-0.937788, | ||
+ | obj83.userData.points.push(new PMPoint(-0.934326, | ||
+ | |||
+ | obj83.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj83.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj83.userData.pointlabels = [" | ||
+ | obj83.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj83.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj83.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj83.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj83); | ||
+ | scene.add(obj83); | ||
+ | |||
+ | var obj84 = new THREE.Object3D(); | ||
+ | obj84.name = " | ||
+ | obj84.userData.explodable = 1; | ||
+ | obj84.userData.points = []; | ||
+ | obj84.userData.points.push(new PMPoint(-0.928571, | ||
+ | obj84.userData.points.push(new PMPoint(-0.917178, | ||
+ | obj84.userData.points.push(new PMPoint(-0.922037, | ||
+ | |||
+ | obj84.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj84.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj84.userData.pointlabels = [" | ||
+ | obj84.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj84.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj84.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj84.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj84); | ||
+ | scene.add(obj84); | ||
+ | |||
+ | var obj85 = new THREE.Object3D(); | ||
+ | obj85.name = " | ||
+ | obj85.userData.explodable = 1; | ||
+ | obj85.userData.points = []; | ||
+ | obj85.userData.points.push(new PMPoint(-0.884615, | ||
+ | obj85.userData.points.push(new PMPoint(-0.917178, | ||
+ | obj85.userData.points.push(new PMPoint(-0.910448, | ||
+ | |||
+ | obj85.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj85.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj85.userData.pointlabels = [" | ||
+ | obj85.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj85.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj85.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj85.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj85); | ||
+ | scene.add(obj85); | ||
+ | |||
+ | var obj86 = new THREE.Object3D(); | ||
+ | obj86.name = " | ||
+ | obj86.userData.explodable = 1; | ||
+ | obj86.userData.points = []; | ||
+ | obj86.userData.points.push(new PMPoint(-0.884615, | ||
+ | obj86.userData.points.push(new PMPoint(-0.846154, | ||
+ | obj86.userData.points.push(new PMPoint(-0.855212, | ||
+ | |||
+ | obj86.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj86.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj86.userData.pointlabels = [" | ||
+ | obj86.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj86.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj86.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj86.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj86); | ||
+ | scene.add(obj86); | ||
+ | |||
+ | var obj87 = new THREE.Object3D(); | ||
+ | obj87.name = " | ||
+ | obj87.userData.explodable = 1; | ||
+ | obj87.userData.points = []; | ||
+ | obj87.userData.points.push(new PMPoint(-0.829114, | ||
+ | obj87.userData.points.push(new PMPoint(-0.846154, | ||
+ | obj87.userData.points.push(new PMPoint(-0.839169, | ||
+ | |||
+ | obj87.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj87.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj87.userData.pointlabels = [" | ||
+ | obj87.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj87.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj87.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj87.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj87); | ||
+ | scene.add(obj87); | ||
+ | |||
+ | var obj88 = new THREE.Object3D(); | ||
+ | obj88.name = " | ||
+ | obj88.userData.explodable = 1; | ||
+ | obj88.userData.points = []; | ||
+ | obj88.userData.points.push(new PMPoint(-0.829114, | ||
+ | obj88.userData.points.push(new PMPoint(-0.813433, | ||
+ | obj88.userData.points.push(new PMPoint(-0.819549, | ||
+ | |||
+ | obj88.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj88.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj88.userData.pointlabels = [" | ||
+ | obj88.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj88.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj88.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj88.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj88); | ||
+ | scene.add(obj88); | ||
+ | |||
+ | var obj89 = new THREE.Object3D(); | ||
+ | obj89.name = " | ||
+ | obj89.userData.explodable = 1; | ||
+ | obj89.userData.points = []; | ||
+ | obj89.userData.points.push(new PMPoint(-0.785714, | ||
+ | obj89.userData.points.push(new PMPoint(-0.813433, | ||
+ | obj89.userData.points.push(new PMPoint(-0.806069, | ||
+ | |||
+ | obj89.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj89.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj89.userData.pointlabels = [" | ||
+ | obj89.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj89.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj89.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj89.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj89); | ||
+ | scene.add(obj89); | ||
+ | |||
+ | var obj90 = new THREE.Object3D(); | ||
+ | obj90.name = " | ||
+ | obj90.userData.explodable = 1; | ||
+ | obj90.userData.points = []; | ||
+ | obj90.userData.points.push(new PMPoint(-0.785714, | ||
+ | obj90.userData.points.push(new PMPoint(-0.751656, | ||
+ | obj90.userData.points.push(new PMPoint(-0.762136, | ||
+ | |||
+ | obj90.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj90.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj90.userData.pointlabels = [" | ||
+ | obj90.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj90.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj90.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj90.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj90); | ||
+ | scene.add(obj90); | ||
+ | |||
+ | var obj91 = new THREE.Object3D(); | ||
+ | obj91.name = " | ||
+ | obj91.userData.explodable = 1; | ||
+ | obj91.userData.points = []; | ||
+ | obj91.userData.points.push(new PMPoint(-0.72449, | ||
+ | obj91.userData.points.push(new PMPoint(-0.751656, | ||
+ | obj91.userData.points.push(new PMPoint(-0.741936, | ||
+ | |||
+ | obj91.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj91.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj91.userData.pointlabels = [" | ||
+ | obj91.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj91.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj91.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj91.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj91); | ||
+ | scene.add(obj91); | ||
+ | |||
+ | var obj92 = new THREE.Object3D(); | ||
+ | obj92.name = " | ||
+ | obj92.userData.explodable = 1; | ||
+ | obj92.userData.points = []; | ||
+ | obj92.userData.points.push(new PMPoint(-0.72449, | ||
+ | obj92.userData.points.push(new PMPoint(-0.684211, | ||
+ | obj92.userData.points.push(new PMPoint(-0.702429, | ||
+ | |||
+ | obj92.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj92.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj92.userData.pointlabels = [" | ||
+ | obj92.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj92.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj92.userData.facets = [[1, 0, 2]]; | ||
+ | < | ||
+ | obj92.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj92); | ||
+ | scene.add(obj92); | ||
+ | |||
+ | var obj93 = new THREE.Object3D(); | ||
+ | obj93.name = " | ||
+ | obj93.userData.explodable = 1; | ||
+ | obj93.userData.points = []; | ||
+ | obj93.userData.points.push(new PMPoint(-0.5, | ||
+ | obj93.userData.points.push(new PMPoint(-0.684211, | ||
+ | obj93.userData.points.push(new PMPoint(-0.655963, | ||
+ | |||
+ | obj93.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj93.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj93.userData.pointlabels = [" | ||
+ | obj93.userData.edgeindices = [0, 1, 0, 2, 1, 2]; | ||
+ | < | ||
+ | obj93.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj93.userData.facets = [[0, 1, 2]]; | ||
+ | < | ||
+ | obj93.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x50B4FF, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj93); | ||
+ | scene.add(obj93); | ||
+ | |||
+ | // COMMON_CODE_BLOCK_BEGIN | ||
+ | function textSpriteMaterial(message, | ||
+ | if ( parameters === undefined ) parameters = {}; | ||
+ | var fontface = " | ||
+ | var fontsize = parameters.hasOwnProperty(" | ||
+ | fontsize = fontsize*10; | ||
+ | var lines = message.split(' | ||
+ | var size = 512; | ||
+ | for(var i = 0; i< | ||
+ | var tmp = lines[i].length; | ||
+ | while(tmp*fontsize > size){ | ||
+ | | ||
+ | } | ||
+ | } | ||
+ | | ||
+ | var canvas = document.createElement(' | ||
+ | canvas.width = size; | ||
+ | canvas.height = size; | ||
+ | var context = canvas.getContext(' | ||
+ | context.fillStyle = " | ||
+ | context.fill(); | ||
+ | context.font = fontsize + "px " + fontface; | ||
+ | | ||
+ | // text color | ||
+ | context.fillStyle = " | ||
+ | | ||
+ | context.fillText(lines[i], | ||
+ | } | ||
+ | | ||
+ | // canvas contents will be used for a texture | ||
+ | var texture = new THREE.Texture(canvas); | ||
+ | texture.needsUpdate = true; | ||
+ | | ||
+ | var spriteMaterial = new THREE.SpriteMaterial({map: | ||
+ | return spriteMaterial; | ||
+ | } | ||
+ | |||
+ | |||
+ | // ---------------------- INITIALIZING OBJECTS-------------------------------------- | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | |||
+ | function init_object(obj) { | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_points(obj); | ||
+ | modelContains.points = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_pointlabels(obj); | ||
+ | modelContains.pointlabels = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_lines(obj); | ||
+ | modelContains.lines = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_edgelabels(obj); | ||
+ | modelContains.edgelabels = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_arrowheads(obj); | ||
+ | modelContains.arrowheads = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_faces(obj); | ||
+ | modelContains.faces = true; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function init_points(obj) { | ||
+ | var pointgroup = new THREE.Group(); | ||
+ | pointgroup.name = " | ||
+ | var points = obj.userData.points; | ||
+ | var radii = obj.userData.pointradii; | ||
+ | var materials = obj.userData.pointmaterial; | ||
+ | var geometry, | ||
+ | if (!Array.isArray(radii)) { | ||
+ | geometry = new THREE.SphereBufferGeometry(radii); | ||
+ | } | ||
+ | if (!Array.isArray(materials)) { | ||
+ | material = materials; | ||
+ | } | ||
+ | for (var i=0; i< | ||
+ | var point = points[i]; | ||
+ | if (Array.isArray(radii)) { | ||
+ | if (radii[i] == 0) { | ||
+ | continue; | ||
+ | } | ||
+ | geometry = new THREE.SphereBufferGeometry(radii[i]); | ||
+ | } | ||
+ | if (Array.isArray(materials)) { | ||
+ | material = materials[i]; | ||
+ | } | ||
+ | var sphere = new THREE.Mesh(geometry, | ||
+ | point.addSphere(sphere); | ||
+ | pointgroup.add(sphere); | ||
+ | } | ||
+ | obj.add(pointgroup); | ||
+ | } | ||
+ | |||
+ | function init_pointlabels(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var labels = obj.userData.pointlabels; | ||
+ | var pointlabels = new THREE.Group(); | ||
+ | pointlabels.name = " | ||
+ | if (Array.isArray(labels)) { | ||
+ | for (var i=0; i< | ||
+ | var point = points[i]; | ||
+ | var spriteMaterial = textSpriteMaterial( labels[i] ); | ||
+ | var sprite = new THREE.Sprite(spriteMaterial); | ||
+ | point.addLabel(sprite); | ||
+ | pointlabels.add(sprite); | ||
+ | } | ||
+ | } else { | ||
+ | var spriteMaterial = textSpriteMaterial( labels ); | ||
+ | for (var i=0; i< | ||
+ | var point = points[i]; | ||
+ | var sprite = new THREE.Sprite(spriteMaterial); | ||
+ | point.addLabel(sprite); | ||
+ | pointlabels.add(sprite); | ||
+ | } | ||
+ | } | ||
+ | obj.add(pointlabels); | ||
+ | } | ||
+ | |||
+ | function init_lines(obj) { | ||
+ | var edgeindices = obj.userData.edgeindices; | ||
+ | var points = obj.userData.points; | ||
+ | var materials = obj.userData.edgematerial; | ||
+ | var geometry = new THREE.BufferGeometry(); | ||
+ | var bufarr = new Float32Array( obj.userData.edgeindices.length * 3 ); | ||
+ | var bufattr = new THREE.Float32BufferAttribute( bufarr, 3 ); | ||
+ | var geometry = new THREE.BufferGeometry(); | ||
+ | geometry.setAttribute(' | ||
+ | if (Array.isArray(materials)) { | ||
+ | for (var i=0; i< | ||
+ | geometry.addGroup(2*i, | ||
+ | } | ||
+ | } | ||
+ | var lines = new THREE.LineSegments(geometry, | ||
+ | lines.name = " | ||
+ | obj.add(lines); | ||
+ | updateEdgesPosition(obj); | ||
+ | } | ||
+ | |||
+ | function init_edgelabels(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var edgeindices = obj.userData.edgeindices; | ||
+ | var labels = obj.userData.edgelabels; | ||
+ | var edgelabels = new THREE.Group(); | ||
+ | edgelabels.name = " | ||
+ | if (Array.isArray(labels)) { | ||
+ | for (var i=0; i< | ||
+ | var spriteMaterial = textSpriteMaterial( labels[i] ); | ||
+ | var sprite = new THREE.Sprite(spriteMaterial); | ||
+ | sprite.position.copy(new THREE.Vector3().addVectors(points[edgeindices[2*i]].vector, | ||
+ | edgelabels.add(sprite); | ||
+ | } | ||
+ | } else { | ||
+ | var spriteMaterial = textSpriteMaterial( labels ); | ||
+ | for (var i=0; i< | ||
+ | var sprite = new THREE.Sprite(spriteMaterial); | ||
+ | sprite.position.copy(new THREE.Vector3().addVectors(points[edgeindices[2*i]].vector, | ||
+ | edgelabels.add(sprite); | ||
+ | } | ||
+ | } | ||
+ | obj.add(edgelabels); | ||
+ | } | ||
+ | |||
+ | function init_arrowheads(obj) { | ||
+ | var arrowheads = new THREE.Group(); | ||
+ | arrowheads.name = " | ||
+ | var arrowstyle = obj.userData.arrowstyle; | ||
+ | var edgeindices = obj.userData.edgeindices; | ||
+ | var edgematerials = obj.userData.edgematerial; | ||
+ | var points = obj.userData.points; | ||
+ | var material; | ||
+ | if (!Array.isArray(edgematerials)) { | ||
+ | material = new THREE.MeshBasicMaterial( {color: edgematerials.color} ); | ||
+ | } | ||
+ | |||
+ | for (var i=0; i< | ||
+ | var start = points[edgeindices[i]]; | ||
+ | var end = points[edgeindices[i+1]]; | ||
+ | var dist = start.vector.distanceTo( end.vector ) - start.radius() - end.radius(); | ||
+ | if (dist <= 0) { | ||
+ | continue; | ||
+ | } | ||
+ | var dir = new THREE.Vector3().subVectors(end.vector, | ||
+ | dir.normalize(); | ||
+ | var axis = new THREE.Vector3().set(dir.z, | ||
+ | axis.normalize(); | ||
+ | var radians = Math.acos( dir.y ); | ||
+ | var radius = dist/25; | ||
+ | var height = dist/5; | ||
+ | var geometry = new THREE.ConeBufferGeometry(radius, | ||
+ | var position = new THREE.Vector3().addVectors(start.vector, | ||
+ | if (Array.isArray(edgematerials)) { | ||
+ | material = new THREE.MeshBasicMaterial( {color: edgematerials[i].color} ); | ||
+ | } | ||
+ | var cone = new THREE.Mesh( geometry, material ); | ||
+ | cone.quaternion.setFromAxisAngle(axis, | ||
+ | cone.position.copy(position);; | ||
+ | arrowheads.add(cone); | ||
+ | } | ||
+ | obj.add(arrowheads); | ||
+ | } | ||
+ | |||
+ | function init_faces(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var facets = obj.userData.facets; | ||
+ | obj.userData.triangleindices = []; | ||
+ | for (var i=0; i< | ||
+ | facet = facets[i]; | ||
+ | for (var t=0; t< | ||
+ | obj.userData.triangleindices.push(facet[0], | ||
+ | } | ||
+ | } | ||
+ | var bufarr = new Float32Array( obj.userData.triangleindices.length * 3 ); | ||
+ | var bufattr = new THREE.Float32BufferAttribute(bufarr, | ||
+ | | ||
+ | var materials = obj.userData.facetmaterial; | ||
+ | var geometry = new THREE.BufferGeometry(); | ||
+ | var frontmaterials = []; | ||
+ | var backmaterials = []; | ||
+ | geometry.setAttribute(' | ||
+ | if (Array.isArray(materials)) { | ||
+ | var tricount = 0; | ||
+ | var facet; | ||
+ | for (var i=0; i< | ||
+ | facet = facets[i]; | ||
+ | geometry.addGroup(tricount, | ||
+ | tricount += (facet.length-2)*3; | ||
+ | } | ||
+ | for (var j=0; j< | ||
+ | var fmat = materials[j].clone() | ||
+ | fmat.side = THREE.FrontSide; | ||
+ | frontmaterials.push(fmat); | ||
+ | var bmat = materials[j].clone() | ||
+ | bmat.side = THREE.BackSide; | ||
+ | backmaterials.push(bmat); | ||
+ | obj.userData.facetmaterial = frontmaterials.concat(backmaterials); | ||
+ | } | ||
+ | } else if (materials instanceof THREE.Material) { | ||
+ | frontmaterials = materials.clone() | ||
+ | frontmaterials.side = THREE.FrontSide; | ||
+ | backmaterials = materials.clone() | ||
+ | backmaterials.side = THREE.BackSide; | ||
+ | obj.userData.facetmaterial = [frontmaterials, | ||
+ | } | ||
+ | // duplicating the object with front and back should avoid transparency issues | ||
+ | var backmesh = new THREE.Mesh(geometry, | ||
+ | // meshname is used to show/hide objects | ||
+ | backmesh.name = " | ||
+ | obj.add(backmesh); | ||
+ | var frontmesh = new THREE.Mesh(geometry, | ||
+ | frontmesh.name = " | ||
+ | obj.add(frontmesh); | ||
+ | updateFacesPosition(obj); | ||
+ | } | ||
+ | // // | ||
+ | |||
+ | |||
+ | function updateFacesPosition(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var indices = obj.userData.triangleindices; | ||
+ | var faces = obj.getObjectByName(" | ||
+ | var ba = faces.geometry.getAttribute(" | ||
+ | for (var i=0; i< | ||
+ | ba.setXYZ(i, | ||
+ | } | ||
+ | faces.geometry.attributes.position.needsUpdate = true; | ||
+ | | ||
+ | } | ||
+ | |||
+ | function updateEdgesPosition(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var indices = obj.userData.edgeindices; | ||
+ | var lines = obj.getObjectByName(" | ||
+ | var ba = lines.geometry.getAttribute(" | ||
+ | for (var i=0; i< | ||
+ | ba.setXYZ(i, | ||
+ | } | ||
+ | lines.geometry.attributes.position.needsUpdate = true; | ||
+ | } | ||
+ | |||
+ | function onWindowResize() { | ||
+ | renderer.setSize( three.clientWidth, | ||
+ | svgRenderer.setSize( three.clientWidth, | ||
+ | updateCamera(); | ||
+ | } | ||
+ | |||
+ | function updateCamera() { | ||
+ | var width = three.clientWidth; | ||
+ | var height = three.clientHeight; | ||
+ | var aspect = width / height; | ||
+ | if (camera.type == " | ||
+ | camera.left = frustumSize * aspect / - 2; | ||
+ | camera.right = frustumSize * aspect / 2; | ||
+ | camera.top = frustumSize / 2; | ||
+ | camera.bottom = - frustumSize / 2; | ||
+ | } else if (camera.type == " | ||
+ | camera.aspect = aspect; | ||
+ | } | ||
+ | camera.updateProjectionMatrix(); | ||
+ | } | ||
+ | |||
+ | function changeCamera(event) { | ||
+ | var selindex = event.currentTarget.selectedIndex; | ||
+ | camera = cameras[selindex]; | ||
+ | control = controls[selindex]; | ||
+ | control.enabled = true; | ||
+ | for (var i=0; i< | ||
+ | if (i!=selindex) { | ||
+ | controls[i].enabled = false; | ||
+ | } | ||
+ | } | ||
+ | updateCamera(); | ||
+ | } | ||
+ | |||
+ | var camtypenode = document.getElementById(' | ||
+ | camtypenode.onchange = changeCamera; | ||
+ | camtypenode.dispatchEvent(new Event(' | ||
+ | |||
+ | onWindowResize(); | ||
+ | window.addEventListener(' | ||
+ | |||
+ | |||
+ | var xRotationEnabled = false; | ||
+ | var yRotationEnabled = false; | ||
+ | var zRotationEnabled = false; | ||
+ | var rotationSpeedFactor = 1; | ||
+ | var settingsShown = false; | ||
+ | var labelsShown = true; | ||
+ | var intervals = []; | ||
+ | var timeouts = []; | ||
+ | var explodingSpeed = 0.05; | ||
+ | var explodeScale = 0.000001; | ||
+ | var XMLS = new XMLSerializer(); | ||
+ | var svgElement; | ||
+ | var renderId; | ||
+ | |||
+ | var render = function () { | ||
+ | |||
+ | renderId = requestAnimationFrame(render); | ||
+ | |||
+ | // comment in for automatic explosion | ||
+ | // | ||
+ | |||
+ | var phi = 0.02 * rotationSpeedFactor; | ||
+ | |||
+ | if (xRotationEnabled) { | ||
+ | scene.rotation.x += phi; | ||
+ | } | ||
+ | if (yRotationEnabled) { | ||
+ | scene.rotation.y += phi; | ||
+ | } | ||
+ | if (zRotationEnabled) { | ||
+ | scene.rotation.z += phi; | ||
+ | } | ||
+ | |||
+ | control.update(); | ||
+ | renderer.render(scene, | ||
+ | }; | ||
+ | |||
+ | if ( THREE.WEBGL.isWebGLAvailable() ) { | ||
+ | render(); | ||
+ | } else { | ||
+ | var warning = WEBGL.getWebGLErrorMessage(); | ||
+ | three.appendChild( warning ); | ||
+ | } | ||
+ | | ||
+ | function changeTransparency() { | ||
+ | var opacity = 1-Number(event.currentTarget.value); | ||
+ | for (var i=0; i< | ||
+ | child = scene.children[i]; | ||
+ | if ( child.userData.hasOwnProperty(" | ||
+ | if (Array.isArray(child.userData.facetmaterial)) { | ||
+ | for (var j=0; j< | ||
+ | child.userData.facetmaterial[j].opacity = opacity; | ||
+ | } | ||
+ | } else { | ||
+ | child.userData.facetmaterial.opacity = opacity; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function toggleDepthWrite(event) { | ||
+ | depthwrite = event.currentTarget.checked; | ||
+ | for (var i=0; i< | ||
+ | child = scene.children[i]; | ||
+ | if ( child.userData.hasOwnProperty(" | ||
+ | if (Array.isArray(child.userData.facetmaterial)) { | ||
+ | for (var j=0; j< | ||
+ | child.userData.facetmaterial[j].depthWrite = depthwrite; | ||
+ | } | ||
+ | } else { | ||
+ | child.userData.facetmaterial.depthWrite = depthWrite; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function changeRotationX(event){ | ||
+ | xRotationEnabled = event.currentTarget.checked; | ||
+ | } | ||
+ | |||
+ | function changeRotationY(event){ | ||
+ | yRotationEnabled = event.currentTarget.checked; | ||
+ | } | ||
+ | |||
+ | function changeRotationZ(event){ | ||
+ | zRotationEnabled = event.currentTarget.checked; | ||
+ | } | ||
+ | |||
+ | |||
+ | function changeRotationSpeedFactor(event){ | ||
+ | rotationSpeedFactor = Number(event.currentTarget.value); | ||
+ | } | ||
+ | |||
+ | function resetScene(){ | ||
+ | scene.rotation.set(0, | ||
+ | camera.position.set(0, | ||
+ | camera.up.set(0, | ||
+ | } | ||
+ | |||
+ | function showSettings(event){ | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | settingsShown = true; | ||
+ | } | ||
+ | |||
+ | function hideSettings(event){ | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | settingsShown = false; | ||
+ | } | ||
+ | |||
+ | |||
+ | |||
+ | var pos = 150* Math.PI; | ||
+ | |||
+ | function updateFactor() { | ||
+ | pos++; | ||
+ | return Math.sin(.01*pos)+1; | ||
+ | } | ||
+ | |||
+ | // ------------------------ FOLDING ------------------------------------------------ | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | // rotate point p around axis defined by points p1 and p2 by given angle | ||
+ | function rotate(p, p1, p2, angle ){ | ||
+ | angle = -angle; | ||
+ | var x = p.x, y = p.y, z = p.z, | ||
+ | a = p1.x, b = p1.y, c = p1.z, | ||
+ | u = p2.x-p1.x, v = p2.y-p1.y, w = p2.z-p1.z; | ||
+ | var result = []; | ||
+ | var L = u*u + v*v + w*w; | ||
+ | var sqrt = Math.sqrt; | ||
+ | var cos = Math.cos; | ||
+ | var sin = Math.sin; | ||
+ | |||
+ | result[0] = ((a*(v*v+w*w)-u*(b*v+c*w-u*x-v*y-w*z))*(1-cos(angle))+L*x*cos(angle)+sqrt(L)*(-c*v+b*w-w*y+v*z)*sin(angle))/ | ||
+ | result[1] = ((b*(u*u+w*w)-v*(a*u+c*w-u*x-v*y-w*z))*(1-cos(angle))+L*y*cos(angle)+sqrt(L)*(c*u-a*w+w*x-u*z)*sin(angle))/ | ||
+ | result[2] = ((c*(u*u+v*v)-w*(a*u+b*v-u*x-v*y-w*z))*(1-cos(angle))+L*z*cos(angle)+sqrt(L)*(-b*u+a*v-v*x+u*y)*sin(angle))/ | ||
+ | |||
+ | return result; | ||
+ | } | ||
+ | |||
+ | var fold = function(event){ | ||
+ | var obj = foldables[Number(event.currentTarget.name)]; | ||
+ | var foldvalue = Number(event.currentTarget.value); | ||
+ | var scale = foldvalue - obj.userData.oldscale; | ||
+ | |||
+ | for (var j=0; j< | ||
+ | rotateVertices(obj, | ||
+ | } | ||
+ | update(obj); | ||
+ | obj.userData.oldscale += scale; | ||
+ | lookAtBarycenter(obj); | ||
+ | } | ||
+ | |||
+ | function lookAtBarycenter(obj){ | ||
+ | control.target = barycenter(obj); | ||
+ | } | ||
+ | |||
+ | function barycenter(obj) { | ||
+ | var center = new THREE.Vector3(0, | ||
+ | var points = obj.userData.points; | ||
+ | for (var i=0; i< | ||
+ | center.add(points[i].vector); | ||
+ | } | ||
+ | center.divideScalar(points.length); | ||
+ | return center; | ||
+ | } | ||
+ | |||
+ | function rotateVertices(obj, | ||
+ | var axes = obj.userData.axes; | ||
+ | var subtrees = obj.userData.subtrees; | ||
+ | var points = obj.userData.points; | ||
+ | var angles = obj.userData.angles; | ||
+ | if (edge < axes.length){ | ||
+ | for (var j=0; j< | ||
+ | var rotP = rotate(points[subtrees[edge][j]].vector, | ||
+ | points[subtrees[edge][j]].set(rotP[0], | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function update(obj) { | ||
+ | | ||
+ | | ||
+ | } | ||
+ | |||
+ | if (foldables.length) { | ||
+ | var settings = document.getElementById(' | ||
+ | var foldDiv = document.createElement(' | ||
+ | foldDiv.id = ' | ||
+ | var title = document.createElement(' | ||
+ | title.innerHTML = ' | ||
+ | foldDiv.appendChild(title); | ||
+ | foldDiv.className = ' | ||
+ | for (var i=0; i< | ||
+ | var range = document.createElement(' | ||
+ | range.type = ' | ||
+ | range.min = 0; | ||
+ | range.max = 1; | ||
+ | range.value = 0; | ||
+ | range.step = 0.001; | ||
+ | range.name = String(i); | ||
+ | range.oninput = fold; | ||
+ | foldDiv.appendChild(range); | ||
+ | } | ||
+ | lookAtBarycenter(foldables[0]); | ||
+ | settings.insertBefore(foldDiv, | ||
+ | } | ||
+ | |||
+ | | ||
+ | // ---------------------- EXPLOSION ------------------------------------------------ | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | |||
+ | if (explodableModel) { | ||
+ | for (var i=0; i< | ||
+ | obj = scene.children[i]; | ||
+ | if ( obj.userData.explodable ) { | ||
+ | computeCentroid(obj); | ||
+ | } | ||
+ | } | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | explode(0.000001); | ||
+ | } | ||
+ | |||
+ | function computeCentroid(obj) { | ||
+ | centroid = new THREE.Vector3(); | ||
+ | obj.userData.points.forEach(function(pmpoint) { | ||
+ | centroid.add(pmpoint.vector); | ||
+ | }); | ||
+ | centroid.divideScalar(obj.userData.points.length); | ||
+ | obj.userData.centroid = centroid; | ||
+ | } | ||
+ | |||
+ | function explode(factor) { | ||
+ | for (var i=0; i< | ||
+ | var obj = scene.children[i]; | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | var c = obj.userData.centroid; | ||
+ | obj.position.set(c.x*factor, | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function triggerExplode(event){ | ||
+ | explodeScale = Number(event.currentTarget.value); | ||
+ | explode(explodeScale); | ||
+ | } | ||
+ | |||
+ | function setExplodingSpeed(event){ | ||
+ | explodingSpeed = Number(event.currentTarget.value); | ||
+ | } | ||
+ | |||
+ | function triggerAutomaticExplode(event){ | ||
+ | if (event.currentTarget.checked){ | ||
+ | startExploding(); | ||
+ | } else { | ||
+ | clearIntervals(); | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function startExploding(){ | ||
+ | intervals.push(setInterval(explodingInterval, | ||
+ | } | ||
+ | |||
+ | |||
+ | function explodingInterval(){ | ||
+ | explodeScale += explodingSpeed; | ||
+ | if (explodeScale <= 6){ | ||
+ | explode(explodeScale); | ||
+ | } | ||
+ | else{ | ||
+ | explode(6); | ||
+ | explodeScale = 6; | ||
+ | clearIntervals(); | ||
+ | timeouts.push(setTimeout(startUnexploding, | ||
+ | } | ||
+ | document.getElementById(' | ||
+ | } | ||
+ | |||
+ | |||
+ | function startUnexploding(){ | ||
+ | intervals.push(setInterval(unexplodingInterval, | ||
+ | } | ||
+ | |||
+ | function unexplodingInterval(){ | ||
+ | explodeScale -= explodingSpeed; | ||
+ | if (explodeScale >= 0){ | ||
+ | explode(explodeScale); | ||
+ | } | ||
+ | else { | ||
+ | explode(0); | ||
+ | explodeScale = 0; | ||
+ | clearIntervals(); | ||
+ | timeouts.push(setTimeout(startExploding, | ||
+ | } | ||
+ | document.getElementById(' | ||
+ | } | ||
+ | |||
+ | function clearIntervals(){ | ||
+ | intervals.forEach(function(interval){ | ||
+ | clearInterval(interval); | ||
+ | }); | ||
+ | intervals = []; | ||
+ | timeouts.forEach(function(timeout){ | ||
+ | clearTimeout(timeout); | ||
+ | }); | ||
+ | timeouts = []; | ||
+ | } | ||
+ | |||
+ | // ---------------------- DISPLAY -------------------------------------------------- | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | |||
+ | const objectTypeInnerHTMLs = { points: " | ||
+ | const objectTypeVisible = {}; | ||
+ | Object.assign(objectTypeVisible, | ||
+ | const sortedObjectTypeKeys = Object.keys(objectTypeInnerHTMLs).sort(); | ||
+ | const shownObjectTypesList = document.getElementById(' | ||
+ | |||
+ | function setVisibility(bool, | ||
+ | for (var i=0; i< | ||
+ | var obj = scene.children[i].getObjectByName(objname); | ||
+ | if (obj) { | ||
+ | obj.visible = bool; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function toggleObjectTypeVisibility(event){ | ||
+ | var name = event.currentTarget.name; | ||
+ | var checked = event.currentTarget.checked; | ||
+ | objectTypeVisible[name] = checked; | ||
+ | if (name == " | ||
+ | setVisibility(checked," | ||
+ | setVisibility(checked," | ||
+ | } else { | ||
+ | setVisibility(checked, | ||
+ | } | ||
+ | } | ||
+ | |||
+ | for (var i=0; i< | ||
+ | var key = sortedObjectTypeKeys[i]; | ||
+ | if (modelContains[key]) { | ||
+ | var objTypeNode = document.createElement(' | ||
+ | objTypeNode.innerHTML = objectTypeInnerHTMLs[key] + '< | ||
+ | var checkbox = document.createElement(' | ||
+ | checkbox.type = ' | ||
+ | checkbox.checked = true; | ||
+ | checkbox.name = key; | ||
+ | checkbox.onchange = toggleObjectTypeVisibility; | ||
+ | shownObjectTypesList.appendChild(checkbox); | ||
+ | shownObjectTypesList.appendChild(objTypeNode); | ||
+ | } | ||
+ | } | ||
+ | |||
+ | // ------------------------------------------------------ | ||
+ | |||
+ | function toggleObjectVisibility(event){ | ||
+ | var nr = Number(event.currentTarget.name); | ||
+ | scene.children[nr].visible = event.currentTarget.checked; | ||
+ | } | ||
+ | |||
+ | // append checkboxes for displaying or hiding objects | ||
+ | var shownObjectsList = document.getElementById(' | ||
+ | for (var i=0; i< | ||
+ | obj = scene.children[i]; | ||
+ | var objNode = document.createElement(' | ||
+ | objNode.innerHTML = obj.name + '< | ||
+ | var checkbox = document.createElement(' | ||
+ | checkbox.type = ' | ||
+ | checkbox.checked = true; | ||
+ | checkbox.name = String(i); | ||
+ | checkbox.onchange = toggleObjectVisibility; | ||
+ | shownObjectsList.appendChild(checkbox); | ||
+ | shownObjectsList.appendChild(objNode); | ||
+ | } | ||
+ | |||
+ | // ---------------------- SVG ------------------------------------------------------ | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | |||
+ | function takeSvgScreenshot() { | ||
+ | if (objectTypeVisible[" | ||
+ | setVisibility(false," | ||
+ | } | ||
+ | if (objectTypeVisible[" | ||
+ | setVisibility(false," | ||
+ | } | ||
+ | svgRenderer.render(scene, | ||
+ | svgElement = XMLS.serializeToString(svgRenderer.domElement); | ||
+ | | ||
+ | if (objectTypeVisible[" | ||
+ | setVisibility(true," | ||
+ | } | ||
+ | if (objectTypeVisible[" | ||
+ | setVisibility(true," | ||
+ | } | ||
+ | |||
+ | if (document.getElementById(' | ||
+ | //show in new tab | ||
+ | var myWindow = window.open("","" | ||
+ | myWindow.document.body.innerHTML = svgElement; | ||
+ | } else{ | ||
+ | // download svg file | ||
+ | download(" | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function download(filename, | ||
+ | var element = document.createElement(' | ||
+ | element.setAttribute(' | ||
+ | element.setAttribute(' | ||
+ | |||
+ | element.style.display = ' | ||
+ | document.body.appendChild(element); | ||
+ | |||
+ | element.click(); | ||
+ | |||
+ | document.body.removeChild(element); | ||
+ | } | ||
+ | |||
+ | |||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | |||
+ | |||
+ | // ------------------ SHORTCUTS -------------------------------------------- | ||
+ | // ------------------------------------------------------------------------- | ||
+ | |||
+ | /** | ||
+ | * http:// | ||
+ | * Version : 2.01.B | ||
+ | * By Binny V A | ||
+ | * License : BSD | ||
+ | */ | ||
+ | shortcut = { | ||
+ | ' | ||
+ | ' | ||
+ | //Provide a set of default options | ||
+ | var default_options = { | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | } | ||
+ | if(!opt) opt = default_options; | ||
+ | else { | ||
+ | for(var dfo in default_options) { | ||
+ | if(typeof opt[dfo] == ' | ||
+ | } | ||
+ | } | ||
+ | |||
+ | var ele = opt.target; | ||
+ | if(typeof opt.target == ' | ||
+ | var ths = this; | ||
+ | shortcut_combination = shortcut_combination.toLowerCase(); | ||
+ | |||
+ | //The function to be called at keypress | ||
+ | var func = function(e) { | ||
+ | e = e || window.event; | ||
+ | |||
+ | if(opt[' | ||
+ | var element; | ||
+ | if(e.target) element=e.target; | ||
+ | else if(e.srcElement) element=e.srcElement; | ||
+ | if(element.nodeType==3) element=element.parentNode; | ||
+ | |||
+ | if(element.tagName == ' | ||
+ | } | ||
+ | |||
+ | //Find Which key is pressed | ||
+ | if (e.keyCode) code = e.keyCode; | ||
+ | else if (e.which) code = e.which; | ||
+ | var character = String.fromCharCode(code).toLowerCase(); | ||
+ | |||
+ | if(code == 188) character=","; | ||
+ | if(code == 190) character=" | ||
+ | |||
+ | var keys = shortcut_combination.split(" | ||
+ | //Key Pressed - counts the number of valid keypresses - if it is same as the number of keys, the shortcut function is invoked | ||
+ | var kp = 0; | ||
+ | |||
+ | //Work around for stupid Shift key bug created by using lowercase - as a result the shift+num combination was broken | ||
+ | var shift_nums = { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | ";":":", | ||
+ | "'":" | ||
+ | ",":"<", | ||
+ | " | ||
+ | "/":"?", | ||
+ | " | ||
+ | } | ||
+ | // | ||
+ | var special_keys = { | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | } | ||
+ | |||
+ | var modifiers = { | ||
+ | shift: { wanted: | ||
+ | ctrl : { wanted: | ||
+ | alt | ||
+ | meta : { wanted: | ||
+ | }; | ||
+ | | ||
+ | if(e.ctrlKey) modifiers.ctrl.pressed = true; | ||
+ | if(e.shiftKey) modifiers.shift.pressed = true; | ||
+ | if(e.altKey) modifiers.alt.pressed = true; | ||
+ | if(e.metaKey) | ||
+ | | ||
+ | for(var i=0; k=keys[i], | ||
+ | // | ||
+ | if(k == ' | ||
+ | kp++; | ||
+ | modifiers.ctrl.wanted = true; | ||
+ | |||
+ | } else if(k == ' | ||
+ | kp++; | ||
+ | modifiers.shift.wanted = true; | ||
+ | |||
+ | } else if(k == ' | ||
+ | kp++; | ||
+ | modifiers.alt.wanted = true; | ||
+ | } else if(k == ' | ||
+ | kp++; | ||
+ | modifiers.meta.wanted = true; | ||
+ | } else if(k.length > 1) { //If it is a special key | ||
+ | if(special_keys[k] == code) kp++; | ||
+ | |||
+ | } else if(opt[' | ||
+ | if(opt[' | ||
+ | |||
+ | } else { //The special keys did not match | ||
+ | if(character == k) kp++; | ||
+ | else { | ||
+ | if(shift_nums[character] && e.shiftKey) { //Stupid Shift key bug created by using lowercase | ||
+ | character = shift_nums[character]; | ||
+ | if(character == k) kp++; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | if(kp == keys.length && | ||
+ | modifiers.ctrl.pressed == modifiers.ctrl.wanted && | ||
+ | modifiers.shift.pressed == modifiers.shift.wanted && | ||
+ | modifiers.alt.pressed == modifiers.alt.wanted && | ||
+ | modifiers.meta.pressed == modifiers.meta.wanted) { | ||
+ | callback(e); | ||
+ | |||
+ | if(!opt[' | ||
+ | // | ||
+ | e.cancelBubble = true; | ||
+ | e.returnValue = false; | ||
+ | |||
+ | // | ||
+ | if (e.stopPropagation) { | ||
+ | e.stopPropagation(); | ||
+ | e.preventDefault(); | ||
+ | } | ||
+ | return false; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | this.all_shortcuts[shortcut_combination] = { | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | }; | ||
+ | //Attach the function with the event | ||
+ | if(ele.addEventListener) ele.addEventListener(opt[' | ||
+ | else if(ele.attachEvent) ele.attachEvent(' | ||
+ | else ele[' | ||
+ | }, | ||
+ | |||
+ | //Remove the shortcut - just specify the shortcut and I will remove the binding | ||
+ | ' | ||
+ | shortcut_combination = shortcut_combination.toLowerCase(); | ||
+ | var binding = this.all_shortcuts[shortcut_combination]; | ||
+ | delete(this.all_shortcuts[shortcut_combination]) | ||
+ | if(!binding) return; | ||
+ | var type = binding[' | ||
+ | var ele = binding[' | ||
+ | var callback = binding[' | ||
+ | |||
+ | if(ele.detachEvent) ele.detachEvent(' | ||
+ | else if(ele.removeEventListener) ele.removeEventListener(type, | ||
+ | else ele[' | ||
+ | } | ||
+ | } | ||
+ | |||
+ | shortcut.add(" | ||
+ | var event = new Event(' | ||
+ | if (settingsShown){ | ||
+ | document.getElementById(' | ||
+ | } else { | ||
+ | document.getElementById(' | ||
+ | } | ||
+ | }); | ||
+ | |||
+ | |||
+ | // COMMON_CODE_BLOCK_END | ||
+ | |||
+ | });}); | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ==== More examples can be studied via the following: ==== | ||
+ | |||
+ | <code perl> | ||
+ | > # a torus with two cusps (6 edges) | ||
+ | > $T2 = new Matrix< | ||
+ | > | ||
+ | > # a sphere with four cusps (6 edges) | ||
+ | > $S4 = new Matrix< | ||
+ | > | ||
+ | > # a double torus with two cusps (12 edges) | ||
+ | > $DT2 = new Matrix< | ||
+ | </ | ||
+ | To study 4-dim. secondary fans the following method is useful. It intersects the secondary fan with the 3-dim. standard simplex. | ||
+ | |||
+ | <code perl> | ||
+ | > sub norm($){ | ||
+ | > my $B = new Matrix(shift); | ||
+ | > for (my $i = 0; $i < $B-> | ||
+ | > my $sum = 0; | ||
+ | > for (my $j = 1; $j < $B-> | ||
+ | > $sum = $sum + $B-> | ||
+ | > } | ||
+ | > $x = 1/$sum; | ||
+ | > | ||
+ | > } | ||
+ | > return $B; | ||
+ | > } | ||
+ | > $s = new HyperbolicSurface(DCEL=> | ||
+ | > $f = $s-> | ||
+ | > $v = ones_vector | $f-> | ||
+ | > $a = norm($v); | ||
+ | > $b = $a-> | ||
+ | > $c = ones_vector | $b; | ||
+ | > $q = new fan:: | ||
+ | > $pro = fan:: | ||
+ | > $pro-> | ||
+ | </ | ||
+ | < | ||
+ | <!-- | ||
+ | polymake for knusper | ||
+ | Thu Mar 3 00:31:55 2022 | ||
+ | pcom:pro | ||
+ | --> | ||
+ | |||
+ | |||
+ | < | ||
+ | < | ||
+ | <meta charset=utf-8> | ||
+ | < | ||
+ | < | ||
+ | /* | ||
+ | // COMMON_CODE_BLOCK_BEGIN | ||
+ | */ | ||
+ | html {overflow: scroll;} | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | # | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | } | ||
+ | /* | ||
+ | // COMMON_CODE_BLOCK_END | ||
+ | */ | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | <div id=' | ||
+ | <div class=group id=' | ||
+ | < | ||
+ | < | ||
+ | <div class=indented>< | ||
+ | <div class=suboption> | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | <div class=group id=' | ||
+ | < | ||
+ | < | ||
+ | <div class=indented>< | ||
+ | </ | ||
+ | |||
+ | <div class=group id=' | ||
+ | < | ||
+ | <div class=indented> | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | <div class=suboption> | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | |||
+ | <div class=group id=' | ||
+ | < | ||
+ | <div class=indented> | ||
+ | < | ||
+ | </ | ||
+ | <div class=suboption> | ||
+ | <div class=indented> | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | < | ||
+ | <div class=indented> | ||
+ | < | ||
+ | <select id=" | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | <div class=group id=' | ||
+ | < | ||
+ | <div class=indented> | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | </ | ||
+ | <img id=' | ||
+ | <img id=' | ||
+ | <div id=" | ||
+ | </ | ||
+ | < | ||
+ | requirejs.config({ | ||
+ | paths: { | ||
+ | three: '/ | ||
+ | TrackballControls: | ||
+ | OrbitControls: | ||
+ | Projector: '/ | ||
+ | SVGRenderer: | ||
+ | WEBGL: '/ | ||
+ | }, | ||
+ | shim: { | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | } | ||
+ | }); | ||
+ | | ||
+ | require([' | ||
+ | window.THREE = THREE; | ||
+ | require([' | ||
+ | | ||
+ | THREE.TrackballControls = TrackballControls; | ||
+ | THREE.OrbitControls = OrbitControls; | ||
+ | THREE.Projector = Projector; | ||
+ | THREE.SVGRenderer = SVGRenderer; | ||
+ | THREE.WEBGL = WEBGL; | ||
+ | |||
+ | // COMMON_CODE_BLOCK_BEGIN | ||
+ | |||
+ | const intervalLength = 25; // for automatic animations | ||
+ | const explodableModel = true; | ||
+ | const modelContains = { points: false, pointlabels: | ||
+ | const foldables = []; | ||
+ | |||
+ | var three = document.getElementById(" | ||
+ | var scene = new THREE.Scene(); | ||
+ | var renderer = new THREE.WebGLRenderer( { antialias: true } ); | ||
+ | var svgRenderer = new THREE.SVGRenderer( { antialias: true } ); | ||
+ | renderer.setPixelRatio( window.devicePixelRatio ); | ||
+ | renderer.setClearColor(0xFFFFFF, | ||
+ | svgRenderer.setClearColor(0xFFFFFF, | ||
+ | three.appendChild(renderer.domElement); | ||
+ | |||
+ | var frustumSize = 4; | ||
+ | var cameras = [new THREE.PerspectiveCamera(75, | ||
+ | cameras.forEach(function(cam) { | ||
+ | cam.position.set(0, | ||
+ | cam.lookAt(0, | ||
+ | cam.up.set(0, | ||
+ | }); | ||
+ | var controls = [new THREE.TrackballControls(cameras[0], | ||
+ | var camera, control; | ||
+ | |||
+ | controls[0].zoomSpeed = 0.2; | ||
+ | controls[0].rotateSpeed = 4; | ||
+ | |||
+ | |||
+ | // class to allow move points together with labels and spheres | ||
+ | var PMPoint = function (x,y,z) { | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | PMPoint.prototype.addLabel = function(labelsprite) { | ||
+ | | ||
+ | | ||
+ | } | ||
+ | PMPoint.prototype.addSphere = function(spheremesh) { | ||
+ | | ||
+ | | ||
+ | } | ||
+ | PMPoint.prototype.set = function(x, | ||
+ | | ||
+ | if (this.sprite) { | ||
+ | this.sprite.position.copy(this.vector); | ||
+ | } | ||
+ | if (this.sphere) { | ||
+ | this.sphere.position.copy(this.vector); | ||
+ | } | ||
+ | } | ||
+ | PMPoint.prototype.radius = function() { | ||
+ | if (this.sphere) { | ||
+ | return this.sphere.geometry.parameters.radius; | ||
+ | } else { | ||
+ | return 0; | ||
+ | } | ||
+ | }; | ||
+ | // select the target node | ||
+ | var target = document.querySelector('# | ||
+ | |||
+ | // create an observer instance | ||
+ | var observer = new MutationObserver(function(mutations) { | ||
+ | | ||
+ | if (mutation.removedNodes && mutation.removedNodes.length > 0) { | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | }); | ||
+ | }); | ||
+ | |||
+ | // configuration of the observer: | ||
+ | var config = { childList: true, characterData: | ||
+ | |||
+ | // pass in the target node, as well as the observer options | ||
+ | while (target) { | ||
+ | if (target.className==" | ||
+ | observer.observe(target, | ||
+ | break; | ||
+ | } | ||
+ | | ||
+ | } | ||
+ | |||
+ | // COMMON_CODE_BLOCK_END | ||
+ | |||
+ | var obj0 = new THREE.Object3D(); | ||
+ | obj0.name = " | ||
+ | obj0.userData.explodable = 1; | ||
+ | obj0.userData.points = []; | ||
+ | obj0.userData.points.push(new PMPoint(6.6, | ||
+ | obj0.userData.points.push(new PMPoint(4.6, | ||
+ | obj0.userData.points.push(new PMPoint(1, 1, 3)); | ||
+ | obj0.userData.points.push(new PMPoint(1, 3, 1)); | ||
+ | obj0.userData.points.push(new PMPoint(0, 1, 1)); | ||
+ | obj0.userData.points.push(new PMPoint(1, 1, 0)); | ||
+ | obj0.userData.points.push(new PMPoint(0.333333, | ||
+ | obj0.userData.points.push(new PMPoint(1, 0, 1)); | ||
+ | obj0.userData.points.push(new PMPoint(3, 1, 1)); | ||
+ | obj0.userData.points.push(new PMPoint(6.6, | ||
+ | obj0.userData.points.push(new PMPoint(4.6, | ||
+ | obj0.userData.points.push(new PMPoint(6.6, | ||
+ | obj0.userData.points.push(new PMPoint(5.6, | ||
+ | obj0.userData.points.push(new PMPoint(6.6, | ||
+ | |||
+ | obj0.userData.pointradii = [0, 0, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0, 0, 0, 0, 0]; | ||
+ | < | ||
+ | obj0.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj0.userData.pointlabels = [" ", " ", " | ||
+ | obj0.userData.edgeindices = [0, 1, 1, 3, 2, 4, 3, 4, 3, 5, 4, 6, 5, 6, 2, 7, 6, 7, 5, 8, 7, 8, 0, 9, 8, 9, 2, 10, 9, 11, 10, 11, 1, 12, 10, 12, 0, 13, 11, 13, 12, 13]; | ||
+ | < | ||
+ | obj0.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj0.userData.facets = [[3, 4, 2, 10, 12, 1], [6, 4, 3, 5], [2, 4, 6, 7], [10, 2, 7, 8, 9, 11], [7, 6, 5, 8], [3, 1, 0, 9, 8, 5], [11, 9, 0, 13], [1, 12, 13, 0], [12, 10, 11, 13]]; | ||
+ | < | ||
+ | obj0.userData.facetmaterial = [new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj0); | ||
+ | scene.add(obj0); | ||
+ | |||
+ | var obj1 = new THREE.Object3D(); | ||
+ | obj1.name = " | ||
+ | obj1.userData.explodable = 1; | ||
+ | obj1.userData.points = []; | ||
+ | obj1.userData.points.push(new PMPoint(1, 6.6, 4.6)); | ||
+ | obj1.userData.points.push(new PMPoint(4.6, | ||
+ | obj1.userData.points.push(new PMPoint(1, 3, 1)); | ||
+ | obj1.userData.points.push(new PMPoint(0, 1, 1)); | ||
+ | obj1.userData.points.push(new PMPoint(1, 1, 3)); | ||
+ | obj1.userData.points.push(new PMPoint(1, 4.6, 6.6)); | ||
+ | obj1.userData.points.push(new PMPoint(4.6, | ||
+ | obj1.userData.points.push(new PMPoint(5.6, | ||
+ | obj1.userData.points.push(new PMPoint(0, 6.6, 6.6)); | ||
+ | |||
+ | obj1.userData.pointradii = [0, 0, 0.02, 0.02, 0.02, 0, 0, 0, 0]; | ||
+ | < | ||
+ | obj1.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj1.userData.pointlabels = [" ", " ", " | ||
+ | obj1.userData.edgeindices = [0, 1, 0, 2, 1, 2, 2, 3, 3, 4, 4, 5, 4, 6, 5, 6, 1, 7, 6, 7, 0, 8, 3, 8, 5, 8, 7, 8]; | ||
+ | < | ||
+ | obj1.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj1.userData.facets = [[4, 5, 8, 3], [6, 5, 4], [2, 0, 1], [3, 8, 0, 2], [4, 3, 2, 1, 7, 6], [8, 7, 1, 0], [8, 5, 6, 7]]; | ||
+ | < | ||
+ | obj1.userData.facetmaterial = [new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj1); | ||
+ | scene.add(obj1); | ||
+ | |||
+ | var obj2 = new THREE.Object3D(); | ||
+ | obj2.name = " | ||
+ | obj2.userData.explodable = 1; | ||
+ | obj2.userData.points = []; | ||
+ | obj2.userData.points.push(new PMPoint(1, 1, 3)); | ||
+ | obj2.userData.points.push(new PMPoint(0, 1, 1)); | ||
+ | obj2.userData.points.push(new PMPoint(1, 0, 1)); | ||
+ | obj2.userData.points.push(new PMPoint(0.333333, | ||
+ | obj2.userData.points.push(new PMPoint(0, 0, 1)); | ||
+ | |||
+ | obj2.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj2.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj2.userData.pointlabels = [" | ||
+ | obj2.userData.edgeindices = [0, 1, 0, 2, 1, 3, 2, 3, 0, 4, 1, 4, 2, 4, 3, 4]; | ||
+ | < | ||
+ | obj2.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj2.userData.facets = [[3, 4, 1], [3, 2, 4], [0, 4, 2], [1, 4, 0], [3, 1, 0, 2]]; | ||
+ | < | ||
+ | obj2.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj2); | ||
+ | scene.add(obj2); | ||
+ | |||
+ | var obj3 = new THREE.Object3D(); | ||
+ | obj3.name = " | ||
+ | obj3.userData.explodable = 1; | ||
+ | obj3.userData.points = []; | ||
+ | obj3.userData.points.push(new PMPoint(6.6, | ||
+ | obj3.userData.points.push(new PMPoint(6.6, | ||
+ | obj3.userData.points.push(new PMPoint(3, 1, 1)); | ||
+ | obj3.userData.points.push(new PMPoint(1, 0, 1)); | ||
+ | obj3.userData.points.push(new PMPoint(1, 1, 3)); | ||
+ | obj3.userData.points.push(new PMPoint(4.6, | ||
+ | obj3.userData.points.push(new PMPoint(4.6, | ||
+ | obj3.userData.points.push(new PMPoint(6.6, | ||
+ | obj3.userData.points.push(new PMPoint(6.6, | ||
+ | |||
+ | obj3.userData.pointradii = [0, 0, 0.02, 0.02, 0.02, 0, 0, 0, 0]; | ||
+ | < | ||
+ | obj3.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj3.userData.pointlabels = [" ", " ", " | ||
+ | obj3.userData.edgeindices = [0, 1, 0, 2, 1, 2, 2, 3, 3, 4, 4, 5, 4, 6, 5, 6, 1, 7, 6, 7, 0, 8, 3, 8, 5, 8, 7, 8]; | ||
+ | < | ||
+ | obj3.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj3.userData.facets = [[5, 4, 3, 8], [6, 4, 5], [2, 1, 0], [8, 3, 2, 0], [3, 4, 6, 7, 1, 2], [1, 7, 8, 0], [5, 8, 7, 6]]; | ||
+ | < | ||
+ | obj3.userData.facetmaterial = [new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj3); | ||
+ | scene.add(obj3); | ||
+ | |||
+ | var obj4 = new THREE.Object3D(); | ||
+ | obj4.name = " | ||
+ | obj4.userData.explodable = 1; | ||
+ | obj4.userData.points = []; | ||
+ | obj4.userData.points.push(new PMPoint(6.6, | ||
+ | obj4.userData.points.push(new PMPoint(6.6, | ||
+ | obj4.userData.points.push(new PMPoint(3, 1, 1)); | ||
+ | obj4.userData.points.push(new PMPoint(1, 1, 0)); | ||
+ | obj4.userData.points.push(new PMPoint(1, 3, 1)); | ||
+ | obj4.userData.points.push(new PMPoint(4.6, | ||
+ | obj4.userData.points.push(new PMPoint(4.6, | ||
+ | obj4.userData.points.push(new PMPoint(6.6, | ||
+ | obj4.userData.points.push(new PMPoint(6.6, | ||
+ | |||
+ | obj4.userData.pointradii = [0, 0, 0.02, 0.02, 0.02, 0, 0, 0, 0]; | ||
+ | < | ||
+ | obj4.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj4.userData.pointlabels = [" ", " ", " | ||
+ | obj4.userData.edgeindices = [0, 1, 0, 2, 1, 2, 2, 3, 3, 4, 4, 5, 4, 6, 5, 6, 1, 7, 6, 7, 0, 8, 3, 8, 5, 8, 7, 8]; | ||
+ | < | ||
+ | obj4.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj4.userData.facets = [[4, 5, 8, 3], [6, 5, 4], [2, 0, 1], [3, 8, 0, 2], [4, 3, 2, 1, 7, 6], [8, 7, 1, 0], [8, 5, 6, 7]]; | ||
+ | < | ||
+ | obj4.userData.facetmaterial = [new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj4); | ||
+ | scene.add(obj4); | ||
+ | |||
+ | var obj5 = new THREE.Object3D(); | ||
+ | obj5.name = " | ||
+ | obj5.userData.explodable = 1; | ||
+ | obj5.userData.points = []; | ||
+ | obj5.userData.points.push(new PMPoint(1, 3, 1)); | ||
+ | obj5.userData.points.push(new PMPoint(0, 1, 1)); | ||
+ | obj5.userData.points.push(new PMPoint(1, 1, 0)); | ||
+ | obj5.userData.points.push(new PMPoint(0.333333, | ||
+ | obj5.userData.points.push(new PMPoint(0, 1, 0)); | ||
+ | |||
+ | obj5.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj5.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj5.userData.pointlabels = [" | ||
+ | obj5.userData.edgeindices = [0, 1, 0, 2, 1, 3, 2, 3, 0, 4, 1, 4, 2, 4, 3, 4]; | ||
+ | < | ||
+ | obj5.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj5.userData.facets = [[3, 4, 2], [3, 1, 4], [0, 4, 1], [2, 4, 0], [3, 2, 0, 1]]; | ||
+ | < | ||
+ | obj5.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj5); | ||
+ | scene.add(obj5); | ||
+ | |||
+ | var obj6 = new THREE.Object3D(); | ||
+ | obj6.name = " | ||
+ | obj6.userData.explodable = 1; | ||
+ | obj6.userData.points = []; | ||
+ | obj6.userData.points.push(new PMPoint(3, 1, 1)); | ||
+ | obj6.userData.points.push(new PMPoint(1, 0, 1)); | ||
+ | obj6.userData.points.push(new PMPoint(1, 1, 0)); | ||
+ | obj6.userData.points.push(new PMPoint(0.333333, | ||
+ | obj6.userData.points.push(new PMPoint(1, 0, 0)); | ||
+ | |||
+ | obj6.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj6.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj6.userData.pointlabels = [" | ||
+ | obj6.userData.edgeindices = [0, 1, 0, 2, 1, 3, 2, 3, 0, 4, 1, 4, 2, 4, 3, 4]; | ||
+ | < | ||
+ | obj6.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj6.userData.facets = [[4, 3, 2], [1, 3, 4], [0, 1, 4], [4, 2, 0], [2, 3, 1, 0]]; | ||
+ | < | ||
+ | obj6.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj6); | ||
+ | scene.add(obj6); | ||
+ | |||
+ | var obj7 = new THREE.Object3D(); | ||
+ | obj7.name = " | ||
+ | obj7.userData.explodable = 1; | ||
+ | obj7.userData.points = []; | ||
+ | obj7.userData.points.push(new PMPoint(1, 1, 3)); | ||
+ | obj7.userData.points.push(new PMPoint(0, 1, 3)); | ||
+ | obj7.userData.points.push(new PMPoint(0, 1, 1)); | ||
+ | obj7.userData.points.push(new PMPoint(0, 6.6, 6.6)); | ||
+ | obj7.userData.points.push(new PMPoint(0, 4.6, 6.6)); | ||
+ | obj7.userData.points.push(new PMPoint(1, 4.6, 6.6)); | ||
+ | |||
+ | obj7.userData.pointradii = [0.02, 0.02, 0.02, 0, 0, 0]; | ||
+ | < | ||
+ | obj7.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj7.userData.pointlabels = [" | ||
+ | obj7.userData.edgeindices = [0, 1, 0, 2, 1, 2, 2, 3, 1, 4, 3, 4, 0, 5, 3, 5, 4, 5]; | ||
+ | < | ||
+ | obj7.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj7.userData.facets = [[4, 1, 0, 5], [2, 1, 4, 3], [0, 1, 2], [5, 0, 2, 3], [4, 5, 3]]; | ||
+ | < | ||
+ | obj7.userData.facetmaterial = [new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj7); | ||
+ | scene.add(obj7); | ||
+ | |||
+ | var obj8 = new THREE.Object3D(); | ||
+ | obj8.name = " | ||
+ | obj8.userData.explodable = 1; | ||
+ | obj8.userData.points = []; | ||
+ | obj8.userData.points.push(new PMPoint(1, 1, 3)); | ||
+ | obj8.userData.points.push(new PMPoint(2.2, | ||
+ | obj8.userData.points.push(new PMPoint(1, 4.6, 6.6)); | ||
+ | obj8.userData.points.push(new PMPoint(4.6, | ||
+ | |||
+ | obj8.userData.pointradii = [0.02, 0, 0, 0]; | ||
+ | < | ||
+ | obj8.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj8.userData.pointlabels = [" | ||
+ | obj8.userData.edgeindices = [0, 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3]; | ||
+ | < | ||
+ | obj8.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj8.userData.facets = [[0, 1, 2], [3, 1, 0], [0, 2, 3], [2, 1, 3]]; | ||
+ | < | ||
+ | obj8.userData.facetmaterial = [new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj8); | ||
+ | scene.add(obj8); | ||
+ | |||
+ | var obj9 = new THREE.Object3D(); | ||
+ | obj9.name = " | ||
+ | obj9.userData.explodable = 1; | ||
+ | obj9.userData.points = []; | ||
+ | obj9.userData.points.push(new PMPoint(1, 3, 1)); | ||
+ | obj9.userData.points.push(new PMPoint(2.2, | ||
+ | obj9.userData.points.push(new PMPoint(1, 6.6, 4.6)); | ||
+ | obj9.userData.points.push(new PMPoint(4.6, | ||
+ | |||
+ | obj9.userData.pointradii = [0.02, 0, 0, 0]; | ||
+ | < | ||
+ | obj9.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj9.userData.pointlabels = [" | ||
+ | obj9.userData.edgeindices = [0, 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3]; | ||
+ | < | ||
+ | obj9.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj9.userData.facets = [[1, 0, 2], [3, 0, 1], [2, 0, 3], [1, 2, 3]]; | ||
+ | < | ||
+ | obj9.userData.facetmaterial = [new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj9); | ||
+ | scene.add(obj9); | ||
+ | |||
+ | var obj10 = new THREE.Object3D(); | ||
+ | obj10.name = " | ||
+ | obj10.userData.explodable = 1; | ||
+ | obj10.userData.points = []; | ||
+ | obj10.userData.points.push(new PMPoint(1, 3, 1)); | ||
+ | obj10.userData.points.push(new PMPoint(0, 3, 1)); | ||
+ | obj10.userData.points.push(new PMPoint(0, 1, 1)); | ||
+ | obj10.userData.points.push(new PMPoint(0, 6.6, 6.6)); | ||
+ | obj10.userData.points.push(new PMPoint(0, 6.6, 4.6)); | ||
+ | obj10.userData.points.push(new PMPoint(1, 6.6, 4.6)); | ||
+ | |||
+ | obj10.userData.pointradii = [0.02, 0.02, 0.02, 0, 0, 0]; | ||
+ | < | ||
+ | obj10.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj10.userData.pointlabels = [" | ||
+ | obj10.userData.edgeindices = [0, 1, 0, 2, 1, 2, 2, 3, 1, 4, 3, 4, 0, 5, 3, 5, 4, 5]; | ||
+ | < | ||
+ | obj10.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj10.userData.facets = [[1, 4, 5, 0], [3, 4, 1, 2], [1, 0, 2], [0, 5, 3, 2], [5, 4, 3]]; | ||
+ | < | ||
+ | obj10.userData.facetmaterial = [new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj10); | ||
+ | scene.add(obj10); | ||
+ | |||
+ | var obj11 = new THREE.Object3D(); | ||
+ | obj11.name = " | ||
+ | obj11.userData.explodable = 1; | ||
+ | obj11.userData.points = []; | ||
+ | obj11.userData.points.push(new PMPoint(1, 1, 3)); | ||
+ | obj11.userData.points.push(new PMPoint(0, 1, 1)); | ||
+ | obj11.userData.points.push(new PMPoint(0, 0, 1)); | ||
+ | obj11.userData.points.push(new PMPoint(0, 1, 3)); | ||
+ | |||
+ | obj11.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj11.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj11.userData.pointlabels = [" | ||
+ | obj11.userData.edgeindices = [0, 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3]; | ||
+ | < | ||
+ | obj11.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj11.userData.facets = [[1, 3, 0], [2, 3, 1], [0, 3, 2], [1, 0, 2]]; | ||
+ | < | ||
+ | obj11.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj11); | ||
+ | scene.add(obj11); | ||
+ | |||
+ | var obj12 = new THREE.Object3D(); | ||
+ | obj12.name = " | ||
+ | obj12.userData.explodable = 1; | ||
+ | obj12.userData.points = []; | ||
+ | obj12.userData.points.push(new PMPoint(1, 1, 3)); | ||
+ | obj12.userData.points.push(new PMPoint(1, 0, 1)); | ||
+ | obj12.userData.points.push(new PMPoint(0, 0, 1)); | ||
+ | obj12.userData.points.push(new PMPoint(1, 0, 3)); | ||
+ | |||
+ | obj12.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj12.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj12.userData.pointlabels = [" | ||
+ | obj12.userData.edgeindices = [0, 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3]; | ||
+ | < | ||
+ | obj12.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj12.userData.facets = [[0, 3, 1], [2, 3, 0], [1, 3, 2], [0, 1, 2]]; | ||
+ | < | ||
+ | obj12.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj12); | ||
+ | scene.add(obj12); | ||
+ | |||
+ | var obj13 = new THREE.Object3D(); | ||
+ | obj13.name = " | ||
+ | obj13.userData.explodable = 1; | ||
+ | obj13.userData.points = []; | ||
+ | obj13.userData.points.push(new PMPoint(0, 1, 1)); | ||
+ | obj13.userData.points.push(new PMPoint(0.333333, | ||
+ | obj13.userData.points.push(new PMPoint(0, 0, 1)); | ||
+ | obj13.userData.points.push(new PMPoint(0, 0.333333, 0.333333)); | ||
+ | |||
+ | obj13.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj13.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj13.userData.pointlabels = [" | ||
+ | obj13.userData.edgeindices = [0, 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3]; | ||
+ | < | ||
+ | obj13.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj13.userData.facets = [[3, 0, 1], [2, 0, 3], [1, 0, 2], [3, 1, 2]]; | ||
+ | < | ||
+ | obj13.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj13); | ||
+ | scene.add(obj13); | ||
+ | |||
+ | var obj14 = new THREE.Object3D(); | ||
+ | obj14.name = " | ||
+ | obj14.userData.explodable = 1; | ||
+ | obj14.userData.points = []; | ||
+ | obj14.userData.points.push(new PMPoint(1, 0, 1)); | ||
+ | obj14.userData.points.push(new PMPoint(0.333333, | ||
+ | obj14.userData.points.push(new PMPoint(0, 0, 1)); | ||
+ | obj14.userData.points.push(new PMPoint(0.333333, | ||
+ | |||
+ | obj14.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj14.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj14.userData.pointlabels = [" | ||
+ | obj14.userData.edgeindices = [0, 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3]; | ||
+ | < | ||
+ | obj14.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj14.userData.facets = [[1, 0, 3], [2, 0, 1], [3, 0, 2], [1, 3, 2]]; | ||
+ | < | ||
+ | obj14.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj14); | ||
+ | scene.add(obj14); | ||
+ | |||
+ | var obj15 = new THREE.Object3D(); | ||
+ | obj15.name = " | ||
+ | obj15.userData.explodable = 1; | ||
+ | obj15.userData.points = []; | ||
+ | obj15.userData.points.push(new PMPoint(1, 1, 3)); | ||
+ | obj15.userData.points.push(new PMPoint(2.2, | ||
+ | obj15.userData.points.push(new PMPoint(4.6, | ||
+ | obj15.userData.points.push(new PMPoint(4.6, | ||
+ | |||
+ | obj15.userData.pointradii = [0.02, 0, 0, 0]; | ||
+ | < | ||
+ | obj15.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj15.userData.pointlabels = [" | ||
+ | obj15.userData.edgeindices = [0, 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3]; | ||
+ | < | ||
+ | obj15.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj15.userData.facets = [[0, 1, 3], [2, 1, 0], [0, 3, 2], [3, 1, 2]]; | ||
+ | < | ||
+ | obj15.userData.facetmaterial = [new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj15); | ||
+ | scene.add(obj15); | ||
+ | |||
+ | var obj16 = new THREE.Object3D(); | ||
+ | obj16.name = " | ||
+ | obj16.userData.explodable = 1; | ||
+ | obj16.userData.points = []; | ||
+ | obj16.userData.points.push(new PMPoint(1, 1, 3)); | ||
+ | obj16.userData.points.push(new PMPoint(1, 0, 3)); | ||
+ | obj16.userData.points.push(new PMPoint(1, 0, 1)); | ||
+ | obj16.userData.points.push(new PMPoint(6.6, | ||
+ | obj16.userData.points.push(new PMPoint(4.6, | ||
+ | obj16.userData.points.push(new PMPoint(4.6, | ||
+ | |||
+ | obj16.userData.pointradii = [0.02, 0.02, 0.02, 0, 0, 0]; | ||
+ | < | ||
+ | obj16.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj16.userData.pointlabels = [" | ||
+ | obj16.userData.edgeindices = [0, 1, 0, 2, 1, 2, 2, 3, 1, 4, 3, 4, 0, 5, 3, 5, 4, 5]; | ||
+ | < | ||
+ | obj16.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj16.userData.facets = [[0, 1, 4, 5], [2, 1, 0], [4, 1, 2, 3], [0, 5, 3, 2], [5, 4, 3]]; | ||
+ | < | ||
+ | obj16.userData.facetmaterial = [new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj16); | ||
+ | scene.add(obj16); | ||
+ | |||
+ | var obj17 = new THREE.Object3D(); | ||
+ | obj17.name = " | ||
+ | obj17.userData.explodable = 1; | ||
+ | obj17.userData.points = []; | ||
+ | obj17.userData.points.push(new PMPoint(3, 1, 1)); | ||
+ | obj17.userData.points.push(new PMPoint(6.6, | ||
+ | obj17.userData.points.push(new PMPoint(6.6, | ||
+ | obj17.userData.points.push(new PMPoint(6.6, | ||
+ | |||
+ | obj17.userData.pointradii = [0.02, 0, 0, 0]; | ||
+ | < | ||
+ | obj17.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj17.userData.pointlabels = [" | ||
+ | obj17.userData.edgeindices = [0, 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3]; | ||
+ | < | ||
+ | obj17.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj17.userData.facets = [[0, 2, 1], [3, 2, 0], [0, 1, 3], [1, 2, 3]]; | ||
+ | < | ||
+ | obj17.userData.facetmaterial = [new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj17); | ||
+ | scene.add(obj17); | ||
+ | |||
+ | var obj18 = new THREE.Object3D(); | ||
+ | obj18.name = " | ||
+ | obj18.userData.explodable = 1; | ||
+ | obj18.userData.points = []; | ||
+ | obj18.userData.points.push(new PMPoint(3, 1, 1)); | ||
+ | obj18.userData.points.push(new PMPoint(3, 0, 1)); | ||
+ | obj18.userData.points.push(new PMPoint(1, 0, 1)); | ||
+ | obj18.userData.points.push(new PMPoint(6.6, | ||
+ | obj18.userData.points.push(new PMPoint(6.6, | ||
+ | obj18.userData.points.push(new PMPoint(6.6, | ||
+ | |||
+ | obj18.userData.pointradii = [0.02, 0.02, 0.02, 0, 0, 0]; | ||
+ | < | ||
+ | obj18.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj18.userData.pointlabels = [" | ||
+ | obj18.userData.edgeindices = [0, 1, 0, 2, 1, 2, 2, 3, 1, 4, 3, 4, 0, 5, 3, 5, 4, 5]; | ||
+ | < | ||
+ | obj18.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj18.userData.facets = [[1, 0, 5, 4], [2, 0, 1], [1, 4, 3, 2], [5, 0, 2, 3], [4, 5, 3]]; | ||
+ | < | ||
+ | obj18.userData.facetmaterial = [new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj18); | ||
+ | scene.add(obj18); | ||
+ | |||
+ | var obj19 = new THREE.Object3D(); | ||
+ | obj19.name = " | ||
+ | obj19.userData.explodable = 1; | ||
+ | obj19.userData.points = []; | ||
+ | obj19.userData.points.push(new PMPoint(1, 3, 1)); | ||
+ | obj19.userData.points.push(new PMPoint(2.2, | ||
+ | obj19.userData.points.push(new PMPoint(4.6, | ||
+ | obj19.userData.points.push(new PMPoint(4.6, | ||
+ | |||
+ | obj19.userData.pointradii = [0.02, 0, 0, 0]; | ||
+ | < | ||
+ | obj19.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj19.userData.pointlabels = [" | ||
+ | obj19.userData.edgeindices = [0, 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3]; | ||
+ | < | ||
+ | obj19.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj19.userData.facets = [[0, 2, 1], [3, 2, 0], [0, 1, 3], [1, 2, 3]]; | ||
+ | < | ||
+ | obj19.userData.facetmaterial = [new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj19); | ||
+ | scene.add(obj19); | ||
+ | |||
+ | var obj20 = new THREE.Object3D(); | ||
+ | obj20.name = " | ||
+ | obj20.userData.explodable = 1; | ||
+ | obj20.userData.points = []; | ||
+ | obj20.userData.points.push(new PMPoint(3, 1, 1)); | ||
+ | obj20.userData.points.push(new PMPoint(6.6, | ||
+ | obj20.userData.points.push(new PMPoint(6.6, | ||
+ | obj20.userData.points.push(new PMPoint(6.6, | ||
+ | |||
+ | obj20.userData.pointradii = [0.02, 0, 0, 0]; | ||
+ | < | ||
+ | obj20.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj20.userData.pointlabels = [" | ||
+ | obj20.userData.edgeindices = [0, 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3]; | ||
+ | < | ||
+ | obj20.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj20.userData.facets = [[0, 2, 3], [1, 2, 0], [0, 3, 1], [3, 2, 1]]; | ||
+ | < | ||
+ | obj20.userData.facetmaterial = [new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj20); | ||
+ | scene.add(obj20); | ||
+ | |||
+ | var obj21 = new THREE.Object3D(); | ||
+ | obj21.name = " | ||
+ | obj21.userData.explodable = 1; | ||
+ | obj21.userData.points = []; | ||
+ | obj21.userData.points.push(new PMPoint(1, 3, 1)); | ||
+ | obj21.userData.points.push(new PMPoint(1, 3, 0)); | ||
+ | obj21.userData.points.push(new PMPoint(1, 1, 0)); | ||
+ | obj21.userData.points.push(new PMPoint(6.6, | ||
+ | obj21.userData.points.push(new PMPoint(4.6, | ||
+ | obj21.userData.points.push(new PMPoint(4.6, | ||
+ | |||
+ | obj21.userData.pointradii = [0.02, 0.02, 0.02, 0, 0, 0]; | ||
+ | < | ||
+ | obj21.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj21.userData.pointlabels = [" | ||
+ | obj21.userData.edgeindices = [0, 1, 0, 2, 1, 2, 2, 3, 1, 4, 3, 4, 0, 5, 3, 5, 4, 5]; | ||
+ | < | ||
+ | obj21.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj21.userData.facets = [[1, 0, 5, 4], [2, 0, 1], [5, 0, 2, 3], [1, 4, 3, 2], [4, 5, 3]]; | ||
+ | < | ||
+ | obj21.userData.facetmaterial = [new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj21); | ||
+ | scene.add(obj21); | ||
+ | |||
+ | var obj22 = new THREE.Object3D(); | ||
+ | obj22.name = " | ||
+ | obj22.userData.explodable = 1; | ||
+ | obj22.userData.points = []; | ||
+ | obj22.userData.points.push(new PMPoint(3, 1, 1)); | ||
+ | obj22.userData.points.push(new PMPoint(3, 1, 0)); | ||
+ | obj22.userData.points.push(new PMPoint(1, 1, 0)); | ||
+ | obj22.userData.points.push(new PMPoint(6.6, | ||
+ | obj22.userData.points.push(new PMPoint(6.6, | ||
+ | obj22.userData.points.push(new PMPoint(6.6, | ||
+ | |||
+ | obj22.userData.pointradii = [0.02, 0.02, 0.02, 0, 0, 0]; | ||
+ | < | ||
+ | obj22.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj22.userData.pointlabels = [" | ||
+ | obj22.userData.edgeindices = [0, 1, 0, 2, 1, 2, 2, 3, 1, 4, 3, 4, 0, 5, 3, 5, 4, 5]; | ||
+ | < | ||
+ | obj22.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj22.userData.facets = [[0, 1, 4, 5], [2, 1, 0], [0, 5, 3, 2], [4, 1, 2, 3], [5, 4, 3]]; | ||
+ | < | ||
+ | obj22.userData.facetmaterial = [new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj22); | ||
+ | scene.add(obj22); | ||
+ | |||
+ | var obj23 = new THREE.Object3D(); | ||
+ | obj23.name = " | ||
+ | obj23.userData.explodable = 1; | ||
+ | obj23.userData.points = []; | ||
+ | obj23.userData.points.push(new PMPoint(1, 3, 1)); | ||
+ | obj23.userData.points.push(new PMPoint(0, 1, 1)); | ||
+ | obj23.userData.points.push(new PMPoint(0, 1, 0)); | ||
+ | obj23.userData.points.push(new PMPoint(0, 3, 1)); | ||
+ | |||
+ | obj23.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj23.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj23.userData.pointlabels = [" | ||
+ | obj23.userData.edgeindices = [0, 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3]; | ||
+ | < | ||
+ | obj23.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj23.userData.facets = [[3, 1, 0], [2, 1, 3], [0, 1, 2], [3, 0, 2]]; | ||
+ | < | ||
+ | obj23.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj23); | ||
+ | scene.add(obj23); | ||
+ | |||
+ | var obj24 = new THREE.Object3D(); | ||
+ | obj24.name = " | ||
+ | obj24.userData.explodable = 1; | ||
+ | obj24.userData.points = []; | ||
+ | obj24.userData.points.push(new PMPoint(0, 1, 1)); | ||
+ | obj24.userData.points.push(new PMPoint(0.333333, | ||
+ | obj24.userData.points.push(new PMPoint(0, 1, 0)); | ||
+ | obj24.userData.points.push(new PMPoint(0, 0.333333, 0.333333)); | ||
+ | |||
+ | obj24.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj24.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj24.userData.pointlabels = [" | ||
+ | obj24.userData.edgeindices = [0, 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3]; | ||
+ | < | ||
+ | obj24.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj24.userData.facets = [[2, 0, 1], [3, 0, 2], [1, 0, 3], [2, 1, 3]]; | ||
+ | < | ||
+ | obj24.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj24); | ||
+ | scene.add(obj24); | ||
+ | |||
+ | var obj25 = new THREE.Object3D(); | ||
+ | obj25.name = " | ||
+ | obj25.userData.explodable = 1; | ||
+ | obj25.userData.points = []; | ||
+ | obj25.userData.points.push(new PMPoint(1, 3, 1)); | ||
+ | obj25.userData.points.push(new PMPoint(1, 1, 0)); | ||
+ | obj25.userData.points.push(new PMPoint(0, 1, 0)); | ||
+ | obj25.userData.points.push(new PMPoint(1, 3, 0)); | ||
+ | |||
+ | obj25.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj25.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj25.userData.pointlabels = [" | ||
+ | obj25.userData.edgeindices = [0, 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3]; | ||
+ | < | ||
+ | obj25.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj25.userData.facets = [[3, 0, 1], [2, 0, 3], [1, 0, 2], [3, 1, 2]]; | ||
+ | < | ||
+ | obj25.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj25); | ||
+ | scene.add(obj25); | ||
+ | |||
+ | var obj26 = new THREE.Object3D(); | ||
+ | obj26.name = " | ||
+ | obj26.userData.explodable = 1; | ||
+ | obj26.userData.points = []; | ||
+ | obj26.userData.points.push(new PMPoint(1, 1, 0)); | ||
+ | obj26.userData.points.push(new PMPoint(0.333333, | ||
+ | obj26.userData.points.push(new PMPoint(0, 1, 0)); | ||
+ | obj26.userData.points.push(new PMPoint(0.333333, | ||
+ | |||
+ | obj26.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj26.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj26.userData.pointlabels = [" | ||
+ | obj26.userData.edgeindices = [0, 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3]; | ||
+ | < | ||
+ | obj26.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj26.userData.facets = [[0, 1, 3], [2, 1, 0], [3, 1, 2], [0, 3, 2]]; | ||
+ | < | ||
+ | obj26.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj26); | ||
+ | scene.add(obj26); | ||
+ | |||
+ | var obj27 = new THREE.Object3D(); | ||
+ | obj27.name = " | ||
+ | obj27.userData.explodable = 1; | ||
+ | obj27.userData.points = []; | ||
+ | obj27.userData.points.push(new PMPoint(1, 0, 1)); | ||
+ | obj27.userData.points.push(new PMPoint(0.333333, | ||
+ | obj27.userData.points.push(new PMPoint(1, 0, 0)); | ||
+ | obj27.userData.points.push(new PMPoint(0.333333, | ||
+ | |||
+ | obj27.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj27.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj27.userData.pointlabels = [" | ||
+ | obj27.userData.edgeindices = [0, 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3]; | ||
+ | < | ||
+ | obj27.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj27.userData.facets = [[1, 0, 2], [3, 0, 1], [2, 0, 3], [1, 2, 3]]; | ||
+ | < | ||
+ | obj27.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj27); | ||
+ | scene.add(obj27); | ||
+ | |||
+ | var obj28 = new THREE.Object3D(); | ||
+ | obj28.name = " | ||
+ | obj28.userData.explodable = 1; | ||
+ | obj28.userData.points = []; | ||
+ | obj28.userData.points.push(new PMPoint(3, 1, 1)); | ||
+ | obj28.userData.points.push(new PMPoint(1, 0, 1)); | ||
+ | obj28.userData.points.push(new PMPoint(1, 0, 0)); | ||
+ | obj28.userData.points.push(new PMPoint(3, 0, 1)); | ||
+ | |||
+ | obj28.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj28.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj28.userData.pointlabels = [" | ||
+ | obj28.userData.edgeindices = [0, 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3]; | ||
+ | < | ||
+ | obj28.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj28.userData.facets = [[0, 1, 3], [2, 1, 0], [3, 1, 2], [0, 3, 2]]; | ||
+ | < | ||
+ | obj28.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj28); | ||
+ | scene.add(obj28); | ||
+ | |||
+ | var obj29 = new THREE.Object3D(); | ||
+ | obj29.name = " | ||
+ | obj29.userData.explodable = 1; | ||
+ | obj29.userData.points = []; | ||
+ | obj29.userData.points.push(new PMPoint(3, 1, 1)); | ||
+ | obj29.userData.points.push(new PMPoint(1, 1, 0)); | ||
+ | obj29.userData.points.push(new PMPoint(1, 0, 0)); | ||
+ | obj29.userData.points.push(new PMPoint(3, 1, 0)); | ||
+ | |||
+ | obj29.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj29.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj29.userData.pointlabels = [" | ||
+ | obj29.userData.edgeindices = [0, 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3]; | ||
+ | < | ||
+ | obj29.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj29.userData.facets = [[1, 0, 3], [2, 0, 1], [3, 0, 2], [1, 3, 2]]; | ||
+ | < | ||
+ | obj29.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj29); | ||
+ | scene.add(obj29); | ||
+ | |||
+ | var obj30 = new THREE.Object3D(); | ||
+ | obj30.name = " | ||
+ | obj30.userData.explodable = 1; | ||
+ | obj30.userData.points = []; | ||
+ | obj30.userData.points.push(new PMPoint(1, 1, 0)); | ||
+ | obj30.userData.points.push(new PMPoint(0.333333, | ||
+ | obj30.userData.points.push(new PMPoint(1, 0, 0)); | ||
+ | obj30.userData.points.push(new PMPoint(0.333333, | ||
+ | |||
+ | obj30.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj30.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj30.userData.pointlabels = [" | ||
+ | obj30.userData.edgeindices = [0, 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3]; | ||
+ | < | ||
+ | obj30.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj30.userData.facets = [[0, 1, 2], [3, 1, 0], [2, 1, 3], [0, 2, 3]]; | ||
+ | < | ||
+ | obj30.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj30); | ||
+ | scene.add(obj30); | ||
+ | |||
+ | var obj31 = new THREE.Object3D(); | ||
+ | obj31.name = " | ||
+ | obj31.userData.explodable = 1; | ||
+ | obj31.userData.points = []; | ||
+ | obj31.userData.points.push(new PMPoint(0, 1, 3)); | ||
+ | obj31.userData.points.push(new PMPoint(1, 1, 3)); | ||
+ | obj31.userData.points.push(new PMPoint(0, 4.6, 6.6)); | ||
+ | obj31.userData.points.push(new PMPoint(1, 4.6, 6.6)); | ||
+ | obj31.userData.points.push(new PMPoint(2.2, | ||
+ | obj31.userData.points.push(new PMPoint(0, 2.2, 6.6)); | ||
+ | |||
+ | obj31.userData.pointradii = [0.02, 0.02, 0, 0, 0, 0]; | ||
+ | < | ||
+ | obj31.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj31.userData.pointlabels = [" | ||
+ | obj31.userData.edgeindices = [0, 1, 0, 2, 1, 3, 2, 3, 1, 4, 3, 4, 0, 5, 2, 5, 4, 5]; | ||
+ | < | ||
+ | obj31.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj31.userData.facets = [[2, 0, 5], [4, 1, 3], [1, 0, 2, 3], [5, 0, 1, 4], [2, 5, 4, 3]]; | ||
+ | < | ||
+ | obj31.userData.facetmaterial = [new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj31); | ||
+ | scene.add(obj31); | ||
+ | |||
+ | var obj32 = new THREE.Object3D(); | ||
+ | obj32.name = " | ||
+ | obj32.userData.explodable = 1; | ||
+ | obj32.userData.points = []; | ||
+ | obj32.userData.points.push(new PMPoint(0, 3, 1)); | ||
+ | obj32.userData.points.push(new PMPoint(1, 3, 1)); | ||
+ | obj32.userData.points.push(new PMPoint(0, 6.6, 4.6)); | ||
+ | obj32.userData.points.push(new PMPoint(1, 6.6, 4.6)); | ||
+ | obj32.userData.points.push(new PMPoint(2.2, | ||
+ | obj32.userData.points.push(new PMPoint(0, 6.6, 2.2)); | ||
+ | |||
+ | obj32.userData.pointradii = [0.02, 0.02, 0, 0, 0, 0]; | ||
+ | < | ||
+ | obj32.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj32.userData.pointlabels = [" | ||
+ | obj32.userData.edgeindices = [0, 1, 0, 2, 1, 3, 2, 3, 1, 4, 3, 4, 0, 5, 2, 5, 4, 5]; | ||
+ | < | ||
+ | obj32.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj32.userData.facets = [[0, 2, 5], [4, 3, 1], [3, 2, 0, 1], [0, 5, 4, 1], [5, 2, 3, 4]]; | ||
+ | < | ||
+ | obj32.userData.facetmaterial = [new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj32); | ||
+ | scene.add(obj32); | ||
+ | |||
+ | var obj33 = new THREE.Object3D(); | ||
+ | obj33.name = " | ||
+ | obj33.userData.explodable = 1; | ||
+ | obj33.userData.points = []; | ||
+ | obj33.userData.points.push(new PMPoint(1, 1, 3)); | ||
+ | obj33.userData.points.push(new PMPoint(0, 0, 1)); | ||
+ | obj33.userData.points.push(new PMPoint(0, 1, 3)); | ||
+ | obj33.userData.points.push(new PMPoint(1, 0, 3)); | ||
+ | obj33.userData.points.push(new PMPoint(0, 0, 3)); | ||
+ | |||
+ | obj33.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj33.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj33.userData.pointlabels = [" | ||
+ | obj33.userData.edgeindices = [0, 1, 0, 2, 1, 2, 0, 3, 1, 3, 1, 4, 2, 4, 3, 4]; | ||
+ | < | ||
+ | obj33.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj33.userData.facets = [[4, 1, 3], [4, 2, 1], [0, 1, 2], [3, 1, 0], [4, 3, 0, 2]]; | ||
+ | < | ||
+ | obj33.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj33); | ||
+ | scene.add(obj33); | ||
+ | |||
+ | var obj34 = new THREE.Object3D(); | ||
+ | obj34.name = " | ||
+ | obj34.userData.explodable = 1; | ||
+ | obj34.userData.points = []; | ||
+ | obj34.userData.points.push(new PMPoint(0.333333, | ||
+ | obj34.userData.points.push(new PMPoint(0, 0, 1)); | ||
+ | obj34.userData.points.push(new PMPoint(0, 0.333333, 0.333333)); | ||
+ | obj34.userData.points.push(new PMPoint(0.333333, | ||
+ | obj34.userData.points.push(new PMPoint(0, 0, 0.333333)); | ||
+ | |||
+ | obj34.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj34.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj34.userData.pointlabels = [" | ||
+ | obj34.userData.edgeindices = [0, 1, 0, 2, 1, 2, 0, 3, 1, 3, 1, 4, 2, 4, 3, 4]; | ||
+ | < | ||
+ | obj34.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj34.userData.facets = [[1, 4, 3], [2, 4, 1], [0, 2, 1], [1, 3, 0], [3, 4, 2, 0]]; | ||
+ | < | ||
+ | obj34.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj34); | ||
+ | scene.add(obj34); | ||
+ | |||
+ | var obj35 = new THREE.Object3D(); | ||
+ | obj35.name = " | ||
+ | obj35.userData.explodable = 1; | ||
+ | obj35.userData.points = []; | ||
+ | obj35.userData.points.push(new PMPoint(1, 0, 3)); | ||
+ | obj35.userData.points.push(new PMPoint(1, 1, 3)); | ||
+ | obj35.userData.points.push(new PMPoint(4.6, | ||
+ | obj35.userData.points.push(new PMPoint(4.6, | ||
+ | obj35.userData.points.push(new PMPoint(2.2, | ||
+ | obj35.userData.points.push(new PMPoint(2.2, | ||
+ | |||
+ | obj35.userData.pointradii = [0.02, 0.02, 0, 0, 0, 0]; | ||
+ | < | ||
+ | obj35.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj35.userData.pointlabels = [" | ||
+ | obj35.userData.edgeindices = [0, 1, 0, 2, 1, 3, 2, 3, 1, 4, 3, 4, 0, 5, 2, 5, 4, 5]; | ||
+ | < | ||
+ | obj35.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj35.userData.facets = [[0, 2, 5], [4, 3, 1], [3, 2, 0, 1], [0, 5, 4, 1], [5, 2, 3, 4]]; | ||
+ | < | ||
+ | obj35.userData.facetmaterial = [new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj35); | ||
+ | scene.add(obj35); | ||
+ | |||
+ | var obj36 = new THREE.Object3D(); | ||
+ | obj36.name = " | ||
+ | obj36.userData.explodable = 1; | ||
+ | obj36.userData.points = []; | ||
+ | obj36.userData.points.push(new PMPoint(3, 1, 1)); | ||
+ | obj36.userData.points.push(new PMPoint(3, 0, 1)); | ||
+ | obj36.userData.points.push(new PMPoint(6.6, | ||
+ | obj36.userData.points.push(new PMPoint(6.6, | ||
+ | obj36.userData.points.push(new PMPoint(6.6, | ||
+ | obj36.userData.points.push(new PMPoint(6.6, | ||
+ | |||
+ | obj36.userData.pointradii = [0.02, 0.02, 0, 0, 0, 0]; | ||
+ | < | ||
+ | obj36.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj36.userData.pointlabels = [" | ||
+ | obj36.userData.edgeindices = [0, 1, 0, 2, 1, 3, 2, 3, 1, 4, 3, 4, 0, 5, 2, 5, 4, 5]; | ||
+ | < | ||
+ | obj36.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj36.userData.facets = [[3, 1, 4], [5, 0, 2], [0, 1, 3, 2], [4, 1, 0, 5], [3, 4, 5, 2]]; | ||
+ | < | ||
+ | obj36.userData.facetmaterial = [new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj36); | ||
+ | scene.add(obj36); | ||
+ | |||
+ | var obj37 = new THREE.Object3D(); | ||
+ | obj37.name = " | ||
+ | obj37.userData.explodable = 1; | ||
+ | obj37.userData.points = []; | ||
+ | obj37.userData.points.push(new PMPoint(1, 3, 0)); | ||
+ | obj37.userData.points.push(new PMPoint(1, 3, 1)); | ||
+ | obj37.userData.points.push(new PMPoint(4.6, | ||
+ | obj37.userData.points.push(new PMPoint(4.6, | ||
+ | obj37.userData.points.push(new PMPoint(2.2, | ||
+ | obj37.userData.points.push(new PMPoint(2.2, | ||
+ | |||
+ | obj37.userData.pointradii = [0.02, 0.02, 0, 0, 0, 0]; | ||
+ | < | ||
+ | obj37.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj37.userData.pointlabels = [" | ||
+ | obj37.userData.edgeindices = [0, 1, 0, 2, 1, 3, 2, 3, 1, 4, 3, 4, 0, 5, 2, 5, 4, 5]; | ||
+ | < | ||
+ | obj37.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj37.userData.facets = [[2, 0, 5], [4, 1, 3], [1, 0, 2, 3], [5, 0, 1, 4], [2, 5, 4, 3]]; | ||
+ | < | ||
+ | obj37.userData.facetmaterial = [new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj37); | ||
+ | scene.add(obj37); | ||
+ | |||
+ | var obj38 = new THREE.Object3D(); | ||
+ | obj38.name = " | ||
+ | obj38.userData.explodable = 1; | ||
+ | obj38.userData.points = []; | ||
+ | obj38.userData.points.push(new PMPoint(3, 1, 0)); | ||
+ | obj38.userData.points.push(new PMPoint(3, 1, 1)); | ||
+ | obj38.userData.points.push(new PMPoint(6.6, | ||
+ | obj38.userData.points.push(new PMPoint(6.6, | ||
+ | obj38.userData.points.push(new PMPoint(6.6, | ||
+ | obj38.userData.points.push(new PMPoint(6.6, | ||
+ | |||
+ | obj38.userData.pointradii = [0.02, 0.02, 0, 0, 0, 0]; | ||
+ | < | ||
+ | obj38.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj38.userData.pointlabels = [" | ||
+ | obj38.userData.edgeindices = [0, 1, 0, 2, 1, 3, 2, 3, 1, 4, 3, 4, 0, 5, 2, 5, 4, 5]; | ||
+ | < | ||
+ | obj38.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj38.userData.facets = [[0, 2, 5], [4, 3, 1], [3, 2, 0, 1], [0, 5, 4, 1], [5, 2, 3, 4]]; | ||
+ | < | ||
+ | obj38.userData.facetmaterial = [new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj38); | ||
+ | scene.add(obj38); | ||
+ | |||
+ | var obj39 = new THREE.Object3D(); | ||
+ | obj39.name = " | ||
+ | obj39.userData.explodable = 1; | ||
+ | obj39.userData.points = []; | ||
+ | obj39.userData.points.push(new PMPoint(1, 3, 1)); | ||
+ | obj39.userData.points.push(new PMPoint(0, 1, 0)); | ||
+ | obj39.userData.points.push(new PMPoint(0, 3, 1)); | ||
+ | obj39.userData.points.push(new PMPoint(1, 3, 0)); | ||
+ | obj39.userData.points.push(new PMPoint(0, 3, 0)); | ||
+ | |||
+ | obj39.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj39.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj39.userData.pointlabels = [" | ||
+ | obj39.userData.edgeindices = [0, 1, 0, 2, 1, 2, 0, 3, 1, 3, 1, 4, 2, 4, 3, 4]; | ||
+ | < | ||
+ | obj39.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj39.userData.facets = [[1, 4, 3], [2, 4, 1], [0, 2, 1], [1, 3, 0], [3, 4, 2, 0]]; | ||
+ | < | ||
+ | obj39.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj39); | ||
+ | scene.add(obj39); | ||
+ | |||
+ | var obj40 = new THREE.Object3D(); | ||
+ | obj40.name = " | ||
+ | obj40.userData.explodable = 1; | ||
+ | obj40.userData.points = []; | ||
+ | obj40.userData.points.push(new PMPoint(0.333333, | ||
+ | obj40.userData.points.push(new PMPoint(0, 1, 0)); | ||
+ | obj40.userData.points.push(new PMPoint(0, 0.333333, 0.333333)); | ||
+ | obj40.userData.points.push(new PMPoint(0.333333, | ||
+ | obj40.userData.points.push(new PMPoint(0, 0.333333, 0)); | ||
+ | |||
+ | obj40.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj40.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj40.userData.pointlabels = [" | ||
+ | obj40.userData.edgeindices = [0, 1, 0, 2, 1, 2, 0, 3, 1, 3, 1, 4, 2, 4, 3, 4]; | ||
+ | < | ||
+ | obj40.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj40.userData.facets = [[4, 1, 3], [4, 2, 1], [0, 1, 2], [3, 1, 0], [4, 3, 0, 2]]; | ||
+ | < | ||
+ | obj40.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj40); | ||
+ | scene.add(obj40); | ||
+ | |||
+ | var obj41 = new THREE.Object3D(); | ||
+ | obj41.name = " | ||
+ | obj41.userData.explodable = 1; | ||
+ | obj41.userData.points = []; | ||
+ | obj41.userData.points.push(new PMPoint(0.333333, | ||
+ | obj41.userData.points.push(new PMPoint(1, 0, 0)); | ||
+ | obj41.userData.points.push(new PMPoint(0.333333, | ||
+ | obj41.userData.points.push(new PMPoint(0.333333, | ||
+ | obj41.userData.points.push(new PMPoint(0.333333, | ||
+ | |||
+ | obj41.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj41.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj41.userData.pointlabels = [" | ||
+ | obj41.userData.edgeindices = [0, 1, 0, 2, 1, 2, 0, 3, 1, 3, 1, 4, 2, 4, 3, 4]; | ||
+ | < | ||
+ | obj41.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj41.userData.facets = [[1, 4, 3], [2, 4, 1], [0, 2, 1], [1, 3, 0], [3, 4, 2, 0]]; | ||
+ | < | ||
+ | obj41.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj41); | ||
+ | scene.add(obj41); | ||
+ | |||
+ | var obj42 = new THREE.Object3D(); | ||
+ | obj42.name = " | ||
+ | obj42.userData.explodable = 1; | ||
+ | obj42.userData.points = []; | ||
+ | obj42.userData.points.push(new PMPoint(3, 1, 1)); | ||
+ | obj42.userData.points.push(new PMPoint(1, 0, 0)); | ||
+ | obj42.userData.points.push(new PMPoint(3, 0, 1)); | ||
+ | obj42.userData.points.push(new PMPoint(3, 1, 0)); | ||
+ | obj42.userData.points.push(new PMPoint(3, 0, 0)); | ||
+ | |||
+ | obj42.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj42.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj42.userData.pointlabels = [" | ||
+ | obj42.userData.edgeindices = [0, 1, 0, 2, 1, 2, 0, 3, 1, 3, 1, 4, 2, 4, 3, 4]; | ||
+ | < | ||
+ | obj42.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj42.userData.facets = [[4, 1, 3], [4, 2, 1], [0, 1, 2], [3, 1, 0], [4, 3, 0, 2]]; | ||
+ | < | ||
+ | obj42.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj42); | ||
+ | scene.add(obj42); | ||
+ | |||
+ | var obj43 = new THREE.Object3D(); | ||
+ | obj43.name = " | ||
+ | obj43.userData.explodable = 1; | ||
+ | obj43.userData.points = []; | ||
+ | obj43.userData.points.push(new PMPoint(1, 1, 3)); | ||
+ | obj43.userData.points.push(new PMPoint(1, 0, 3)); | ||
+ | obj43.userData.points.push(new PMPoint(0, 0, 3)); | ||
+ | obj43.userData.points.push(new PMPoint(0, 1, 3)); | ||
+ | obj43.userData.points.push(new PMPoint(0, 2.2, 6.6)); | ||
+ | obj43.userData.points.push(new PMPoint(0, 0, 6.6)); | ||
+ | obj43.userData.points.push(new PMPoint(2.2, | ||
+ | obj43.userData.points.push(new PMPoint(2.2, | ||
+ | |||
+ | obj43.userData.pointradii = [0.02, 0.02, 0.02, 0.02, 0, 0, 0, 0]; | ||
+ | < | ||
+ | obj43.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj43.userData.pointlabels = [" | ||
+ | obj43.userData.edgeindices = [0, 1, 1, 2, 0, 3, 2, 3, 3, 4, 2, 5, 4, 5, 0, 6, 4, 6, 1, 7, 5, 7, 6, 7]; | ||
+ | < | ||
+ | obj43.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj43.userData.facets = [[5, 2, 1, 7], [3, 2, 5, 4], [0, 3, 4, 6], [7, 1, 0, 6], [1, 2, 3, 0], [5, 7, 6, 4]]; | ||
+ | < | ||
+ | obj43.userData.facetmaterial = [new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj43); | ||
+ | scene.add(obj43); | ||
+ | |||
+ | var obj44 = new THREE.Object3D(); | ||
+ | obj44.name = " | ||
+ | obj44.userData.explodable = 1; | ||
+ | obj44.userData.points = []; | ||
+ | obj44.userData.points.push(new PMPoint(1, 3, 1)); | ||
+ | obj44.userData.points.push(new PMPoint(1, 3, 0)); | ||
+ | obj44.userData.points.push(new PMPoint(0, 3, 0)); | ||
+ | obj44.userData.points.push(new PMPoint(0, 3, 1)); | ||
+ | obj44.userData.points.push(new PMPoint(0, 6.6, 2.2)); | ||
+ | obj44.userData.points.push(new PMPoint(0, 6.6, 0)); | ||
+ | obj44.userData.points.push(new PMPoint(2.2, | ||
+ | obj44.userData.points.push(new PMPoint(2.2, | ||
+ | |||
+ | obj44.userData.pointradii = [0.02, 0.02, 0.02, 0.02, 0, 0, 0, 0]; | ||
+ | < | ||
+ | obj44.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj44.userData.pointlabels = [" | ||
+ | obj44.userData.edgeindices = [0, 1, 1, 2, 0, 3, 2, 3, 3, 4, 2, 5, 4, 5, 0, 6, 4, 6, 1, 7, 5, 7, 6, 7]; | ||
+ | < | ||
+ | obj44.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj44.userData.facets = [[2, 5, 7, 1], [4, 5, 2, 3], [6, 4, 3, 0], [1, 7, 6, 0], [2, 1, 0, 3], [7, 5, 4, 6]]; | ||
+ | < | ||
+ | obj44.userData.facetmaterial = [new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj44); | ||
+ | scene.add(obj44); | ||
+ | |||
+ | var obj45 = new THREE.Object3D(); | ||
+ | obj45.name = " | ||
+ | obj45.userData.explodable = 1; | ||
+ | obj45.userData.points = []; | ||
+ | obj45.userData.points.push(new PMPoint(0.333333, | ||
+ | obj45.userData.points.push(new PMPoint(0, 0.333333, 0.333333)); | ||
+ | obj45.userData.points.push(new PMPoint(0.333333, | ||
+ | obj45.userData.points.push(new PMPoint(0.333333, | ||
+ | obj45.userData.points.push(new PMPoint(0, 0, 0.333333)); | ||
+ | obj45.userData.points.push(new PMPoint(0, 0.333333, 0)); | ||
+ | obj45.userData.points.push(new PMPoint(0.333333, | ||
+ | obj45.userData.points.push(new PMPoint(0, 0, 0)); | ||
+ | |||
+ | obj45.userData.pointradii = 0.02; | ||
+ | < | ||
+ | obj45.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj45.userData.pointlabels = [" | ||
+ | obj45.userData.edgeindices = [0, 1, 0, 2, 0, 3, 1, 4, 2, 4, 1, 5, 3, 5, 2, 6, 3, 6, 4, 7, 5, 7, 6, 7]; | ||
+ | < | ||
+ | obj45.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj45.userData.facets = [[7, 5, 3, 6], [1, 5, 7, 4], [7, 6, 2, 4], [0, 1, 4, 2], [3, 5, 1, 0], [6, 3, 0, 2]]; | ||
+ | < | ||
+ | obj45.userData.facetmaterial = new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj45); | ||
+ | scene.add(obj45); | ||
+ | |||
+ | var obj46 = new THREE.Object3D(); | ||
+ | obj46.name = " | ||
+ | obj46.userData.explodable = 1; | ||
+ | obj46.userData.points = []; | ||
+ | obj46.userData.points.push(new PMPoint(3, 1, 0)); | ||
+ | obj46.userData.points.push(new PMPoint(3, 0, 0)); | ||
+ | obj46.userData.points.push(new PMPoint(3, 0, 1)); | ||
+ | obj46.userData.points.push(new PMPoint(3, 1, 1)); | ||
+ | obj46.userData.points.push(new PMPoint(6.6, | ||
+ | obj46.userData.points.push(new PMPoint(6.6, | ||
+ | obj46.userData.points.push(new PMPoint(6.6, | ||
+ | obj46.userData.points.push(new PMPoint(6.6, | ||
+ | |||
+ | obj46.userData.pointradii = [0.02, 0.02, 0.02, 0.02, 0, 0, 0, 0]; | ||
+ | < | ||
+ | obj46.userData.pointmaterial = new THREE.MeshBasicMaterial( { color: 0xFF0000, side: THREE.DoubleSide, | ||
+ | obj46.userData.pointlabels = [" | ||
+ | obj46.userData.edgeindices = [0, 1, 1, 2, 0, 3, 2, 3, 3, 4, 2, 5, 4, 5, 0, 6, 4, 6, 1, 7, 5, 7, 6, 7]; | ||
+ | < | ||
+ | obj46.userData.edgematerial = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 1.5, transparent: | ||
+ | obj46.userData.facets = [[7, 1, 0, 6], [2, 1, 7, 5], [3, 2, 5, 4], [6, 0, 3, 4], [0, 1, 2, 3], [7, 6, 4, 5]]; | ||
+ | < | ||
+ | obj46.userData.facetmaterial = [new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0x77EC9E, depthFunc: THREE.LessDepth, | ||
+ | new THREE.MeshBasicMaterial( { color: 0xFF0000, depthFunc: THREE.LessDepth, | ||
+ | init_object(obj46); | ||
+ | scene.add(obj46); | ||
+ | |||
+ | // COMMON_CODE_BLOCK_BEGIN | ||
+ | function textSpriteMaterial(message, | ||
+ | if ( parameters === undefined ) parameters = {}; | ||
+ | var fontface = " | ||
+ | var fontsize = parameters.hasOwnProperty(" | ||
+ | fontsize = fontsize*10; | ||
+ | var lines = message.split(' | ||
+ | var size = 512; | ||
+ | for(var i = 0; i< | ||
+ | var tmp = lines[i].length; | ||
+ | while(tmp*fontsize > size){ | ||
+ | | ||
+ | } | ||
+ | } | ||
+ | | ||
+ | var canvas = document.createElement(' | ||
+ | canvas.width = size; | ||
+ | canvas.height = size; | ||
+ | var context = canvas.getContext(' | ||
+ | context.fillStyle = " | ||
+ | context.fill(); | ||
+ | context.font = fontsize + "px " + fontface; | ||
+ | | ||
+ | // text color | ||
+ | context.fillStyle = " | ||
+ | | ||
+ | context.fillText(lines[i], | ||
+ | } | ||
+ | | ||
+ | // canvas contents will be used for a texture | ||
+ | var texture = new THREE.Texture(canvas); | ||
+ | texture.needsUpdate = true; | ||
+ | | ||
+ | var spriteMaterial = new THREE.SpriteMaterial({map: | ||
+ | return spriteMaterial; | ||
+ | } | ||
+ | |||
+ | |||
+ | // ---------------------- INITIALIZING OBJECTS-------------------------------------- | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | |||
+ | function init_object(obj) { | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_points(obj); | ||
+ | modelContains.points = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_pointlabels(obj); | ||
+ | modelContains.pointlabels = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_lines(obj); | ||
+ | modelContains.lines = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_edgelabels(obj); | ||
+ | modelContains.edgelabels = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_arrowheads(obj); | ||
+ | modelContains.arrowheads = true; | ||
+ | } | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | init_faces(obj); | ||
+ | modelContains.faces = true; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function init_points(obj) { | ||
+ | var pointgroup = new THREE.Group(); | ||
+ | pointgroup.name = " | ||
+ | var points = obj.userData.points; | ||
+ | var radii = obj.userData.pointradii; | ||
+ | var materials = obj.userData.pointmaterial; | ||
+ | var geometry, | ||
+ | if (!Array.isArray(radii)) { | ||
+ | geometry = new THREE.SphereBufferGeometry(radii); | ||
+ | } | ||
+ | if (!Array.isArray(materials)) { | ||
+ | material = materials; | ||
+ | } | ||
+ | for (var i=0; i< | ||
+ | var point = points[i]; | ||
+ | if (Array.isArray(radii)) { | ||
+ | if (radii[i] == 0) { | ||
+ | continue; | ||
+ | } | ||
+ | geometry = new THREE.SphereBufferGeometry(radii[i]); | ||
+ | } | ||
+ | if (Array.isArray(materials)) { | ||
+ | material = materials[i]; | ||
+ | } | ||
+ | var sphere = new THREE.Mesh(geometry, | ||
+ | point.addSphere(sphere); | ||
+ | pointgroup.add(sphere); | ||
+ | } | ||
+ | obj.add(pointgroup); | ||
+ | } | ||
+ | |||
+ | function init_pointlabels(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var labels = obj.userData.pointlabels; | ||
+ | var pointlabels = new THREE.Group(); | ||
+ | pointlabels.name = " | ||
+ | if (Array.isArray(labels)) { | ||
+ | for (var i=0; i< | ||
+ | var point = points[i]; | ||
+ | var spriteMaterial = textSpriteMaterial( labels[i] ); | ||
+ | var sprite = new THREE.Sprite(spriteMaterial); | ||
+ | point.addLabel(sprite); | ||
+ | pointlabels.add(sprite); | ||
+ | } | ||
+ | } else { | ||
+ | var spriteMaterial = textSpriteMaterial( labels ); | ||
+ | for (var i=0; i< | ||
+ | var point = points[i]; | ||
+ | var sprite = new THREE.Sprite(spriteMaterial); | ||
+ | point.addLabel(sprite); | ||
+ | pointlabels.add(sprite); | ||
+ | } | ||
+ | } | ||
+ | obj.add(pointlabels); | ||
+ | } | ||
+ | |||
+ | function init_lines(obj) { | ||
+ | var edgeindices = obj.userData.edgeindices; | ||
+ | var points = obj.userData.points; | ||
+ | var materials = obj.userData.edgematerial; | ||
+ | var geometry = new THREE.BufferGeometry(); | ||
+ | var bufarr = new Float32Array( obj.userData.edgeindices.length * 3 ); | ||
+ | var bufattr = new THREE.Float32BufferAttribute( bufarr, 3 ); | ||
+ | var geometry = new THREE.BufferGeometry(); | ||
+ | geometry.setAttribute(' | ||
+ | if (Array.isArray(materials)) { | ||
+ | for (var i=0; i< | ||
+ | geometry.addGroup(2*i, | ||
+ | } | ||
+ | } | ||
+ | var lines = new THREE.LineSegments(geometry, | ||
+ | lines.name = " | ||
+ | obj.add(lines); | ||
+ | updateEdgesPosition(obj); | ||
+ | } | ||
+ | |||
+ | function init_edgelabels(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var edgeindices = obj.userData.edgeindices; | ||
+ | var labels = obj.userData.edgelabels; | ||
+ | var edgelabels = new THREE.Group(); | ||
+ | edgelabels.name = " | ||
+ | if (Array.isArray(labels)) { | ||
+ | for (var i=0; i< | ||
+ | var spriteMaterial = textSpriteMaterial( labels[i] ); | ||
+ | var sprite = new THREE.Sprite(spriteMaterial); | ||
+ | sprite.position.copy(new THREE.Vector3().addVectors(points[edgeindices[2*i]].vector, | ||
+ | edgelabels.add(sprite); | ||
+ | } | ||
+ | } else { | ||
+ | var spriteMaterial = textSpriteMaterial( labels ); | ||
+ | for (var i=0; i< | ||
+ | var sprite = new THREE.Sprite(spriteMaterial); | ||
+ | sprite.position.copy(new THREE.Vector3().addVectors(points[edgeindices[2*i]].vector, | ||
+ | edgelabels.add(sprite); | ||
+ | } | ||
+ | } | ||
+ | obj.add(edgelabels); | ||
+ | } | ||
+ | |||
+ | function init_arrowheads(obj) { | ||
+ | var arrowheads = new THREE.Group(); | ||
+ | arrowheads.name = " | ||
+ | var arrowstyle = obj.userData.arrowstyle; | ||
+ | var edgeindices = obj.userData.edgeindices; | ||
+ | var edgematerials = obj.userData.edgematerial; | ||
+ | var points = obj.userData.points; | ||
+ | var material; | ||
+ | if (!Array.isArray(edgematerials)) { | ||
+ | material = new THREE.MeshBasicMaterial( {color: edgematerials.color} ); | ||
+ | } | ||
+ | |||
+ | for (var i=0; i< | ||
+ | var start = points[edgeindices[i]]; | ||
+ | var end = points[edgeindices[i+1]]; | ||
+ | var dist = start.vector.distanceTo( end.vector ) - start.radius() - end.radius(); | ||
+ | if (dist <= 0) { | ||
+ | continue; | ||
+ | } | ||
+ | var dir = new THREE.Vector3().subVectors(end.vector, | ||
+ | dir.normalize(); | ||
+ | var axis = new THREE.Vector3().set(dir.z, | ||
+ | axis.normalize(); | ||
+ | var radians = Math.acos( dir.y ); | ||
+ | var radius = dist/25; | ||
+ | var height = dist/5; | ||
+ | var geometry = new THREE.ConeBufferGeometry(radius, | ||
+ | var position = new THREE.Vector3().addVectors(start.vector, | ||
+ | if (Array.isArray(edgematerials)) { | ||
+ | material = new THREE.MeshBasicMaterial( {color: edgematerials[i].color} ); | ||
+ | } | ||
+ | var cone = new THREE.Mesh( geometry, material ); | ||
+ | cone.quaternion.setFromAxisAngle(axis, | ||
+ | cone.position.copy(position);; | ||
+ | arrowheads.add(cone); | ||
+ | } | ||
+ | obj.add(arrowheads); | ||
+ | } | ||
+ | |||
+ | function init_faces(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var facets = obj.userData.facets; | ||
+ | obj.userData.triangleindices = []; | ||
+ | for (var i=0; i< | ||
+ | facet = facets[i]; | ||
+ | for (var t=0; t< | ||
+ | obj.userData.triangleindices.push(facet[0], | ||
+ | } | ||
+ | } | ||
+ | var bufarr = new Float32Array( obj.userData.triangleindices.length * 3 ); | ||
+ | var bufattr = new THREE.Float32BufferAttribute(bufarr, | ||
+ | | ||
+ | var materials = obj.userData.facetmaterial; | ||
+ | var geometry = new THREE.BufferGeometry(); | ||
+ | var frontmaterials = []; | ||
+ | var backmaterials = []; | ||
+ | geometry.setAttribute(' | ||
+ | if (Array.isArray(materials)) { | ||
+ | var tricount = 0; | ||
+ | var facet; | ||
+ | for (var i=0; i< | ||
+ | facet = facets[i]; | ||
+ | geometry.addGroup(tricount, | ||
+ | tricount += (facet.length-2)*3; | ||
+ | } | ||
+ | for (var j=0; j< | ||
+ | var fmat = materials[j].clone() | ||
+ | fmat.side = THREE.FrontSide; | ||
+ | frontmaterials.push(fmat); | ||
+ | var bmat = materials[j].clone() | ||
+ | bmat.side = THREE.BackSide; | ||
+ | backmaterials.push(bmat); | ||
+ | obj.userData.facetmaterial = frontmaterials.concat(backmaterials); | ||
+ | } | ||
+ | } else if (materials instanceof THREE.Material) { | ||
+ | frontmaterials = materials.clone() | ||
+ | frontmaterials.side = THREE.FrontSide; | ||
+ | backmaterials = materials.clone() | ||
+ | backmaterials.side = THREE.BackSide; | ||
+ | obj.userData.facetmaterial = [frontmaterials, | ||
+ | } | ||
+ | // duplicating the object with front and back should avoid transparency issues | ||
+ | var backmesh = new THREE.Mesh(geometry, | ||
+ | // meshname is used to show/hide objects | ||
+ | backmesh.name = " | ||
+ | obj.add(backmesh); | ||
+ | var frontmesh = new THREE.Mesh(geometry, | ||
+ | frontmesh.name = " | ||
+ | obj.add(frontmesh); | ||
+ | updateFacesPosition(obj); | ||
+ | } | ||
+ | // // | ||
+ | |||
+ | |||
+ | function updateFacesPosition(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var indices = obj.userData.triangleindices; | ||
+ | var faces = obj.getObjectByName(" | ||
+ | var ba = faces.geometry.getAttribute(" | ||
+ | for (var i=0; i< | ||
+ | ba.setXYZ(i, | ||
+ | } | ||
+ | faces.geometry.attributes.position.needsUpdate = true; | ||
+ | | ||
+ | } | ||
+ | |||
+ | function updateEdgesPosition(obj) { | ||
+ | var points = obj.userData.points; | ||
+ | var indices = obj.userData.edgeindices; | ||
+ | var lines = obj.getObjectByName(" | ||
+ | var ba = lines.geometry.getAttribute(" | ||
+ | for (var i=0; i< | ||
+ | ba.setXYZ(i, | ||
+ | } | ||
+ | lines.geometry.attributes.position.needsUpdate = true; | ||
+ | } | ||
+ | |||
+ | function onWindowResize() { | ||
+ | renderer.setSize( three.clientWidth, | ||
+ | svgRenderer.setSize( three.clientWidth, | ||
+ | updateCamera(); | ||
+ | } | ||
+ | |||
+ | function updateCamera() { | ||
+ | var width = three.clientWidth; | ||
+ | var height = three.clientHeight; | ||
+ | var aspect = width / height; | ||
+ | if (camera.type == " | ||
+ | camera.left = frustumSize * aspect / - 2; | ||
+ | camera.right = frustumSize * aspect / 2; | ||
+ | camera.top = frustumSize / 2; | ||
+ | camera.bottom = - frustumSize / 2; | ||
+ | } else if (camera.type == " | ||
+ | camera.aspect = aspect; | ||
+ | } | ||
+ | camera.updateProjectionMatrix(); | ||
+ | } | ||
+ | |||
+ | function changeCamera(event) { | ||
+ | var selindex = event.currentTarget.selectedIndex; | ||
+ | camera = cameras[selindex]; | ||
+ | control = controls[selindex]; | ||
+ | control.enabled = true; | ||
+ | for (var i=0; i< | ||
+ | if (i!=selindex) { | ||
+ | controls[i].enabled = false; | ||
+ | } | ||
+ | } | ||
+ | updateCamera(); | ||
+ | } | ||
+ | |||
+ | var camtypenode = document.getElementById(' | ||
+ | camtypenode.onchange = changeCamera; | ||
+ | camtypenode.dispatchEvent(new Event(' | ||
+ | |||
+ | onWindowResize(); | ||
+ | window.addEventListener(' | ||
+ | |||
+ | |||
+ | var xRotationEnabled = false; | ||
+ | var yRotationEnabled = false; | ||
+ | var zRotationEnabled = false; | ||
+ | var rotationSpeedFactor = 1; | ||
+ | var settingsShown = false; | ||
+ | var labelsShown = true; | ||
+ | var intervals = []; | ||
+ | var timeouts = []; | ||
+ | var explodingSpeed = 0.05; | ||
+ | var explodeScale = 0.000001; | ||
+ | var XMLS = new XMLSerializer(); | ||
+ | var svgElement; | ||
+ | var renderId; | ||
+ | |||
+ | var render = function () { | ||
+ | |||
+ | renderId = requestAnimationFrame(render); | ||
+ | |||
+ | // comment in for automatic explosion | ||
+ | // | ||
+ | |||
+ | var phi = 0.02 * rotationSpeedFactor; | ||
+ | |||
+ | if (xRotationEnabled) { | ||
+ | scene.rotation.x += phi; | ||
+ | } | ||
+ | if (yRotationEnabled) { | ||
+ | scene.rotation.y += phi; | ||
+ | } | ||
+ | if (zRotationEnabled) { | ||
+ | scene.rotation.z += phi; | ||
+ | } | ||
+ | |||
+ | control.update(); | ||
+ | renderer.render(scene, | ||
+ | }; | ||
+ | |||
+ | if ( THREE.WEBGL.isWebGLAvailable() ) { | ||
+ | render(); | ||
+ | } else { | ||
+ | var warning = WEBGL.getWebGLErrorMessage(); | ||
+ | three.appendChild( warning ); | ||
+ | } | ||
+ | | ||
+ | function changeTransparency() { | ||
+ | var opacity = 1-Number(event.currentTarget.value); | ||
+ | for (var i=0; i< | ||
+ | child = scene.children[i]; | ||
+ | if ( child.userData.hasOwnProperty(" | ||
+ | if (Array.isArray(child.userData.facetmaterial)) { | ||
+ | for (var j=0; j< | ||
+ | child.userData.facetmaterial[j].opacity = opacity; | ||
+ | } | ||
+ | } else { | ||
+ | child.userData.facetmaterial.opacity = opacity; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function toggleDepthWrite(event) { | ||
+ | depthwrite = event.currentTarget.checked; | ||
+ | for (var i=0; i< | ||
+ | child = scene.children[i]; | ||
+ | if ( child.userData.hasOwnProperty(" | ||
+ | if (Array.isArray(child.userData.facetmaterial)) { | ||
+ | for (var j=0; j< | ||
+ | child.userData.facetmaterial[j].depthWrite = depthwrite; | ||
+ | } | ||
+ | } else { | ||
+ | child.userData.facetmaterial.depthWrite = depthWrite; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function changeRotationX(event){ | ||
+ | xRotationEnabled = event.currentTarget.checked; | ||
+ | } | ||
+ | |||
+ | function changeRotationY(event){ | ||
+ | yRotationEnabled = event.currentTarget.checked; | ||
+ | } | ||
+ | |||
+ | function changeRotationZ(event){ | ||
+ | zRotationEnabled = event.currentTarget.checked; | ||
+ | } | ||
+ | |||
+ | |||
+ | function changeRotationSpeedFactor(event){ | ||
+ | rotationSpeedFactor = Number(event.currentTarget.value); | ||
+ | } | ||
+ | |||
+ | function resetScene(){ | ||
+ | scene.rotation.set(0, | ||
+ | camera.position.set(0, | ||
+ | camera.up.set(0, | ||
+ | } | ||
+ | |||
+ | function showSettings(event){ | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | settingsShown = true; | ||
+ | } | ||
+ | |||
+ | function hideSettings(event){ | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | settingsShown = false; | ||
+ | } | ||
+ | |||
+ | |||
+ | |||
+ | var pos = 150* Math.PI; | ||
+ | |||
+ | function updateFactor() { | ||
+ | pos++; | ||
+ | return Math.sin(.01*pos)+1; | ||
+ | } | ||
+ | |||
+ | // ------------------------ FOLDING ------------------------------------------------ | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | // rotate point p around axis defined by points p1 and p2 by given angle | ||
+ | function rotate(p, p1, p2, angle ){ | ||
+ | angle = -angle; | ||
+ | var x = p.x, y = p.y, z = p.z, | ||
+ | a = p1.x, b = p1.y, c = p1.z, | ||
+ | u = p2.x-p1.x, v = p2.y-p1.y, w = p2.z-p1.z; | ||
+ | var result = []; | ||
+ | var L = u*u + v*v + w*w; | ||
+ | var sqrt = Math.sqrt; | ||
+ | var cos = Math.cos; | ||
+ | var sin = Math.sin; | ||
+ | |||
+ | result[0] = ((a*(v*v+w*w)-u*(b*v+c*w-u*x-v*y-w*z))*(1-cos(angle))+L*x*cos(angle)+sqrt(L)*(-c*v+b*w-w*y+v*z)*sin(angle))/ | ||
+ | result[1] = ((b*(u*u+w*w)-v*(a*u+c*w-u*x-v*y-w*z))*(1-cos(angle))+L*y*cos(angle)+sqrt(L)*(c*u-a*w+w*x-u*z)*sin(angle))/ | ||
+ | result[2] = ((c*(u*u+v*v)-w*(a*u+b*v-u*x-v*y-w*z))*(1-cos(angle))+L*z*cos(angle)+sqrt(L)*(-b*u+a*v-v*x+u*y)*sin(angle))/ | ||
+ | |||
+ | return result; | ||
+ | } | ||
+ | |||
+ | var fold = function(event){ | ||
+ | var obj = foldables[Number(event.currentTarget.name)]; | ||
+ | var foldvalue = Number(event.currentTarget.value); | ||
+ | var scale = foldvalue - obj.userData.oldscale; | ||
+ | |||
+ | for (var j=0; j< | ||
+ | rotateVertices(obj, | ||
+ | } | ||
+ | update(obj); | ||
+ | obj.userData.oldscale += scale; | ||
+ | lookAtBarycenter(obj); | ||
+ | } | ||
+ | |||
+ | function lookAtBarycenter(obj){ | ||
+ | control.target = barycenter(obj); | ||
+ | } | ||
+ | |||
+ | function barycenter(obj) { | ||
+ | var center = new THREE.Vector3(0, | ||
+ | var points = obj.userData.points; | ||
+ | for (var i=0; i< | ||
+ | center.add(points[i].vector); | ||
+ | } | ||
+ | center.divideScalar(points.length); | ||
+ | return center; | ||
+ | } | ||
+ | |||
+ | function rotateVertices(obj, | ||
+ | var axes = obj.userData.axes; | ||
+ | var subtrees = obj.userData.subtrees; | ||
+ | var points = obj.userData.points; | ||
+ | var angles = obj.userData.angles; | ||
+ | if (edge < axes.length){ | ||
+ | for (var j=0; j< | ||
+ | var rotP = rotate(points[subtrees[edge][j]].vector, | ||
+ | points[subtrees[edge][j]].set(rotP[0], | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function update(obj) { | ||
+ | | ||
+ | | ||
+ | } | ||
+ | |||
+ | if (foldables.length) { | ||
+ | var settings = document.getElementById(' | ||
+ | var foldDiv = document.createElement(' | ||
+ | foldDiv.id = ' | ||
+ | var title = document.createElement(' | ||
+ | title.innerHTML = ' | ||
+ | foldDiv.appendChild(title); | ||
+ | foldDiv.className = ' | ||
+ | for (var i=0; i< | ||
+ | var range = document.createElement(' | ||
+ | range.type = ' | ||
+ | range.min = 0; | ||
+ | range.max = 1; | ||
+ | range.value = 0; | ||
+ | range.step = 0.001; | ||
+ | range.name = String(i); | ||
+ | range.oninput = fold; | ||
+ | foldDiv.appendChild(range); | ||
+ | } | ||
+ | lookAtBarycenter(foldables[0]); | ||
+ | settings.insertBefore(foldDiv, | ||
+ | } | ||
+ | |||
+ | | ||
+ | // ---------------------- EXPLOSION ------------------------------------------------ | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | |||
+ | if (explodableModel) { | ||
+ | for (var i=0; i< | ||
+ | obj = scene.children[i]; | ||
+ | if ( obj.userData.explodable ) { | ||
+ | computeCentroid(obj); | ||
+ | } | ||
+ | } | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | explode(0.000001); | ||
+ | } | ||
+ | |||
+ | function computeCentroid(obj) { | ||
+ | centroid = new THREE.Vector3(); | ||
+ | obj.userData.points.forEach(function(pmpoint) { | ||
+ | centroid.add(pmpoint.vector); | ||
+ | }); | ||
+ | centroid.divideScalar(obj.userData.points.length); | ||
+ | obj.userData.centroid = centroid; | ||
+ | } | ||
+ | |||
+ | function explode(factor) { | ||
+ | for (var i=0; i< | ||
+ | var obj = scene.children[i]; | ||
+ | if (obj.userData.hasOwnProperty(" | ||
+ | var c = obj.userData.centroid; | ||
+ | obj.position.set(c.x*factor, | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function triggerExplode(event){ | ||
+ | explodeScale = Number(event.currentTarget.value); | ||
+ | explode(explodeScale); | ||
+ | } | ||
+ | |||
+ | function setExplodingSpeed(event){ | ||
+ | explodingSpeed = Number(event.currentTarget.value); | ||
+ | } | ||
+ | |||
+ | function triggerAutomaticExplode(event){ | ||
+ | if (event.currentTarget.checked){ | ||
+ | startExploding(); | ||
+ | } else { | ||
+ | clearIntervals(); | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function startExploding(){ | ||
+ | intervals.push(setInterval(explodingInterval, | ||
+ | } | ||
+ | |||
+ | |||
+ | function explodingInterval(){ | ||
+ | explodeScale += explodingSpeed; | ||
+ | if (explodeScale <= 6){ | ||
+ | explode(explodeScale); | ||
+ | } | ||
+ | else{ | ||
+ | explode(6); | ||
+ | explodeScale = 6; | ||
+ | clearIntervals(); | ||
+ | timeouts.push(setTimeout(startUnexploding, | ||
+ | } | ||
+ | document.getElementById(' | ||
+ | } | ||
+ | |||
+ | |||
+ | function startUnexploding(){ | ||
+ | intervals.push(setInterval(unexplodingInterval, | ||
+ | } | ||
+ | |||
+ | function unexplodingInterval(){ | ||
+ | explodeScale -= explodingSpeed; | ||
+ | if (explodeScale >= 0){ | ||
+ | explode(explodeScale); | ||
+ | } | ||
+ | else { | ||
+ | explode(0); | ||
+ | explodeScale = 0; | ||
+ | clearIntervals(); | ||
+ | timeouts.push(setTimeout(startExploding, | ||
+ | } | ||
+ | document.getElementById(' | ||
+ | } | ||
+ | |||
+ | function clearIntervals(){ | ||
+ | intervals.forEach(function(interval){ | ||
+ | clearInterval(interval); | ||
+ | }); | ||
+ | intervals = []; | ||
+ | timeouts.forEach(function(timeout){ | ||
+ | clearTimeout(timeout); | ||
+ | }); | ||
+ | timeouts = []; | ||
+ | } | ||
+ | |||
+ | // ---------------------- DISPLAY -------------------------------------------------- | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | |||
+ | const objectTypeInnerHTMLs = { points: " | ||
+ | const objectTypeVisible = {}; | ||
+ | Object.assign(objectTypeVisible, | ||
+ | const sortedObjectTypeKeys = Object.keys(objectTypeInnerHTMLs).sort(); | ||
+ | const shownObjectTypesList = document.getElementById(' | ||
+ | |||
+ | function setVisibility(bool, | ||
+ | for (var i=0; i< | ||
+ | var obj = scene.children[i].getObjectByName(objname); | ||
+ | if (obj) { | ||
+ | obj.visible = bool; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function toggleObjectTypeVisibility(event){ | ||
+ | var name = event.currentTarget.name; | ||
+ | var checked = event.currentTarget.checked; | ||
+ | objectTypeVisible[name] = checked; | ||
+ | if (name == " | ||
+ | setVisibility(checked," | ||
+ | setVisibility(checked," | ||
+ | } else { | ||
+ | setVisibility(checked, | ||
+ | } | ||
+ | } | ||
+ | |||
+ | for (var i=0; i< | ||
+ | var key = sortedObjectTypeKeys[i]; | ||
+ | if (modelContains[key]) { | ||
+ | var objTypeNode = document.createElement(' | ||
+ | objTypeNode.innerHTML = objectTypeInnerHTMLs[key] + '< | ||
+ | var checkbox = document.createElement(' | ||
+ | checkbox.type = ' | ||
+ | checkbox.checked = true; | ||
+ | checkbox.name = key; | ||
+ | checkbox.onchange = toggleObjectTypeVisibility; | ||
+ | shownObjectTypesList.appendChild(checkbox); | ||
+ | shownObjectTypesList.appendChild(objTypeNode); | ||
+ | } | ||
+ | } | ||
+ | |||
+ | // ------------------------------------------------------ | ||
+ | |||
+ | function toggleObjectVisibility(event){ | ||
+ | var nr = Number(event.currentTarget.name); | ||
+ | scene.children[nr].visible = event.currentTarget.checked; | ||
+ | } | ||
+ | |||
+ | // append checkboxes for displaying or hiding objects | ||
+ | var shownObjectsList = document.getElementById(' | ||
+ | for (var i=0; i< | ||
+ | obj = scene.children[i]; | ||
+ | var objNode = document.createElement(' | ||
+ | objNode.innerHTML = obj.name + '< | ||
+ | var checkbox = document.createElement(' | ||
+ | checkbox.type = ' | ||
+ | checkbox.checked = true; | ||
+ | checkbox.name = String(i); | ||
+ | checkbox.onchange = toggleObjectVisibility; | ||
+ | shownObjectsList.appendChild(checkbox); | ||
+ | shownObjectsList.appendChild(objNode); | ||
+ | } | ||
+ | |||
+ | // ---------------------- SVG ------------------------------------------------------ | ||
+ | // --------------------------------------------------------------------------------- | ||
+ | |||
+ | function takeSvgScreenshot() { | ||
+ | if (objectTypeVisible[" | ||
+ | setVisibility(false," | ||
+ | } | ||
+ | if (objectTypeVisible[" | ||
+ | setVisibility(false," | ||
+ | } | ||
+ | svgRenderer.render(scene, | ||
+ | svgElement = XMLS.serializeToString(svgRenderer.domElement); | ||
+ | | ||
+ | if (objectTypeVisible[" | ||
+ | setVisibility(true," | ||
+ | } | ||
+ | if (objectTypeVisible[" | ||
+ | setVisibility(true," | ||
+ | } | ||
+ | |||
+ | if (document.getElementById(' | ||
+ | //show in new tab | ||
+ | var myWindow = window.open("","" | ||
+ | myWindow.document.body.innerHTML = svgElement; | ||
+ | } else{ | ||
+ | // download svg file | ||
+ | download(" | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function download(filename, | ||
+ | var element = document.createElement(' | ||
+ | element.setAttribute(' | ||
+ | element.setAttribute(' | ||
+ | |||
+ | element.style.display = ' | ||
+ | document.body.appendChild(element); | ||
+ | |||
+ | element.click(); | ||
+ | |||
+ | document.body.removeChild(element); | ||
+ | } | ||
+ | |||
+ | |||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | document.getElementById(' | ||
+ | |||
+ | |||
+ | // ------------------ SHORTCUTS -------------------------------------------- | ||
+ | // ------------------------------------------------------------------------- | ||
+ | |||
+ | /** | ||
+ | * http:// | ||
+ | * Version : 2.01.B | ||
+ | * By Binny V A | ||
+ | * License : BSD | ||
+ | */ | ||
+ | shortcut = { | ||
+ | ' | ||
+ | ' | ||
+ | //Provide a set of default options | ||
+ | var default_options = { | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | } | ||
+ | if(!opt) opt = default_options; | ||
+ | else { | ||
+ | for(var dfo in default_options) { | ||
+ | if(typeof opt[dfo] == ' | ||
+ | } | ||
+ | } | ||
+ | |||
+ | var ele = opt.target; | ||
+ | if(typeof opt.target == ' | ||
+ | var ths = this; | ||
+ | shortcut_combination = shortcut_combination.toLowerCase(); | ||
+ | |||
+ | //The function to be called at keypress | ||
+ | var func = function(e) { | ||
+ | e = e || window.event; | ||
+ | |||
+ | if(opt[' | ||
+ | var element; | ||
+ | if(e.target) element=e.target; | ||
+ | else if(e.srcElement) element=e.srcElement; | ||
+ | if(element.nodeType==3) element=element.parentNode; | ||
+ | |||
+ | if(element.tagName == ' | ||
+ | } | ||
+ | |||
+ | //Find Which key is pressed | ||
+ | if (e.keyCode) code = e.keyCode; | ||
+ | else if (e.which) code = e.which; | ||
+ | var character = String.fromCharCode(code).toLowerCase(); | ||
+ | |||
+ | if(code == 188) character=","; | ||
+ | if(code == 190) character=" | ||
+ | |||
+ | var keys = shortcut_combination.split(" | ||
+ | //Key Pressed - counts the number of valid keypresses - if it is same as the number of keys, the shortcut function is invoked | ||
+ | var kp = 0; | ||
+ | |||
+ | //Work around for stupid Shift key bug created by using lowercase - as a result the shift+num combination was broken | ||
+ | var shift_nums = { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | ";":":", | ||
+ | "'":" | ||
+ | ",":"<", | ||
+ | " | ||
+ | "/":"?", | ||
+ | " | ||
+ | } | ||
+ | // | ||
+ | var special_keys = { | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | } | ||
+ | |||
+ | var modifiers = { | ||
+ | shift: { wanted: | ||
+ | ctrl : { wanted: | ||
+ | alt | ||
+ | meta : { wanted: | ||
+ | }; | ||
+ | | ||
+ | if(e.ctrlKey) modifiers.ctrl.pressed = true; | ||
+ | if(e.shiftKey) modifiers.shift.pressed = true; | ||
+ | if(e.altKey) modifiers.alt.pressed = true; | ||
+ | if(e.metaKey) | ||
+ | | ||
+ | for(var i=0; k=keys[i], | ||
+ | // | ||
+ | if(k == ' | ||
+ | kp++; | ||
+ | modifiers.ctrl.wanted = true; | ||
+ | |||
+ | } else if(k == ' | ||
+ | kp++; | ||
+ | modifiers.shift.wanted = true; | ||
+ | |||
+ | } else if(k == ' | ||
+ | kp++; | ||
+ | modifiers.alt.wanted = true; | ||
+ | } else if(k == ' | ||
+ | kp++; | ||
+ | modifiers.meta.wanted = true; | ||
+ | } else if(k.length > 1) { //If it is a special key | ||
+ | if(special_keys[k] == code) kp++; | ||
+ | |||
+ | } else if(opt[' | ||
+ | if(opt[' | ||
+ | |||
+ | } else { //The special keys did not match | ||
+ | if(character == k) kp++; | ||
+ | else { | ||
+ | if(shift_nums[character] && e.shiftKey) { //Stupid Shift key bug created by using lowercase | ||
+ | character = shift_nums[character]; | ||
+ | if(character == k) kp++; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | if(kp == keys.length && | ||
+ | modifiers.ctrl.pressed == modifiers.ctrl.wanted && | ||
+ | modifiers.shift.pressed == modifiers.shift.wanted && | ||
+ | modifiers.alt.pressed == modifiers.alt.wanted && | ||
+ | modifiers.meta.pressed == modifiers.meta.wanted) { | ||
+ | callback(e); | ||
+ | |||
+ | if(!opt[' | ||
+ | // | ||
+ | e.cancelBubble = true; | ||
+ | e.returnValue = false; | ||
+ | |||
+ | // | ||
+ | if (e.stopPropagation) { | ||
+ | e.stopPropagation(); | ||
+ | e.preventDefault(); | ||
+ | } | ||
+ | return false; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | this.all_shortcuts[shortcut_combination] = { | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | }; | ||
+ | //Attach the function with the event | ||
+ | if(ele.addEventListener) ele.addEventListener(opt[' | ||
+ | else if(ele.attachEvent) ele.attachEvent(' | ||
+ | else ele[' | ||
+ | }, | ||
+ | |||
+ | //Remove the shortcut - just specify the shortcut and I will remove the binding | ||
+ | ' | ||
+ | shortcut_combination = shortcut_combination.toLowerCase(); | ||
+ | var binding = this.all_shortcuts[shortcut_combination]; | ||
+ | delete(this.all_shortcuts[shortcut_combination]) | ||
+ | if(!binding) return; | ||
+ | var type = binding[' | ||
+ | var ele = binding[' | ||
+ | var callback = binding[' | ||
+ | |||
+ | if(ele.detachEvent) ele.detachEvent(' | ||
+ | else if(ele.removeEventListener) ele.removeEventListener(type, | ||
+ | else ele[' | ||
+ | } | ||
+ | } | ||
+ | |||
+ | shortcut.add(" | ||
+ | var event = new Event(' | ||
+ | if (settingsShown){ | ||
+ | document.getElementById(' | ||
+ | } else { | ||
+ | document.getElementById(' | ||
+ | } | ||
+ | }); | ||
+ | |||
+ | |||
+ | // COMMON_CODE_BLOCK_END | ||
+ | |||
+ | });}); | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||