Minimal Tier-M geometry: a JSON triangle mesh + tier-selective loading#130
Open
louistrue wants to merge 1 commit into
Open
Minimal Tier-M geometry: a JSON triangle mesh + tier-selective loading#130louistrue wants to merge 1 commit into
louistrue wants to merge 1 commit into
Conversation
A minimal, dependency-free geometry core for IFCX, aligned with the ADR buildingSMART#6 direction toward a simple JSON mesh rather than a full USD/glTF runtime contract: - DisplayMesh: a minimal JSON triangle mesh (points + triangle indices, optional normals/uvs and provenance). Maps losslessly to UsdGeomMesh and to glTF, and is consumable by any JSON/HTTP client with no USD or glTF runtime. - TierResolver: tier-selective loading with an access log — a consumer that requests only Tier M provably never reads any other tier's table. - AttributeTable: the NDJSON one-row-per-line table primitive. - source-hash: RFC 8785 (JCS) canonicalisation + SHA-256, "sha256-<hex>" (SRI convention), for content-addressed staleness/change detection. - JSON schema for DisplayMesh; tests for all of the above. No dependency on the procedural/Brep/external catalogs — those tiers are keys in the routing taxonomy only, proposed separately.
9bddca5 to
56eab75
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Minimal Tier-M geometry: a JSON triangle mesh + tier-selective loading
Following the ADR 6 (https://github.com/buildingSMART/IFCX-CORE/issues/6) discussion (geometry representations), this proposes the smallest useful geometry core as code (types + behaviour + tests): a minimal JSON triangle mesh and the tier routing contract around it, nothing USD- or glTF-runtime-specific.
It's deliberately scoped to what the thread converged on ("the simplest triangle mesh we can think of serialized as JSON", mapping cleanly to both USD and glTF without forcing consumers to implement either runtime). Procedural and Brep tiers are out of scope here and proposed separately.
This PR intentionally touches
src/only, it does not add a normative schema yet (see "Schema" below), so the representation can be discussed before we fix its serialized form.What's in it
DisplayMesh(TS type):points+faceVertexIndices(triangles only), optionalnormals/uvs, and provenance (derivedFrom,sourceHash,faceGroups). The triangle geometry maps directly to a triangulatedUsdGeomMeshand a glTF triangle primitive (face counts implicit; positions as authored, subject to glTF float precision); the provenance fields ride in glTFextras/ USD custom attributes. Consumable by any JSON/HTTP client with no USD/glTF runtime.TierResolver: tier-selective loading with an access log: by construction a resolver asked only for Tier M never reads another tier's table (a test asserts the procedural table is refused even on an explicit cross-tier request).AttributeTable: the NDJSON one-row-per-line table primitive the tiers are addressed through (aligns with the "index → separate attribute records" shape in Post alpha #105).DisplayMesh.sourceHashis kept as an opaque field; the content-hashing scheme (for staleness/deltas) is proposed separately, alongside the code that produces it, to keep this PR to the mesh representation.No dependency on the procedural / Brep / external catalogs, those are keys in the routing taxonomy only. ~270 lines, tests included, builds and runs green with no new runtime dependency.
Open questions this is meant to settle (from the ADR 6 thread)
IfcTriangulatedFaceSet-as-JSON (@TLiebich): happy to align field names / dropPnIndex— the intent is the minimal subset, so if a JSON serialization ofIfcTriangulatedFaceSetis the preferred basis, this is a starting point to converge on, not a competing invention.Schema (deliberately deferred)
I did not add a schema file, to avoid pre-deciding its format: current
maindefines schemas as TypeSpec underschema/, while #105 moves toward JSON-schema + OpenAPI. Once the mesh shape is agreed I'll add the normative schema in whichever form the project settles on.$id/ versioning / namespace follow the same decision.The
externaltier is reserved in the routing taxonomy but ships no payload here (opaque interop reference, proposed separately).Wider context (not in this PR)
The fuller tiered story with Brep topology as identity-bearing nodes (relevant to ADR 3 identity), procedural authoring intent, importers, viewer all lives on a separate branch in my fork and in the ADR 6 / 3 threads. This PR is just the minimal, mergeable mesh slice.