How can I apply this script to a surface?
download the ngons plugin and look at the example files.
also search this forum for “planarize hexagons” and similar terms. There are Kangaroo plugin methods for this as well.
Reading the search results is important because there are geometric limits to what kinds of surfaces can be covered with planar convex hexagons. some forms just won’t work. Some work very well.
It can’t be done without a specific plugin?
It’s for a periodic surface…and also you’ll need luchbox.
No, it can’t. But the plug ins you need are all free on food4rhino.com