[vtkusers] implicit function from polydata

Frederic DANESI frederic.danesi at dinccs.com
Fri Mar 25 18:58:34 EDT 2011


Hi,

I am sure to follow your method here ...
Usually, when you want to know if a point is inside a closed surface, you
shoot a ray and count the intersection ...

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 :
http://staff.science.uva.nl/~dshamoni/myprojects/Boolean.html

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 ...

HTH
Fred.


2011/3/25 vlibertiaux <vlibertiaux at gmail.com>

> Hi everyone,
>
> I am trying to create an implicit function from a polydata using
> ImplicitDataSet.  My final goal is to determine if a given point lies
> within
> a volume described by its outer surface.
>
> I tried it two different ways: first I created an ImplicitDataSet directly
> from my polydata using this code:
>
> vtkElevationFilter *efilter = vtkElevationFilter::New();
> efilter->SetInput(polydata);
> efilter->Update();
> vtkImplicitDataSet *dataset = vtkImplicitDataSet::New();
> dataset->SetDataSet(efilter->GetOutput())
>  then when I test if a point "belongs" to this function with
> dataset->FunctionValue(x,y,z) <= 0 , none of them seems to verify the
> condition.
>
> I then tried another approach: I do a projection of my polydata to the
> z-plane, and define a new polydata which is flat (contour).
>
> I then use this piece of code to create the implicit data set :
>
> vtkDelaunay3D *delaunay = vtkDelaunay3D::New();
> delaunay->SetInput(contour);
> delaunay->BoundTriangulationOff();
> delaunay->Update();
> vtkElevationFilter *efilter = vtkElevationFilter::New();
> efilter->SetInputConnection(delaunay->GetOutputPort());
> efilter->Update();
> vtkImplicitDataSet *dataset = vtkImplicitDataSet::New();
> dataset->SetDataSet(efilter->GetOutput())
> dataset->SetOutValue(-1000000);
>
> and I test with :
>
> dataset->FunctionValue(x,y,0) != -1000000
>
> In either case, the condition is not verify but I know that some points
> verify them.
>
> Any help will be greatly appreciated !
>
> Thank you very much,
>
> V.
>
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/implicit-function-from-polydata-tp4264854p4264854.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



-- 


Cordialement,
F.Danesi
-- 
Responsable Développement Informatique et Travail Collaboratif
Centre Technique DINCCS (Centre Technique Dédié à l’Ingénierie Numérique, la
Conception Collaborative et la Simulation)
MICADO / DINCCS
Pôle de Haute Technologie, BP 90005
08005 Charleville-Mézières Cedex
Tel. : +33 (0) 3.24.41.69.55 / +33 (0) 6.62.76.13.32
Email : frederic.danesi at dinccs.com
Web : www.afmicado.com / www.dinccs.com

-----

DISCLAIMER :
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110325/f8490cd3/attachment.htm>


More information about the vtkusers mailing list