mkazhdan / TextureSignalProcessing

Gradient-Domain Processing within a Texture Atlas
70 stars 12 forks source link

Explanation on errors #9

Closed JohnAlphaIII closed 4 years ago

JohnAlphaIII commented 4 years ago

Hi Michael,

Thanks for an awesome library! Very easy to build and use. With some of my meshes I get errors:

1) LoopVertices: Non-simple loop, node XXX 2) InitializeBoundaryPolygons: Non-opposite boundary node at node XXX

Can you please explain what could be the reason for these issues?

JohnAlphaIII commented 4 years ago

Here are the meshes I am trying to process. meshes.zip

mkazhdan commented 4 years ago

I think the underlying assumption is that the individual charts are valid manifold meshes, with boundary. Specifically, the code is looking at each individual chart (i.e. connected component) and trying to walk around its boundary. It terminates once it reaches a boundary vertex that has already been visited. Assuming the individual chart was manifold, if it hits a vertex that's been processed then that vertex should be the starting vertex and everything is good. However, if the chart is not manifold, it could hit some other processed vertex first and then the code crashes.

I tried visualizing the texture map for model2.ply, but it looked too gnarly to get a read on: atlas

Here's a visualization of a situation where things could be going bad. badness.pdf Assuming we start going around the chart, counter-clockwise, from vertex 0, after we meet vertex 6 we meet vertex 3, which has already been processed. Had the mesh been watertight, the first time we meet a processed vertex would be when we get back around to vertex 0.

JohnAlphaIII commented 4 years ago

Thanks for the explanation! It helps!