Hi Luca,<br><br>thanks for the reply. I've tried the method and it works fine.<br><br>But the problem is, that there is not just one intersection between a line and a vtkPolyData object. For example if we have a poly-sphere and a line, there could be two intersection points between the sphere and the line. And this method gives me only one point. It saves its coordinates in the "pline" argument (see below).<br>But how should I get all the intersection points?<br><br>Thanks!<br><br><br>Che<br><br><br><b><i>Luca Pallozzi Lavorante <lplavorante@gmail.com></i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> Hi Che, <br> I have succesfully used vtkCellLocator::IntersectWithLine, although I donīt know the meaning of all its arguments:<br> I have done the following:<br> <br> if (locator->IntersectWithLine(p1, p2, 0.001, t, pline, pcoords, subId, cellid, cell) != 0) {<br> // Enters here if
there is intersection<br>}<br> <br> where:<br> <br> p1 and p2 are the intersecting lineīs endpoints,<br> double t = 0.0;<br> double pline[3] = { 0, 0, 0};<br> double pcoords[3] = { 0, 0, 0};<br> int subId = 0;<br> int cellid = -1;<br> vtkGenericCell *cell = vtkGenericCell::New();<br> <br> Using the 'cell' instance you can get interesting informations about the triangle involved in the intersection, but I havenīt used this feature. <br> <br> Also, donīt forget to do sometthing like this before invoking the IntersectWithLine method:<br> <br> vtkCellLocator *locator = vtkCellLocator::New();<br> locator->SetDataSet(vtkPolyData* data);<br> locator->BuildLocator();<br> <br> Hope this help<br> <br> Luca<br> <br> <br><div><span class="gmail_quote">On 11/20/06, <b class="gmail_sendername">Chavdar Papazov</b> <<a
href="mailto:chenkaz@yahoo.com">chenkaz@yahoo.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> Dear VTK Users,<br><br>would you explain to me how to use the method 'IntersectWithLine()' of the class vtkCellLocator.<br>There are three versions of this method. The first one is:<br><br>virtual vtkCellLocator::IntersectWithLine(double a0[3], <br> double
a1[3],<br> double toi,<br> double&
t,<br> double x[3],<br> double
pcoords[3],<br> int& subid)<br><br><br>In the html-doc there is no explanation of the parameters of the method, so I don't know how to call it.<br>I have a vtkPolyData object and two points in 3D which define the line. And I want to check whether the line intersects the vtkPolyData object.<br><br>Do you have any ideas?<br>Thanks!<br><br>Che<br><div> <font color="#666666"><font size="2"><hr size="1">Sponsored Link</font></font><br><br> <a href="http://forms.nextag.com/goto.jsp?url=/serv/main/buyer/education.jsp?doSearch=n&tm=y&search=wrkg_adults_1yr&s=3968&p=5036" target="_blank" onclick="return
top.js.OpenExtLink(window,event,this)">Degrees for working adults in as fast as 1 year. Bachelors, Masters, Associates. Top schools </a> </div><br>_______________________________________________<br>This is the private VTK discussion list.<br>Please keep messages on-topic. Check the FAQ at: <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank"> http://www.vtk.org/Wiki/VTK_FAQ</a><br>Follow this link to subscribe/unsubscribe:<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers </a><br><br><br></blockquote></div><br> </blockquote><br><p> 
<font color="666666"><font size="2"><hr size=1>Sponsored Link</font></font><br><br>
<a href="https://www2.nextag.com/goto.jsp?product=100000035&url=%2fst.jsp&tm=y&search=b_historiclows170k&s=3968&p=5035&disc=y&vers=687">Mortgage rates near historic lows: $150,000 loan as low as $579/mo. Intro-*Terms</a>