[vtkusers] How to crop a 3D model?

David Doria daviddoria at gmail.com
Wed Apr 18 07:55:57 EDT 2012


On Wed, Apr 18, 2012 at 5:23 AM, Wenlong <scc.wwl at gmail.com> wrote:

> Hi, David
>
> Thank you very much for your reply.
>
> What I want to achieve is to cut a smaller area from the big model. For
> example, my current model contains 7710 points and it covers from left ear
> to right ear and from the chin to the forehead. I don't need such a big
> area. So I need to cut it and make the result covers from left cheek to
> right cheek and from chin to eyebrows. Also I need to make the number of
> points is 5090.
>
> The original model (bigger) is from .wrl files and the result I'd like to
> write it as .vtk files.
>
> Anther thing I worry about is if I need to re-create the texture
> coordinates
> to fit the result models.
>
> Thank you very much for your kindly help. I am looking forward to hear from
> you.
>
> Best regards
> Wenlong
>

You should be able to create the object to use to crop the data (a sphere
perhaps?) and select the points inside that object like this:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/PointInsideObject

Then you can extract the points that were selected like this:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ExtractCellsUsingPoints

This is not a particularly easy part of VTK, so you will probably have to
play around with it a bit.

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120418/a10aea39/attachment.htm>


More information about the vtkusers mailing list