Skip to content

Units And Geometry Primitives

Units and geometry must be deterministic so paths, hashes, evals, and exports are reproducible.

ArchAI uses an internal coordinate-space model. GeoJSON, JSON-FG, LandXML, IFC, USD, glTF, Blender, Archicad, and Revit are adapter formats, not the internal coordinate truth.

For the full format decision, see Coordinates And Formats. For the v1 implementation decision, see Geometry Kernel.

QuantityCanonical storage
Lengthmillimeters
Areasquare meters
Volumecubic meters
Angledegrees in author-facing data, radians in math internals
TimeISO 8601 strings
mm(3000)
m(3)
deg(90)
sqm(12)

Source should avoid ambiguous unitless dimensions.

distance 5000mm
target_gfa 4200sqm
max 18000mm
Coordinate systemPurpose
ProjectLocal authoring coordinates
SiteSite-relative coordinates
SurveySurvey source coordinates
GISGeospatial source data
GeoreferencedReal-world CRS
Local elementElement-local transforms
BackendHost-specific coordinates

Every coordinate must belong to an explicit coordinate space or inherit one from the nearest geometry block.

boundary:
coordinate_space site.main.frames.local
unit mm
edge front: (0, 0) -> (42000, 0)

Canonical JSON should prefer explicit coordinate objects:

{
"space": "site.main.frames.local",
"x": "0mm",
"y": "42000mm",
"z": "0mm"
}
LevelPurposeExample
Semantic geometryAgent-editable intentwall baseline, parcel edge, floorplate boundary
Realization geometryHigh-fidelity derived shapesolids, BRep, openings
Preview geometryFast visual outputmesh, glTF, Blender scene

Agents should edit semantic geometry first. Realization and preview geometry are derived artifacts.

PrimitiveUsed by
Pointsurvey, terrain, boundaries
Polylineparcel edges, contours, roads
Boundary loopparcels, spaces, floorplates
Polygon regionenvelopes, no-build zones, floorplates
Terrain surfacetopo, grading, slope
Extrusionpreview walls, massing, slabs
Mesh proxyBlender, glTF, USD previews

Semantic geometry belongs to ArchAI. Third-party kernels are implementation details behind @archai/geometry.

V1 uses local projected coordinates and integer millimeters for topology-critical planar operations. Geo-referenced coordinates are transformed into local frames before parcel, setback, envelope, and floorplate operations run.

The implementation stack is:

CapabilityKernel
Polygon clipping, booleans, offsetsClipper2 adapter
Preview triangulationearcut
Terrain TINdelaunator
Spatial indexingrbush
CRS transformsproj4

earcut output is preview geometry only. Eval validity must come from canonical polygons and deterministic geometry checks, not from preview triangulation.