Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Get half edge from two points
  • Loading branch information
JimmyBoivie authored and JimmyBoivie committed Dec 7, 2015
1 parent 8f54553 commit a88442a
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions main/PointList.pde
Expand Up @@ -51,6 +51,25 @@ public class PointList {
return struct;
}

public HalfEdge getHalfEdge(Point p, Point q) {
int num = points.size();
int id = -1;
for (int i = 0; i < num; i++) {
if (p.equals(points.get(i))) {
id = i;
}
}
HalfEdge first = p.getRef();
if (first == null) { return null; }
HalfEdge temp = first.gettwin().getnext();
while (temp != first) {
if (temp.gettwin().getOrigin().equals(q)) {
return temp;
}
}
return null;
}

public boolean intersectsSomething(Point p, Point q) {
ArrayList<HalfEdge> structures = getAllStructures();
int num = structures.size();
Expand Down

0 comments on commit a88442a

Please sign in to comment.