Improve the code or add a solid
Pull requests are welcome; CONTRIBUTING.md
describes local checks. Keep search, rigorous verification and presentation as separate stages.
- For a new 3D solid, define high-precision vertices in
polyhedra.py and regenerate
src/solids.json and src/solids_hp.json. Add its number field and exact construction in
scripts/exact_solids.py, and regenerate and
self-check src/solids_exact.json.
- Register a 3D problem in
scripts/engine.py
(PROBLEMS and the family lists). Higher-dimensional geometry and pair definitions instead live in
src/polytopes_nd.py and
scripts/engine_nd.py.
A new nD solid also needs exact verifier support, including the appropriate facet checks.
- Run the relevant geometry, certification and site checks. Maintainer publication uses
scripts/publish.py / scripts/publish_nd.py; python3 scripts/site.py
builds the local site from the records and certificates. Records enter the public catalogue only after review
and the relevant checks.
Use the same JSON as the record files. Canonical solids are in
src/solids.json (high-precision coordinates in
src/solids_hp.json, exact definitions in
src/solids_exact.json).
Each piece row is [x, y, z, qw, qx, qy, qz]: a scalar-first quaternion rotates the canonical piece,
then its centre translates it. The quaternion must be nonzero and is normalized by the checker.
The container is s_full times the canonical container in its canonical orientation, centred at the
origin or at the optional container_center.
This complete example places two unit cubes in a larger cube with positive gaps:
{
"piece": "cube",
"container": "cube",
"n": 2,
"s_full": 2.2,
"pieces": [
[-0.55, 0, 0, 1, 0, 0, 0],
[ 0.55, 0, 0, 1, 0, 0, 0]
]
}
Platonic and Archimedean solids and the regular unit-edge prisms/antiprisms use unit-edge geometry.
Elongated prism keys encode their fixed aspect ratio; their base edge defines the size unit. Catalan solids use the
canonical dual of the corresponding unit-edge Archimedean solid, obtained by polar reciprocity in their common midsphere, and use that
canonical size convention. Use the recorded normalization when comparing scales or densities; do not rescale a
source's coordinates without documenting the conversion. Available 3D keys: .
In dimensions d = 4, 5 or 6, each pieces row contains d centre coordinates, the
d(d−1)/2 upper-triangular entries of a skew-symmetric matrix S (row by row), and d signs D, in that order.
The signs are ±1 with an even number of −1 entries, and the exact rotation is
R = diag(D) (I − S)−1 (I + S).
The container is container_center + s_full × mu × C, where C is the canonical container polytope and
mu = edge(P) / edge(C) is required and checked exactly. Thus s_full remains the ratio of
container edge to piece edge even when the two stored canonical polytopes have different edge lengths.
A plane row [i, j, u_1, …, u_d, t] uses zero-based piece indices and proves
u·x < t for piece i and u·x > t for piece j. Supply a plane for every pair not already
separated by the verifier's circumscribed-ball test. Coordinates and plane parameters may be finite JSON numbers
or rational strings such as "1/2". Preserve the native values: display-rounded poses or an arbitrary
floating rotation matrix are not this certificate format.
This complete example certifies two tesseracts; each row has 4 centre coordinates, 6 zero skew parameters and
4 positive signs. Save it as two-tesseracts.json and run
python3 certify_nd.py two-tesseracts.json:
{
"dim": 4,
"piece": "c8",
"container": "c8",
"n": 2,
"s_full": 2.2,
"mu": "1",
"pieces": [
[-0.55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1],
[ 0.55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1]
],
"planes": [[0, 1, 1, 0, 0, 0, 0]]
}
4D keys: c5 (5-cell), c8 (tesseract), c16 (16-cell),
c24 (24-cell), c120 (120-cell), c600 (600-cell).
5D: sx5, hc5, op5; 6D: sx6, hc6,
op6, for the simplex, hypercube and orthoplex respectively. Piece and container must have the same
dimension. For producing a native record from numerical centre/rotation arrays, see
claim_nd.make_claim and its documented internal-unit
conversion.