MPI-IS / mesh

MPI-IS Mesh Processing Library
Other
663 stars 152 forks source link

Mesh and Meshviewer cannot be used #51

Open ghost opened 3 years ago

ghost commented 3 years ago

I had compiled and install Boost and the psbody-mesh package following the README.md using Makefile in the repository. And run the test successfully by the command $ make tests as well as $ make documentation.

But when I use the command $ meshviewer view sphere.obj, it occurs an error, ValueError: Could not load file.

Tarceback reports that the error occurs in File "psbody/mesh/serialization/serialization.py", line 98, in load_from_obj_cpp from .loadobj import loadobj.

Then I found there is not loadobj file in the whole directory, as well as aabb_normals, spatialsearch, plyutils. It indicates the Cmakelist.txt in ./mesh is no use.

Do you know how to deal with the problem?

ghost commented 3 years ago

Finally, I found that the file CMakeLists.txt in mesh/mesh hadn't used in BOOST_INCLUDE_DIRS=/path/to/boost/include make all. It caused these files whose names were aabb_normals, spatialsearch, plyutils, loadobj hadn't generated. As a result, we cannot import them, becuase they don't exist at all.

In the end, I cmake the file CMakeLists.txt in mesh/mesh, and get these missing files. Then I successfully fix this bug.

khushgrover commented 3 years ago

I got the same error, could you please share exactly what worked?

ghost commented 3 years ago

I got the same error, could you please share exactly what worked?

cd mesh/mesh/cmake/
cmake ..
make

then you can see aabb_normals.so, spatialsearch.so, plyutils.so and loadobj.so files in the folder mesh/mesh/cmake. follow your bug, put these files into correct folders.

ryancll commented 3 years ago

Hi @faneggs , thank you for sharing! What should I do after copying *.so to the correct folder?

from .loadobj import loadobj In "psbody/mesh/serialization/serialization.py", line 98 I think the loadobj should a be py file, but now we only have a .so file.

Could you please share more details? Thx

khushgrover commented 3 years ago

Using this command

$ meshviewer view sphere.obj

it occurs an error, ValueError: Could not load file. I got it working by specifying the actual path for the object.

$ meshviewer view data/unittest/sphere.obj
ghost commented 3 years ago

Hi @faneggs , thank you for sharing! What should I do after copying *.so to the correct folder?

from .loadobj import loadobj In "psbody/mesh/serialization/serialization.py", line 98 I think the loadobj should a be py file, but now we only have a .so file.

Could you please share more details? Thx

the .so file is a dynamic link library that can be imported by any language.

ghost commented 3 years ago

if you are using python3, then you might see an error following after cmake ..:

CMake Error at cmake/thirdparty.cmake:35 (message):
  [numpy] the following error occured: File "<string>", line 1

      import numpy; print numpy.get_include()
                              ^

  SyntaxError: invalid syntax

   - Consider setting PYTHON_ROOT in the environment
Call Stack (most recent call first):
  CMakeLists.txt:17 (include)

-- Configuring incomplete, errors occurred!

Open and edit the file ./mesh/cmake/thirdparty.cmake Replace import numpy; print numpy.get_include() with import numpy; print(numpy.get_include()) in this file

cmake ..agian

trinanjan12 commented 3 years ago

@faneggs @khushgrover I followed these steps

  1. git clone https://github.com/MPI-IS/mesh.git
  2. cd mesh
  3. make all BOOST_INCLUDE_DIRS=/usr/include/boost/
  4. make tests and make documentation
  5. after this cd mesh/cmake and cmake .. and make at the end this shows building the missing files like loadobj.so
  6. meshviewer view sphere.obj still shows the error

    v, vt, vn, f, ft, fn, mtl_path, landm, segm = loadobj(filename) ValueError: Could not load file

I didn't understand the part when you said copy the files to the exact location. as in copy where. the missing files(loadobj.so etc) are generated in the dir mesh/mesh/cmake . Do I need to move them somewhere?

meshviewer view data/unittest/sphere.obj this works though!!

ghost commented 3 years ago

@faneggs @khushgrover I followed these steps

  1. git clone https://github.com/MPI-IS/mesh.git
  2. cd mesh
  3. make all BOOST_INCLUDE_DIRS=/usr/include/boost/
  4. make tests and make documentation
  5. after this cd mesh/cmake and cmake .. and make at the end this shows building the missing files like loadobj.so
  6. meshviewer view sphere.obj still shows the error v, vt, vn, f, ft, fn, mtl_path, landm, segm = loadobj(filename) ValueError: Could not load file

I didn't understand the part when you said copy the files to the exact location. as in copy where. the missing files(loadobj.so etc) are generated in the dir mesh/mesh/cmake . Do I need to move them somewhere?

meshviewer view data/unittest/sphere.obj this works though!!

./mesh/geometry/spatialsearch.so ./mesh/serialization/plyutils.so ./mesh/spatialsearch.so ./mesh/serialization/loadobj.so