Hi,<div><br></div><div>I am sure to follow your method here ...</div><div>Usually, when you want to know if a point is inside a closed surface, you shoot a ray and count the intersection ...</div><div><br></div><div>If you want to do so, or find out what others have done, you may find some useful hints in the work of Dave Pont (see VTK users archives) and here : <a href="http://staff.science.uva.nl/~dshamoni/myprojects/Boolean.html">http://staff.science.uva.nl/~dshamoni/myprojects/Boolean.html</a></div>
<div><br></div><div>Regarding your code: since you have projected the polydata on the z-plane, you should use vtkDelaunay2D instead of Delaunay3D.  Be aware however that you will get only a convex hull if you do not have to outer edges to provide vtkDelaunay with ...</div>
<div><br></div><div>HTH</div><div>Fred.</div><div><div><br><br><div class="gmail_quote">2011/3/25 vlibertiaux <span dir="ltr">&lt;<a href="mailto:vlibertiaux@gmail.com">vlibertiaux@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi everyone,<br>
<br>
I am trying to create an implicit function from a polydata using<br>
ImplicitDataSet.  My final goal is to determine if a given point lies within<br>
a volume described by its outer surface.<br>
<br>
I tried it two different ways: first I created an ImplicitDataSet directly<br>
from my polydata using this code:<br>
<br>
vtkElevationFilter *efilter = vtkElevationFilter::New();<br>
efilter-&gt;SetInput(polydata);<br>
efilter-&gt;Update();<br>
vtkImplicitDataSet *dataset = vtkImplicitDataSet::New();<br>
dataset-&gt;SetDataSet(efilter-&gt;GetOutput())<br>
 then when I test if a point &quot;belongs&quot; to this function with<br>
dataset-&gt;FunctionValue(x,y,z) &lt;= 0 , none of them seems to verify the<br>
condition.<br>
<br>
I then tried another approach: I do a projection of my polydata to the<br>
z-plane, and define a new polydata which is flat (contour).<br>
<br>
I then use this piece of code to create the implicit data set :<br>
<br>
vtkDelaunay3D *delaunay = vtkDelaunay3D::New();<br>
delaunay-&gt;SetInput(contour);<br>
delaunay-&gt;BoundTriangulationOff();<br>
delaunay-&gt;Update();<br>
vtkElevationFilter *efilter = vtkElevationFilter::New();<br>
efilter-&gt;SetInputConnection(delaunay-&gt;GetOutputPort());<br>
efilter-&gt;Update();<br>
vtkImplicitDataSet *dataset = vtkImplicitDataSet::New();<br>
dataset-&gt;SetDataSet(efilter-&gt;GetOutput())<br>
dataset-&gt;SetOutValue(-1000000);<br>
<br>
and I test with :<br>
<br>
dataset-&gt;FunctionValue(x,y,0) != -1000000<br>
<br>
In either case, the condition is not verify but I know that some points<br>
verify them.<br>
<br>
Any help will be greatly appreciated !<br>
<br>
Thank you very much,<br>
<br>
V.<br>
<br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/implicit-function-from-polydata-tp4264854p4264854.html" target="_blank">http://vtk.1045678.n5.nabble.com/implicit-function-from-polydata-tp4264854p4264854.html</a><br>

Sent from the VTK - Users mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote></div><br><br clear="all"><br>-- <br><br><br>Cordialement,<br>F.Danesi<br>-- <br>Responsable Développement Informatique et Travail Collaboratif<br>Centre Technique DINCCS (Centre Technique Dédié à l’Ingénierie Numérique, la Conception Collaborative et la Simulation)<br>
MICADO / DINCCS<br>Pôle de Haute Technologie, BP 90005<br>08005 Charleville-Mézières Cedex<br>Tel. : +33 (0) 3.24.41.69.55 / +33 (0) 6.62.76.13.32<br>Email : <a href="mailto:frederic.danesi@dinccs.com">frederic.danesi@dinccs.com</a><br>
Web : <a href="http://www.afmicado.com">www.afmicado.com</a> / <a href="http://www.dinccs.com">www.dinccs.com</a><br><br>-----<br><br>DISCLAIMER :<br>This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.<br>
<br>
</div></div>