[vtkusers] howto: rectangular grid, circle

David Doria daviddoria+vtk at gmail.com
Thu Feb 4 14:42:35 EST 2010


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100204/cbd61cdf/attachment.htm>


More information about the vtkusers mailing list