Tetrahedralize and Triangulate filters should check if input is already triangulated
The Tetrahedralize
and Triangulate
filters blindly convert all their cells to tetrahedra/triangles. If the input already comprises only these simplicies, then this is wasted effort.
These filters should first check to see if their input already only has the desired cell type. It should first check if the input cell set is a CellSetSingleType<>
with the proper cell type. If so, it can just return the input as output. It should then check if the input cell set is a CellSetExplicit<>
and all the cells are the appropriate type. (I think the fastest way to do this would be to pull out the ArrayHandle
of cell shapes, create an ArrayHandleTransform
that is true for tetrahedron/triangle and false otherwise, and then use vtkm::cont::Algorithm::Reduce
on that.