In vtkyou can add up to the hexagonal prism cell in vtkUnstructuredGridwith InsertNextCell (int type, vtkIdType npts, vtkIdType *ptIds). This is good, but I would like to include the heptagonal and octagonal prism in vtkUnstructuredGrid. Cell type not defined in vtk ...
Just to eliminate some doubts, I work with c#, but examples c++or pythonwill be enough to translate it into c#.
To get back to this problem, I first copied and slightly modified the code in this example to get a voxel (8 points and celltype = 11)
vtkPoints points = vtkPoints.New();
points.InsertNextPoint(-1.0, -1.0, -1.0);
points.InsertNextPoint(1.0, -1.0, -1.0);
points.InsertNextPoint(1.0, 1.0, -1.0);
points.InsertNextPoint(-1.0, 1.0, -1.0);
points.InsertNextPoint(-1.0, -1.0, 1.0);
points.InsertNextPoint(1.0, -1.0, 1.0);
points.InsertNextPoint(1.0, 1.0, 1.0);
points.InsertNextPoint(-1.0, 1.0, 1.0);
vtkUnstructuredGrid unstructuredGrid1 = vtkUnstructuredGrid.New();
unstructuredGrid1.SetPoints(points);
int[] ptIds = new int[] { 0, 1, 2, 3, 4, 5, 6, 7 };
IntPtr ptIdsPointer = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(int)) * 8);
Marshal.Copy(ptIds, 0, ptIdsPointer, 8);
unstructuredGrid1.InsertNextCell(11, 8, ptIdsPointer);
Marshal.FreeHGlobal(ptIdsPointer);
vtkDataSetMapper mapper = vtkDataSetMapper.New();
mapper.SetInputConnection(unstructuredGrid1.GetProducerPort());
vtkActor actor = vtkActor.New();
actor.SetMapper(mapper);
actor.GetProperty().SetColor(1, 0, 0);
actor.GetProperty().SetPointSize(3);
actor.GetProperty().SetOpacity(1);
actor.GetProperty().SetLineWidth(2);
actor.GetProperty().EdgeVisibilityOn();
Renderer3D.AddActor(actor);
This correctly shows the voxel output: 
, , VTK_POLYHEDRON, , pf grid
unstructuredGrid1.InsertNextCell(11, 8, ptIdsPointer);
to (42 VTK_POLYHEDRON, 11 VTK_VOXEL) points = 14
unstructuredGrid1.InsertNextCell(42, 14, ptIdsPointer);
. - ++,
int numberOfVertices = 14;
int numberOfFaces = 9;
int numberOfFaceVertices = 4;
vtkIdType heptagonPointsIds[14] =
{0, 1, 2, 3, 4, 5, 6
7, 8, 9, 10, 11, 12,13};
vtkSmartPointer<vtkPoints> points = vtkSmartPointer<vtkPoints>::New();
points->InsertNextPoint(454.6, 678.534, 1.1009301757813);
points->InsertNextPoint(454.6, 678.545, 1.1500146484375);
points->InsertNextPoint(454.6, 678.556, 1.2255187988281);
points->InsertNextPoint(455.1, 678.556, 1.6478076171875);
points->InsertNextPoint(455.1, 678.534, 1.7926538085938);
points->InsertNextPoint(455.1, 678.545, 1.7166479492188);
points->InsertNextPoint(454.85, 678.534, 1.0092297363281);
points->InsertNextPoint(454.6, 678.534, 5.1009301757813);
points->InsertNextPoint(454.6, 678.545, 5.1500146484375);
points->InsertNextPoint(454.6, 678.556, 5.2255187988281);
points->InsertNextPoint(455.1, 678.556, 5.6478076171875);
points->InsertNextPoint(455.1, 678.534, 5.7926538085938);
points->InsertNextPoint(455.1, 678.545, 5.7166479492188);
points->InsertNextPoint(454.85, 678.534, 5.0092297363281);
vtkIdType heptagonPrismFace[9][4] = {
{0, 1, 7, 8},
{1, 2, 8, 9},
{2, 3, 9, 10},
{3, 4, 10, 11},
{4, 5, 11, 12},
{5, 6, 12, 13},
{6, 1, 13, 8},
{0, 1, 2, 3},
{7, 8, 9, 10},
};
vtkSmartPointer<vtkCellArray> heptagonFaces=
vtkSmartPointer<vtkCellArray>::New();
for (int i = 0; i < numberOfFaces; i++)
{
heptagonFaces->InsertNextCell(numberOfFaceVertices, heptagonPrismFace[i]);
}
vtkSmartPointer<vtkUnstructuredGrid> uGrid = vtkSmartPointer<vtkUnstructuredGrid>::New();
uGrid->InsertNextCell(VTK_POLYHEDRON,
numberOfVertices, heptagonPointsIds,
numberOfFaces, heptagonFaces->GetPointer());
uGrid->SetPoints(points);
vtkSmartPointer<vtkDataSetMapper> mapper = vtkSmartPointer<vtkDataSetMapper>::New();
mapper->SetInputConnection(uGrid->GetProducerPort());
- : 