[vtkusers] Coloring 2D surface along contourlines

Deij, Menno M.Deij at marin.nl
Tue Jul 5 15:43:43 EDT 2011


Hi Jérôme,

I've tried using vtkContourFilter, but that does not help with the coloring on the polygonal data set. It only extracts the isolines, which can be added to the scene using a separate vtkActor (optionally with a vtkTubeFilter to enhance the isoline 'width').

Best wishes,
Menno



MARIN news: Are you a PhD/MSc student with no fear of depth?<http://www.marin.nl/web/News/News-items/Are-you-a-PhDMSc-student-with-no-fear-of-depth.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.



________________________________
From: Jérôme [jerome.velut at gmail.com]
Sent: Tuesday, July 05, 2011 8:37 PM
To: Deij, Menno
Cc: vtkusers at vtk.org
Subject: Re: [vtkusers] Coloring 2D surface along contourlines

Hi,

You may want to use vtkContourFilter: It implements an isoline extraction from any type of dataset.

HTH
Jerome

2011/7/5 Deij, Menno <M.Deij at marin.nl<mailto:M.Deij at marin.nl>>
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.


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.



_______________________________________________
Powered by www.kitware.com<http://www.kitware.com>

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110705/e9023aa2/attachment.htm>


More information about the vtkusers mailing list