Thanks for the response Roxy,

Btw what does the z term represent in your code? I don't have much Open_SCAD experience.