I saw this (quite old) challenge online:
https://www.makerbot.com/media-center/2011/10/11/openscad-challenge-klein-bottle
I could not resist making my own! I'm perfectionist, I made it as perfect as I could.
I made it using bezier curves because that was a lot easier than trying to model the shape by removing "donnut" shapes around it (I could not see a neat solution to do this). Since there is no bezier functionality in OpenSCAD, I had to create my own, from an existing library found on thingiverse.
The bottle is easy to customise. I added 4 variables at the beginning of the files:
- wallThickness
- bottleHeight
- bottleDiameter
- tubeDiameter
The "precision" (number of polygons generated) is also configurable.
I also uploaded a "cut" version to see inside the bottle. That one is for education purpose, and also to prove that I didn't "cheated".
Bezier library: http://www.thingiverse.com/thing:2170645
NOTE: The library is quite small, I uploaded it with the model for simplicity.