For anyone wanting to make a perfectly perspective correct cube based on the 2:1 slope used, you should enter a Height equal to the "total width" * sqrt(3/8) (about 0.612).
To get the total width from this script, you would do Left*4 + (2 or 3 from Corner), and of course Left equal to Right in this case.