diff --git a/main/PointList.pde b/main/PointList.pde index 3001f6f..c8e765f 100644 --- a/main/PointList.pde +++ b/main/PointList.pde @@ -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 structures = getAllStructures(); int num = structures.size();