Difficulty applying Python logic to mesh

I have sourced a grasshopper logic that achieves the outcome I am after however i have had great difficulty applying it to my desired mesh, the logic requires a surface to work off and am curious about whether there are any ways around this. The mesh and example surface are contained within the Rhino attachment and GH script is also attached,
any help would be greatly appreciated

flat_panelization7.3dm (19.4 MB)
flat_panelization7.gh (94.3 KB)