[vtkusers] Random point set generation inside a surface

David Netherway david.netherway at adelaide.edu.au
Thu Mar 13 18:14:08 EST 2003


Would it be suitable to generate the random points on a fixed grid. Then you
could create a structured grid of the data. Then turn the points inside the
volume into a 1 dimensional array and generate random points within that
array.

David Netherway


----- Original Message -----
From: <David.Pont at ForestResearch.co.nz>
To: "Carlos Martínez Burgos" <cmarbur at iti.upv.es>
Cc: "VTK User Mailing List" <vtkusers at public.kitware.com>;
<vtkusers-admin at public.kitware.com>
Sent: Thursday, 13 March, 2003 7:08 AM
Subject: Re: [vtkusers] Random point set generation inside a surface


>
> Carlos,
>     I have a class that treats polydata as an implicit surface.
> You could get the centre and radius for your polydata (from its bounds?),
> use vtkPointSource to generate a random set of points in that region,
using
> SetCenter and SetRadius and SetNumberOfPoints. Of course some points will
> fall outside the surface, then use the class I have, vtkImplicitPolydata,
> to clip away the points outside the surface. You will not have exact
> control over the number of points inside the surface, but it should work
if
> that is not a strict requirement. Tell me if you want the class and I will
> send the C++ code to you.
>   Dave Pont
>
>
> |--------+--------------------------------->
> |        |          Carlos Martínez Burgos |
> |        |          <cmarbur at iti.upv.es>   |
> |        |          Sent by:               |
> |        |          vtkusers-admin at public.k|
> |        |          itware.com             |
> |        |                                 |
> |        |                                 |
> |        |          13/03/2003 00:11       |
> |        |                                 |
> |--------+--------------------------------->
>
>---------------------------------------------------------------------------
---------------------------------|
>   |
|
>   |      To:     VTK User Mailing List <vtkusers at public.kitware.com>
|
>   |      cc:
|
>   |      Subject:     [vtkusers] Random point set generation inside a
surface                                  |
>
>---------------------------------------------------------------------------
---------------------------------|
>
>
>
>
> Hi all.
>
> I have a closed surface (vtkPolyData) and want to generate a random point
> set inside this surface. I don't know how exactly do this. Is there a
> method in VTK?
>
> I have an idea. Get the OBBTree of the surface and its bounding box. Then
> generate random points with their coordinates inside the bounding box.
> Then test if the point is inside the surface using the OBBTree method
> InsideOrOutside. If the point is outside the surface generate it again.
> What do you think about this method? I think that it sometimes can take
> too much time if the surface is not like a cube because of in/out test but
> I don't have any idea.
>
> Thanks a lot.
>
> --
> ----------------------------------------------------------------------
> Carlos Martínez Burgos      |     Instituto Tecnológico de Informática
> Ingeniero Informático       |      Universidad Politécnica de Valencia
> Tlf: +34 963877237          |                        Camí de Vera, S/N
> cmarbur at iti.upv.es          |                   46071 Valencia - Spain
> www.iti.upv.es/~cmarbur     |                           www.iti.upv.es
> ----------------------------------------------------------------------
>
> _______________________________________________
> 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://public.kitware.com/mailman/listinfo/vtkusers
>
>
>
>
> _______________________________________________
> 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://public.kitware.com/mailman/listinfo/vtkusers
>




More information about the vtkusers mailing list