in run_nerf_helpers.py [0:0]
def _ray_mesh(input_pts):
rays_string = ""
num_lines = 0
for ray_samples in input_pts[indices]:
# ray_samples: samples_per_ray x 3
for i in range(samples_per_ray - 1):
num_lines += 1
start_x, start_y, start_z = ray_samples[i]
end_x, end_y, end_z = ray_samples[i + 1]
eps = 0.00001
rays_string += (
"v "
+ str(start_x)
+ " "
+ str(start_y)
+ " "
+ str(start_z)
+ "\n"
+ "v "
+ str(start_x + eps)
+ " "
+ str(start_y + eps)
+ " "
+ str(start_z + eps)
+ "\n"
+ "v "
+ str(end_x)
+ " "
+ str(end_y)
+ " "
+ str(end_z)
+ "\n"
)
for i in range(num_lines):
# faces are 1-indexed
first_vertex_index = i * 3 + 1
rays_string += (
"f "
+ str(first_vertex_index)
+ " "
+ str(first_vertex_index + 1)
+ " "
+ str(first_vertex_index + 2)
+ "\n"
)
return rays_string