Commit 9c3ca2b7 authored by amandaghassaei's avatar amandaghassaei
Browse files

small changes

parent c4e9f0b8
This diff is collapsed.
......@@ -440,6 +440,7 @@
<li><a href="#" class="demo" data-url="Tessellations/waterbombTwist.svg">Waterbomb (eight-crease base)</a></li>
<li><a href="#" class="demo" data-url="Tessellations/reschtritessellation.svg">Resch Triangle Tessellation</a></li>
<li><a href="#" class="demo" data-url="Tessellations/reschbarbell.svg">Resch Barbell Tessellation</a></li>
<li><a href="#" class="demo" data-url="Tessellations/honeycomb_333_cp.svg">Lang Honeycomb Tessellation</a></li>
<li><a href="#" class="demo" data-url="Tessellations/oval_tessellation_cp.svg">Lang Oval Tessellation</a></li>
</ul>
</li>
......@@ -457,7 +458,6 @@
<ul class="dropdown-menu">
<li><a href="#" class="demo" data-url="Origami/hypar.svg">Hypar</a></li>
<li><a href="#" class="demo" data-url="Tessellations/hyperbolic_limit_cp.svg">Lang Hyperbolic Limit</a></li>
<li><a href="#" class="demo" data-url="Tessellations/honeycomb_333_cp.svg">Lang Honeycomb Tessellation</a></li>
<li><a href="#" class="demo" data-url="Tessellations/wedged_double_faced.svg">Lang Wedged Double Faced Tessellation</a></li>
<li><a href="#" class="demo" data-url="Tessellations/rattanweaveLang.svg">Lang Rattan Weave</a></li>
</ul>
......
......@@ -215,8 +215,9 @@ function initModel(globals){
var _creases = [];
for (var i=0;i<allCreaseParams.length;i++) {//allCreaseParams.length
var creaseParams = allCreaseParams[i];//face1Ind, vertInd, face2Ind, ver2Ind, edgeInd, angle
var creaseParams = allCreaseParams[i];//face1Ind, vert1Ind, face2Ind, ver2Ind, edgeInd, angle
var type = creaseParams[5]!=0 ? 1:0;
//edge, face1Index, face2Index, targetTheta, type, node1, node2, index
_creases.push(new Crease(_edges[creaseParams[4]], creaseParams[0], creaseParams[2], creaseParams[5], type, _nodes[creaseParams[1]], _nodes[creaseParams[3]], _creases.length));
}
......
......@@ -205,6 +205,14 @@ function initPattern(globals){
mergeVertices();
var nullEdges = 0;
nullEdges += removeNullEdges(outlines);
nullEdges += removeNullEdges(mountains);
nullEdges += removeNullEdges(valleys);
nullEdges += removeNullEdges(cuts);
nullEdges += removeNullEdges(triangulations);
if (nullEdges>0) console.warn(nullEdges + " null edges removed");
//remove duplicates for each set of edges
var duplicates = 0;
duplicates += removeDuplicates(outlines, outlines);
......@@ -233,6 +241,18 @@ function initPattern(globals){
globals.model.buildModel(faces, vertices, allEdges, allCreaseParams);
}
function removeNullEdges(allEdges){
var num = 0;
for (var i=allEdges.length-1;i>=0;i--){
var edge = allEdges[i];
if (edge[0]==edge[1]){
allEdges.splice(i, 1);
num++;
}
}
return num;
}
function removeRedundantVertices(set){
// console.log(JSON.stringify(set));
var badVertices = [];
......@@ -312,7 +332,9 @@ function initPattern(globals){
for (var j=i-1;j>=0;j--){
var edge1 = set1[i];
var edge2 = set2[j];
if (edge2.indexOf(edge1[0]) >= 0 && edge2.indexOf(edge1[1]) >= 0){
if ((edge2[0] == edge1[0] || edge2[0] == edge1[1]) && (edge2[1] == edge1[0] || edge2[1] == edge1[1])){
console.log(edge1);
console.log(edge2);
set2.splice(j, 1);
if (set2 == set1) i--;
j--;
......
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