sgsellan / gpytoolbox

A collection of utility functions to prototype geometry processing research in python
https://gpytoolbox.org
GNU General Public License v3.0
206 stars 15 forks source link

Exception: The file test/unit_tests_data/bunny_oded.obj could not be opened. #134

Closed xjtu19 closed 4 months ago

xjtu19 commented 5 months ago

EEEEEEEE

ERROR: test_bunny (main.TestRemeshBotsch)

Traceback (most recent call last): File "D:\gpytoolbox\test\test_remesh_botsch.py", line 17, in test_bunny v,f = gpytoolbox.read_mesh("test/unit_tests_data/bunny_oded.obj") File "D:\gpytoolbox\src\gpytoolbox\read_mesh.py", line 89, in read_mesh V,F,UV,Ft,N,Fn = _read_obj(file,return_UV,return_N,reader) File "D:\gpytoolbox\src\gpytoolbox\read_mesh.py", line 135, in _read_obj raise Exception(f"The file {file} could not be opened.") Exception: The file test/unit_tests_data/bunny_oded.obj could not be opened.

xjtu19 commented 5 months ago

Traceback (most recent call last): File "D:\gpytoolbox\test\test_remesh_botsch.py", line 1, in from .context import gpytoolbox ImportError: attempted relative import with no known parent package

xjtu19 commented 5 months ago

EEEEEEEE

ERROR: test_bunny (main.TestRemeshBotsch)

Traceback (most recent call last): File "D:\gpytoolbox\test\test_remesh_botsch.py", line 17, in test_bunny v,f = gpytoolbox.read_mesh("test/unit_tests_data/bunny_oded.obj") File "D:\gpytoolbox\src\gpytoolbox\read_mesh.py", line 89, in read_mesh V,F,UV,Ft,N,Fn = _read_obj(file,return_UV,return_N,reader) File "D:\gpytoolbox\src\gpytoolbox\read_mesh.py", line 135, in _read_obj raise Exception(f"The file {file} could not be opened.") Exception: The file test/unit_tests_data/bunny_oded.obj could not be opened.

My operating system is windows 10, when I replace the .obj path "test/unit_tests_data/bunny_oded.obj" with "./unit_tests_data/bunny_oded.obj", this error can be settled.

xjtu19 commented 5 months ago

Traceback (most recent call last): File "D:\gpytoolbox\test\test_remesh_botsch.py", line 1, in from .context import gpytoolbox ImportError: attempted relative import with no known parent package

Change

from .context import gpytoolbox from .context import numpy as np from .context import unittest

to

import gpytoolbox import numpy as np import unittest

since there is no context file in the directory.

xjtu19 commented 5 months ago

It seems OK, running the test code outputs

