MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / validate_normals

Method validate_normals

src/IO/STLParser.cpp:363–378  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

361}
362
363void STLParser::validate_normals() {
364 const Float EPS = 1e-16;
365 bool valid = true;
366 for (NormalList::iterator itr = m_facet_normals.begin();
367 itr != m_facet_normals.end(); itr++) {
368 Float n_norm = itr->norm();
369 if (n_norm < 1.0 - EPS || n_norm > 1.0 + EPS) {
370 valid = false;
371 break;
372 }
373 }
374
375 if (!valid) {
376 m_facet_normals.clear();
377 }
378}
379
380bool STLParser::has_normal() const {
381 return !m_facet_normals.empty();

Callers

nothing calls this directly

Calls 4

normMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected