How to merge fhe figure of different face which intersect with each other

I want to realize the same function like export dwg, which is export sumodel data to 2D dwg, so I need to transform figure by the view, and merge the figure of different face which intersect with each other , and filter out the obscured outlinesis

the way I use now is use LOPageCreateEntityIterator get all entities and transform by view, and calculate their intereced figure by pure geometric operations . the speed is is significantly slower than the export dwg function of layout , so I want to know is there any api to get these figure considering intersection and cover by the perspective like the picture below?