<div dir="ltr">Hi all<br><br>please help me to figure up the simplest manipulation that trees should do to polyData:<br>Division of vtkPolyData to regions and returning the arrays of the vtkIdType in each region.<br>for example: I have a poly of x points (vtkIdType) and I want that the tree will divide it to 8 regions such that each region will contain x/8 points based on their spacial location.<br>
<br>I tried to do that in the following way but the array is empty (not because the poly is Null) ...<br><br><br>    vtkSmartPointer&lt;vtkKdTree&gt; kDtree = vtkSmartPointer&lt;vtkKdTree&gt;::New();<br>    kDtree-&gt;SetDataSet(polyData);<br>
    kDtree-&gt;SetNumberOfRegionsOrLess(numOfRegions); //  numOfRegions is the number of regions that I&#39;d like the poly to be divided<br>    kDtree-&gt;BuildLocator();<br><br><br>    for(int i=1; i&lt; numOfRegions; i++)<br>
    {<br>        vtkIdTypeArray* points = kDtree-&gt;GetPointsInRegion(i);<br>        for(vtkIdType idx=1; idx&lt; points-&gt;GetSize(); idx++) // GetSize returns an error because points is empty...<br>        {<br>            ...<br>
<br><br>Please help me to understand this, <b>any help would be useful</b> ...<br><br>Hila<br></div>