How to cut all faces in a specific direction from a point?
I'd would use a boolean modifier to go around this. It's a pretty easy way, not quite with the script though but works.
Start  by creating a very thin cube and rotating it by any angle you want, but make sure its cutting through all your mesh. Then give your icosphere a boolean modifier and set this new cube you have created as the mesh to use for boolean operation, don't forget to set the operation to difference.

p.s. It won't work with a plane as a boolean, only cube, just like that: