Tool changing registers geometry of tool to avoid collision