Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix Major bug 1
  • Loading branch information
JimmyBoivie authored and JimmyBoivie committed Dec 7, 2015
1 parent 1445a49 commit 6f52c01
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
1 change: 1 addition & 0 deletions main/CompGeo.pde
Expand Up @@ -3,6 +3,7 @@ public static class CompGeo {
public static int CCW(Point a, Point b, Point c) {
// Return 1 if turn abc is ccw -1 if turn abc is cw 0 if no turn
float f = (b.getX() - a.getX())*(c.getY() - a.getY()) - (c.getX() - a.getX())*(b.getY()-a.getY());

if (f < 0) { return 1; }
if (f > 0) { return -1; }
return 0;
Expand Down
8 changes: 4 additions & 4 deletions main/HalfEdge.pde
Expand Up @@ -274,10 +274,10 @@ public class HalfEdge {

private boolean intersectsEventually(Point p, Point q) {
boolean shared = false;
if (this.getOrigin().equals(p)) { shared = true; }
if (this.getOrigin().equals(q)) { shared = true; }
if (this.gettwin().getOrigin().equals(p)) { shared = true; }
if (this.gettwin().getOrigin().equals(q)) { shared = true; }
if (this.getOrigin() == p) { shared = true; }
if (this.getOrigin() == q) { shared = true; }
if (this.gettwin().getOrigin() == p) { shared = true; }
if (this.gettwin().getOrigin() == q) { shared = true; }
if (shared == false) {
if (CompGeo.intersect(p, q, this.getOrigin(), this.gettwin().getOrigin()) == 1) {
return true;
Expand Down
4 changes: 0 additions & 4 deletions main/Point.pde
Expand Up @@ -30,10 +30,6 @@ public class Point {
ref = h;
}

public boolean equals(float a, float b) {
return ((a == x) && (b == y));
}

public ArrayList<HalfEdge> getLeaving() {
if (ref == null) { return null; }
return ref.getAllLeaving();
Expand Down
4 changes: 2 additions & 2 deletions main/main.pde
Expand Up @@ -13,7 +13,7 @@ public void setup() {
background(255);
fill(0,0);
translate(width/2, height/2);
Point p1 = new Point(300, 300);
/*Point p1 = new Point(300, 300);
list.addPoint(p1);
Point p2 = new Point(400, 350);
list.addPoint(p2);
Expand Down Expand Up @@ -63,7 +63,7 @@ public void setup() {
HalfEdge h14 = new HalfEdge(p8, p15);
HalfEdge h15 = new HalfEdge(p9, p15);
HalfEdge h16 = new HalfEdge(p16, p17);

*/
//h1.printFace();
//float f = CompGeo.signedArea(h1.gettwin());
//float f2 = CompGeo.signedArea(h1);
Expand Down

0 comments on commit 6f52c01

Please sign in to comment.