Skip to content

§GEOREF: real TrueNorth + IfcSite lat/long — replacing a hardcoded "0" two live consumers have been rotating by - #117

Open
red1oon wants to merge 7 commits into
fable/meshdb-livewirefrom
feat/georef-sunpath
Open

red1oon wants to merge 7 commits into
fable/meshdb-livewirefrom
feat/georef-sunpath

Conversation

@red1oon

@red1oon red1oon commented Sep 18, 2026

Copy link
Copy Markdown
Owner

Implements prompts/GEOREF_SUNPATH_COMPASS.md §1-§4 (T1/T2). The viewer half is red1oon/bim-ootb#1751.

The defect

DAGCompiler/python/extractIFCtoDB.py wrote ("true_north_angle", "0") — the literal string, every building, since §KUL001 added the key. Meanwhile viewer/sitecam.js:81 and viewer/walk.js:275 have been applying a real rotation formula to it on every site-camera open and every walk-mode GPS fix. A live consumer, a real formula, a permanently stubbed input — the same class as bim-ootb #1744's inert _realAabb.

What changed

  • extract_georef() + _compound_angle_to_degrees() — real IfcGeometricRepresentationContext.TrueNorth and IfcSite.RefLatitude/RefLongitude/RefElevation. Six keys: true_north_angle, true_north_source, site_latitude, site_longitude, site_elevation_m, site_latlong_source.
  • prepare_large_ifc.py's own hardcoded "0" was INSERT OR REPLACE — it would have re-stamped 0 over the real value its part DBs now carry, one function after the fix landed. Now OR IGNORE: a backfill, never an overwrite.
  • scripts/witness_georef_extract.py — W-GEOREF-EXTRACT.
  • prompts/GEOREF_SUNPATH_COMPASS.md §2 corrected, §11-§13 added.

Two things the spec got wrong, caught before anything depended on them

1. The sign. §2 said atan2(x, y). Both consumers want atan2(-x, y) — the bearing of MODEL north measured from TRUE north, not the model-frame bearing of the TrueNorth vector. On Hospital_IFC2x3_ARC.ifc (TrueNorth = (-0.0871557427476695, 0.996194698091745)) that is +5.000000°; the spec's formula would have shipped -5° and rotated every fix the wrong way. §2 is corrected in place with the derivation and the fixture.

2. A non-conformant TrueNorth is in this fleet. Clinic_Electrical_IFC2x3.ifc #11050, Clinic_HVAC_IFC2x3.ifc #76172, Ifc2x3_Duplex_Plumbing.ifc #40 and LTU_AHouse_STR.ifc #66 each write IFCDIRECTION((2.0, 6.12303176911189E-17, 1.0)) — three components, z = 1.0, XY length 2. Reading its first two ratios gives exactly -90.000000°: precise, confident, a quarter turn wrong. Refused, and recorded as malformed_truenorth_ignored — a different fact from "the file had none".

§4

An absent lat/long is written empty, never 0/0. 0,0 is a real place in the Gulf of Guinea, and writing it turns "we do not know" into "we know, and it is there".

Witness

§GEOREF_WITNESS PASS files=5/5 arithmetic=6 defaults=7 wrong=0

Five real fleet IFCs, no synthetic fixture; every expected value hand-derived from the STEP literal quoted beside it in the witness. VACUOUS when internal/ is absent, never PASS.

Two real non-zero fixtures found in the fleet: Hospital_IFC2x3_ARC +5.000000°, merged_federation +52.040036° (Penang, 5.96277289 / 100.63712571).

Open, needs your call

prompts/GEOREF_SUNPATH_COMPASS.md §12.1 — Hospital's 14 discipline files give three different site coordinates: ARC 42.3584/-71.0598, STR+MEP 42.2130/-71.0330 (≈16 km away), MECH 43.1221/-77.6302 (Rochester NY, ≈500 km away). The majority picks one, the architectural master picks another. No self-heal patch was written for Hospital — that is a ruling, not a coin-flip to ship as fact.

🤖 Generated with Claude Code

…a 3-year-old hardcoded "0"

Implementing prompts/GEOREF_SUNPATH_COMPASS.md §1-§4 T1/T2. Witness: W-GEOREF-EXTRACT.

extractIFCtoDB.py wrote `("true_north_angle", "0")` — the literal string, every building, since
§KUL001 added the key — while viewer/sitecam.js:81 and viewer/walk.js:275 applied a real rotation
formula to it on every site-camera open and every walk-mode GPS fix. A live consumer, a real
formula, a permanently stubbed input. Same class as bim-ootb #1744's inert `_realAabb`.

Now extracted for real: `true_north_angle`, `true_north_source`, `site_latitude`,
`site_longitude`, `site_elevation_m`, `site_latlong_source`.

