[vtkusers] Basic questions?
Jérôme
jerome.velut at gmail.com
Thu Jan 28 06:17:01 EST 2010
Hi,
Yes, by setting NumberOfPoints to 1, Radius to 0 and Center to your x,y,z
coordinates in vtkPointSource, you will generate a single point where you
want. I use it daily for seeding algorithms.
I don't think it is overkill: VTK has a lot of classes, and, IMHO, I'd
rather not having one specialized class to generate one point beside another
that generates N points.
In ParaView ->Sources ->Point Source, this is exactly what is used and the
default settings are: 1 point, Radius=0.
cheers,
Jerome
2010/1/28 Anders Wallin <anders.e.e.wallin at gmail.com>
> >> 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
> _______________________________________________
> 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/20100128/c09115c3/attachment.htm>
More information about the vtkusers
mailing list