Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "face_normals incorrect shape" warning #19

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions code/utils/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def get_surface_trace(path, epoch, sdf, resolution=100, return_mesh=False):
i=I, j=J, k=K, name='implicit_surface',
opacity=1.0)]

meshexport = trimesh.Trimesh(verts, faces, normals)
meshexport = trimesh.Trimesh(verts, faces, vertex_normals=-normals)
meshexport.export('{0}/surface_{1}.ply'.format(path, epoch), 'ply')

if return_mesh:
Expand Down Expand Up @@ -168,7 +168,7 @@ def get_surface_high_res_mesh(sdf, resolution=100):

verts = verts + np.array([grid['xyz'][0][0], grid['xyz'][1][0], grid['xyz'][2][0]])

mesh_low_res = trimesh.Trimesh(verts, faces, normals)
mesh_low_res = trimesh.Trimesh(verts, faces, vertex_normals=-normals)
components = mesh_low_res.split(only_watertight=False)
areas = np.array([c.area for c in components], dtype=np.float)
mesh_low_res = components[areas.argmax()]
Expand Down Expand Up @@ -221,7 +221,7 @@ def get_surface_high_res_mesh(sdf, resolution=100):
verts.unsqueeze(-1)).squeeze()
verts = (verts + grid_points[0]).cpu().numpy()

meshexport = trimesh.Trimesh(verts, faces, normals)
meshexport = trimesh.Trimesh(verts, faces, vertex_normals=-normals)

return meshexport

Expand Down