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

Method init_boundary_vertex_normals

tools/Assembler/Mesh/TriangleMesh.cpp:290–307  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

288}
289
290void TriangleMesh::init_boundary_vertex_normals() {
291 const size_t dim = getDim();
292 const size_t num_bd_vertices = getNbrBoundaryNodes();
293 m_boundary_vertex_normals.resize(num_bd_vertices, 3);
294 for (size_t bvi=0; bvi<num_bd_vertices; bvi++) {
295 VectorI adj_edges = getBoundaryNodeAdjacentBoundaryFaces(bvi);
296 VectorF normal = VectorF::Zero(3);
297 const size_t num_adj_edges = adj_edges.size();
298 for (size_t j=0; j<num_adj_edges; j++) {
299 size_t bej = adj_edges[j];
300 VectorF edge_normal = getBoundaryFaceNormal(bej);
301 Float edge_len = getBoundaryFaceArea(bej);
302 normal += edge_normal * edge_len;
303 }
304 normal.normalize();
305 m_boundary_vertex_normals.row(bvi) = normal;
306 }
307}
308

Callers

nothing calls this directly

Calls 2

normalizeMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected