コード例 #1
0
    def test_write_ply(self):
        # Prepare input test signal
        folder_path = parutil.get_file_path('sumo/threedee/test_data')
        file_path = os.path.join(folder_path, 'example_tetrahedron.ply')
        cloud_input = PointCloud.load_ply(file_path)

        # Write test signal into write_ply
        file_path = os.path.join(folder_path, 'example_write.ply')
        cloud_input.write_ply(file_path)
        cloud_output = PointCloud.load_ply(file_path)

        self.assertTrue(isinstance(cloud_output, PointCloud))
        self.assertEqual(cloud_output.num_points(), cloud_input.num_points())
        np.testing.assert_array_equal(cloud_output.points(),
                                      cloud_input.points())
コード例 #2
0
 def test_load_ply(self):
     file_path = parutil.get_file_path(
         'sumo/threedee/test_data/example_tetrahedron.ply')
     cloud = PointCloud.load_ply(file_path)
     self.assertTrue(isinstance(cloud, PointCloud))
     self.assertEquals(cloud.num_points(), 12)