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

Function getComponent

source/MRMesh/MRMeshComponents.cpp:42–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42FaceBitSet getComponent( const MeshPart& meshPart, FaceId id, FaceIncidence incidence, const UndirectedEdgeBitSet * isCompBd )
43{
44 MR_TIMER;
45 auto unionFindStruct = getUnionFindStructureFaces( meshPart, incidence, isCompBd );
46 const FaceBitSet& region = meshPart.mesh.topology.getFaceIds( meshPart.region );
47
48 int faceRoot = unionFindStruct.find( id );
49 const auto& allRoots = unionFindStruct.roots();
50 FaceBitSet res;
51 res.resize( allRoots.size() );
52 for ( auto f : region )
53 {
54 if ( allRoots[f] == faceRoot )
55 res.set( f );
56 }
57 return res;
58}
59
60VertBitSet getComponentVerts( const Mesh& mesh, VertId id, const VertBitSet* region /*= nullptr */ )
61{

Callers 1

EMSCRIPTEN_BINDINGSFunction · 0.50

Calls 5

findMethod · 0.45
resizeMethod · 0.45
sizeMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected