[vtkusers] Random point set generation inside a surface

Carlos Martínez Burgos cmarbur at iti.upv.es
Wed Mar 12 06:11:58 EST 2003


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
----------------------------------------------------------------------




More information about the vtkusers mailing list