Skip to main content

Module klein

Module klein 

Source

Structs§

KleinBottle
A Klein bottle — a non-orientable closed surface with no boundary. Cannot be embedded in 3D without self-intersection.
KleinNavigation
Handles movement on a Klein bottle where crossing the top/bottom boundary flips left and right.
KleinRenderer
Renders the fundamental domain of a Klein bottle with flip indicators.

Functions§

klein_wrap
Wrap a position in a Klein bottle fundamental domain. Width axis wraps normally (like a torus). Height axis wraps with horizontal reflection (like a Klein bottle). Returns (wrapped_position, whether_orientation_is_flipped).
orientation_at
Get the orientation sign at a given position in the Klein bottle domain. +1.0 for normal orientation, -1.0 for flipped.