[vtkusers] Coloring 2D surface along contourlines

Deij, Menno M.Deij at marin.nl
Tue Jul 5 10:05:24 EDT 2011


Dear vtk-users,

First a disclaimer: I’m quite new to VTK and this is my first post to the users list.

I’m trying to do the following: read in a list of 3D-coordinates representing a wavy surface as a vtkStructuredGrid, color it according to the elevation and show it. The structured grid has dimensions i=50, j=100, k=1 (note that k=1, the surface is made up of polygons).
My first attempt was using the following pipeline:

[vtkStructuredGrid with points having scalar data: elevation] --> [vtkStructuredGridGeometryFilter] --> [vtkPolyDataNormals] -->  [vtkPolyDataMapper] -> [vtkActor]

But the result is quite blurred and full of ‘kinks’ between the colored sections (see screenshot_1.png).

What I want to achieve is something that has smooth/crisp lines along the contourlines, similar to screenshot_2.png. Here the colors change depending on constant elevation. I achieved this picture by cutting the wavy surface using vtkClipPolyData at 10 different elevations and creating 10 different actors for this (for more clarity see screenshot_3.png).

My question is: is there a more simple way to achieve the smooth/crisp lines along contourlines, or is clipping multiple times the only solution? I’ve been trying to do something with vtkMarchingSquares, but this does not act on vtkPolyData only on vtkImageData.

Thanks and best wishes,


Menno

PS. I hope the pictures are viewable in the list, if not I can make them available on request.

[cid:image8299b0.JPG at 543071a2.4a89d00c][cid:image6531f6.JPG at d95a81f6.4e8cdc1e]

dr. ir. Menno A. Deij


Software Engineer


Maritime Simulation Group




MARIN




        2, Haagsteeg

E M.Deij at marin.nl<mailto:M.Deij at marin.nl>       P.O. Box 28     T +31 317 49 39 11
        6700 AA Wageningen
T       The Netherlands I  www.marin.nl<http://www.marin.nl>





MARIN news: Practical Application Viscous-flow Calculations for Simulation of Manoeuvring Ships<http://www.marin.nl/web/News/News-items/Practical-Application-Viscousflow-Calculations-for-Simulation-of-Manoeuvring-Ships.htm>

This e-mail may be confidential, privileged and/or protected by copyright. If you are not the intended recipient, you should return it to the sender immediately and delete your copy from your system.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110705/9025878f/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image8299b0.JPG
Type: image/jpeg
Size: 1069 bytes
Desc: image8299b0.JPG
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110705/9025878f/attachment.jpeg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image6531f6.JPG
Type: image/jpeg
Size: 1622 bytes
Desc: image6531f6.JPG
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110705/9025878f/attachment-0001.jpeg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: screeshot_1.png
Type: image/png
Size: 132770 bytes
Desc: screeshot_1.png
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110705/9025878f/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: screeshot_2 .png
Type: image/png
Size: 10186 bytes
Desc: screeshot_2 .png
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110705/9025878f/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: screeshot_3 .png
Type: image/png
Size: 11946 bytes
Desc: screeshot_3 .png
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110705/9025878f/attachment-0002.png>


More information about the vtkusers mailing list