[vtkusers] Basic questions?

Anders Wallin anders.e.e.wallin at gmail.com
Thu Jan 28 03:39:32 EST 2010


>> 1. If I want to write my own source-class, what is the minimal
>> functionality I need to provide so it can work as input to a
>> PolyDataMapper? Is there a simple example somewhere? In Python?
>
> All it has to do is produce a PolyData to be the input of a
> PolyDataMapper. Here is an example:
> http://www.vtk.org/Wiki/VTK/Examples/vtkPolyDataAlgorithmReader

OK, thanks I will try this.

>> 2. I want to load from disk and render STL-surfaces, i.e. a bunch of
>> triangles. I have code for reading triangles from disk into Python,
>> but what source/data class should I use? Examples?
>
> I don't understand what you are asking. Here is how to read STL file:
> http://www.vtk.org/Wiki/VTK/Examples/IO/ReadSTL
> (but I think you've already done that?). So now what do you want to do exactly?

In 1. above I would have a geometry or parametric function which
generates the polydata by calculation, and in 2. I would read the
triangles from a file. The triangles in an STL file can come in any
order and may not be connected or share edges, I hope that will work.

>> 3. Is there a source-class for a single point/vertex?
> You can use this:
> http://www.vtk.org/Wiki/VTK/Examples/PointSource
> with
> pointSource->SetNumberOfPoints(1);

and radius=0 ?
Just seems a bit overkill to use a class which can generate N random
points inside/on a circle with different distributions, when all I
want is a single point positioned at a known (x,y,z) coordinate.

AW



More information about the vtkusers mailing list