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

Function normal

source/MRMesh/MRMeshMath.cpp:493–508  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

491}
492
493Vector3f normal( const MeshTopology & topology, const VertCoords & points, const MeshTriPoint & p )
494{
495 if ( p.bary.b == 0 )
496 {
497 // do not require to have triangular face to the left of p.e
498 const Vector3f n0 = normal( topology, points, topology.org( p.e ) );
499 const Vector3f n1 = normal( topology, points, topology.dest( p.e ) );
500 return lerp( n0, n1, p.bary.a ).normalized();
501 }
502 VertId a, b, c;
503 topology.getLeftTriVerts( p.e, a, b, c );
504 auto n0 = normal( topology, points, a );
505 auto n1 = normal( topology, points, b );
506 auto n2 = normal( topology, points, c );
507 return p.bary.interpolate( n0, n1, n2 ).normalized();
508}
509
510Vector3f pseudonormal( const MeshTopology & topology, const VertCoords & points, VertId v, const FaceBitSet * region )
511{

Callers 1

pseudonormalFunction · 0.70

Calls 6

lerpFunction · 0.85
orgMethod · 0.45
destMethod · 0.45
normalizedMethod · 0.45
getLeftTriVertsMethod · 0.45
interpolateMethod · 0.45

Tested by

no test coverage detected