Method and apparatus for producing three dimensional nano and micro scale structures