NVIDIAGameWorks / NVIDIAGameWorks/kaolin
Bugs in ops.mesh.check_sign() triggered under special circumstances
Open
@Caenorst is already working on this.
Since May 18, 2022.
no-issue-activity
- Dominant language
- Python
- Stars
- 5.2k
- Forks
- 629
- Avg merge
- 53m
- Merged PRs (30d)
- 2
Description
Bugs in ops.mesh.check_sign() triggered under special circumstances
We found that if a point is in a sepcific axis, the check_sign is invalid for some primitive meshes.
from kaolin.ops.mesh import check_sign, index_vertices_by_faces
import trimesh as tm
import torch
# we test the check_sign function
x_points = torch.Tensor([[[1, 0, 0]]])
y_points = torch.Tensor([[[0, 1, 0]]])
z_points = torch.Tensor([[[0, 0, 1]]])
# e.g. When the test primitive is Sphere, check_sign is incorrect on x/y-axis
sphere_mesh = tm.primitives.Sphere(radius=2.0, subdivision=3)
points = z_points
print(f'trimesh contains() result: {sphere_mesh.contains(points.squeeze(0))}')
print(f'check_sign() result: {check_sign(torch.Tensor(sphere_mesh.vertices).unsqueeze(0), torch.Tensor(sphere_mesh.faces).long(), points)}')
Note that the cast a ray from the point is a really smart idea, and it is valid for most of points in our test, we don't know if this is an imperfection in the implementation.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.