Hello, I have a polydata, and after extracting its boundary edges I want to traverse them, and for each point in each edge, I want to find the point Id in the polydata. Something like this :<br><br><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
vtkSmartPointer<vtkFeatureEdges> boundaryEdges = vtkSmartPointer<vtkFeatureEdges>::New();<br><span class="Apple-tab-span" style="white-space:pre">        </span>boundaryEdges->SetInput(polydata);<br><span class="Apple-tab-span" style="white-space:pre">        </span>boundaryEdges->BoundaryEdgesOn();<br>
<span class="Apple-tab-span" style="white-space:pre">        </span>boundaryEdges->FeatureEdgesOff();<br><span class="Apple-tab-span" style="white-space:pre">        </span>boundaryEdges->ManifoldEdgesOff();<br><span class="Apple-tab-span" style="white-space:pre">        </span>boundaryEdges->NonManifoldEdgesOff();<br>
<span class="Apple-tab-span" style="white-space:pre">        </span>boundaryEdges->Update();<br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="Apple-tab-span" style="white-space:pre">        </span>vtkSmartPointer<vtkPolyData> edges = boundaryEdges->GetOutput();<br>
</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
for(vtkIdType i = 0; i < edges->GetNumberOfCells(); i++)//for each point in boundary edges<br><span class="Apple-tab-span" style="white-space:pre">        </span> {<br><span class="Apple-tab-span" style="white-space:pre">                </span>vtkSmartPointer<vtkLine> line = vtkLine::SafeDownCast(edges->GetCell(i));<br>
<span class="Apple-tab-span" style="white-space:pre">                </span>vtkSmartPointer<vtkPoints> points_line = line->GetPoints(); //2 points<br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="Apple-tab-span" style="white-space:pre">                </span>double p[3];<br>
<span class="Apple-tab-span" style="white-space:pre">                </span>for(int j = 0; j < points_line->GetNumberOfPoints(); j++)<br><span class="Apple-tab-span" style="white-space:pre">                </span>{<br><span class="Apple-tab-span" style="white-space:pre">                        </span>points_line->GetPoint(j,p);<br>
<span class="Apple-tab-span" style="white-space:pre">                        </span>vtkIdType idPointCorrespondant = polydata->FindPoint(p);<font color="#ff6666">//Error in this line<br></font> }<br> }</blockquote><div>
<br></div><div><br></div><div>The error I have is in this function (into the file vtkIdList.h) :</div><div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
inline vtkIdType vtkIdList::InsertNextId(const vtkIdType vtkid)<br>{<br> if ( this->NumberOfIds >= this->Size ) <font color="#ff0000">//the debugger stop in this line<br></font> {<br> this->Resize(this->NumberOfIds+1);<br>
}<br> this->Ids[this->NumberOfIds++] = vtkid;<br> return this->NumberOfIds-1;<br>}</blockquote></div><div><br></div><div>I tried the same code with another polydata and it works, So I can't figure out what is wrong with my polydata. </div>
<div>Here is the code of the example : <a href="http://pastie.org/4558410">http://pastie.org/4558410</a><br>Someone can help me?<br><br>Thank you!</div><div><br clear="all"><div><br></div>-- <br>--------<br>Gonzalo Amadio<br>
<br>
</div>