Topology-based reasoning on non-manifold shapes,