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

Method compute_importance_level

tools/Wires/Misc/MeshCleaner.cpp:26–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24}
25
26VectorI MeshCleaner::compute_importance_level(const MatrixFr& vertices) {
27 VectorF bbox_min = vertices.colwise().minCoeff();
28 VectorF bbox_max = vertices.colwise().maxCoeff();
29 BoxChecker checker(bbox_min, bbox_max);
30
31 const size_t num_vertices = vertices.rows();
32 VectorI level = VectorI::Zero(num_vertices);
33 for (size_t i=0; i<num_vertices; i++) {
34 const VectorF& v = vertices.row(i);
35 if (checker.is_on_boundary_corners(v)) {
36 level[i] = 3;
37 } else if (checker.is_on_boundary_edges(v)) {
38 level[i] = 2;
39 } else if (checker.is_on_boundary(v)) {
40 level[i] = 1;
41 }
42 }
43
44 return level;
45}
46
47void MeshCleaner::remove_duplicated_vertices(
48 MatrixFr& vertices, MatrixIr& faces, Float tol) {

Callers

nothing calls this directly

Calls 3

is_on_boundary_edgesMethod · 0.80
is_on_boundaryMethod · 0.80

Tested by

no test coverage detected