Line elements cause missing edges in triangle cells

This started in VTK 9.6, but is present in 9.7 as well. I’m not sure how pervasive it is, but if I have an unstructured grid with only triangles and lines, the triangles don’t have edges shown. If I don’t have the lines, the triangles have edges with the same code.

With lines:

Without lines:

If I switch to quads instead of triangles, the quads have edges in both cases. So, its something about the interaction of triangles and lines that’s causing something weird to happen.

Is there any workaround for this?

example_triangles.py below shows the issue if using VTK 9.6 or later. If you comment out the line creation on 116-119, the triangles will then have edges. example_quads is the same as example_tris but its has quads instead of tris and shows edges whether line elements are present or not.

If you run any of these in VTK 9.4 .1 or earlier, edges are shown for all cases.

Example code:

example_triangles.py (4.5 KB)

example_quads.py (4.3 KB)

Doing some more research, the edges of triangles show if there are any other cells with a quad face shown (quad, wedge, hex, etc). The same issue with edges not showing also pertains to tetrahedral elements, so its something to do with triangular faces that are causing the issue.

Sounds ripe for a bisect if anyone wants to go on an adventure…