When storing face information for polyhedral cells,
vtkUnstructuredGrid uses a
vtkIdTypeArray in a special format that looks awfully similar to how
vtkCellArray used maintain its internal storage. I wonder if it should simply be changed to using
vtkCellArray instead. That allows us to use a non-interleaved storage for faces. Together with using a
FaceLocations the one-2-many relationship can be easily preserved without resorting to custom layout used by the
So here’s the proposed structure:
vtkCellArray): simply stores point ids for all points for each polyhedral element
vtkCellArray): each element defines a face. The indices per element directly refer to point ids.
vtkCellArray): each element identifies a polyhedral cell. The indices per element reference face defined in the Face array.
Contrast this with how this information is currently stored:
vtkCellArray): simply stores point ids for all points for each polyhedral element (same as in the new proposal)
vtkIdTypeArray): an interlaved array of the form
(numCellFaces, numFace0Pts, id1, id2, id3, numFace1Pts,id1, id2, id3, ...)
vtkIdTypeArray): offset array into Faces array indicating where the faces for a corresponding cell are stored