[vtkusers] howto: rectangular grid, circle

Nico Schlömer nico.schloemer at gmail.com
Mon Feb 8 19:12:06 EST 2010


Hi,

thanks for your quick answer.

> Here is a brief summary of the data types available in VTK:
> http://vtk.org/Wiki/VTK/Tutorials/3DDataTypes

I don't really understand what's so *3D* about it (e.g., Image Data).
Is there other 2D stuff, too?

> and an unstructured grid:
> http://vtk.org/Wiki/VTK/Examples/IO/WriteVTU

Thanks a lot for the link to the examples page, that's really really
helpful. I was able to play around with it and do this and that.
Still, I'm missing a few things, e.g., tutorials for writing other
data types (e.g., VTR files). I'm also not quite clear now on the
options that I could use in conjunction with the writers. Is that
something I'd have to discover by the doxygen documentation, or are
there comprehensive example/option description resources?

I was specifically asking myself if it's possible to include custom
info into XML-style VT* files. I'm solving PDEs here, and I'd like to
store the result of one run, and I thought it might be a good idea to
store it in a format which I can actually *look* at, too, rather than
just plain numbers in columns. I'd like to store additional info about
the respective PDE, too, which for example in the old-style VTK files
I always used the second row for (although space was rather limited
there).

Cheers,
Nico




On Thu, Feb 4, 2010 at 2:27 PM, Nico Schlömer <nico.schloemer at
gmail.com>wrote:

> Hi all,
>
> I have this data and I wonder how to represent it best in a scientific
> format (e.g., some flavor of VTK). I'm not sure though which suits
> best.
>
> So, I'm having this very simple 2D rectangular grid here, let's say
> equal grid spacing overall, and I intersect this with, say a circle,
> such that I'm looking at *only the grid points which sit inside the
> circle. -- A pixeled circle then if you want.
>
> At each grid point, I got one scalar value, and this I'd like to visualize.
>
> I was looking at STRUCTURED_POINTS to plot the values in the circle
> and a tight bounding box around it, but here I'd have to set values
> for all the points outside the circle I guess.
>
> I'm not too familar with the XML formats, so I haven't really looked
> into that yet.
>
> Anyone got a quick idea for which representation may be best suited?
>
> Cheers,
> Nico
>
Here is a brief summary of the data types available in VTK:
http://vtk.org/Wiki/VTK/Tutorials/3DDataTypes
In your case, as you mentioned, you shouldn't represent the points outside
the circle, so "grid based" methods are out. This leaves you with
vtkPolyData and vtkUnstructuredGrid.

Here is an example of how to make a polydata:
http://vtk.org/Wiki/VTK/Examples/IO/WriteVTP

and an unstructured grid:
http://vtk.org/Wiki/VTK/Examples/IO/WriteVTU

Let us know if you have any problems.

Thanks,

David



More information about the vtkusers mailing list