| 384 | } |
| 385 | |
| 386 | ConvertToFloatVector getToFloatConverter( const Box3d& box ) |
| 387 | { |
| 388 | Vector3d center{ box.center() }; |
| 389 | auto bbSize = box.size(); |
| 390 | double maxDim = std::max( { bbSize[0],bbSize[1],bbSize[2] } ); |
| 391 | |
| 392 | // range is selected so that after centering each integer point is within [-max/2; +max/2] range, |
| 393 | // so the difference of any two points will be within [-max; +max] range |
| 394 | double range = maxDim / cRangeIntMax; |
| 395 | |
| 396 | return [range, center] ( const Vector3i& v ) |
| 397 | { |
| 398 | return Vector3f( Vector3d{ v }*range + center ); |
| 399 | }; |
| 400 | } |
| 401 | |
| 402 | std::optional<Vector3i> findTwoSegmentsIntersection( const Vector3i& ai, const Vector3i& bi, const Vector3i& ci, const Vector3i& di ) |
| 403 | { |
no test coverage detected