cellLocator->BuildLocator(); // Now fire a ray from outside the bounds to the center and find a // cell. This cell should be on the outside surface double rayStart[3];
for (unsigned int i = 0; i < 3; i++) { rayStart[i] = bounds[2 * i + 1] * 1.1; } v
tkIdType cellId = -1;
double xyz[3], t, pcoords[3];
int subId;
cellLocator->IntersectWithLine(rayStart, center, 0.0001, t, xyz, pcoords, subId, cellId);
std::cout << "Id of cell on outside surface: " << cellId << std::endl; vtkNew<vtkPolyDataConnectivityFilter> connectivityFilter;