Point Inside a Solid or Not?

Does anyone know an easyway (preferably an API call) to check if a point is inside a solid or not?

andi's picture

Hi, I am using the following code:

BRepClass3d_SolidClassifier classifier (SOLID,VERTEX,ACCURACY);
return classifier.State ();

yasir.ibrahim's picture

Thank you very much, I have used your suggestion as follows (code in java, using opencascade through JNI)

BRepClass3d_SolidClassifier solidClassifier = new BRepClass3d_SolidClassifier(wholeShape);
//normalPoint[1] = -1.0;
solidClassifier.Perform(normalPoint, 1.0);
boolean normalPointInside = !(solidClassifier.State() == TopAbs_State.TopAbs_OUT);

solidClassifier.Perform(otherNormalPoint, 1.0);
boolean otherNormalPointInside = !(solidClassifier.State() == TopAbs_State.TopAbs_OUT);

Once again Thank you for your help.