-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reordered local vertices in load_mesh / flipped tets in mesh #57
Comments
this should fix this one too: |
I don't think this issue was ever properly resolved. The commit linked does not fix the problem which is that the CMesh3D class sorts each of the cell's vertices by ID. In for (auto fid : cell.fs)
{
cell.vs.insert(cell.vs.end(), mesh_.faces[fid].vs.begin(), mesh_.faces[fid].vs.end());
}
sort(cell.vs.begin(), cell.vs.end());
cell.vs.erase(unique(cell.vs.begin(), cell.vs.end()), cell.vs.end()); Maybe this is only so the unique will work, and removing duplicates while preserving order might fix it. 🤞 There are a number of other sorts in that file as well. Some are doing it to remove duplicates, but others are doing it on temporary local variables to check for equality. The latter seems perfectly fine. |
Actually even with an order-preserving duplicate removal, I still get inverted elements. I think it comes from the |
Yes, I once went through this, I also think it's creating every cell from its faces. |
When a mesh in msh22 format is loaded, if I call
mesh->cell_vertex(c, v)
to get the cell list, the local vertices are sorted.Here're the first few cells in my mesh
Here're the first few cells in the mesh class
This may make tets flip if one wants to export the mesh.
The text was updated successfully, but these errors were encountered: