Deleted part of trimmed surface

Hi,

I’m seeking for some help regarding trimmed surfaces. How can I know in c# which part of trimmed surface is visible and which one is deleted?
Also how can I get information from edge surface, if this edge has been created by trimming? Or even better how can I get ID of surface used to trim?

Knowing what a Brep is and how is is structured is a good start. This diagram has helped many.

http://wiki.mcneel.com/developer/brepstructure

What are you doing and why do you need to know what part of a a trimmed surface is active?

I think I get the diagram. I just need to delete inactive part, use only active one, and make other operations on active face i.e. determine which object have been used to trim the surface, if object exists in workspace. I think I know how to do it now.

Edit:

What I’m actually trying to do is as follow. I have 2 surfaces, 1st is trimmed by 2nd one. I need to check if 2nd surface is placed within rhino tolerance to 1st one, if Yes, I try to determine what is the 2nd surface ID.

In many cases, this is not possible. A planar surface with a hole in the middle is a good example.

Rhino does have a ShrinkTrimmedSrf command which will contract the underlying untrimmed surface close to its trimming boundaries (check the help file for details). In RhinoCommon, you would use Rhino.Geometry.Brep.ShrinkFaces. But again, this only works in certain cases.

On the two surfaces, I would find all of the naked edge curves (edges with a single Brep face). Then I could compare the edge curves between the surfaces until I found the two that matched (within some tolerance). Curve.ClosestPoint will be a useful function. Curve.GetDistancesBetweenCurves might be helpful too.