Hi all, I am facing an issue dealing with complex faces in openmesh via the python interface. I have a mesh I am loading via trimesh (hard requirement at this time), and using that to build an openmesh mesh. This mesh (and others i work with) is degenerate in the sense that it has complex faces, and trying to ignore that problem leads to the python process crashing (either hanging or segfault/bus error depending on the mesh). If i proactively try to delete the complex faces immediately after they are created, I get a seg fault. I have attached a minimum working example complete with degenerate STL, I would appreciate any assistance debugging this and/or working around it! Cheers, Bruce
Hi, The problem is caused by degenerate triangles with duplicate vertices. It can be avoided by checking each face for duplicates: if len(set(face)) != 3: continue With this check, there should be no need to delete anything. Best, Alex
On 4. Oct 2021, at 17:35, Bruce Jones <bruce.jones@markforged.com> wrote:
Hi all,
I am facing an issue dealing with complex faces in openmesh via the python interface. I have a mesh I am loading via trimesh (hard requirement at this time), and using that to build an openmesh mesh. This mesh (and others i work with) is degenerate in the sense that it has complex faces, and trying to ignore that problem leads to the python process crashing (either hanging or segfault/bus error depending on the mesh). If i proactively try to delete the complex faces immediately after they are created, I get a seg fault. I have attached a minimum working example complete with degenerate STL, I would appreciate any assistance debugging this and/or working around it!
Cheers, Bruce
<benchy_fail.zip>_______________________________________________ OpenMesh mailing list -- openmesh@lists.rwth-aachen.de To unsubscribe send an email to openmesh-leave@lists.rwth-aachen.de https://lists.rwth-aachen.de/postorius/lists/openmesh.lists.rwth-aachen.de
Thanks Alex, I agree that this is a workaround for avoiding the complex faces in this case. However this isn't the only reason a face could be complex. I also don't think it's unreasonable to expect to be able to add and delete these faces without a segfault, it would actually be preferable if the add operation throws if it cannot be cleanly added. Cheers, Bruce On Sat, Oct 9, 2021, 7:27 AM Dielen, Alexander < alexander.dielen@rwth-aachen.de> wrote:
Hi,
The problem is caused by degenerate triangles with duplicate vertices.
It can be avoided by checking each face for duplicates:
if len(set(face)) != 3: continue
With this check, there should be no need to delete anything.
Best, Alex
On 4. Oct 2021, at 17:35, Bruce Jones <bruce.jones@markforged.com> wrote:
Hi all,
I am facing an issue dealing with complex faces in openmesh via the python interface. I have a mesh I am loading via trimesh (hard requirement at this time), and using that to build an openmesh mesh. This mesh (and others i work with) is degenerate in the sense that it has complex faces, and trying to ignore that problem leads to the python process crashing (either hanging or segfault/bus error depending on the mesh). If i proactively try to delete the complex faces immediately after they are created, I get a seg fault. I have attached a minimum working example complete with degenerate STL, I would appreciate any assistance debugging this and/or working around it!
Cheers, Bruce
<benchy_fail.zip>_______________________________________________ OpenMesh mailing list -- openmesh@lists.rwth-aachen.de To unsubscribe send an email to openmesh-leave@lists.rwth-aachen.de
https://lists.rwth-aachen.de/postorius/lists/openmesh.lists.rwth-aachen.de
Hi Bruce, if you try to add a complex face (to the best of my knowledge) no face will be added to the mesh and an invalid face handle is returned (with idx -1). Therefore, you should not need to delete the invalid faces afterwards. Best, - Isaak On 10/9/21 1:43 PM, Bruce Jones wrote:
Thanks Alex,
I agree that this is a workaround for avoiding the complex faces in this case. However this isn't the only reason a face could be complex. I also don't think it's unreasonable to expect to be able to add and delete these faces without a segfault, it would actually be preferable if the add operation throws if it cannot be cleanly added.
Cheers, Bruce
On Sat, Oct 9, 2021, 7:27 AM Dielen, Alexander <alexander.dielen@rwth-aachen.de <mailto:alexander.dielen@rwth-aachen.de>> wrote:
Hi,
The problem is caused by degenerate triangles with duplicate vertices.
It can be avoided by checking each face for duplicates:
if len(set(face)) != 3: continue
With this check, there should be no need to delete anything.
Best, Alex
> On 4. Oct 2021, at 17:35, Bruce Jones <bruce.jones@markforged.com <mailto:bruce.jones@markforged.com>> wrote: > > Hi all, > > I am facing an issue dealing with complex faces in openmesh via the python interface. I have a mesh I am loading via trimesh (hard requirement at this time), and using that to build an openmesh mesh. This mesh (and others i work with) is degenerate in the sense that it has complex faces, and trying to ignore that problem leads to the python process crashing (either hanging or segfault/bus error depending on the mesh). If i proactively try to delete the complex faces immediately after they are created, I get a seg fault. I have attached a minimum working example complete with degenerate STL, I would appreciate any assistance debugging this and/or working around it! > > Cheers, > Bruce > > <benchy_fail.zip>_______________________________________________ > OpenMesh mailing list -- openmesh@lists.rwth-aachen.de <mailto:openmesh@lists.rwth-aachen.de> > To unsubscribe send an email to openmesh-leave@lists.rwth-aachen.de <mailto:openmesh-leave@lists.rwth-aachen.de> > https://lists.rwth-aachen.de/postorius/lists/openmesh.lists.rwth-aachen.de <https://lists.rwth-aachen.de/postorius/lists/openmesh.lists.rwth-aachen.de>
_______________________________________________ OpenMesh mailing list -- openmesh@lists.rwth-aachen.de To unsubscribe send an email to openmesh-leave@lists.rwth-aachen.de https://lists.rwth-aachen.de/postorius/lists/openmesh.lists.rwth-aachen.de
participants (3)
-
Bruce Jones
-
Dielen, Alexander
-
Isaak Lim