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

Function getPointsForRefineFeature

source/MRMesh/MRFeatureRefine.cpp:96–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94}
95
96VertBitSet getPointsForRefineFeature( const PointCloud& pointCloud, const FeatureObject& feature, float distanceEps, float normalEps )
97{
98 VertBitSet detectedVerts;
99 detectedVerts.resize( pointCloud.validPoints.size() + 1, false );
100
101 const auto distanceEpsSq = distanceEps * distanceEps;
102 const auto cosNormalEps = std::cos( normalEps / 180.0f * PI_F );
103
104 BitSetParallelFor( pointCloud.validPoints, [&] ( VertId v )
105 {
106 const auto proj = feature.projectPoint( pointCloud.points[v] );
107 const auto lenSq = ( proj.point - pointCloud.points[v] ).lengthSq();
108 if ( lenSq >= distanceEpsSq )
109 return;
110
111 if ( pointCloud.hasNormals() && proj.normal )
112 {
113 const auto& worldNormal = *proj.normal;
114 if ( std::abs( dot( worldNormal, pointCloud.normals[v] ) ) < cosNormalEps )
115 return;
116 }
117
118 detectedVerts.set( v, true );
119 } );
120
121 return detectedVerts;
122}
123
124VertBitSet filterDisjointPoints( const Mesh& mesh, const VertBitSet& selectedPoints, const FaceBitSet& referenceFaces )
125{

Callers 1

refineFeatureObjectFunction · 0.85

Calls 9

BitSetParallelForFunction · 0.85
absFunction · 0.85
hasNormalsMethod · 0.80
dotFunction · 0.70
resizeMethod · 0.45
sizeMethod · 0.45
projectPointMethod · 0.45
lengthSqMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected