Hi,<br>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.<br>I don&#39;t think it is overkill: VTK has a lot of classes, and, IMHO, I&#39;d rather not having one specialized class to generate one point beside another that generates N points.<br>
In ParaView -&gt;Sources -&gt;Point Source, this is exactly what is used and the default settings are: 1 point, Radius=0.<br><br>cheers,<br>Jerome<br><br><br><div class="gmail_quote">2010/1/28 Anders Wallin <span dir="ltr">&lt;<a href="mailto:anders.e.e.wallin@gmail.com">anders.e.e.wallin@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">&gt;&gt; 1. If I want to write my own source-class, what is the minimal<br>
&gt;&gt; functionality I need to provide so it can work as input to a<br>
&gt;&gt; PolyDataMapper? Is there a simple example somewhere? In Python?<br>
&gt;<br>
&gt; All it has to do is produce a PolyData to be the input of a<br>
&gt; PolyDataMapper. Here is an example:<br>
&gt; <a href="http://www.vtk.org/Wiki/VTK/Examples/vtkPolyDataAlgorithmReader" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/vtkPolyDataAlgorithmReader</a><br>
<br>
</div>OK, thanks I will try this.<br>
<div class="im"><br>
&gt;&gt; 2. I want to load from disk and render STL-surfaces, i.e. a bunch of<br>
&gt;&gt; triangles. I have code for reading triangles from disk into Python,<br>
&gt;&gt; but what source/data class should I use? Examples?<br>
&gt;<br>
&gt; I don&#39;t understand what you are asking. Here is how to read STL file:<br>
&gt; <a href="http://www.vtk.org/Wiki/VTK/Examples/IO/ReadSTL" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/IO/ReadSTL</a><br>
&gt; (but I think you&#39;ve already done that?). So now what do you want to do exactly?<br>
<br>
</div>In 1. above I would have a geometry or parametric function which<br>
generates the polydata by calculation, and in 2. I would read the<br>
triangles from a file. The triangles in an STL file can come in any<br>
order and may not be connected or share edges, I hope that will work.<br>
<div class="im"><br>
&gt;&gt; 3. Is there a source-class for a single point/vertex?<br>
&gt; You can use this:<br>
&gt; <a href="http://www.vtk.org/Wiki/VTK/Examples/PointSource" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/PointSource</a><br>
&gt; with<br>
&gt; pointSource-&gt;SetNumberOfPoints(1);<br>
<br>
</div>and radius=0 ?<br>
Just seems a bit overkill to use a class which can generate N random<br>
points inside/on a circle with different distributions, when all I<br>
want is a single point positioned at a known (x,y,z) coordinate.<br>
<font color="#888888"><br>
AW<br>
</font><div><div></div><div class="h5">_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</div></div></blockquote></div><br>