The geometry of nonparametric filament estimation