Using pymeshlab from python, how to get the faces selected by the filter compute_selection_by_self_intersections_per_face()?

651 Views Asked by At

I have a 3d object with self intersections. I load it with meshlab and when I apply the Select Self Intersection Face filter, it selects the faces with self intersections.

Applying the same method with pymeshlab, loading the object applying the filter compute_selection_by_self_intersections_per_face does not return any selected faces. How can I get the faces that the filter have selected.

At the end of the next example when I call ms.current_mesh().selected_face_number() it returns zero

import pymeshlab

ms = pymeshlab.MeshSet()
ms.load_new_mesh('test.obj')                          
ms.compute_selection_by_self_intersections_per_face()
# ms.current_mesh().face_selection_array()
print(ms.current_mesh().selected_face_number())
1

There are 1 best solutions below

1
Mark van Mars On

Not working due to a syntax error of the rgb assignment...trying to fix it...but you get the idea...

ms.compute_selection_by_color_per_face(colorspace=0, color=[125;125;125;255], inclusive=False, percentrh=0.2, percentgs=0.2, percentbv=0.2)