Skip to content

CMake: allow use of system-provided meshlab & pybind11#445

Merged
alemuntoni merged 4 commits intocnr-isti-vclab:develfrom
nim65s:packaging
Sep 23, 2025
Merged

CMake: allow use of system-provided meshlab & pybind11#445
alemuntoni merged 4 commits intocnr-isti-vclab:develfrom
nim65s:packaging

Conversation

@nim65s
Copy link

@nim65s nim65s commented Sep 20, 2025

follows cnr-isti-vclab/vcglib#248

NB: this PR is way easier to review by hidding whitespaces

@nim65s nim65s marked this pull request as draft September 22, 2025 15:27
@nim65s nim65s marked this pull request as ready for review September 22, 2025 17:24
@alemuntoni
Copy link
Member

@nim65s did you tested the pymeshlab package built and installed in an environment where meshlab was already installed?
Right now I don't have the time to do it myself... But I would be really surprised if it just works out of the box :D

@nim65s
Copy link
Author

nim65s commented Sep 23, 2025

Yes, I did something like this:

>>> from pymeshlab import MeshSet
>>> ms = MeshSet()
>>> ms.load_new_mesh("/…/base_link.STL")
>>> ms.meshing_decimation_quadric_edge_collapse()
>>> ms.save_current_mesh("/…/base_link2.STL")

And base_link2.STL is created and lighter than the initial one.

I did that with nixpkgs though, which add some additional magic to make certain things autowork and break others.

I had to copy libio_* & libfliter_* plugins from meshlab to pymeshlab for example. I guess the loading mechanism can be improved for this, but I did not want to put that in the same PR set

@nim65s
Copy link
Author

nim65s commented Sep 23, 2025

I tested that on linux and macos, with the following recipe: https://github.com/nim65s/nixpkgs/blob/meshlab/pkgs/applications/graphics/pymeshlab/default.nix

@alemuntoni
Copy link
Member

Ok, that makes sense.

I would just put a warning somewhere to say that the package would use meshlab built with single float precision, which could lead to different behaviors w.r.t. the pypi pymeshlab package (which uses double precision).

Anyway, that's really great! Thanks for your work!!

@nim65s
Copy link
Author

nim65s commented Sep 23, 2025

out of curiosity, what is the rationnale for the default single on meshlab but default double on pymeshlab ?

@alemuntoni
Copy link
Member

On pymeshlab it is default double because it is default also in python.
In my opinion it should be default double also meshlab, but since it was born with floats (which made sense 20 years ago) we keep it float mainly for backward compatibility.

@nim65s
Copy link
Author

nim65s commented Sep 23, 2025

I've added a warning :)

@alemuntoni
Copy link
Member

Thank you @nim65s!! :)

@alemuntoni alemuntoni merged commit aaa50b5 into cnr-isti-vclab:devel Sep 23, 2025
96 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants