[vtkusers] vtkBooleanPolyDataFilter?

Dženan Zukić dzenanz at gmail.com
Wed Nov 18 10:59:46 EST 2015


A possible workaround is to convert your 3D objects into volumetric image
representation (example
<http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/PolyDataToImageData>)
using the same voxel lattice (same spacing, extent and origin). You can
then do voxel-by-voxel Boolean operations and convert resulting image back
into the polygonal representation using marching cubes
<http://www.vtk.org/doc/nightly/html/classvtkMarchingCubes.html>. In the
choice of spacing, there is a trade-off between loss of quality on one side
and memory requirements and processing time on the other.

You can also implement your own filter for Boolean operations of
non-intersecting meshes. In case the meshes do not intersect, the
operations are somewhat trivial:

   - concentric objects, intersection: keep the inner object without
   modifications
   - concentric objects, difference: invert normals of the inner object and
   append it to the outer object (the case you described)
   - disjoint objects, intersection: empty set
   - disjoint objects, difference: keep one of the objects without
   modifications, discard the other

The non-trivial part is detecting which case is it (intersecting,
concentric or disjoint meshes).

HTH

On Wed, Nov 18, 2015 at 7:52 AM, Cory Quammen <cory.quammen at kitware.com>
wrote:

> You are correct in assuming that the filter requires overlap. It sounds
> like you want a method that computes Boolean  operations on volume meshes.
> I'm not aware of a filter that does that.
>
> Cory
> On Nov 18, 2015 4:33 AM, "mbcx9rb9" <richard.j.brown at live.co.uk> wrote:
>
>> Hi all,
>>
>> I want to create a volume, which is a margin around a previously existing
>> volume.
>>
>> I had initially thought to use vtkBooleanPolyDataFilter, except for two
>> sphere sources with matching centres but differing radii,
>> SetOperationToDifference returns nothing, but I was hoping that it would
>> return a spherical shell.
>>
>> Looking at the example,
>> Examples/Cxx/PolyData/BooleanOperationPolyDataFilter, I get the impression
>> that there needs to be intersection between the two polydata, so I guess
>> this method won't work for concentric objects.
>>
>> Can anyone suggest a way to create a polydata shell? At the moment, I will
>> settle for methods that only work for vtkSphereSource, but in the future,
>> I'll need to be able to extend this to more generic shapes.
>>
>> Thanks in advance for the help.
>>
>>
>>
>> --
>> View this message in context:
>> http://vtk.1045678.n5.nabble.com/vtkBooleanPolyDataFilter-tp5735056.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
>>
>> Search the list archives at: http://markmail.org/search/?q=vtkusers
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/vtkusers
>>
>
> _______________________________________________
> 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
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151118/49b1b0a1/attachment.html>


More information about the vtkusers mailing list