Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Common/vtkSurfaceBase.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1413,6 +1413,21 @@ void vtkSurfaceBase::CreateFromPolyData(vtkPolyData *input)
// just copy the polydata in input
this->ShallowCopy(input);

#if ( (VTK_MAJOR_VERSION >= 9))
// GetFaceVertices() hands out raw pointers into the polygon connectivity and
// therefore requires 64-bit AOS cell storage. The input may carry another
// layout (32-bit or fixed-size, e.g. from vtkSurfaceNets3D), so copy its
// polygons into 64-bit storage instead of converting the shared array in place.
if (!this->GetPolys()->IsStorage64Bit())
{
vtkCellArray *Polys64 = vtkCellArray::New();
Polys64->DeepCopy(this->GetPolys());
Polys64->ConvertTo64BitStorage();
this->SetPolys(Polys64);
Polys64->Delete();
}
#endif

// Delete the cells that are not polygons
vtkCellArray *VerticesCells=this->GetVerts();
vtkCellArray *LinesCells=this->GetLines();
Expand Down
Loading