jannessm / quadric-mesh-simplification

Fast python implementation of the quadric mesh simplification algorithm from http://mgarland.org/files/papers/quadrics.pdf
MIT License
105 stars 10 forks source link

Type mismatch on windows #2

Open FreakTheMighty opened 4 years ago

FreakTheMighty commented 4 years ago

Hey @jannessm I'm looking forward to trying out this library! Running on windows, I bumped into this type error. It seems that the long type is not cross compatible with windows. This project seems to have bumped into a similar issue. I wonder, is it possible to apply a similar fix to this project?

quadric-mesh-simplification\quad_mesh_simplify\simplify_test.py", line 63, in test_simplify_mesh_without_threshold
    res_pos, res_face = simplify_mesh(np.copy(pos), np.copy(face), 10 - i)
  File "quad_mesh_simplify\simplify.pyx", line 73, in quad_mesh_simplify.simplify.simplify_mesh
    face_copy = np.copy(face_in)
ValueError: Buffer dtype mismatch, expected 'DTYPE_LONG_T' but got 'long'
jannessm commented 4 years ago

Hey. I have released a new version that is mainly based on c to speed up the whole process. I would appreciate if you test the compatibility to windows. Please let me know if you run into issues!

FreakTheMighty commented 4 years ago

Hey @jannessm looks like I'm having similar type issues. May I ask, what motivated you to move away from Cython?

======================================================================
ERROR: test_simplify_mesh_with_threshold (__main__.SimplifyTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".\simplify_test.py", line 178, in test_simplify_mesh_with_threshold
    res_pos, res_face = simplify_mesh(np.copy(pos), np.copy(face), 5, threshold=0.6)
  File "quad_mesh_simplify\simplify.pyx", line 73, in quad_mesh_simplify.simplify.simplify_mesh
ValueError: Buffer dtype mismatch, expected 'DTYPE_LONG_T' but got 'unsigned long'

======================================================================
ERROR: test_simplify_mesh_without_threshold (__main__.SimplifyTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".\simplify_test.py", line 141, in test_simplify_mesh_without_threshold
    res_pos, res_face = simplify_mesh(np.copy(pos), np.copy(face), 10 - i)
  File "quad_mesh_simplify\simplify.pyx", line 73, in quad_mesh_simplify.simplify.simplify_mesh
ValueError: Buffer dtype mismatch, expected 'DTYPE_LONG_T' but got 'unsigned long'

----------------------------------------------------------------------
jannessm commented 4 years ago

Since I am dealing with very large meshes that I want to reduce quite heavily, I wanted to speed up the code. And now I can deal without any overhead of cython which indeed speeded up the whole process. But to wrap the function for python I am still using cython ;)

jannessm commented 4 years ago

And sadly, I am currently very busy. I will take care of it, if I am free. Otherwise, it would be very nice if you could search for the error in the code and create a PR! Thank you very much.

FreakTheMighty commented 4 years ago

I hear that :). I did make an attempt at fixing this, but was a bit over my head with the cython side of things. At that point I just moved over to Ubuntu and moved on.

Perhaps I'll return to this later.

jannessm commented 3 years ago

Hi, I have added the cibuildwheel workflow. Now it should be usable under windows. It would be very kind, if you would test the behavior and let me know if the error persists. Thank you!

FreakTheMighty commented 3 years ago

Sorry, been very busy this week. I'll do my best to get to testing next week.