[vtk-developers] Re: contour lines and scalar color plot issues with vtkUnstructuredGrid

David C. Thompson dcthomp at sandia.gov
Wed Feb 15 14:00:52 EST 2006


On Wed, 2006-02-15 at 07:50, Burlen wrote:
> There may be more to this problem than interpolation error. I say this because 
> in the past we have used rectilinear grids with non constant grid spacing and 
> experienced no such issues. If my present problem were caused by 
> interpolation error I would expect the same problem when using the 
> irregularly spaced rectilinear grids.
> 
> It seems to me that the problem of open contours might be caused by the 
> algorithm(s) used with unstructuredGrids built with the append filter. Could 
> it have somehting to do with the fact that the boxes in my case are appended 
> in a "willy nilly" order? adjacent boxes aren't necessarily appended one 
> after the other.
> 
> In the vtk text it says something to the effect that there are two ways for 
> the contouring process to terminate, 1) when a contour closes on itself, 2) 
> when the edge of the dataset is reached. Since in the example I sent, the 
> contours aren't closed, the contour generation process must have reached the 
> edge of the dataset. So Maybe even though I appeneded the original 
> vtkImageData into one vtkUnstructuredGrid vtk sees them as mulitiple 
> datasets? 
To the best of my knowledge, the contour algorithms will never "stitch"
neighboring datasets; it is something you must do yourself if you want.
For instance, you could constrain "pendant" nodes on the boundary to
interpolate the same function as the lower-resolution neighbor. In the
example I gave previously, you might change the high-resolution point
values from

f=  0    2    3    3 
    |    |    |    |
  --x----x----x----x--
    |              |
f=  0              3

to 

f = 0    1    2    3
    |    |    |    |
  --x----x----x----x--
    |              |
    0              3

The output contours would then match up visually, but you would still
have to use vtkCleanPolyData or some such to stitch vertices on the
boundary. In 3D, this can still lead to trouble since there will be
triangles with pendant vertices in the output contours, but at least
there should not be large cracks.

You say in the past you used rectilinear grids with non-constant spacing
without problem. Do you mean multiple rectilinear grids with
discontinuities as shown in your picture? If so, is it possible that
whatever generated the function values properly constrained f as I've
shown above? If you mean a single rectilinear grid, then it is
impossible to have discontinuities like the ones above because of the
way the grid is defined, but it is also impossible to have local
refinement. Choose your poison: unacceptably large meshes or
unacceptably discontinuous function approximation.

	David




More information about the vtk-developers mailing list