[Paraview] Bonds representation

Jerier Jean-François jean-francois.jerier at epfl.ch
Thu Nov 18 10:23:32 EST 2010


Hi Eric,

Many thanks for your file and your clear explanations, I managed to do that I wanted. I have learned many things on Paraview and I discovered the power of filters.

Regards
JF

________________________________________
From: Eric E. Monson [emonson at cs.duke.edu]
Sent: Thursday, November 18, 2010 3:31 PM
To: Jerier Jean-François
Cc: paraview at paraview.org
Subject: Re: [Paraview] Bonds representation

Hey Jean-François,

Well, since you want to apply the Tube filter, you may want to define your data as POLYDATA instead of unstructured grid (since you have to turn the data into vtkPolyData to apply the Tube filter, anyway). Then, since the radius of the tube filter is based on point data rather than cell data, you'll have to run Cell Data to Point Data in ParaView at some point, but with the way your data is defined now you share points at the intersections of the line segments, and so the point data will end up as the average value of each of the neighboring cells. (Just run it on your data file and you'll see in the Inspector tab that all values are 15.) You can solve this by running the Shrink filter first with a Shrink Factor of 1.0 and it will duplicate the end points for you. (This will also create an Unstructured Grid out of your polydata, though.) So, you might want to just define the duplicate end points in your data file. With this you can just load it in, run cell data to point data, and then apply tubes. Of course, you can also just define point data in your data file, where you duplicate the cell data for each of the line segment end points instead of doing this with ParaView.

With separate cells you'll always get disconnected tubes (instead of one continuous tube with "nice" joined corners around the square, in this case) -- I don't think you can avoid this with the way you need to define your data on the edges.

Mainly it comes down to choices between how much you want to do with ParaView filters, and how much you want to pre-process and just store in your data file instead. I'll attach an alternate vtk file which does the extreme example of putting everything in the data file so all you have to do is load it in and apply the Tube filter. (But again, if you want to store minimal information in you data file, you can just use your original data file and apply the pipeline: file.vtk->Shrink->CellDatatoPointData->ExtractSurface->Tube.)

Hope this helps,
-Eric



More information about the ParaView mailing list