<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<vtkKdTree> kDtree = vtkSmartPointer<vtkKdTree>::New();<br> kDtree->SetDataSet(polyData);<br>
kDtree->SetNumberOfRegionsOrLess(numOfRegions); // numOfRegions is the number of regions that I'd like the poly to be divided<br> kDtree->BuildLocator();<br><br><br> for(int i=1; i< numOfRegions; i++)<br>
{<br> vtkIdTypeArray* points = kDtree->GetPointsInRegion(i);<br> for(vtkIdType idx=1; idx< points->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>