Open SamuelReithmeir opened 2 months ago
I've created a pull request which should fix the issue. https://github.com/jpcy/xatlas/pull/138
Better fixed by https://github.com/jpcy/xatlas/pull/138
Thanks a lot. I'll continue this thread. I've found another one issue. NGon is gnored if it's too polygonal. If NGon has at least one zero area triangle it will be ignored.
A problem is here. I'm checking it.
This has worked out. We need to calculate an area of all triangles. And then make a decision if it should be ignored.
Now it works well even with a 10000 NGon.
I'll update my pull request.
Another one problem is found: XAtlas triangulates Quads/NGons and considers them as uniquee triangles. For example, 2 triangles of a quad can be in different charts.
This doesn't happen if an original mesh is triangulated:
I think it can be fixed in the computeCharts() function. Looking at it.
It was pretty hard to understand what's going on there but I almos fixed quads and ngons determination by charts. Hopefully, to finish today/tomorrow.
Finally, I made've final changes/fixes for Quads/NGons.
My commit: https://github.com/jpcy/xatlas/pull/138/commits/22f4d644aeff61a99af10facd579d4736c5043d4 https://github.com/jpcy/xatlas/pull/138#issuecomment-2445383272
Pictures: Some pictures of a final result after a generation:
Some pictures to explain a new computeBoundaryIntersection variable which I've added with the latest commit.
I just stumbled over a problem with FaceVertexCount, i get an invalid memory access. A sample would be: face0: 3 vertices face1: 4 vertices face2: 5 vertices this results in a total IndexCount of 12
when adding that mesh declaration i get a invalid memory access (i use XAtlas in c# using swig). After looking at the code i found this code: https://github.com/jpcy/xatlas/blob/f700c7790aaa030e794b52ba7791a05c085faf0c/source/xatlas/xatlas.cpp#L9096
According to my understanding
face * faceVertexCount + i
seems to be a logic error. To explain: This seems to calculate the offset/beginning of the indices of this face and addi
. But the problem is that it assumes that all faces before also have the same faceVertexCount, which destroys the entire purpose of having faceVertexCount be an array in the first place.Please correct me if i misunderstand the logik here, but i will provide a PR, which will change the logic here to a variable which will sum up the previous faceVertexCounts.