cnr-isti-vclab / PyMeshLab

The open source mesh processing python library
GNU General Public License v3.0
775 stars 62 forks source link

Ambient occlusion & volumetric obscurance fail in pymeshlab #287

Open Bathsheba opened 1 year ago

Bathsheba commented 1 year ago

Current versions of everything on Windows I swear I saw these both working just a couple weeks ago. 😢

Maybe related to https://github.com/cnr-isti-vclab/PyMeshLab/issues/43

import pymeshlab

ms = pymeshlab.MeshSet()
ms.load_new_mesh('torus.stl')
print("loaded")

### THESE FAIL WITH "Aborted"
ms.compute_scalar_by_volumetric_obscurance(onprimitive='On vertices', obscuranceexponent=.001)
#ms.compute_scalar_ambient_occlusion()
###

print("vo done")
ms.compute_color_from_scalar_using_transfer_function_per_vertex(tfslist='Grey Scale')
print("grayscale")
ms.apply_color_laplacian_smoothing_per_vertex(iteration=8)
ms.apply_color_brightness_contrast_gamma_per_vertex(contrast=25)
ms.compute_color_transfer_vertex_to_face()    # save obj with mtl file rather than color-by-vertex
ms.save_current_mesh('torus_vo.obj', save_vertex_normal=False, save_vertex_color=False, save_face_color=True)
print("saved")
ms.clear()

exit(0)
alemuntoni commented 1 year ago

Are you using a linux subsystem or are you running the code in a pure windows terminal? I am not able to replicate this issue on my Windows 11 machine, python 3.10 and pymeshlab 2022.2.post3 (at least with my torus.stl). Ambient occlusion works as expected and it does not crash.

Bathsheba commented 1 year ago

Windows 11, WSL2, I can get you the python and pymeshlab versions when I get back to that machine. Thanks for looking! I think there's no need to be picky about the torus, for me this fails on every mesh.

angshine commented 1 year ago

I am experiencing the same issue. However, I found that the ambient occlusion filter functions properly within a Jupyter Notebook, but results in an "Aborted" error when executed as a Python script.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. The resources of the VCLab team are limited, and so we are asking for your help. If this is a bug and you can still reproduce this error on the last release of PyMeshLab, please reply with all of the information you have about it in order to keep the issue open. If this is a feature request, and you feel that it is still relevant and valuable, please tell us why. This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

Bathsheba commented 12 months ago

I still see this problem, in pymeshlab both ms.compute_scalar_by_volumetric_obscurance(onprimitive='On vertices', obscuranceexponent=0) and ms.compute_scalar_ambient_occlusion(occmode="per-Vertex", usegpu=False, reqviews=64) fail with "Aborted". I've tried many different options. Windows 11, WSL2, Meshlab_64bit_fp v2022.02, pymeshlab-2022.2.post4 Thanks for your consideration.