-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
25 lines (17 loc) · 739 Bytes
/
test.py
File metadata and controls
25 lines (17 loc) · 739 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import torch
import trimesh
from ray_field import utils
with torch.no_grad():
model, device = utils.init_model('bunny')
origins, dirs = utils.generate_sphere_rays_tensor(50, device)
result = model.forward(dict(origins=origins, dirs=dirs), intersections_only = False, return_all_atoms = True)
all_intersections = result[8]
all_normals = result[9]
all_is_intersecting = result[12]
all_is_intersecting = all_is_intersecting.flatten(end_dim=2)
all_intersections = all_intersections.flatten(end_dim=2)
print(all_intersections.shape, all_is_intersecting.shape)
exit()
intersect_cloud = trimesh.points.PointCloud(all_intersections)
scene = trimesh.Scene([intersect_cloud])
scene.show()