<div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I also tried this:<br><br> vtkOBBTree* Tree = vtkOBBTree::New();<br>
Tree->SetDataSet(polydata);<div><br><br> //intersect the locator with the line<br> double LineP0[3] = {0.5, 0.5, 1.0};<br>
double LineP1[3] = {0.5, 0.5, -1.0};<br></div> vtkPoints* IntersectPoints = vtkPoints::New();<br> Tree->IntersectWithLine(LineP0, LineP1, IntersectPoints, NULL);<br><br> std::cout << "NumPoints: " << IntersectPoints->GetNumberOfPoints() << std::endl;<br>
<br>and it just segfaults on the IntersectWithLine call.<br><br>Dave<br>
</blockquote></div><br>Thanks Murali Dhanakoti. (In the future, please reply to the list rather than an individual so the knowledge is shared with all :) )<br><br>The problem was that I was not calling Tree->BuildLocator() before doing the intersections in both examples! I've actually done this same thing with other classes in the past - can we add some kind of check that says "Error - you need to call BuildLocator() before doing anything" rather than just crashing or giving bogus results? (I've been asking these kinds of questions on the users list - are the better posed to the dev list?)<br>
<span></span><br>Murali also mentioned that "pcoords are the parametric coordinates of the intersection point." Is this somewhere in the documentation and I just missed it? Or can the documentation be updated/improved?<br>
<br>I will add an example of this vtkOBBTree usage to the wiki. Is it possible to make links to the wiki in the documentation so when you are in the documentation you can click "click here to see an example"?<br>
<br clear="all">Thanks,<br><br>David<br>