[vtkusers] Unstructured grid to structured grid?

Chris Marsh chris.marsh at usask.ca
Wed Sep 17 14:55:55 EDT 2014


Because, at this point, I just wanted to get something working, and all the
example code has Delaunay2D. Figured it was a good start :) Agreed though
that it is non-optimal in the long run.

Chris Marsh
PhD Student
chrismarsh.ca

13 Kirk Hall
University of Saskatchewan

On Wed, Sep 17, 2014 at 12:53 PM, David Gobbi <david.gobbi at gmail.com> wrote:

> I'm not sure if I've understood, but if your original data already has
> connectivity (i.e. faces), then why are you using vtkDelaunay2D at all?
>
> On Wed, Sep 17, 2014 at 12:49 PM, Chris Marsh <chris.marsh at usask.ca>
> wrote:
> > Hi all,
> >
> > Thanks for persevering with me. I got it working correctly with
> > vtkPlaneSource.
> >
> > The problem ended up being a PEBKAC with how I was using the Delaunay2D
> > class: When converting from CGAL to vtkUnstructuredgrid, you need to
> index
> > the face values and vertices separately while maintaining connectivity.
> > Because you are defining the connectivity, this works. However! with
> > vtkDelaunay2D, you can't do this. Rather, for each vertex that is added
> to
> > 'points', the face data must be added 3-times. Which this isn't quite
> > perfect, it should work fine, unless there is a way of using an
> unstructured
> > mesh and a probe filter?
> > http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/GeometryFilter
>  suggests
> > you can? So I will have to play around with that more.
> >
> > Thanks again, much appreciated.
> >
> > Chris Marsh
> > PhD Student
> > chrismarsh.ca
> >
> > 13 Kirk Hall
> > University of Saskatchewan
> >
> > On Wed, Sep 17, 2014 at 11:00 AM, David Gobbi <david.gobbi at gmail.com>
> wrote:
> >>
> >> On Wed, Sep 17, 2014 at 10:45 AM, Chris Marsh <chris.marsh at usask.ca>
> >> wrote:
> >> > Hi David,
> >> >
> >> > Thanks for the reply, this is slowly starting to make sense. That call
> >> > did
> >> > in fact fix the bounds issues. However, the output still looks like it
> >> > did
> >> > in the above screenshot.
> >> >
> >> >>The plane is already composed of cells, so you should not run it
> >> > through Delaunay.
> >> >
> >> > This is what perplexed me about the above linked example.
> >> >
> >> > What is the best way to write the probe results to a file then?
> >>
> >> At the beginning, I was hinting that you should probe with a
> >> vtkImageData, which you could have written out as an image
> >> (either as raw data, or as a png, etc).  But now that you have
> >> the probed data as a polydata plane, you'll have to get the
> >> scalars that are associated with the points that make up the
> >> polydata.  GetPointData()->GetScalars() will return an array
> >> that contains all the scalars.  See the VTK text for an in-depth
> >> description of how data is stored in a VTK data set.
> >>
> >>  - David
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20140917/43e9b5b2/attachment.html>


More information about the vtkusers mailing list