Determining a surface is inside another surface?

Hi Everybody!

i'm using OCC 5.2 and my problem is how to determine a surface is inside another surface? i tried Brep_Feat::IsInside() function but it only worked with two planar surfaces. Could someone help me to solve this problem?

Roman Lygin's picture

Hi,
What does "a surface is inside another" mean ? Is it that 2nd surface lies within a half-space formed by the 1st surface ? Another example - two concentric spheres ?
In any case you have to deal with normals, I guess. You could try to get any point P1 from 1st surface and P2 from 2nd. Compute a dot product of vector {P1, P2} and normal N1 of surface S1 at a point P1. If it's negative then S2 is inside S1, otherwise - outside. Of course, the above assumption is relevant only if surfaces can be placed one inside another (i.e. do not intersect, do not wrap each other and so forth).

Hope this helps.
Roman

ngoctn's picture

Thanks Roman
I've found my own method to solve this problem. But your suggestion is also useful. I'll try to deal with your method and then compare two results.
Best regards!
Ngoc TRUONG NGUYEN