TheRON 7b3182c0b9 port: the 3x and 4x profile catalogues; build() now exists
Completes the port. mechcomp.profiles.build and ProfileRejected are live,
so all 123 oracle cases execute rather than skip.

  _common.py   assembly pipeline shared by both families, and the eight
               base checks both generators declare identically
  four_x.py    five profiles, all direct library calls with N=4
  three_x.py   six profiles; four are library calls with N=3, while
               A Frame and T are built from join-layer primitives
               because they are specific arrangements rather than
               instances of a family

466 tests: 436 pass, 30 fail. THE 30 FAILURES ARE EXPECTED. Do not treat a
red `make test` here as a broken port.

All 30 are test_accepted_case_matches_oracle, and all 30 breach on
SECTION_AREA_MM2 alone -- VOLUME_MM3 and MASS_G are that value times 100
and times density, so each case has one underlying discrepancy reported
three times. Worst relative error 2.24e-05.

Everything that positions material is exact. ENVELOPE_X_MM, ENVELOPE_Y_MM,
MIN_WALL_ACTUAL_MM and every profile extra (AF_*, FIN_*, SPOKE_*, RING_*,
T_*) pass at 1e-4 mm in all 123 cases. Every count is exact. All ten
rejections fire correctly, including the bespoke A Frame and T paths.

Cause is F-034, now characterised precisely: the port is exact and the
reference is noisy. _circlecorner computes (90-angle)/180*segs(), which at
$fn=48 on a 90-degree corner is exactly 12. The port lands on 12.0 every
time and takes ceil 12; OpenSCAD's arithmetic lands a hair under 45 degrees
at some corners, pushing the value fractionally above 12 and the ceiling to
13. Measured on Rectangle: reference envelope 50 vertices, port 48.

There is nothing to correct on this side. Both boundaries sit within
0.0027 mm (4x) and 0.0043 mm (3x) of a true arc and within ~0.4 um of each
other -- far inside the project's 0.01 mm criterion. The tests fail because
VOLUME_MM3 is compared at 1e-4 absolute against a magnitude near 20000,
demanding 5e-9 relative agreement from discretised geometry.

Resolving that means changing the comparison policy in test_oracle.py, not
the oracle: the tolerance block is inside the hashed document and editing
it would break test_integrity_hash by design. Deferred pending a decision.

See docs/PRECISION.md for what the 0.01 mm criterion means and what this
compiler does not do.
2026-08-20 06:41:59 -05:00
2026-08-14 09:21:31 -04:00

Mechanical Compiler

Build the capacity to construct real structures from reclaimed and commodity materials, using whatever fabrication is actually to hand — 3D printing, tabletop CNC, welding, cement casting, COTS stock.

The reference case is a faceted timber shell: planar panels meeting along straight fold lines, converging on nodes, sitting on a platform. Buildable without a factory, provided someone has worked out what the pieces are and how they meet. That last clause is the project. The Mechanical Compiler exists to make the pieces computable, qualifiable, and reproducible by someone who was not present when they were designed.

Scope

In scope: geometry, qualification, and reproducibility of structural members and their interfaces.

Not in scope: building codes, permitting, jurisdictional approval. Qualification and compliance are different things. A qualification says this member is what it claims to be, made this way, from this stock. Compliance is a jurisdiction-specific argument someone else may build on top.

The project records physical claims, never verdicts — section modulus, moment of inertia, material provenance, process parameters. Those are what any future argument would need. A pass/fail verdict would bake in a jurisdiction we do not want to be bound to. Measure and attest; never adjudicate.

Repository layout

docs/                     specification, state, failure log, roadmap
legacy/openscad/          rev 8.0.0 generators — reference, not a live target
fixtures/                 frozen acceptance oracles
tools/reference-toolchain/  pinned OpenSCAD + BOSL2, build-time only
src/mechcomp/             the application
tests/                    acceptance against the oracle

Read docs/ROADMAP.md first for what this is, then docs/ENVIRONMENT.md for how an instance is built. If you are writing provisioning automation, read docs/FAILURES.md before the specification — every entry is something a script written from the specification alone would have got wrong.

Getting started

make deps            # virtualenv, base + CAD requirements
make verify-oracle   # confirm the frozen oracle is intact
make test            # pytest -n auto

make verify-oracle needs nothing but Python. It should pass on any machine at any time; if it does not, stop.

The oracle

fixtures/strap-beam-8.0.0/ holds 123 frozen cases — 113 accepted, 10 rejected — produced by OpenSCAD 2021.01 with BOSL2 at 92d697c2. It is the acceptance criterion for any reimplementation of the generators.

The ten rejected cases are part of the contract. A port that accepts them is wrong, however good its numbers look elsewhere. It is easy to reproduce the geometry and quietly lose the constraint that made it trustworthy.

The generators under legacy/openscad/ are the reference implementation, kept so the oracle can be regenerated. They are not a live target and the running application has no OpenSCAD dependency.

Provenance

This project's documents, code and roadmap are LLM-generated under human direction. That is stated plainly here and in any downstream submission. We do not obscure it.

The maintainer reviews and owns every line. Anything that could not be defended in a review thread does not ship.

Licence

AGPL-3.0-or-later. See LICENSE.

Section 13 obliges us to offer source to users interacting over a network, so any deployed web tier carries a visible link back to this repository. That is a licence obligation, not a courtesy.

S
Description
No description provided
Readme AGPL-3.0
1.1 MiB
Languages
Python 81%
OpenSCAD 18%
Shell 0.5%
Makefile 0.3%
Dockerfile 0.2%