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

Bizarre Surface Slice With Cube #6

Closed
dcolli23 opened this issue Sep 1, 2023 · 2 comments
Closed

Bizarre Surface Slice With Cube #6

dcolli23 opened this issue Sep 1, 2023 · 2 comments

Comments

@dcolli23
Copy link

dcolli23 commented Sep 1, 2023

Description

Hello, I was getting some weird results for some tests I'm doing with CDCPD and I've found that I'm getting a strange SDF surface with pytorch_volumetric. The surface seems to jut out of the expected surface.

The mesh is a cube mesh with center at (0, 0, 0), moved to (3.51, 0, 0) with the pytorch_volumetric visualization frame. The cube mesh has side length of 0.2.

This shows the strange jut of surface.

pytorch_volumetric_weird_results

And a zoomed view.

pytorch_volumetric_weird_results_zoomed

Am I doing something wrong that may cause this?

To Reproduce

Script To Reproduce:

import pytorch_volumetric as pv
import numpy as np
import matplotlib.pyplot as plt
import open3d as o3d

CUBE_OBJ_FILEPATH = "./src/cdcpd_torch/tests/data/cube.obj"

# Visualize with Open3D
m_o3d = o3d.io.read_triangle_mesh(CUBE_OBJ_FILEPATH)
o3d.visualization.draw_geometries([m_o3d])

# Visualize with pytorch_volumetric
obj = pv.MeshObjectFactory(CUBE_OBJ_FILEPATH, vis_frame_pos=(3.51, 0, 0))
sdf = pv.MeshSDF(obj)

query_range = np.array([
    [3.0, 4.0],
    [-0.5, 0.5],
    [0.0, 0.0]
])
pv.draw_sdf_slice(sdf, query_range)
plt.show()

And The Cube Mesh:

# Blender 3.5.0
# www.blender.org
mtllib cube.mtl
o Cube
v 0.100000 0.100000 -0.100000
v 0.100000 -0.100000 -0.100000
v 0.100000 0.100000 0.100000
v 0.100000 -0.100000 0.100000
v -0.100000 0.100000 -0.100000
v -0.100000 -0.100000 -0.100000
v -0.100000 0.100000 0.100000
v -0.100000 -0.100000 0.100000
vn -0.0000 1.0000 -0.0000
vn -0.0000 -0.0000 1.0000
vn -1.0000 -0.0000 -0.0000
vn -0.0000 -1.0000 -0.0000
vn 1.0000 -0.0000 -0.0000
vn -0.0000 -0.0000 -1.0000
vt 0.625000 0.500000
vt 0.375000 0.500000
vt 0.625000 0.750000
vt 0.375000 0.750000
vt 0.875000 0.500000
vt 0.625000 0.250000
vt 0.125000 0.500000
vt 0.375000 0.250000
vt 0.875000 0.750000
vt 0.625000 1.000000
vt 0.625000 0.000000
vt 0.375000 0.000000
vt 0.375000 1.000000
vt 0.125000 0.750000
s 0
usemtl Material
f 5/5/1 3/3/1 1/1/1
f 3/3/2 8/13/2 4/4/2
f 7/11/3 6/8/3 8/12/3
f 2/2/4 8/14/4 6/7/4
f 1/1/5 4/4/5 2/2/5
f 5/6/6 2/2/6 6/8/6
f 5/5/1 7/9/1 3/3/1
f 3/3/2 7/10/2 8/13/2
f 7/11/3 5/6/3 6/8/3
f 2/2/4 4/4/4 8/14/4
f 1/1/5 3/3/5 4/4/5
f 5/6/6 1/1/6 2/2/6
@LemonPi
Copy link
Member

LemonPi commented Sep 1, 2023

This was a known issue due to how ray-tracing destinations are set that should've been fixed with the RobotSDF_batching_fix branch which was merged 2 weeks ago. Are you using the latest master or a previous release? I don't think the latest release has this fix yet.

@dcolli23
Copy link
Author

dcolli23 commented Sep 7, 2023

Thanks for the quick reply. I see. I'm using the pip-installed version so I believe I'm behind master. Is it easy/quick to do another release or should I just pull master and do a local install?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants