I have to perform a lot of "is point inside a shape" queries in my application. Currently I am doing the query through the BRepClass3d_SolidClassifier with some preliminary filtering (bounding box) but the code is quite slow so I am looking for some hints how to speed it up.
The points (x,y,z) that I have to check can be divided into large subsets satisfying condition z=const. So I think that the problem can be reduced to 2D by checking if the point (x,y) is inside a face obtained by cutting the shape by the plane z=const. Can I expect some speedup by replacing the BRepClass3d_SolidClassifier by the BRepClass_FaceClassifier? Or should I do the test via some other OCC package/classes? Any other ideas?
Another note: the test need not to be accurate. The original problem is to query if a small solid cube is inside (more than 50% of its mass) a shape. This was approximated by querying if several points of the cube (center and neighbourhood) are inside the shape. So I think that e.g. using tesselation of the shape is an option?
To give you an idea about the problem size: there are tens of shapes and 10-100s of thousands of cubes (points).
Any hints will be appreciated.
Best regards, Petr