MOAB edge-face adjacency error for polyhedra
I’ve found an edge to face adjacency error for a particular kind of polyhedron. See the attached example code.
Basically, consider a cube, but where 3 of the faces in a line (sharing 2 edges pairwise) are a single polygon face, which is shaped like a C. For an edge joining corners of the C, ask for adjacent faces, you should get 2, but instead get 3 (the C face is included when it shouldn’t be). In this case the C face contains the two vertices bounding the edge, but not the edge itself.
I’ll work on fixing this one myself, as it’s important for us at Simscale.
Comments (4)
-
-
I mean, this has no relation to the problem you reported; the problem appears (I think) because v2-v6 edge is interior to the C-shape face; we first look at the vertex adjacencies, intersect them; we do not check if the edge is indeed on the side of the polygon ;
-
in general, allowing faces that are non-planar in a polyhedron opens a can of worms; or maybe the example is just for illustration ? I think we said somewhere that it is the user’s responsibility to have a correctly-defined polyhedron, as we do not do any geometric checks.
-
and the example is wrong, it is not a polyhedron; the 4th face should have been v1, v2, v6, v7, v3, v4, v8, v5
correction: he comment is wrong; the faces should have been these, comparing the code with the comments:
36 // f1: v1, v5, v8, v4
37 // f2: v1, v2, v6, v5
38 // f3: v2, v3, v7, v6
39 // f4: v1, v2, v3, v7, v6, v5, v8, v4The error still appears because edge v2-v6 is not recognized as internal to the C-shape, non-planar polygon;
We look at up-adjacencies for the vertices that form the existing edge v2-v6; both vertices are adjacent to 3 polygons, including the C-shape one; for the C-shape one, v2-v6 edge is interior, not on the side;
#0 moab::AEntityFactory::get_up_adjacency_elements
#10x00000000006f2c52 in moab::AEntityFactory::get_adjacencies
#20x0000000000423a06 in moab::get_adjacencies_intersection
#3 0x0000000000416574 in moab::Core::get_adjacencies
#40x000000000040eab6 in main (argc=1, argv=0x7fffffffd4f8) at polyedge.cpp:107 - Log in to comment
I have issues with this example; the way to describe the 8-node face is not unique;
How do I know it is not the complementary ? The other C shape that you can form ? Faces have no way to determine if they are inward or outward oriented with respect to the polyhedron; the loop that describe the C shape face is the same; one is yin, the other yan.
Only if I look at the other 3 faces you define, it is clear that the C face is the union of the other 3 faces of the cube;