Filling rotated parts gaps with scripts

Hi I was looking to see if I could get some help on how to fill a gap like this…

image

I have looked at previous topics but none seemed to get what i needed
Any help would be greatly appreciated

I need to fill this by script

1 Like

There is a plugin called fillgap.

i need a script that can do it not a plugin but thanks