private bool IsEdgeSideOfTriangle(Triangle triangle, TriPoint ep, TriPoint eq) { int index = triangle.EdgeIndex(ep, eq); if (index != -1) { triangle.MarkConstrainedEdge(index); Triangle t = triangle.GetNeighbor(index); if (t != null) { t.MarkConstrainedEdge(ep, eq); } return(true); } return(false); }
private Triangle NextFlipTriangle(SweepContext tcx, Winding o, Triangle t, Triangle ot, TriPoint p, TriPoint op) { int edge_index; if (o == Winding.CCW) { // ot is not crossing edge after flip edge_index = ot.EdgeIndex(p, op); ot.DelaunayEdge[edge_index] = true; Legalize(tcx, ot); ot.ClearDelaunayEdges(); return(t); } // t is not crossing edge after flip edge_index = t.EdgeIndex(p, op); t.DelaunayEdge[edge_index] = true; Legalize(tcx, t); t.ClearDelaunayEdges(); return(ot); }