How to draw the outer outline of AIS Shape

Hello,
I want to know how to draw the outer outline of AIS_Shape when AIS_Shape has holes
111.png is the effect I want to achieve. If it is a complete TopoDS_Wire, what I use is to traverse all faces, and then judge whether the normal direction of this face is parallel to the Y-axis. If it is parallel,I'm just going to show the OuterWire on this side
Just like my second uploaded image, I wonder if there is any way to achieve the 111.png effect.
How to do that?
Thanks in advance
yangyang