Commit 593c6cb3 authored by amandaghassaei's avatar amandaghassaei
Browse files

small fixes

parent c1145bb4
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -3,18 +3,18 @@
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="2261.271px" height="2084px" viewBox="0 0 2261.271 2084" enable-background="new 0 0 2261.271 2084" xml:space="preserve">
<path opacity="0.5" fill="none" stroke="#FF0000" stroke-width="4.3568" stroke-miterlimit="10" d="M135.014,48.805v1026.698
M189.019,48.805v1026.698 M243.024,48.805v1026.698 M297.03,48.805v1026.698 M351.035,48.805v1026.698 M405.041,48.805v1026.698
M459.046,48.805v1026.698 M513.051,48.805v1026.698 M567.057,48.805v1026.698 M621.062,48.805v1026.698 M675.066,48.805v1026.698
M729.073,48.805v1026.698 M783.078,48.805v1026.698 M837.083,48.805v1026.698 M891.089,48.805v1026.698 M945.094,48.805v1026.698
M999.1,48.805v1026.698 M1053.105,48.805v1026.698 M1107.111,48.805v1026.698 M1161.117,48.805v1026.698 M81.008,1020.908h1134.084
M81.008,966.902h1134.084 M81.008,912.896h1134.084 M81.008,858.893h1134.084 M81.008,804.887h1134.084 M81.008,750.881h1134.084
M81.008,696.875h1134.084 M81.008,642.869h1134.084 M81.008,588.863h1134.084 M81.008,534.857h1134.084 M81.008,480.852h1134.084
M81.008,426.846h1134.084 M81.008,372.84h1134.084 M81.008,318.834h1134.084 M81.008,264.828h1134.084 M81.008,210.822h1134.084
M81.008,156.816h1134.084 M81.008,102.811h1134.084"/>
<path opacity="0.5" fill="none" stroke="#0000FF" stroke-width="4.3568" stroke-miterlimit="10" enable-background="new " d="
M135.014,48.805v1026.698 M189.019,48.805v1026.698 M243.024,48.805v1026.698 M297.03,48.805v1026.698 M351.035,48.805v1026.698
M405.041,48.805v1026.698 M459.046,48.805v1026.698 M513.051,48.805v1026.698 M567.057,48.805v1026.698 M621.062,48.805v1026.698
M675.066,48.805v1026.698 M729.073,48.805v1026.698 M783.078,48.805v1026.698 M837.083,48.805v1026.698 M891.089,48.805v1026.698
M945.094,48.805v1026.698 M999.1,48.805v1026.698 M1053.105,48.805v1026.698 M1107.111,48.805v1026.698 M1161.117,48.805v1026.698
M81.008,1020.908h1134.084 M81.008,966.902h1134.084 M81.008,912.896h1134.084 M81.008,858.893h1134.084 M81.008,804.887h1134.084
M81.008,750.881h1134.084 M81.008,696.875h1134.084 M81.008,642.869h1134.084 M81.008,588.863h1134.084 M81.008,534.857h1134.084
M81.008,480.852h1134.084 M81.008,426.846h1134.084 M81.008,372.84h1134.084 M81.008,318.834h1134.084 M81.008,264.828h1134.084
M81.008,210.822h1134.084 M81.008,156.816h1134.084 M81.008,102.811h1134.084"/>
<path fill="none" stroke="#000000" stroke-width="4.3568" stroke-miterlimit="10" d="M81.008,48.805v1026.111 M1215.121,48.805
v1026.111 M81.008,1074.916h1134.113 M81.008,48.805h1134.113"/>
<path fill="none" stroke="#0000FF" stroke-width="4.3568" stroke-miterlimit="10" d="M81.008,48.805l108.011,108.012
<path fill="none" stroke="#FF0000" stroke-width="4.3568" stroke-miterlimit="10" d="M81.008,48.805l108.011,108.012
M81.008,156.816L189.019,48.805 M243.024,48.805l-54.005,54.006 M297.03,102.811l-54.005-54.006 M351.035,210.822L243.024,102.811
M351.035,102.811L243.024,210.822 M351.035,156.816L459.046,48.805 M351.035,48.805l108.011,108.012 M135.014,156.816
l108.011,108.012 M243.024,156.816l-108.01,108.012 M135.014,210.822l-54.006,54.006 M81.008,264.828l54.006,54.006
......@@ -42,26 +42,26 @@
M1215.121,210.822l-108.012,108.012 M1161.115,318.834l53.977,54.006 M1215.092,372.84l-53.977,54.006 M1161.115,372.84
l-108.01,108.012 M1161.115,480.852l-108.01-108.012 M189.019,318.834L81.008,426.846 M189.019,426.846L81.008,318.834
M135.011,480.852l-54.006,54.006 M135.011,588.863l-54.006-54.006 M189.016,534.857l108.011,108.012 M297.027,534.857
L189.016,642.869 M297.027,480.852l108.011,108.016 M405.038,480.852L297.027,588.863 M351.032,588.863l108.011,108.012
L189.016,642.869 M297.027,480.852l108.011,108.017 M405.038,480.852L297.027,588.863 M351.032,588.863l108.011,108.012
M459.043,588.863L351.032,696.875 M351.032,642.869L243.021,750.881 M243.021,642.869l108.011,108.012 M459.043,534.857
l108.011,108.012 M567.054,534.857L459.043,642.869 M567.054,480.852l108.011,108.016 M675.064,480.852L567.054,588.863
l108.011,108.012 M567.054,534.857L459.043,642.869 M567.054,480.852l108.011,108.017 M675.064,480.852L567.054,588.863
M621.059,588.863L729.07,696.875 M621.059,696.875L729.07,588.863 M621.059,642.869L513.048,750.881 M513.048,642.869
l108.011,108.012 M729.07,534.857l108.011,108.012 M837.081,534.857L729.07,642.869 M837.081,480.852l108.01,108.016
M945.091,480.852l-108.01,108.016 M891.086,588.863l108.011,108.012 M891.086,696.875l108.011-108.012 M891.086,642.869
l108.011,108.012 M729.07,534.857l108.011,108.012 M837.081,534.857L729.07,642.869 M837.081,480.852l108.01,108.017
M945.091,480.852l-108.01,108.017 M891.086,588.863l108.011,108.012 M891.086,696.875l108.011-108.012 M891.086,642.869
L783.075,750.881 M783.075,642.869l108.011,108.012 M999.097,534.857l108.011,108.012 M1107.107,534.857L999.097,642.869
M1107.107,480.852l108.011,108.016 M1215.118,480.852l-108.011,108.016 M1161.112,588.863l53.979,54.006 M1215.092,642.869
M1107.107,480.852l108.011,108.017 M1215.118,480.852l-108.011,108.017 M1161.112,588.863l53.979,54.006 M1215.092,642.869
l-53.979,54.006 M1161.112,642.869l-108.011,108.012 M1161.112,750.881l-108.011-108.012 M189.016,588.863L81.005,696.875
M81.005,588.863l108.011,108.012 M135.008,750.881l-54.006,54.006 M81.002,804.887l54.006,54.006 M189.013,804.887l108.011,108.012
M297.024,804.887L189.013,912.898 M297.024,750.881l108.011,108.012 M405.035,750.881L297.024,858.893 M351.029,858.893
L459.04,966.904 M459.04,858.893L351.029,966.904 M351.029,912.898l-108.01,108.012 M243.019,912.898L351.03,1020.91
M459.04,804.887l108.011,108.012 M567.051,804.887L459.04,912.898 M567.051,750.881l108.012,108.012 M675.062,750.881
L567.051,858.893 M621.056,858.893l108.011,108.016 M621.056,966.904l108.011-108.012 M621.056,912.898L513.045,1020.91
L567.051,858.893 M621.056,858.893l108.011,108.017 M621.056,966.904l108.011-108.012 M621.056,912.898L513.045,1020.91
M513.045,912.898l108.011,108.012 M729.066,804.887l108.012,108.012 M837.078,804.887L729.066,912.898 M837.078,750.881
l108.01,108.012 M945.088,750.881l-108.01,108.012 M891.083,858.893l108.011,108.016 M891.083,966.904l108.011-108.012
l108.01,108.012 M945.088,750.881l-108.01,108.012 M891.083,858.893l108.011,108.017 M891.083,966.904l108.011-108.012
M891.083,912.898L783.072,1020.91 M783.072,912.898l108.011,108.012 M999.094,804.887l108.012,108.012 M1107.104,804.887
l-108.01,108.012 M1107.104,750.881l108.015,108.012 M1215.115,750.881l-108.012,108.012 M1215.092,912.896l-53.982-54.004
l-108.01,108.012 M1107.104,750.881l108.016,108.012 M1215.115,750.881l-108.012,108.012 M1215.092,912.896l-53.982-54.004
M1215.092,912.896l-53.982,54.011 M1161.109,912.898L1053.1,1020.91 M1161.109,1020.91L1053.1,912.898 M189.013,858.893
L81.002,966.904 M81.002,858.893l108.011,108.016 M80.999,1074.916l54.006-54.006 M297.021,1020.91l54.014,54.593 M405.032,1020.91
L81.002,966.904 M81.002,858.893l108.011,108.017 M80.999,1074.916l54.006-54.006 M297.021,1020.91l54.014,54.593 M405.032,1020.91
l-53.997,54.593 M567.048,1020.91l54.015,54.593 M621.062,1075.503l53.996-54.593 M837.075,1020.91l54.014,54.593 M945.085,1020.91
l-53.996,54.593 M1107.102,1020.91l54.017,54.593 M1215.112,1020.91l-53.995,54.593"/>
l-53.996,54.593 M1107.102,1020.91l54.018,54.593 M1215.112,1020.91l-53.995,54.593"/>
</svg>
......@@ -6,21 +6,13 @@
function initModel(globals){
var geometry = new THREE.BufferGeometry();
geometry.dynamic = true;
var geometry = new THREE.Geometry();
var lineGeometries = [geometry, geometry, geometry, geometry, geometry];
var material, material2;
var frontside = new THREE.Mesh(geometry);//front face of mesh
var backside = new THREE.Mesh(geometry);//back face of mesh (different color)
backside.visible = false;
setMeshMaterial();
var lineGeometries = [];
for (var i=0;i<5;i++){
var lineGeometry = new THREE.BufferGeometry();
lineGeometry.dynamic = true;
lineGeometries.push(lineGeometry);
}
var lineMaterial = new THREE.LineBasicMaterial({color: 0x000000, linewidth: 1});
var hingeLines = new THREE.LineSegments(lineGeometries[0], lineMaterial);
......@@ -28,6 +20,32 @@ function initModel(globals){
var valleyLines = new THREE.LineSegments(lineGeometries[2], lineMaterial);
var cutLines = new THREE.LineSegments(lineGeometries[3], lineMaterial);
var facetLines = new THREE.LineSegments(lineGeometries[4], lineMaterial);
clearGeometries();
setMeshMaterial();
function clearGeometries(){
if (geometry) geometry.dispose();
geometry = new THREE.BufferGeometry();
geometry.dynamic = true;
frontside.geometry = geometry;
backside.geometry = geometry;
for (var i=0;i<lineGeometries.length;i++){
if (lineGeometries[i]) lineGeometries[i].dispose();
var lineGeometry = new THREE.BufferGeometry();
lineGeometry.dynamic = true;
lineGeometries[i] = lineGeometry;
}
hingeLines.geometry = lineGeometries[0];
mountainLines.geometry = lineGeometries[1];
valleyLines.geometry = lineGeometries[2];
cutLines.geometry = lineGeometries[3];
facetLines.geometry = lineGeometries[4];
}
var allTypes;//place to store line types
// var borderLines = new THREE.LineSegments(geometry);
......@@ -270,6 +288,9 @@ function initModel(globals){
}
var positionsAttribute = new THREE.BufferAttribute(positions, 3);
clearGeometries();
geometry.addAttribute('position', positionsAttribute);
geometry.addAttribute('color', new THREE.BufferAttribute(colors, 3));
geometry.setIndex(new THREE.BufferAttribute(indices, 1));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment