[vtkusers] implicit function from polydata
vlibertiaux
vlibertiaux at gmail.com
Fri Mar 25 17:07:27 EDT 2011
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.
More information about the vtkusers
mailing list