51 scalar s = v.
perp(w) /
d;
57 else if (s >= (1-SMALL))
67 scalar t = u.
perp(w) /
d;
73 else if (t >= (1-SMALL))
79 edgePt = e.
start()+t*v;
87 scalar edge0 = e.
start() & u;
88 scalar edge1 = e.
end() & u;
89 bool edgeOrder = edge0 < edge1;
91 scalar minEdge = (edgeOrder ? edge0 : edge1);
92 scalar maxEdge = (edgeOrder ? edge1 : edge0);
96 scalar this0 = start() & u;
97 scalar this1 = end() & u;
98 bool thisOrder = this0 < this1;
100 scalar minThis =
min(this0, this1);
101 scalar maxThis =
max(this1, this0);
102 const point2D& minThisPt = (thisOrder ? start() : end());
103 const point2D& maxThisPt = (thisOrder ? end() : start());
105 if (maxEdge < minThis)
111 else if (maxEdge < maxThis)
115 thisPt = nearestDist(edgePt).rawPoint();
120 if (minEdge < minThis)
127 else if (minEdge < maxThis)
131 thisPt = nearestDist(edgePt).rawPoint();