Classify point relative to a solid

Everything DG Kernel: Technical discussions and issues
Post Reply
Tom Di Sessa
Posts: 1
Joined: Tue Oct 01, 2024 12:20 am

Classify point relative to a solid

Post by Tom Di Sessa »

Hello

Is there a way to find out whether a point is inside or outside of a solid IBRepSolid_DG?

Thank you
Prashant Kande
Posts: 61
Joined: Tue Jun 18, 2024 6:12 am

Re: Classify point relative to a solid

Post by Prashant Kande »

Hi Tom

Query IMetrics_DG from the entity.
For BRep solids IMetrics_DG.GetPointLocation() returns a value enumerated with PointVsSurfaceLocation_DG

The check is relatively tricky. You need to be sure that either the surface is closed, or the point is close enough to the object.

For meshes, I believe the method returns -1 (inside), 0 (on the surface), 1 outside.
Post Reply