Solution (source code)

= Solution

For an ordinary closed manifold <boundary representation>, three requirements are:

* \b[Valid embedded faces.] Each face is planar and bounded by simple closed edge loops with nonzero area; distinct face interiors do not cross, and faces meet only in their declared common edges or <vertices of a polyhedron>. A quadrilateral with four noncoplanar <vertices of a polyhedron> is not one planar face; a bow-tie loop does not bound a simple face. Holes, when allowed, need separate correctly oriented loops.
* \b[Closed manifold incidence.] Exactly two faces meet at each edge, and the incident faces around each <vertex of a polyhedron> form one cyclic fan. A single missing face leaves edges incident with only one face. Three faces sharing an edge, or two closed shells touching only at one <vertex of a polyhedron>, violate the local surface condition. The second example shows why the edge count alone is insufficient.
* \b[Consistent orientation.] Adjacent oriented faces traverse their common edge in opposite directions, giving compatible outward <normal vectors>. Reversing just one face of a <tetrahedron> breaks this condition. For a cavity, the material's outward <normal vector> points into the cavity, so shell orientation must also respect which region is solid.

Together these support the answer
$$
\boxed{\text{embedded planar faces; closed manifold incidence; consistent outward orientation}.}
$$
For a connected orientable closed boundary of genus $g$, the <Euler characteristic> provides an additional check, $V-E+F=2-2g$, when faces are disk-like. The familiar value $2$ applies to a sphere-like shell; it must not be imposed blindly on every <polyhedron>. Correct counts alone do not exclude intersections or invalid local incidence.