MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / getToFloatConverter

Function getToFloatConverter

source/MRMesh/MRPrecisePredicates3.cpp:386–400  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

384}
385
386ConvertToFloatVector 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
402std::optional<Vector3i> findTwoSegmentsIntersection( const Vector3i& ai, const Vector3i& bi, const Vector3i& ci, const Vector3i& di )
403{

Callers 4

selfBooleanFunction · 0.85
rayMeshIntersectAll_Function · 0.85
getVectorConvertersFunction · 0.85
precisePredicatesFunction · 0.85

Calls 3

maxFunction · 0.85
centerMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected