Unique node numeration on edges of vtkLagrangeTetra

Hello!

In most vtkCell types if the function GetEdge() is called, the points on the edge are in such order: first point, then last point, and then the remaining points in sequence. This is not the case for vtkLagrangeTetra, the points are in order from first to last. Why is that?

If I have:

vtkCell* cell;

auto edge = cell→GetEdge(0);

How can I get the first and last point ids on the edge without any special treatment for specific cell types?

I can’t speak to the rationale of the ordering (TJ Corona implemented it and has since left Kitware for other pastures). But you should be able to use these methods to transform back and forth between a 3-tuple index and a flat offset of points in connectivity order:

  void ToBarycentricIndex(vtkIdType index, vtkIdType* bindex);
  vtkIdType ToIndex(const vtkIdType* bindex);

I do not have a barycentric index, I solely have an edge local id and I want to be able to get the first and last index of the edges for an arbitrary cell type, is it possible to implement without special treatment for different cell types?