[ [-0.7, -0.70, 1.0], [0.0, -0.1, 1.0], [0.7, -0.7, 1.0], [-0.7, 0.1, 1.0], [0.0, 0.7, 1.0], [0.7, 0.1, 1.0], ], dtype=torch.float32, ) faces0 = torch.tensor([[1, 0, 2], [4, 3, 5]], dtype=torch.int64) # Points for a simple point cloud. Get the vertices from a # torus and apply rotations such that the points are no longer # symmerical in X/Y. torus_mesh = torus(r=0.25, R=1.0, sides=5, rings=2 * 5) t = (Transform3d().rotate_axis_angle(angle=90, axis="Y").rotate_axis_angle( angle=45, axis="Z").scale(0.3)) torus_points = t.transform_points(torus_mesh.verts_padded()).squeeze() def _save_debug_image(idx, image_size, bin_size, blur): """ Save a mask image from the rasterization output for debugging. """ H, W = image_size # Save out the last image for debugging rgb = (idx[-1, ..., :3].cpu() > -1).squeeze() suffix = "square" if H == W else "non_square" filename = "%s_bin_size_%s_blur_%.3f_%dx%d.png" filename = filename % (suffix, str(bin_size), blur, H, W)
def bm_load_complex_obj(N: int): meshes = torus(r=0.25, R=1.0, sides=N, rings=2 * N) [verts], [faces] = meshes.verts_list(), meshes.faces_list() return TestMeshObjIO._bm_load_obj(verts, faces, decimal_places=5)
def bm_save_complex_ply(N: int): meshes = torus(r=0.25, R=1.0, sides=N, rings=2 * N) [verts], [faces] = meshes.verts_list(), meshes.faces_list() return TestMeshPlyIO._bm_save_ply(verts, faces, decimal_places=5)