trimesh
trimesh copied to clipboard
OBJ loading and export causing self-intersections
I do have an obj file representing the following geometry

when I load this obj file with trimesh and export it again directly the mesh will have defects. This is what Meshlab shows when I run "select self intersecting faces":

Those defects are also represented as entities in mesh.outline(). For the original mesh in Meshlab the selection remains empty.
If I first convert the obj to ply in Meshlab, then load and export in trimesh no such "self intersections" are created. I write "self intersections" because really they are not visibly self intersections.
What might be the issue here?
Hey, is it possible this is from merging vertices? Does it happen with trimesh.load('thing.obj', process=False)?
Unfortunately this does not change behavior.
Can you provide the before and after files?
Here's how I generated them (sample.obj is the original):
trimesh.load('sample.obj', process=False).export('sample_no_process.obj')
trimesh.load('sample.obj').export('sample_process.obj')
Thanks for the models! I'm not sure what's going on here as this is a somewhat complicated interleaved file, but I did notice if you load with m = trimesh.load('sample.obj', process=False, maintain_order=True) it has a lot more vertices and renders more nicely.