def pointcloud(): cur_dir = os.path.dirname(os.path.realpath(__file__)) pointcloud = usd.import_pointcloud( os.path.join(cur_dir, os.pardir, os.pardir, os.pardir, 'samples/rocket_pointcloud.usda'), '/World/pointcloud') return pointcloud
def test_import_single(self, out_dir, pointcloud): out_path = os.path.join(out_dir, 'pointcloud.usda') pointcloud_in = usd.import_pointcloud(file_path=out_path, scene_path=self.scene_path) # Confirm imported pointcloud matches original input assert torch.allclose(pointcloud, pointcloud_in)
def pointcloud_with_color(): cur_dir = os.path.dirname(os.path.realpath(__file__)) pointcloud, color, normals = usd.import_pointcloud( os.path.join(cur_dir, os.pardir, os.pardir, os.pardir, 'samples/golden/pointcloud_GeomPoints_colors.usda'), '/World/pointcloud') return (pointcloud, color)
def pointcloud_instancer(): cur_dir = os.path.dirname(os.path.realpath(__file__)) pointcloud, color, normals = usd.import_pointcloud( os.path.join(cur_dir, os.pardir, os.pardir, os.pardir, 'samples/rocket_pointcloud.v0.9.0.usda'), '/World/pointcloud') return pointcloud
def test_import_single_instancer(self, out_dir, pointcloud_instancer): # Test that the read from UsdPointInstancer is the same as the read from UsdGeomPoints out_path = os.path.join(out_dir, 'pointcloud.usda') pointcloud_in, colors_in, normals_in = usd.import_pointcloud(file_path=out_path, scene_path=self.scene_path) # Confirm imported pointcloud matches original input assert torch.allclose(pointcloud_instancer, pointcloud_in)
def test_import_single_color(self, out_dir, pointcloud): out_path = os.path.join(out_dir, 'pointcloud_colors.usda') pointcloud_in, color, _ = usd.import_pointcloud(file_path=out_path, scene_path=self.scene_path) # Confirm imported pointcloud matches original input assert torch.allclose(pointcloud, pointcloud_in) # Confirm that points have the same shape as color assert pointcloud_in.shape == color.shape