Internal error: Closed surface not correctly partitioned
When trying to call DirectX::UVAtlasCreate with a specific mesh, it consistently fails with a Closed surface not correctly partitioned error. I have uploaded an example project (including the data for the mesh in question) to replicate the issue here:
test_uvatlas.zip
The mesh is rather large, so UVAtlasComputeIMTFromTexture takes a few minutes to complete.
It works fine with other, simpler meshes.
Edit: I've tried it with another large mesh and got the same error. I have no idea what to look for, otherwise I'd try to narrow it down. Also, DirectX::UVAtlasComputeIMTFromTexture can take a few hours to complete, I'm not sure if that's normal.
There are a number of these warnings before the failure:
Try to clean the non-manifold mesh, generated by partition
The DirectXMesh Clean and Validate methods are very useful for conditioning the mesh before you attempt to use UVAtlas.
https://github.com/microsoft/DirectXMesh/wiki/DirectXMesh#mesh-cleanup-and-validation
There are a number of these warnings before the failure:
Try to clean the non-manifold mesh, generated by partitionThe DirectXMesh
CleanandValidatemethods are very useful for conditioning the mesh before you attempt to use UVAtlas.https://github.com/microsoft/DirectXMesh/wiki/DirectXMesh#mesh-cleanup-and-validation
@walbourn Hi Chuck,
I checked the codes and found that the UVAtlasTool already called the DirectXMesh Clean and Validate methods before calling the UVAtlasCreate, but for some meshes, I still got the "closed surface not correctly partitioned" error.
Does this mean there could be some non-manifold meshes that couldn't be fixed by the DirectXMesh Clean and Validate methods, and UVAtlasCreate would fail on those meshes?
Thanks!
Right. meshconvert only calls Clean if you use -c, but uvatlas always calls it.
Do you get any warnings from Validate (which is called before Clean) or just from UVAtlas?
Right.
meshconvertonly callsCleanif you use-c, butuvatlasalways calls it.Do you get any warnings from
Validate(which is called beforeClean) or just from UVAtlas?
Yes, I got warnings from Validate saying "bowties found" and "vertex dups". But I thought Clean would take care of those issues. I also got those warnings when processing others meshes, but UVAtlasTool worked fine on those meshes.
Try hacking up your local copy of uvatlas to do the Validate again after the Clean. It seems like it's not fixing all the issues...
Try hacking up your local copy of uvatlas to do the
Validateagain after theClean. It seems like it's not fixing all the issues...
I put another Validate after Clean, and the message returned from the 2nd Validate is empty. I also test the Validate method with all available VALIDATE_FLAGS, and the results are the same: the Validate before Clean reports "bowties found" warning, and the one after Clean doesn't report anything.
OK, so the Clean worked but there's some degenerate case in your model that's tripping up UVAtlas...