[vtkusers] SetCells for multiple cell types

Nico Schlömer nico.schloemer at gmail.com
Tue Nov 24 19:29:35 EST 2015


Thanks for the suggestion!
I actually ended up implementing it without the `UnstructuredGridSource`
and just a plain old `vtkUnstructuredGrid`:
```
    mesh.SetCells(
        numpy_support.numpy_to_vtk(
            cell_types,
            deep=1,
            array_type=vtk.vtkUnsignedCharArray().GetDataType()
            ),
        numpy_support.numpy_to_vtk(
            cell_offsets,
            deep=1,
            array_type=vtk.vtkIdTypeArray().GetDataType()
            ),
        cell_array
        )
```

Cheers,
Nico


On Tue, Nov 24, 2015 at 12:12 PM Favre Jean <jfavre at cscs.ch> wrote:

> Yes, it is possible. Here is an example, adapted from a bigger test case I
> have.
>
> -----------------
> Jean/CSCS
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151125/6451096e/attachment.html>


More information about the vtkusers mailing list