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

Method addVertex

source/MRMesh/MRGridSampling.cpp:77–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77void Grid::addVertex( const Vector3f& p, VertId vid, ObjId oid )
78{
79 const auto pos = pointPos( p );
80 auto & ge = voxels_[ toVoxelId( pos ) ];
81 const auto distSq = ( p - voxelCenter( pos ) ).lengthSq();
82 if ( distSq < ge.centerDistSq )
83 {
84 ge.centerDistSq = distSq;
85 ge.vid = vid;
86 ge.oid = oid;
87 }
88}
89
90VertBitSet Grid::getSamples() const
91{

Callers 3

verticesGridSamplingFunction · 0.80
pointGridSamplingFunction · 0.80
multiModelGridSamplingFunction · 0.80

Calls 1

lengthSqMethod · 0.45

Tested by

no test coverage detected