Is it possible to create a volumetric object which has a circle, a square and an equilateral triangle as orthogonal profiles? This question was posed to me by a friend (formulated as creating a peg to fit perfectly into holes of these shapes), and after an experiment in OpenSCAD it seems it is not possible - either one profile has to be an isosceles triangle rather than equilateral, rectangular rather than square, or elliptical rather than circular:




It makes sense that this is impossible. The height of the triangle is shared with the height of the square. The height of the square needs to be the diameter of the circle, as do the sides of the triangle.This is where we reach a contradiction. As the height of an equilateral triangle can never equal its side length.
To visualize the contradiction we can break the isosceles triangle into two (30,60,90) triangles and compare the height to the side length using the Pythagorean theorem.
let d = diameter of the circle and h = height of the equilateral triangle
$$d^2= (d/2)^2 + h^2$$
$$d^2 = d^2/4 + h^2$$
$$3d^2/4 = h^2$$
$$3^{1/2}d/2 = h$$
Therefore $h \neq d$
