[vtkusers] Writing vtu files

Eric E. Monson emonson at cs.duke.edu
Fri Sep 10 18:08:40 EDT 2010


Hey Jee,

(Make sure you reply to the whole list so everyone can contribute and learn together.)

There are various examples and tests which are linked off of the vtkUnstructuredGrid documentation page:

http://www.vtk.org/doc/nightly/html/classvtkUnstructuredGrid.html

For example, there is a Python script that specifically shows how to build various types of cells:

http://vtk.org/gitweb?p=VTK.git;a=blob;f=Examples/DataManipulation/Python/BuildUGrid.py

and just glancing through some of the tests, I see that TestUnstructuredGridGeometryFilter.cxx assembles an unstructured grid with many types of cells:

http://vtk.org/gitweb?p=VTK.git;a=blob;f=Graphics/Testing/Cxx/TestUnstructuredGridGeometryFilter.cxx

These are also in the VTK source code in [vtk_src]/Examples/DataManipulation/Python and [vtk_src]/Graphics/Testing/Cxx respectively. You can look through the other examples, too, as there may be simpler ones more tailored for exactly what you're trying to do.

Good luck,
-Eric


On Sep 10, 2010, at 5:16 PM, shankarjee at Ucla.edu wrote:

> Eric
>   Is there some code which also explains how to add cell data to the unstructured grid file. Sorry I am just learning to use vtk. Thanks
> 
> Jee
> 
> 
> Quoting "Eric E. Monson" <emonson at cs.duke.edu>:
> 
>> Hey Jee,
>> 
>> Do you need help creating your unstructured grid, or just writing it?
>> 
>> There is this example on the wiki for writing an XML-based VTK unstructured grid file:
>> 
>> http://www.paraview.org/Wiki/VTK/Examples/Cxx/IO/WriteVTU
>> 
>> -Eric
>> 
>> ------------------------------------------------------
>> Eric E Monson
>> Duke Visualization Technology Group
>> 
>> 
>> On Sep 10, 2010, at 12:25 PM, shankarjee at ucla.edu wrote:
>> 
>>> Hi
>>>   I am trying to write vtu files using vtk c++ routines. I was able to find a sample code on how to write structured grid. Can some one point me to an example to how to write unstructured grid in XML format using the vtk c++ routines. Thanks
>>> 
>>> Jee
>>> _______________________________________________
>>> Powered by www.kitware.com
>>> 
>>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>> 
>>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>>> 
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.vtk.org/mailman/listinfo/vtkusers
>> 
>> 
> 




More information about the vtkusers mailing list