Cut edge with plane. Return true and set weight to fraction between edge-start and edge-end
| 78 | // Cut edge with plane. Return true and set weight to fraction between |
| 79 | // edge-start and edge-end |
| 80 | bool Foam::geomCellLooper::cutEdge |
| 81 | ( |
| 82 | const plane& cutPlane, |
| 83 | const label edgeI, |
| 84 | scalar& weight |
| 85 | ) const |
| 86 | { |
| 87 | const pointField& pts = mesh().points(); |
| 88 | |
| 89 | const edge& e = mesh().edges()[edgeI]; |
| 90 | |
| 91 | scalar s = cutPlane.normalIntersect(pts[e.start()], e.vec(pts)); |
| 92 | |
| 93 | if ((s > -pointEqualTol_) && (s < 1 + pointEqualTol_)) |
| 94 | { |
| 95 | weight = s; |
| 96 | |
| 97 | return true; |
| 98 | } |
| 99 | else |
| 100 | { |
| 101 | // Make sure we don't use this value |
| 102 | weight = -GREAT; |
| 103 | |
| 104 | return false; |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | |
| 109 | // If edge close enough to endpoint snap to endpoint. |