Repository navigation
Project North direction: data-model property + viewport compass #362
Description
Activity
Status update: the viewport portion has shipped. #478 added the live compass and align-to-north behavior, and #487 fixed 3D-only compass synchronization. The requested first-class north model is still absent—there is no
northDirection/project-north field on Site or Building, nor the corresponding MCP contract—so I’m keeping this issue open for that durable data-model work.- addedenhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed
on Aug 4, 2026 Re-checked this against current
main. The core ask stands, with one correction to the original write-up.Still true: there is no first-class North.
grepfornorthDirection/projectNorth/northDeg/trueNorthacrosspackages/core/src/schema/andpackages/mcp/src/returns nothing. Site and Building carry no orientation field, and the MCP contract has nothing to anchor a real-world bearing against. The viewport half shipped (#478 compass + align-to-north, #487 3D sync), so what's left is exactly the durable data-model work this issue is named for.Correction: the two templates don't actually disagree. Reading the geometry rather than the prose, both use −z = north:
two-bedroom.ts—wall_nspans[X_MIN, Z_MIN] → [X_MAX, Z_MIN],wall_sspansZ_MAX. So positive z points south, as its header states.garden-house.ts—wall_nis at-HOUSE_D,wall_sat+HOUSE_D, andzone_gardenextends to-HOUSE_D - GARDEN_DEPTH, i.e. further into −z. The garden is at −z, which is north under the same convention.
So the convention is consistent in the code;
garden-house.tsjust never writes it down, which is why it reads like a contradiction. That's a smaller and different problem than "templates pick their own convention silently" — worth knowing before someone starts, since it means there's no existing inconsistency to migrate, just an undocumented assumption to make explicit and then to promote into the schema.That splits this into two independently shippable pieces:
- Documentation-sized: copy the coordinate-system paragraph from
two-bedroom.ts:13-14intogarden-house.ts, so both templates state −z = north. Genuine good-first-issue: one comment, no behaviour change. - The actual work: an orientation field on Site (or Building), an MCP contract for it, and the compass reading from it rather than from world axes. This needs a design call first — degrees vs vector, which node owns it, what happens to existing scenes that have no value (treat absent as "−z is north" to stay backward-compatible with every scene and template written so far), and whether the 2D panel's 90° rotation and the 3D top-down snap offset should then be derived from it.
Labeling
enhancement+help wanted. Piece 2 is a schema change, so it wants agreement on the shape before code — if you or anyone else wants to take it, propose the field on this issue first and we'll settle it there rather than in review.- added a commit that references this issue
on Aug 4, 2026 I checked current main: the compass/align-to-north UI and the garden-house coordinate documentation are already present. I'd like to work on the remaining durable orientation contract, with this concrete shape for agreement before implementation:
- Store
northDirectiononSiteNode, since one site's buildings should share north independently of each building's existing rotation. - Use a finite angle in radians about world +Y, with
0meaning world -Z. The corresponding north vector is[-sin(northDirection), 0, -cos(northDirection)]; this makes the angle directly compatible with the existing camera azimuth convention. Missing values default to 0, preserving saved scenes and templates. - Treat it as orientation metadata: changing north never rotates geometry. The existing 2D/3D compass and align action read the selected building's parent site and use this angle; building-local rotations remain independent.
- Support the field through the existing validated
apply_patch/get_scenepath, with coverage for legacy scenes, non-finite values, serialization/patch round trips, and rotated buildings. No separate true/project-north or sun-study model in this change.
Would this Site-owned, radians-from-minus-Z shape work for you, or would you prefer the original radians-from-plus-X representation? I will keep the durable schema change separate from the already-shipped compass work while this is settled.
- Store
- addedready-for-humanNeeds human input during executionNeeds human input during execution
on Sep 12, 2026
Problem or motivation
Pascal has no first-class North in its data model. The word "north"
appears only as informal English in template comments, and the two
templates that use it don't even agree:
packages/mcp/src/templates/two-bedroom.ts:14— "
zrunning north/south (positive z points south)"packages/mcp/src/templates/garden-house.ts:14— "back garden zone immediately to the north of the house"
(without specifying which axis)
There's no
northDirection,northDeg, compass, or any otherorientation primitive anywhere in the schema. So:
with bearings from North, a north-up site plan, a 2-D plotting
library) have nothing to anchor their input against. The
external-coordinate gotcha documented in Docs: document the plan↔world coordinate convention for MCP/API authors #337 / docs(mcp): document plan↔world coordinate convention #356 is partly
because there's no canonical North to map page-up coordinates
onto — the README has to tell authors to verify with a guide image.
inspecting a scene. The 2-D plan panel applies a 90° rotation and
the 3-D top-down snap defaults to a ~45° offset (also documented in
Docs: document the plan↔world coordinate convention for MCP/API authors #337), so "north on the page" doesn't map intuitively to anything.
This is what surfaced #337 in the first place — building geometry
programmatically from a surveyor's report (every wall a bearing from
True North) means chasing the rotation manually, because the editor
has nothing to anchor it against.
Proposed solution
A tiered approach so the maintainer can pick a starting point. Tier 1
on its own would close the gap meaningfully; Tier 2 makes it complete.
Tier 1 — minimum viable (a property, a widget, a default)
northDirection: number(radians, CCW from world+Xto matchPascal's existing rotation conventions) to
SiteorBuilding.Default to whatever the current templates implicitly assume so
existing scenes don't move.
existing camera-mode button in
apps/editor/components/viewer-toolbar.tsx),rotating with the camera so it always points to true north on screen.
Tier 2 — high-leverage follow-ups
north faces screen-up, and adjusts
FLOORPLAN_VIEW_ROTATION_DEG/the floor-plan SVG group rotation so 2-D plan view does the same.
northDirectionover MCP (settable viaapply_patch/readable from
get_scene). Agents authoring from a survey can dropthe value in once and have everything else line up — closes the loop
the README PR opens.
Tier 3 — explicitly out of scope for v1, mentioned so it doesn't
get baked into the wrong place
North = aligned to a building facade for drawing clarity, True North
= the cardinal). Worth considering if Pascal ever wants sun-studies
northDirection+ lat/long + date/time.Alternatives considered
solve the underlying issue: even after reading the docs an author
still has to verify orientation against a guide image every time.
visibly broken — the two-bedroom template says +Z is south and the
garden-house template says the garden is to the north without
saying which axis.
world +Z (or +X) regardless. Tempting but doesn't help anyone
authoring from a real-world bearings source; it just relabels the
existing world axes.
Additional context
Every comparable tool has this:
So Pascal not exposing this is the unusual position rather than the
ask being unusual.
Open questions
SiteorBuilding? Site is the outermost container andmultiple buildings could share a site's north. Building already
has a
rotation: [x,y,z], so Building.rotation[1] is roughly "thisbuilding's facade angle relative to site axes". Storing north on
Site keeps these orthogonal; storing on Building lets each building
have its own. My instinct says Site, but you may have a reason to
put it on Building.
two-bedroom.tstemplate's stated convention ("+Z = south" inverted)and is the most common assumption in north-up site plans. Worth
defaulting explicitly rather than leaving it implicit as today.
could also be a small N marker on the existing camera-mode button,
or a compass overlay near the orthographic-camera toggle in
viewer-toolbar.tsx:438.Likely a design call.
Happy to take a stab at Tier 1 if there's interest; want to confirm
the schema placement and widget direction first.
Related: #337, #356.