[vtkusers] Basic questions?

David Doria daviddoria+vtk at gmail.com
Wed Jan 27 23:03:28 EST 2010


On Wed, Jan 27, 2010 at 10:48 PM, Anders Wallin
<anders.e.e.wallin at gmail.com> wrote:
> 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

> 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?

> 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);

Thanks,

David



More information about the vtkusers mailing list