Choose 10,000 random points inside mesh I'm going to be throwing a mesh into a BEM acoustic simulator.

There is a well-known resonance problem with BEM acoustic simulators --if you test for a frequency that matches one of the resonance modes of the mesh, it goes crazy.

There is a known workaround which involves creating random points inside the mesh, so that's what I would like to do.

How would I go about implementing a python script to do this?

I'm assuming scripting is the best way, please someone correct me if I'm wrong here.

EDIT: how about picking a random point-pair P Q, intercepting it with the mesh, and if there are exactly 2 points of intersection A and B, then use A + t(B-A) where t is randomly chosen between 0 and 1

For a closed mesh of a human head and shoulders (so mostly convex), a significant number of points pairs should produce a valid result

The only question is: can I determine the points at which a line hits a mesh?

EDIT: mathutils.geometry.intersect_ray_tri from http://www.blender.org/documentation/blender_python_api_2_65_5/mathutils.geometry.html

EDIT: http://www.blender.org/documentation/248PythonDoc/Mesh.Mesh-class.html#pointInside
There is  way to do this without python, using particles.


Create a particle system and pick volume and random as the distribution settings:



Also set the physics to none to conserve processing power.

You'll want to set the Number to 10000, but I don't think the computer I'm currently on will like that :P.
Create a one-vertex object. The easiest way to do this is by adding a plane and deleting three vertices. After you delete the extra verts, switch back to object mode (Tab) and press ShiftCtrlAltC> Origin to geometry to snap the origin to the single vertex.
Pick your single vertex object as the particle system object in Particles > Render:


With the object with the particle system selected, press Convert on the particle modifier in the  modifiers tab:


Join the resulting vertices to your object with CtrlJ (everything should already be selected correctly). Remember to remove the particle system, as pressing Convert does not delete it.


Result: