Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix
  • Loading branch information
jrb10014 committed Dec 15, 2015
1 parent 9669476 commit 7ec1037
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions main/HalfEdge.pde
Expand Up @@ -252,8 +252,8 @@ public class HalfEdge {
}

public HalfEdge findHalfEdgeSelected(float x, float y, float distance, Point farAway) {
if (this.isSelected(x,y,distance, farAway)) { return this; }
if (counted != false) {
if (this.isSelected(x,y,distance, farAway) == true) { return this; }
if (counted == false) {
counted = true;
HalfEdge temp = twin.findHalfEdgeSelected(x,y,distance,farAway);
if (temp != null) { return temp; }
Expand All @@ -276,15 +276,17 @@ public class HalfEdge {
float ndy = dx;
float notScaled = sqrt(ndx*ndx + ndy*ndy);
float scale = notScaled/distance;
ndx = ndx/scale;
ndy = ndy/scale;
if (scale > 1) {
ndx = ndx/scale;
ndy = ndy/scale;
}
Point p2 = new Point(midx + ndx, midy + ndy);
Point p4 = new Point(midx - ndx, midy - ndy);
HalfEdge h1 = new HalfEdge(p1, p2);
HalfEdge h2 = new HalfEdge(p2, p3);
HalfEdge h3 = new HalfEdge(p3, p4);
HalfEdge h4 = new HalfEdge(p4, p1);
return CompGeo.inside(h1, new Point(x, y), farAway);
return CompGeo.inside(h1, new Point(x, y), farAway);
}

public ArrayList<HalfEdge> getAllLeaving() {
Expand All @@ -294,13 +296,13 @@ public class HalfEdge {
}
public void printFace() {
HalfEdge temp = next;
//////System.out.println("PrintFaceBegin");
//////System.out.println(origin + " " + twin.getOrigin());
//System.out.println("PrintFaceBegin");
//System.out.println(origin + " " + twin.getOrigin());
while (temp != this) {
//////System.out.println(temp.getOrigin() + " " + temp.gettwin().getOrigin());
//System.out.println(temp.getOrigin() + " " + temp.gettwin().getOrigin());
temp = temp.getnext();
}
//////System.out.println();
//System.out.println();
}

private boolean isReachable(HalfEdge h) {
Expand Down

0 comments on commit 7ec1037

Please sign in to comment.