<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Helvetica;
panose-1:2 11 5 4 2 2 2 3 2 4;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Texte de bulles Car";
margin:0cm;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.TextedebullesCar
{mso-style-name:"Texte de bulles Car";
mso-style-priority:99;
mso-style-link:"Texte de bulles";
font-family:"Tahoma","sans-serif";}
.MsoChpDefault
{mso-style-type:export-only;}
@page Section1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=FR link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal style='background:white'><i><span lang=EN-US
style='font-family:"Helvetica","sans-serif";color:black'>On behalf of a
colleague of mine working with ParaView 4.3.1<o:p></o:p></span></i></p>
<p class=MsoNormal style='background:white'><span lang=EN-US style='font-family:
"Helvetica","sans-serif";color:black'><o:p> </o:p></span></p>
<p class=MsoNormal style='background:white'><span lang=EN-US style='font-family:
"Helvetica","sans-serif";color:black'>Hello,<o:p></o:p></span></p>
<p class=MsoNormal style='background:white'><span lang=EN-US style='font-family:
"Helvetica","sans-serif";color:black'><br>
I am using an algorithm doing calculation on points and their neighbours and I
find the results of those points locators to be strange. To test it I made a
simple algorithm counting how many neighbours each point has.<br
id="yui_3_16_0_ym19_1_1466689264692_2872">
When I create a plane and set its x and y resolution to 100 each, all points
should have the same number of neighbours except on the sides. However
vtkPointLocator, vtkKdTreePointLocator and vtkOctreePointLocator do not find the
same number of neighbours for each point.<br
id="yui_3_16_0_ym19_1_1466689264692_2873">
<br id="yui_3_16_0_ym19_1_1466689264692_2874">
Here is the algorithm that I use to get the number of neighbors each points has
:<br id="yui_3_16_0_ym19_1_1466689264692_2875">
</span><span lang=EN-US style='font-size:10.0pt;font-family:"Helvetica","sans-serif";
color:black'>import vtk<br id="yui_3_16_0_ym19_1_1466689264692_2876">
<br id="yui_3_16_0_ym19_1_1466689264692_2877">
pdi = self.GetInputDataObject(0,0)<br id="yui_3_16_0_ym19_1_1466689264692_2878">
nb_pts = pdi.GetNumberOfPoints()<br id="yui_3_16_0_ym19_1_1466689264692_2879">
<br id="yui_3_16_0_ym19_1_1466689264692_2880">
# Point locator<br id="yui_3_16_0_ym19_1_1466689264692_2881">
loc = vtk.vtkPointLocator()<br id="yui_3_16_0_ym19_1_1466689264692_2882">
#loc = vtk.vtkOctreePointLocator()<br id="yui_3_16_0_ym19_1_1466689264692_2883">
#loc = vtk. vtkKdTreePointLocator()<br id="yui_3_16_0_ym19_1_1466689264692_2884">
<br id="yui_3_16_0_ym19_1_1466689264692_2885">
loc.SetDataSet(pdi)<br id="yui_3_16_0_ym19_1_1466689264692_2886">
loc.BuildLocator()<br id="yui_3_16_0_ym19_1_1466689264692_2887">
<br id="yui_3_16_0_ym19_1_1466689264692_2888">
pts = pdi.GetPoints()<br id="yui_3_16_0_ym19_1_1466689264692_2889">
<br id="yui_3_16_0_ym19_1_1466689264692_2890">
neighbours = vtk.vtkTypeInt64Array()<br
id="yui_3_16_0_ym19_1_1466689264692_2891">
neighbours.SetNumberOfComponents(1)<br id="yui_3_16_0_ym19_1_1466689264692_2892">
neighbours.SetNumberOfTuples(nb_pts)<br
id="yui_3_16_0_ym19_1_1466689264692_2893">
neighbours.SetName('neighbours')<br id="yui_3_16_0_ym19_1_1466689264692_2894">
<br id="yui_3_16_0_ym19_1_1466689264692_2895">
for k in range(nb_pts):<br id="yui_3_16_0_ym19_1_1466689264692_2896">
<br id="yui_3_16_0_ym19_1_1466689264692_2897">
xp = pdi.GetPoint(k)<br
id="yui_3_16_0_ym19_1_1466689264692_2898">
<br id="yui_3_16_0_ym19_1_1466689264692_2899">
id_list = vtk.vtkIdList()<br
id="yui_3_16_0_ym19_1_1466689264692_2900">
<br id="yui_3_16_0_ym19_1_1466689264692_2901">
loc.FindPointsWithinRadius(0.01,xp,id_list)<br
id="yui_3_16_0_ym19_1_1466689264692_2902">
loc.Update()<br id="yui_3_16_0_ym19_1_1466689264692_2903">
<br id="yui_3_16_0_ym19_1_1466689264692_2904">
N = id_list.GetNumberOfIds()<br
id="yui_3_16_0_ym19_1_1466689264692_2905">
neighbours.InsertTuple1(k,N)<br
id="yui_3_16_0_ym19_1_1466689264692_2906">
<br id="yui_3_16_0_ym19_1_1466689264692_2907">
<br id="yui_3_16_0_ym19_1_1466689264692_2908">
self.GetOutput().GetPointData().AddArray(neighbours)</span><span lang=EN-US
style='font-family:"Helvetica","sans-serif";color:black'><o:p></o:p></span></p>
<p class=MsoNormal style='background:white'><span lang=EN-US style='font-family:
"Helvetica","sans-serif";color:black'><o:p> </o:p></span></p>
<p class=MsoNormal style='background:white'><span lang=EN-US style='font-family:
"Helvetica","sans-serif";color:black'>You will find attached sample picture
describing the result I get with each point locator.<br>
<br id="yui_3_16_0_ym19_1_1466689264692_2911">
thank you very much<o:p></o:p></span></p>
</div>
</body>
</html>