Unexpected results from using PMC method.

R G W

CAD community veteran
Hi I'm rgw.
I'm tring to use PMC method to judge whether a point is inside or outside a model.
But the result is not ideal.
Can you give me some advice? Thanks a lot.
1685005446066.png

result:
1685005484409.png
1685005514981.png
 

Attachments

  • PlanePlate.stp
    73.1 KB · Views: 2

calciffer

Active CAD practitioner
Hi, RGW
There is no problem with this algorithm, as can be clearly seen in the picture below.
You have some thin plates in your model. There are just no points that need to be tested that are within these thin plates.
Is the value of your destiny 10? I suggest you set it to 20
1685016867130.png
 

R G W

CAD community veteran
Hi, RGW
There is no problem with this algorithm, as can be clearly seen in the picture below.
You have some thin plates in your model. There are just no points that need to be tested that are within these thin plates.
Is the value of your destiny 10? I suggest you set it to 20
View attachment 617
Thanks! How can I get the point on the model?
 

calciffer

Active CAD practitioner
I mean, if I have a point right on the surface of the model, how can I identify it?

C++:
bool IsIn(const gp_XYZ& pt, const double tol)
{
  const double d = m_dist->Eval( pt.X(), pt.Y(), pt.Z() );
  return  Abs(d) <= tol;
}
 
Top