only compute geometry when needed