47 #ifndef _SUPER4PCS_UTILS_GEOMETRY_H_ 48 #define _SUPER4PCS_UTILS_GEOMETRY_H_ 50 #include "super4pcs/utils/disablewarnings.h" 56 template <
typename Po
intContainer,
typename VecContainer>
57 static inline void CleanInvalidNormals( PointContainer &v,
58 VecContainer &normals){
59 using Point =
typename PointContainer::value_type;
60 using Vector =
typename VecContainer::value_type;
61 if (v.size() == normals.size()){
62 typename PointContainer::iterator itV = v.begin();
63 typename VecContainer::iterator itN = normals.begin();
66 for( ; itV != v.end(); itV++, itN++){
68 if ((*itV).normal().squaredNorm() < 0.01){
69 (*itN) = {0., 0., 0.};
70 (*itV).set_normal({0., 0., 0.});
79 std::cout <<
"Found " << nb <<
" vertices with invalid normals" << std::endl;
87 #endif // _UTILS_GEOMETRY_H_