| 219 | } |
| 220 | |
| 221 | bool MeshAlgorithm::RayNearestField( |
| 222 | const Base::Vector3f& rclPt, |
| 223 | const Base::Vector3f& rclDir, |
| 224 | const std::vector<FacetIndex>& raulFacets, |
| 225 | Base::Vector3f& rclRes, |
| 226 | FacetIndex& rulFacet, |
| 227 | float /*fMaxAngle*/ |
| 228 | ) const |
| 229 | { |
| 230 | Base::Vector3f clProj, clRes; |
| 231 | bool bSol = false; |
| 232 | FacetIndex ulInd = 0; |
| 233 | |
| 234 | for (FacetIndex index : raulFacets) { |
| 235 | if (_rclMesh.GetFacet(index).Foraminate(rclPt, rclDir, clRes /*, fMaxAngle*/)) { |
| 236 | if (!bSol) { // first solution |
| 237 | bSol = true; |
| 238 | clProj = clRes; |
| 239 | ulInd = index; |
| 240 | } |
| 241 | else { // is closer to the point |
| 242 | if ((clRes - rclPt).Length() < (clProj - rclPt).Length()) { |
| 243 | clProj = clRes; |
| 244 | ulInd = index; |
| 245 | } |
| 246 | } |
| 247 | } |
| 248 | } |
| 249 | |
| 250 | if (bSol) { |
| 251 | rclRes = clProj; |
| 252 | rulFacet = ulInd; |
| 253 | } |
| 254 | |
| 255 | return bSol; |
| 256 | } |
| 257 | |
| 258 | bool MeshAlgorithm::FirstFacetToVertex( |
| 259 | const Base::Vector3f& rPt, |
nothing calls this directly
no test coverage detected