Skip to content

Commit

Permalink
Updating faces instead of vertices
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardramon committed Dec 24, 2020
1 parent 82b6de6 commit 3242df6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion code/evaluation/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def evaluate(**kwargs):
cams_transformation[:3,:3] = c_opt * R_opt
cams_transformation[:3,3] = t_opt

mesh = plt.get_surface_high_res_mesh(
mesh = plt.get_surface_mesh(
sdf=lambda x: model.geometry_network(x)[:, 0],
resolution=kwargs['resolution']
)
Expand Down
5 changes: 3 additions & 2 deletions code/utils/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,9 @@ def get_surface_mesh(sdf, resolution=100, sphere_radius=1.):
mesh = components[areas.argmax()]

if sphere_radius:
keep_vertices_idx = np.linalg.norm(mesh.vertices, axis=-1) < sphere_radius
mesh.update_vertices(keep_vertices_idx)
vertices_mask = np.linalg.norm(mesh.vertices, axis=-1) < sphere_radius
faces_mask = vertices_mask[mesh.faces].all(axis=1)
mesh.update_faces(faces_mask)

return mesh

Expand Down

0 comments on commit 3242df6

Please sign in to comment.