PLY model triangulation problem #84
AugmentedRealityCat
started this conversation in
General
Replies: 1 comment
-
I have not noticed any issue like this in blender, I will investigate .. What you're describing sounds a lot like Z-fighting. I would assume the back faces would use the same indexes to the same vertices .. meshlab can import/export too, it is still very relevant btw. edit2: i will look into it in detail .. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Playing a little more with the 3d model export feature I discovered the PLY models coming out of the process were strangely triangulated.
Basically, because of limits of the PLY format, if you want to export both sides of a single polygon surface you have to account for the surface twice, one for the front and one for the back.
This is usual among older legacy formats like PLY. It's basically just a list of polygons described as vertex positions + RGBA values.
The problem here is that this second set of polygons with their normal pointing in the other direction has a different triangulation: the order used to list the vertices is somehow different from one side to the other. Because of this, even though the points (vertices) making the mesh have the same positions on both sides, the triangles themselves are not symmetrical.
Let me explain: If you have a single square split in two triangles, normally the splitting edge will be the same for both sides - but for the PLY model exported by 3d-photo-inpainting that edge has been spinned, and instead of being aligned with the other one, it is crossing in the center at a perpendicular angle - basically the 2 edges (/ and ) form an
X
shape instead of both of them (/ and /) aligning perfectly as single/
.Now, it does that all over the model, including over the inpainted extensions to the 3d surface.
My guess is the order used to draw the polygons going from vertex to vertex on the vertex list is wrong for one of the two sides of the polygonal surfaces constructed by the 3d-photo-inpainting process. Like, one should be clockwise, and the other counter-clockwise, or there is a vertex missing, or it's read from the last to the first, or something like that.
Where is that triangulation error happening though ? I had a look at the original project's documentation and found nothing there about this. I looked further but I was quickly overwhelmed when I tried to make sense of the code itself. Sadly, even though I worked with many of them, I am not a programmer.
There is also a chance that this triangulation problem happens when the model is interpreted by Blender at import. Blender is the only PLY converting application I've found to be working well with those, so I have no way to compare. Maybe I should install Meshlab (?) or something like that - it's an old software I haven't used in years but it did work with PLY.
The reason why I am trying to fix that problem is that unclean meshes like this, with superposing vertices but misaligned opposite triangles, are impossible to clean up, optimize or retopologize. There are tricks to circumvent this usually, like turning the thing into a volume first and then turning that volume into a mesh, but this makes all the vertex colors (the RGB information from our source image) disappear from your model, so all the inpainting colors are lost even if you re-project the whole thing as a texture with camera projection. So I have to find another way.
I found tricks to select and separate the polygonal surfaces that compose the model so as to keep only one set that is all aligned properly, but this only works after exporting the whole PLY as a FBX and importing it in C4d because it has some advanced polygonal selection tools to help me with this task. I have a solution for me - but I'd like a solution for all.
Ideally, for me as a user, it would be easier to get a nice and clean OBJ directly from the 3d-inpainting-process. But a nice and clean PLY would be a great step forward. There is a possibility the PLY is actually clean and the problems is actually with Blender's PLY import...
Beta Was this translation helpful? Give feedback.
All reactions