[math-fun] Condition for a twisted shape to stand on its own on a horizontal surface