Complex Framing structure script enhancement

Hello Guys!
With a friend, we worked on a script to generate beams on a complex surface but it is a bit dirty and too complex, so I would like to know if you knows tricks to improve it!
Thank you very much!:wink:
Complex Framing structure.dyn (515.9 KB)

@miathou Dynamo Version?