We ran into an issue due to documented but unexpected behavior of the VTK API. A new developer introduced a bug by calling
double* vtkPoints::GetPoint(vtkIdType) multiple times and did not expect that a new call to
GetPoint overwrites all previously returned values.
The method documentation correctly describes limitation of the method, so we could say that it’s the developer’s fault of not reading the documentation. However, it would make VTK-based software more robust if it was harder to misuse the API.
What do you think about deprecating/removing the error-prone
double* vtkPoints::GetPoint(vtkIdType) method from the VTK public API?
The method is very convenient and safe to use from Python (as the array values are copied anyway), so it should be kept for that purpose (for example, by adding
#ifdef __VTK_WRAP__ around it instead of actually removing the code).
The issue is somewhat similar to this, with a difference that this
GetPoint API has been around for many years, so it is not a recently introduced change in behavior. Still, maybe a similar approach can be used to address both - maybe using