[vtkusers] Question on vtkImplicitBoolean

David.Pont at ForestResearch.co.nz David.Pont at ForestResearch.co.nz
Thu Nov 4 15:28:50 EST 2004





Hi Jim,

vtkconnectivityfilter

normand at lina.univ-nantes.fr wrote on 04/11/2004 22:28:22:

> Hi,
>
> I was wondering whether it was possible or not to obtain the Bounding
> Box of an vtkImplicitBoolean that I don't want to display.
>
> In fact I'd like VTK to perform some boolean operations on implicit
> functions in a preprocess step and then retrieve the resulting function
> + its bounding box. I will need those informations afterwards in my app.

You could use vtkSampleFunction and vtkContourFilter to obtain a polygonal
representation of the surface, then use GetBounds on the resulting
polydata. The problem is that vtkSampleFunction requires you to define a
sample bounds! If you give a very large bounds vtkSampleFunction will be
very slow, if you give too small a bounds vtkSampleFunction will miss part
of the surface and the result will be incorrect.
You might have to write your own class to solve this effectively... there
are several approaches to implicit surface polygonization in the
literature, your problem is strongly related and you should be able to
adapt some of these algorithms...

>
> Moreover, I'd like to know if it's possible to detect when the result of
> a boolean operation is composed of more than one connected component.

Take a look at vtkConnectivityFilter

>
> For example if I take the 2 polygons represented below, and I subtract
> the one made of # to the other, the result will be made of 2 parts.
>
>         #####
>     ____#___#______
>    |    #    #   |
>    |    #   #   |
>    |    #    #   |
>    |    #   #   |
>    |    #    #   |
>     ____#___#______
>         #   #
>          #####
>
> The problem is that I'd like to perform boolean ops and I don't need to
> visualize them, so I wonder if I will be able to get the infos I'm
> needing.

Not needing to visualize the resulting data set is not a problem in vtk,
but I think you mean that you dont really want to generate the surfaces,
just to know their bounds and how many there are? That would require a
specialised algorithm.

   regards
       Dave P

>
> Thanks in advance
>
> Jim.
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: <http://public.
> kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers




More information about the vtkusers mailing list