[vtkusers] Filter a structured points-space through a 3d-polydata shape
Álvaro González Lorente
sapito_verbenero at hotmail.com
Fri May 21 10:04:44 EDT 2010
Yes. What I exactly have is a structured point space with values that go from 37.0 to 70.0. I don't want them all, only the ones that would fall inside a sphere (for example). So the code would go like that:
pdr = vtk.vtkPolyDataReader()
pdr.SetFileName("pd_sphere.vtk")
pdr.Update()
spr = vtk.vtkStructuredPointsReader()
spr.SetFileName("spt.vtk")
spr.Update()
extractor = vtk.vtkSelectEnclosedPoints()
extractor.SetSurface(pdr.GetOutput())
extractor.SetInput(spt.GetOutput())
extractor.Update()
op = extractor.GetOutput()
After writing the output with the vtkStructuredPointWriter, I get a file where the points that have value different than 0 (which are exactly the ones within the sphere) have a value equal to 0.00392157, instead of 37.0-70.0. That is exactly the problem, hope I made my self enough clear. Thanks.
> Date: Fri, 21 May 2010 08:18:46 -0400
> Subject: Re: [vtkusers] Filter a structured points-space through a 3d-polydata shape
> From: bill.lorensen at gmail.com
> To: sapito_verbenero at hotmail.com
> CC: karthik.krishnan at kitware.com; vtkusers at vtk.org
>
> The input point scalars should be passed through. Can you provide a
> short example that illustrates the problem?
>
> Bill
>
> 2010/5/21 Álvaro González Lorente <sapito_verbenero at hotmail.com>:
> > Hello,
> >
> > Thanks all for your help. It appears that vtkSelectEnclosedPoints has turned
> > out to be the best amongst all choices you have told me. However, a problem
> > has arised: if the initial values of the points in the Structured Points
> > space were from 37.0 to 70.0, the ones that have fallen within the polydata
> > 3d shape are now 0.00392157. Any idea why this is happening? I would like
> > to keep the original values of those points.
> >
> >
> >> Date: Thu, 20 May 2010 11:05:01 -0400
> >> Subject: Re: [vtkusers] Filter a structured points-space through a
> >> 3d-polydata shape
> >> From: bill.lorensen at gmail.com
> >> To: karthik.krishnan at kitware.com
> >> CC: sapito_verbenero at hotmail.com; vtkusers at vtk.org
> >>
> >> Here is an example that uses SelectEnclosedPoints:
> >> http://www.vtk.org/Wiki/VTK/Examples/PolyData/PointInsideObject
> >>
> >>
> >> 2010/5/20 Karthik Krishnan <karthik.krishnan at kitware.com>:
> >> > 2010/5/20 Álvaro González Lorente <sapito_verbenero at hotmail.com>
> >> >>
> >> >> Hello,
> >> >>
> >> >> I have a big structured points space, but not all of its points are of
> >> >> my
> >> >> interest, only the ones that are within the shape of a polydata
> >> >> structure
> >> >> (or an unstructured grid too). I wonder if any of you knows if there is
> >> >> any
> >> >> easy way to filter some particular points which are inside this
> >> >> polydata
> >> >> contour.
> >> >>
> >> >
> >> > What kind of shape ?
> >> >
> >> > If you have a surface, a closed manifold surface, (only 2D cells), you
> >> > can
> >> > use vtkSelectEnclosedPoints. It will shoot rays and do intersection
> >> > tests to
> >> > mark the points inside.
> >> >
> >> > If you have a generic UGrid, you can either extract the boundary faces,
> >> > ensure a closed topology and do the above.
> >> >
> >> > If you have a volume mesh, for instance tetrahedra, you can use the
> >> > FindCell
> >> > API on each tet to do the inside tests...
> >> >
> >> >
> >> > --
> >> > karthik
> >> >
> >> >
> >> >
> >> > _______________________________________________
> >> > 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
> >> >
> >> >
> >
> > ________________________________
> > ¿Sabes que La Gente de Hoy tiene GUARDAESPALDAS contra el Spam?
_________________________________________________________________
Recibe en tu HOTMAIL los emails de TODAS tus CUENTAS. + info
http://www.vivelive.com/hotmail-la-gente-de-hoy/index.html?multiaccount
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100521/1bad2a28/attachment.htm>
More information about the vtkusers
mailing list