예제 #1
0
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
예제 #2
0
    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)
예제 #3
0
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)
예제 #4
0
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
예제 #5
0
    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)
예제 #6
0
    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