Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use meshlab to fix model on Linux/Mac #7995

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

buzzhuzz
Copy link
Contributor

Description

Fixes #5013, #4923

This change introduces new back end for the "Fix model" feature: MeshLabServer.

On Linux and Mac platforms OrcaSlicer checks if "meshlabserver" could be found in path and allows broken objects to be fixed if it is.

Simple script for meshlab added to resources.

In order to make this feature work you need to have MeshLab installed and "meshlabserver" available in PATH.

Screenshots/Recordings/Graphs

orca-meshlab.mp4

Tests

Tested on Linux host only, with native build (no appimage).

@buzzhuzz
Copy link
Contributor Author

It is expected that someone proficient in MeshLab and meshes manipulation will update the meshlab script within resources directory.

I also have not tested this under Mac. From old times I remember apps are distributed in bundles and it might be tricky to add bundled app binary into the path, so I expect someone on Mac would test this change so we could update documentation/notes on how to make it working under OSX.

@buzzhuzz buzzhuzz changed the title fix model using meshlab Use meshlab to fix model on Linux/Mac Jan 10, 2025
@sschwetz
Copy link

I have installed Meshlab 2023.12, and it no longer has meshlabserver. This has been replaced by PyMeshlab.

@buzzhuzz
Copy link
Contributor Author

Well, it looks like PyMeshLab is the way.

Originally I was going to use PyMeshLab, but switched to meshlabserver due to much easier implementation. Somhow I've missed that meshlabserver got removed in latest version.

I'm going to convert this PR to draft just by now in case someone would like to try this on linux.

I'll rework this to use PyMeshLab and update PR.

@buzzhuzz buzzhuzz marked this pull request as draft January 13, 2025 03:15
FixModel reimplemented to use PyMeshLab instead of MeshLabServer

NOTE: this functionality is still in development phase, so
      some additional configuration outside of OrcaSlicer is needed

Current change have been tasted on Linux using PyMeshLab==2024.12
Sample meshlab script created using MeshLab 2024.12.

Testing:

    1. Prepare virtual environment with PyMeshLab installed.
       This step may be skipped if pymeshlab installed globally

        $ python -m venv meshlab
        $ ./meshlab/bin/activate
        (pymeshlab) $ pip install pymeshlab

    2. (optionally) Activate virtual env

        $ source path/to/meshlab-venv/bin/activate

    3. Run OrcaSlicer from command line with venv activated:

        (pymeshlab) $ ./path/to/OrcaSlicer.AppImage

Test sequence may need to be adjusted for the Mac platform
@buzzhuzz
Copy link
Contributor Author

@sschwetz , would you mind testing updated changes with PyMeshLab support?

Please refer to the change description regarding testing sequence. This is not final change as we need to came to solution how to simplify configuration to skip venv usage.

@buzzhuzz
Copy link
Contributor Author

I've added config option to set PyMeshLab location (which is recommended to be installed inside venv).
Now user may create virtualenv with PyMeshLab installed in it. OrcaSlicer shall be configured to point into /bin/ directory (the one containing activate.sh script and/or python3 link) of the respective virtualenv:

Screenshot from 2025-01-27 01-42-21

@buzzhuzz buzzhuzz marked this pull request as ready for review January 26, 2025 15:47
@oskardotglobal
Copy link

oskardotglobal commented Jan 26, 2025

Currently trying this under macOS 15.2.

I've grabbed the latest OrcaSlicer from the build artifacts, created a virtualenv (python3 -m venv ~/.venv) and built pymeshlab from source (pip3 install git+https://github.com/cnr-isti-vclab/PyMeshLab) since pip3 install pymeshlab didn't work.

I set the path in the settings but it still doesn't seem to work (I get an error saying PyMeshLab not found). Can I provide any logs to help?

Edit: The error was that I wasn't using Python 3.10, I was using the Python 3.9 macOS ships. If I create my venv using Python 3.10, I can pip install pymeshlab just fine and can use the "Fix model" function. Thanks for this awesome PR!

@buzzhuzz
Copy link
Contributor Author

@oskardotglobal , WOW I really happy it is working on OSX. Thank you for your testing.

doc/Fix-Model.md Outdated Show resolved Hide resolved
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.

Please get "Fix Model" working in the linux version
3 participants