@chlhjd,
I revived this topic as I solved ultimate test... I did computation - on my PC ab 2 hours... Some central finishing 3d lines were missing, so I manually reconstructed solution and finally I gathered 3d lines into 3d solid... Then I isolated only polyline and applied 2droof-final.lsp - your version and although it solved it quickly, some things are different than with correct 3d solid... Observe in top view differences - 2d lines are red color... You can also check OFFSET command to see where PC - CAD is making mistakes - the part that was reconstructed - somewhere in the middle - top apex, offset is mistaking... So this is just for your spare time - the code could be improved further more, but I don't quite understand it as it's tough code, so if you want to do it you're welcome... In attachment is my DWG with ultimate test... After this, if it's corrected, maybe AutoDesk should check their OFFSET command for improvement... It is buggy on many things (2 circles connected with narrow canal - when offset you get 2 polylines - arced segment + some buggy ending near canal passage), but in most cases it's somewhat doing what should (my polygon polylines for roofs - still buggy on ultimate test)...
Regards, M.R.