vtkSurfaceNets3D crashes when DataCaching is OFF
vtkSurfaceNets3D is crashing when I disable DataCaching.
My pipeline/settings are as follows:
auto contour_filter = vtkSmartPointer<vtkSurfaceNets3D2>::New();
contour_filter->SetInputData(label_field);
contour_filter->SetBackgroundLabel(BG);
for (int i = min_label, count = 0; i <= max_label; ++i)
{
if (i != BG)
contour_filter->SetValue(count++, i);
}
contour_filter->SetSmoothing(true);
contour_filter->SetNumberOfIterations(30);
contour_filter->SetConstraintStrategyToConstraintDistance();
contour_filter->SetAutomaticSmoothingConstraints(true);
contour_filter->SetConstraintScale(1.0);
contour_filter->SetOutputMeshTypeToTriangles();
contour_filter->SetTriangulationStrategyToMinArea();
contour_filter->SetDataCaching(false);
The crash is occurring here https://gitlab.kitware.com/vtk/vtk/-/blob/master/Filters/Core/vtkSurfaceNets3D.cxx?ref_type=heads#L2042
Exception thrown: read access violation. vtkPointSet::GetPoints[virtual](...) returned nullptr.
I guess this happens because here we copy from an invalid this->GeometryCache
.
Edited by Bryn Lloyd