[vtkusers] Coloring 2D surface along contourlines

Jérôme jerome.velut at gmail.com
Wed Jul 6 04:41:01 EDT 2011


Hum... Sorry I misunderstood something. I thought you have a flat grid with
scalar elevation : "vtkStructuredGrid with points having scalar data:
elevation" and you wanted to color the isolevels...

I feel surprised by looking your first screenshot: attached is simulated
terrain in paraview. Pipeline has been built to match your data:
    [ Wavelet, extent=[-25,25/-50,50/0,0] ]
--> [ ExtractSurface ]
--> [ WarpByScalar -- modify the geometry according to wavelet data -- ]
--> [ Elevation -- Compute elevation on z axis -- ]
--> [ GenerateSurfaceNormals ]

ParaView rendering pipeline is totally based on VTK one, as well as the
previous used filters and source. You should be able to get the same
visualisation.

The aliasing that seems to bother you may be due to the interpolation method
: you can try to switch between gouraud and flat in the actor's property. If
it doesn't help and if possible, having your data would make it easier to
help you.

Best regards,
Jerome

2011/7/5 Deij, Menno <M.Deij at marin.nl>

>  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>
>
>>   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 P.O. Box 28 T +31 317 49 39 11  6700 AA
>> Wageningen  T   The Netherlands I  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
>>
>> 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/20110706/22768a03/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: elevation.png
Type: image/png
Size: 100775 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110706/22768a03/attachment.png>


More information about the vtkusers mailing list