/** * Compute the intersection point according the steepest vector. We assume that the point is in * the Triangle * * @param dPoint * @return DPoint * @throws DelaunayError */ public final DPoint getSteepestIntersectionPoint(DPoint dPoint) throws DelaunayError { if (isInside(dPoint)) { for (DEdge dEdge : edges) { if (isTopoOrientedToEdge(dEdge)) { DPoint pt = Tools.computeIntersection( dEdge.getStartPoint(), dEdge.getDirectionVector(), dPoint, getSteepestVector()); if (dEdge.contains(pt)) { return pt; } } } } return null; }
/** * Compute the intersection point according to the vector opposite to the steepest vector. If dp * is outside the triangle, we return null. * * @param dp * @return The point pt of the triangle's boundary for which (dp pt) is colinear to the steepest * vector. * @throws DelaunayError */ public final DPoint getCounterSteepestIntersection(DPoint dp) throws DelaunayError { if (isInside(dp) || isOnAnEdge(dp)) { for (DEdge ed : edges) { if (!isTopoOrientedToEdge(ed)) { DPoint counterSteep = getSteepestVector(); counterSteep.setX(-counterSteep.getX()); counterSteep.setY(-counterSteep.getY()); counterSteep.setZ(-counterSteep.getZ()); DPoint pt = Tools.computeIntersection( ed.getStartPoint(), ed.getDirectionVector(), dp, counterSteep); if (ed.contains(pt)) { return pt; } } } } return null; }