..D:\gpytoolbox\src\gpytoolbox\remesh_botsch.py:92: UserWarning: All vertices in the input mesh are either manually specified feature vertices or boundary vertices, meaning that this call to remesh_botsch will be a no-op. warnings.warn("All vertices in the input mesh are either manually specified feature vertices or boundary vertices, meaning that this call to remesh_botsch will be a no-op.") ..D:\gpytoolbox\src\gpytoolbox\remesh_botsch.py:60: UserWarning: Feature array is not unique. We will compute its unique entries and use those as an input. We recommend you do this yourself to avoid this warning. warnings.warn( ....

Ran 8 tests in 219.878s

OK

xjtu19 commented 5 months ago

To uncomment igl.write_obj("output.obj",u,g), first import igl, and igl is installed using pip install libigl.

import igl # by pip install libigl igl.write_obj("output.obj",u,g)

xjtu19 commented 5 months ago

How to show the triangle mesh, where the faces. vertices and edges can be colored as I need?

sgsellan commented 5 months ago

Hi!

I see you're trying to run our unit tests. I believe you may be running them in the wrong directory: you are supposed to run them from the home directory gpytoolbox as follows (i.e., not inside test/):

python -m unittest -v
xjtu19 commented 5 months ago

Thanks, it's OK now.

(py310) PS D:\gpytoolbox> python -m unittest -v test_airplane (test.test_adjacency_matrix.TestAdjacencyMatrix) ... ok test_bunny (test.test_adjacency_matrix.TestAdjacencyMatrix) ... ok test_mountain (test.test_adjacency_matrix.TestAdjacencyMatrix) ... ok test_single_triangle (test.test_adjacency_matrix.TestAdjacencyMatrix) ... ok test_bunny_oded (test.test_angle_defect.TestAngleDefect) ... ok test_uniform_grid (test.test_angle_defect.TestAngleDefect) ... ok test_uniform_triangle (test.test_angle_defect_intrinsic.TestAngleDefectIntrinsic) ... ok test_uniform_triangles (test.test_angle_defect_intrinsic.TestAngleDefectIntrinsic) ... ok test_apply_colormaps (test.test_apply_colormap.TestApplyColormap) ... ok test_bunny (test.test_approximate_hausdorff_distance.TestApproximateHausdorffDistance) ... ok test_bunny_smaller (test.test_approximate_hausdorff_distance.TestApproximateHausdorffDistance) ... ok test_array1 (test.test_array_correspondence.TestArrayCorrespondence) ... ok test_matrix1 (test.test_array_correspondence.TestArrayCorrespondence) ... ok test_objects (test.test_array_correspondence.TestArrayCorrespondence) ... ok test_random_arrays (test.test_array_correspondence.TestArrayCorrespondence) ... ok test_random_matrices (test.test_array_correspondence.TestArrayCorrespondence) ... ok test_2d_quadtree_mesh (test.test_bad_quad_mesh_from_quadtree.TestBadQuadMeshFromQuadtree) ... ok test_3d_octtree_mesh (test.test_bad_quad_mesh_from_quadtree.TestBadQuadMeshFromQuadtree) ... ok test_2d (test.test_barycenters.TestBarycenters) ... ok test_3d (test.test_barycenters.TestBarycenters) ... ok test_out_of_plane (test.test_barycentric_coordinates.TestBarycentricCoordinates) ... ok test_out_of_plane_vectorized (test.test_barycentric_coordinates.TestBarycentricCoordinates) ... ok test_random_2d_triangles (test.test_barycentric_coordinates.TestBarycentricCoordinates) ... ok test_random_2d_triangles_vectorized (test.test_barycentric_coordinates.TestBarycentricCoordinates) ... ok test_random_3d_triangles (test.test_barycentric_coordinates.TestBarycentricCoordinates) ... ok test_random_3d_triangles_vectorized (test.test_barycentric_coordinates.TestBarycentricCoordinates) ... ok test_kernel (test.test_biharmonic_energy.TestBiharmonicEnergy) ... ok test_regression (test.test_biharmonic_energy.TestBiharmonicEnergy) ... ok test_single_triangle_2d (test.test_biharmonic_energy.TestBiharmonicEnergy) ... ok test_regression (test.test_biharmonic_energy_intrinsic.TestBiharmonicEnergyIntrinsic) ... ok test_uniform_triangle (test.test_biharmonic_energy_intrinsic.TestBiharmonicEnergyIntrinsic) ... ok test_2d_regular (test.test_boundary_edges.TestBoundaryEdges) ... ok test_airplane (test.test_boundary_edges.TestBoundaryEdges) ... ok test_bunny (test.test_boundary_edges.TestBoundaryEdges) ... ok test_mountain (test.test_boundary_edges.TestBoundaryEdges) ... ok test_single_triangle (test.test_boundary_edges.TestBoundaryEdges) ... ok test_larger_cube_mesh (test.test_boundary_faces.TestBoundaryFaces) ... ok test_simple_cube_mesh (test.test_boundary_faces.TestBoundaryFaces) ... ok test_2d_regular (test.test_boundary_loops.TestBoundaryLoops) ... ok test_airplane (test.test_boundary_loops.TestBoundaryLoops) ... ok test_bunny (test.test_boundary_loops.TestBoundaryLoops) ... ok test_mountain (test.test_boundary_loops.TestBoundaryLoops) ... ok test_single_triangle (test.test_boundary_loops.TestBoundaryLoops) ... ok test_2d_regular (test.test_boundary_vertices.TestBoundaryVertices) ... ok test_airplane (test.test_boundary_vertices.TestBoundaryVertices) ... ok test_bunny (test.test_boundary_vertices.TestBoundaryVertices) ... ok test_mountain (test.test_boundary_vertices.TestBoundaryVertices) ... ok test_single_triangle (test.test_boundary_vertices.TestBoundaryVertices) ... ok test_simple_curve (test.test_catmull_rom_spline.TestCatmullRomSpline) ... ok test_colormaps (test.test_colormap.TestColormap) ... ok test_1d (test.test_compactly_supported_normal.TestCompactlySupportedNormal) ... ok test_2d (test.test_compactly_supported_normal.TestCompactlySupportedNormal) ... ok test_2d (test.test_compactly_supported_normal_kernel.TestCompactlySupportedNormalKernel) ... 0.0017365432004927683 5.321322350589141 5.319585807388648 [ 0.49962491 -0.00050013] ok test_varying_length_scale (test.test_compactly_supported_normal_kernel.TestCompactlySupportedNormalKernel) ... ok test_cone (test.test_cone.TestCone) ... ok test_bunny (test.test_connected_components.TestConnectedComponents) ... ok test_mountain (test.test_connected_components.TestConnectedComponents) ... ok test_single_triangle (test.test_connected_components.TestConnectedComponents) ... ok test_split_mountain (test.test_connected_components.TestConnectedComponents) ... ok test_two_connected_triangles (test.test_connected_components.TestConnectedComponents) ... ok test_two_separate_triangles (test.test_connected_components.TestConnectedComponents) ... ok test_bunny_oded (test.test_cotangent_laplacian.TestCotangentLaplacian) ... ok test_single_triangle_2d (test.test_cotangent_laplacian.TestCotangentLaplacian) ... ok test_single_triangle_3d (test.test_cotangent_laplacian.TestCotangentLaplacian) ... ok test_wrt_grad (test.test_cotangent_laplacian.TestCotangentLaplacian) ... ok test_uniform_triangle (test.test_cotangent_laplacian_intrinsic.TestCotangentLaplacianIntrinsic) ... ok test_bunny_oded (test.test_cotangent_weights.TestCotangentWeights) ... ok test_single_triangle_2d (test.test_cotangent_weights.TestCotangentWeights) ... ok test_single_triangle_3d (test.test_cotangent_weights.TestCotangentWeights) ... ok test_uniform_grid (test.test_cotangent_weights_intrinsic.TestCotangentWeightsIntrinsic) ... ok test_uniform_triangle (test.test_cotangent_weights_intrinsic.TestCotangentWeightsIntrinsic) ... ok test_bunny (test.test_cut_edges.TestCutEdges) ... ok test_icosphere (test.test_cut_edges.TestCutEdges) ... [array([557, 278, 641, 437, 507, 642])] ok test_two_triangles (test.test_cut_edges.TestCutEdges) ... ok test_cylinder (test.test_cylinder.TestCylinder) ... ok test_constant_kernel (test.test_dec_d0.TestDecD0) ... ok test_known (test.test_dec_d0.TestDecD0) ... ok test_triangle (test.test_dec_d0.TestDecD0) ... ok test_known (test.test_dec_d1.TestDecD1) ... ok test_triangle (test.test_dec_d1.TestDecD1) ... ok test_uniform_triangle (test.test_dec_h0.TestDecH0) ... ok test_uniform_triangle (test.test_dec_h0_intrinsic.TestDecH0Intrinsic) ... ok test_uniform_triangle (test.test_dec_h0inv.TestDecH0Inv) ... ok test_uniform_triangle (test.test_dec_h0inv_intrinsic.TestDecH0InvIntrinsic) ... ok test_equivalence_to_cotangent_laplacian (test.test_dec_h1.TestDecH1) ... ok test_uniform_triangle (test.test_dec_h1.TestDecH1) ... ok test_uniform_triangle (test.test_dec_h1_intrinsic.TestDecH1Intrinsic) ... ok test_uniform_triangle (test.test_dec_h1inv.TestDecH1Inv) ... ok test_uniform_triangle (test.test_dec_h1inv_intrinsic.TestDecH1InvIntrinsic) ... ok test_uniform_triangle (test.test_dec_h2.TestDecH2) ... ok test_uniform_triangle (test.test_dec_h2_intrinsic.TestDecH2Intrinsic) ... ok test_uniform_triangle (test.test_dec_h2inv.TestDecH2Inv) ... ok test_uniform_triangle (test.test_dec_h2inv_intrinsic.TestDecH2InvIntrinsic) ... ok test_armadillo (test.test_decimate.TestDecimate) ... ok test_with_boundary (test.test_decimate.TestDecimate) ... ok test_cubes (test.test_do_meshes_intersect.TestDoMeshesIntersect) ... ok test_2d_regular (test.test_doublearea.TestDoublearea) ... ok test_orientation (test.test_doublearea.TestDoublearea) ... ok test_polyline_lengths (test.test_doublearea.TestDoublearea) ... ok test_single_triangle_2d (test.test_doublearea.TestDoublearea) ... ok test_single_triangle_3d (test.test_doublearea.TestDoublearea) ... ok test_equilateral_triangle (test.test_doublearea_intrinsic.TestDoubleareaIntrinsic) ... ok test_many_equilateral_triangles (test.test_doublearea_intrinsic.TestDoubleareaIntrinsic) ... ok test_very_tiny_triangle (test.test_doublearea_intrinsic.TestDoubleareaIntrinsic) ... ok test_consistency_meshes (test.test_edge_edge_distance.TestEdgeEdgeDistance) ... ok test_synthetic (test.test_edge_edge_distance.TestEdgeEdgeDistance) ... ok test_indices_make_sense (test.test_edge_indices.TestEdgeIndices) ... ok test_2d_regular (test.test_edges.TestEdges) ... ok test_airplane (test.test_edges.TestEdges) ... ok test_bunny (test.test_edges.TestEdges) ... ok test_mountain (test.test_edges.TestEdges) ... ok test_single_triangle (test.test_edges.TestEdges) ... ok test_regular_cube_mesh (test.test_faces.TestFaces) ... ok test_bunny (test.test_fast_winding_number.TestFastWindingNumber) ... ok test_cube (test.test_fast_winding_number.TestFastWindingNumber) ... ok test_analytic_2d (test.test_fd_grad.TestFdGrad) ... ok test_analytic_3d (test.test_fd_grad.TestFdGrad) ... ok test_convergence_2d (test.test_fd_grad.TestFdGrad) ... ok test_convergence_3d (test.test_fd_grad.TestFdGrad) ... ok test_analytic_2d (test.test_fd_interpolate.TestFdInterpolate) ... ok test_analytic_3d (test.test_fd_interpolate.TestFdInterpolate) ... ok test_analytic_2d (test.test_fd_partial_derivative.TestFdPartialDerivative) ... ok test_analytic_3d (test.test_fd_partial_derivative.TestFdPartialDerivative) ... ok test_convergence_2d (test.test_fd_partial_derivative.TestFdPartialDerivative) ... ok test_convergence_3d (test.test_fd_partial_derivative.TestFdPartialDerivative) ... ok test_constrained_norhs (test.test_fixed_dof_solve.TestMinQuadWithFixed) ... ok test_constrained_rhs (test.test_fixed_dof_solve.TestMinQuadWithFixed) ... ok test_random (test.test_fixed_dof_solve.TestMinQuadWithFixed) ... ok test_unconstrained (test.test_fixed_dof_solve.TestMinQuadWithFixed) ... ok test_inducing_1d (test.test_gaussian_process.TestGaussianProcess) ... ok test_inducing_2d (test.test_gaussian_process.TestGaussianProcess) ... ok test_precomputation (test.test_gaussian_process.TestGaussianProcess) ... ok test_straight_line (test.test_gaussian_process.TestGaussianProcess) ... ok test_verbose (test.test_gaussian_process.TestGaussianProcess) ... --------- Training Gaussian Process with 20 data points. --------- Training time: 0.005969524383544922 seconds. Building K1 matrix... ...built K1 matrix in 0.0 seconds. Building K2 matrix... ...built K2 matrix in 0.003029346466064453 seconds. Computing mean... ...computed mean in 0.0 seconds. Computing covariance... ...computed covariance in 0.0060002803802490234 seconds. Total test time: 0.009029626846313477 seconds. ok test_with_gradients (test.test_gaussian_process.TestGaussianProcess) ... ok test_2d_grad (test.test_grad.TestGrad) ... ok test_3d_grad (test.test_grad.TestGrad) ... ok test_polyline_grad (test.test_grad.TestGrad) ... ok test_single_triangle_2d (test.test_grad.TestGrad) ... ok test_single_triangle_3d (test.test_grad.TestGrad) ... ok test_compare_with_cotangent_laplacian (test.test_grad_intrinsic.TestGradIntrinsic) ... ok test_example_compared_with_known_gt (test.test_grad_intrinsic.TestGradIntrinsic) ... ok test_single_triangle_2d (test.test_grad_intrinsic.TestGradIntrinsic) ... ok test_2d_functions (test.test_grid_laplacian_eigenfunctions.TestGridLaplacianEigenfunctions) ... ok test_2d (test.test_grid_neighbors.TestGridNeighbors) ... ok test_3d (test.test_grid_neighbors.TestGridNeighbors) ... ok test_order_two (test.test_grid_neighbors.TestGridNeighbors) ... ok test_order_two_3d (test.test_grid_neighbors.TestGridNeighbors) ... ok test_single_triangle (test.test_halfedge_edge_map.TestHalfedgeEdgeMap) ... ok test_two_triangles (test.test_halfedge_edge_map.TestHalfedgeEdgeMap) ... ok test_variety_of_meshes (test.test_halfedge_edge_map.TestHalfedgeEdgeMap) ... ok test_2d_regular (test.test_halfedge_lengths.TestHalfedgeLengths) ... ok test_bunny (test.test_halfedge_lengths.TestHalfedgeLengths) ... ok test_single_triangle (test.test_halfedge_lengths.TestHalfedgeLengths) ... ok test_2d_regular (test.test_halfedge_lengths_squared.TestHalfedgeLengthsSquared) ... ok test_single_triangle (test.test_halfedge_lengths_squared.TestHalfedgeLengthsSquared) ... ok test_airplane (test.test_halfedges.TestHalfedges) ... ok test_bunny (test.test_halfedges.TestHalfedges) ... ok test_mountain (test.test_halfedges.TestHalfedges) ... ok test_single_triangle (test.test_halfedges.TestHalfedges) ... ok test_regular_cube_mesh (test.test_halffaces.TestHalffaces) ... ok test_icosphere (test.test_icosphere.TestIcosphere) ... ok test_synthetic_samples (test.test_in_element_aabb.TestInElementAABB) ... ok test_synthetic (test.test_in_quadtree.TestQuadtreeBoundary) ... ok test_consistency_2d (test.test_initialize_aabbtree.TestInitializeAabbTree) ... ok test_consistency_3d (test.test_initialize_aabbtree.TestInitializeAabbTree) ... ok test_hard_polyline_2d (test.test_initialize_aabbtree.TestInitializeAabbTree) ... ok test_simple_groundtruth (test.test_initialize_aabbtree.TestInitializeAabbTree) ... ok test_consistency (test.test_initialize_quadtree.TestInitializeQuadtree) ... ok test_armadillo (test.test_lazy_cage.TestLazyCage) ...

sgsellan commented 4 months ago

Awesome! Closing this issue then :)