topology.py: support non-watertight meshes