THE SIGN THE SPEC GAVE WAS WRONG, and it was checked before anything depended on it. §2 said
`atan2(x, y)`; both consumers want `atan2(-x, y)` — the bearing of MODEL north measured from TRUE
north, not the model-frame bearing of the TrueNorth vector. On Hospital_IFC2x3_ARC.ifc
(TrueNorth = (-0.0871557427476695, 0.996194698091745)) that is +5.000000°; the spec's formula
would have shipped -5° and rotated every fix the wrong way. §2 is corrected in place with the
derivation and the fixture.

A NON-CONFORMANT TrueNorth IS IN THIS FLEET. Clinic_Electrical #11050, Clinic_HVAC #76172,
Ifc2x3_Duplex_Plumbing #40 and LTU_AHouse_STR #66 all write
IFCDIRECTION((2.0, 6.12303176911189E-17, 1.0)) — three components, z = 1.0, XY length 2. Reading
its first two ratios gives exactly -90°: precise, confident, a quarter turn wrong. Refused, and
recorded as `malformed_truenorth_ignored` — a different fact from "the file had none".

§4: an absent lat/long is written EMPTY, never 0/0. 0,0 is a real place in the Gulf of Guinea, and
writing it would turn "we do not know" into "we know, and it is there".

prepare_large_ifc.py's own hardcoded "0" was INSERT OR REPLACE — it would have re-stamped 0 over
the real value its part DBs now carry, one function after the fix. Changed to OR IGNORE: a
backfill, never an overwrite.

W-GEOREF-EXTRACT: PASS files=5/5 arithmetic=6 defaults=7 wrong=0. Five REAL fleet IFCs, no
synthetic fixture; every expected value hand-derived from the STEP literal quoted beside it.
Two real non-zero fixtures found: Hospital_IFC2x3_ARC +5.000000°, merged_federation +52.040036°
(Penang, 5.96277289 / 100.63712571).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
red1oon added a commit that referenced this pull request Sep 18, 2026
…pital site-conflict BLOCKED on red1

Cross-session update from bim-ootb PR #1751 / bim-compiler PR #117 (neither merged yet):
T3-T6 done and witnessed (SUN_PATH_WITNESS 59/59, SUN_ORACLE 2968 samples/0 exceeded,
SUN_COMPASS_WITNESS 38/38, GEOREF_PATCH_WITNESS 75/75). Two findings beyond original scope:
4 fleet source files carry malformed TrueNorth data (both extractors now refuse it), and
Sec8's "rotation_z already extracted" premise holds on only 1 of 5 fleet buildings (Terminal) -
falls back to wall bbox aspect elsewhere, logged.

BLOCKED, flagged explicitly for red1, not resolved by either session: Hospital's 14 discipline
files disagree on site coordinates by up to ~500km (ARC/STR+MEP both Boston-area but ~16km apart,
MECH says Rochester NY). No patch written for Hospital - nobody picked a winner.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
red1oon and others added 5 commits September 18, 2026 23:41
A peer session updated prompts/GEOREF_SUNPATH_COMPASS.md on the base branch while this PR was open,
adding T8 (an end-to-end measurement gate) and recording the Hospital blocker. One file, one
conflict, resolved by combining rather than by picking a side:

- §10 (task list + T8) is THEIRS and stays — it is their narrative.
- §11/§12/§13 are MINE and stay. Theirs pointed at "the PR" for the derivation; once this PR merges
  the PR IS this file, so that pointer would have dangled. Their strongest sentence — "do not
  resolve Hospital automatically, not by majority vote, not by closest-to-the-others" — is folded
  into §12.1 rather than lost.
- §2's corrected TrueNorth sign and the malformed-direction block auto-merged intact.

TWO CORRECTIONS TO THE BASE BRANCH'S TEXT, both factual:

1. The STATUS headline read "T1-T7 built + witnessed" while its own T7 line read "untouched as
   recommended — still open". T7 is NOT built. A headline outlives the paragraph that corrects it,
   and §9 is precisely the piece nobody should think already shipped. T7 is now ⛔ NOT STARTED, and
   says so where a grep lands.

2. T8 is recorded as CLOSED with what actually closed it, not as still-open:
   - T8.1 was already covered — §SUN_ORACLE compares against pysolar (NREL SPA, a DIFFERENT
     algorithm), 2,968 samples; not the same formula agreeing with itself.
   - T8.2 and T8.3 were real gaps and are now closed in bim-ootb#1751
     (§SUN_COMPASS_WITNESS PASS checks=45 wrong=0, was 38).
   - ⚠ T8.2 as written asks for `compassGroup.rotation.y`. There is no such property — the rose is
     built from world-space points, so reading it would have found undefined and "passed" while
     asserting nothing. Noted in the task text so the next reader does not go looking for it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ritten and witnessed

Relayed ruling, 2026-09-18, attributed to red1 via a second Claude session working this spec: use
ARC's coordinate for Hospital. The architectural discipline is the authoritative source of record;
STR, MEP and MECH are the errors.

