copy of joint_polytopes for anna's extension