Hi, I need to code a function that discretizes a solid body (Body2) into a 3D point cloud with a certain resolution.
The algorithm would be like this:
- Determine the bounding box of the body;
- Create a 3D point cloud array;
- For each point, determine if a point is inside or outside the body;
- Remove all the points that are outside the body.
This can be optimized, but this way it’s easier to explain. I don’t need to visualize these points or output them back to SW, just keep them in my code.
The problem is step #3. I can’t seem to find any API calls on Body2 that would check if a point at certain XYZ coordinates is inside or outside the body. It could possibly be done with rays, but I am expecting to have millions of points to check, so I need this procedure to be as fast as possible, preferably using only one fast API call per point.
Can anyone suggest how to do this?

