I wrote an interactive module for Geomview that allows the user to control 12 variables in my klein bottle equations. The program evaluates the u/v equations around the shape and calculates normals, inward points (a small distance into each grid square), and the edge list to describe the gridded shape. It can output to Geomview over a pipe, for instant display, or write SIF.

Here are the parameters to my equations, with descriptions:

The trickiest part to writing the program was handling the wrap at the end. I tried to write special cases to connect the "outside" to the "inside", etc, to make the grid close correctly. Still, even though I corrected all visible defects, Sara's analyzer told me there were flipped normals and non-manifold edges. Finally, I took advantage of the analyzer's vertex-merging feature: my program does not imagine the bottle to be connected at all, but of course my parameterization returns identical values at u=0 and u=2*pi. Removing all the end-connection code and extending the evaluation along u all the way to 2*pi created a visually AND geometrically correct part. The analyzer had to fix 2 points where rounding errors outputted slightly different numbers. (View the analyzer's output).

To prevent gridline intersections where the shape self-intersects, I used my interactive geometry generator and the Geomview viewer. Usually, I adjusted Geomview's near and far clipping planes to enclose a very small slice of my shape, so I could see the critical area without any foreground or background geometry in the way. Then I orbited the area over and over so that I could see "sky" between each pair of gridlines that might be intersecting. I never checked the region analytically, but I think I was able to see a gap everywhere there should be one.

Powered by Zope