Recorded as RELAYED, not first-hand, on purpose. §12.1 is the escalation that produced this answer
and it is only checkable against what it overrode, so the full three-way conflict stays on record:
ARC 42.3584/-71.0598, STR+MEP 42.2130/-71.0330 (~16 km), MECH 43.1221/-77.6302 (Rochester NY,
~500 km). No majority vote, no closest-to-the-others heuristic. If the relay was wrong,
buildings/patches/Hospital_extracted.db.sql is the one place it shows and reverting is one commit.

Hospital_IFC2x3_ARC.ifc and Hospital_IFC4_ARC.ifc were diffed against each other first — a ruling
naming a file whose two exports disagreed would not have named a value. They are identical:
true_north_angle 5.000000 (ifc_truenorth), 42.35842896 / -71.05977631, 165.8112 m.

⚠ This makes Hospital the FIRST building in the fleet to ship a non-zero true_north_angle.
sitecam.js:81 and walk.js:275 have applied a real rotation to a permanently-zero input since they
shipped; on Hospital they now rotate by 5 degrees. Intended, and also the first place a sign error
would become visible — so those two will LOOK different here and should be checked against the
number, not against memory.

⚠ The extractor will NOT reproduce this ruling on its own: it reads whichever single IFC it is
pointed at, so re-extracting Hospital from a non-ARC file silently discards it. Said in both the
patch header and §12.1.

§GEOREF_PATCH_WITNESS PASS dbs=6/6 checks=90 wrong=0 (was 5/5, 75) — Hospital's 9,473-statement
patch applies cleanly, the §GEOREF block lands, elements_meta 63,415 and element_transforms 63,182
untouched, and the compass builds on the patched DB.
§13 has no blocked item left.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…s.js; say which and why

Merges the peer session's §7 panel note and records what actually exists against it.

"On the bake panel" and `panels.js` are two different panels. The direction named the first, so a
single "Sun compass" checkbox went into cinema_path_editor.js's Alt+C panel beside Measure / Clash
/ Storey highlight, where every other bake-overlay toggle already lives. ONE box for the whole
bundle, as directed. §SUN_COMPASS_WIRING PASS checks=28 wrong=0.

The panels.js toolbar pill this section describes is NOT built, and §7 now names the two concrete
blockers instead of leaving it looking done: (1) the 2D text has nowhere to go outside a bake —
it is composited onto _captureFrame's context and there is no general live overlay canvas to reuse;
(2) there is no date outside a bake and §6 forbids inventing one — time_machine.js keeps _cursor
private and ships tmSetCursor with no getter, so the correct fix is a tmGetCursor beside it, and
what to show when the timeline has no span is a real product question. Both small; neither started,
because an always-available live overlay changes viewer behaviour nobody asked to change.

The draftingCompass icon flag is CONFIRMED by inspection — panels.js:50 is legs and a pivot, the
drawing instrument, not a rose. No icon was added, since a checkbox needs none.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
red1, 2026-09-19: "Don't fix now, just note in the prompts/#".

§14.1 There are no Flaticon icons on the Alt+C panel and there will not be any from that route —
red1 went looking and did not find them. The artwork sourced for it was realclipart.com
"Personal Use", not Flaticon free tier, so it was pulled on licence grounds (§12.7, added here
too). What ships is Lucide's own compass plus three honest reuses from the same ISC set. Three
toggles stay caption-only; Lucide almost certainly covers all three and would close it with no
licensing question, one table entry each.

§14.2 HUD overlap, checked rather than assumed. The day-counter corner is one ordered column and
every box advances a shared offset, the clock included — it returns its drawn height so nothing
lands on it. Two collisions remain and neither is new: the counter can be set to a BOTTOM corner,
where the column would grow into the sun readout; and the path box can take its own corner while
still being pushed down by the counter's and now the clock's height. The honest fix is one offset
per corner instead of one global _stackY, which touches every overlay in that column and wants its
own change.

§14.3 A settable exact date — asked for, not built. Dates come from the 4D schedule's span today.
Noted with the shape it would take, and the trap: if the sun's date can be overridden, the label
must say which date it is showing or it and the day counter describe different days.

§14.4 The time is NOT a 2pm default. red1 saw "14:43 solar" and asked — the hour sweeps 9:00→17:00
across the film and 14:43 is where frame 6 of 8 landed. A fixed hour was built first and rejected:
it loses the sunrise-to-sunset reading red1 asked for. Advice recorded for if it is revisited —
keep the sweep, consider narrowing to 9:30→16:30, because the current end landing near the horizon
on a winter date is luck rather than design.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…; and what real frames caught that witnesses could not

Records the work on bim-ootb #1752 (18 commits stranded off main by #1751's squash merge).
§14.3's settable date is now built; §12.7's licence question is closed by Lucide's ISC compass.

The part worth keeping is the four defects that only a rendered frame exposed — chief among them
that the whole overlay never drew on a buildup-off bake while every witness passed, because the
witnesses call the function and only the bake calls the call site.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant