BIM Intent Compiler — How it works

4-Database Architecture
Compilation Pipeline
BOM Tree + Coordinates

Click any table to see what it holds

component_library.db
LOD Geometry Store
component_definitions
component_geometries
component_types
placement_rules
I_Geometry_Map
M_Product_Image
surface_styles
M_Product
material_layers
ad_material_thermal
ad_room_boundary
ad_product_dim
placement_rules
shared reference
material_layers
thermal props
ERP.db
Discipline Validation Rules + Calibration
ad_element_mep
ad_space_type_mep_bom
ad_fp_coverage
ad_space_type
ad_assembly_manifest
ad_wall_face
placement_rules
AD_SysConfig
W_Calibration_Result
validation rules
drive BOM resolver
M_Product refs
cross-DB lookup
{PREFIX}_BOM.db
Per-Building Dictionary — BOM Catalog (read-only)
m_bom (M_BOM)
m_bom_line (M_BOM_Line)
M_Product
C_DocType
m_bom_line_ma
ad_sysconfig
BOM dictionary
→ order + compile
c_order refs
DocType lookup
output.db
Self-Contained — Orders + Production + Compiled Result
ORDER (WHAT)
c_order (C_Order)
c_orderline (WHAT only)
PRODUCTION (HOW) — PP_Order_Node
PP_Order_Node (HOW)
PP_Order_NodeProduct (params)
SPATIAL (WHERE) — S_Resource
co_empty_space
co_empty_space_line (S_Resource)
COMPILED OUTPUT
elements_meta
element_instances
element_assemblies
← Click a table above to see its role
ERD — Cross-Database Relationships
See docs/DATA_MODEL.md for full cross-database relationship mapping.
Key chain: m_bom_line.child_product_idM_ProductM_Product_Image [geometry_hash]component_geometries [mesh BLOB]
4 databases: component_library.db (geometry), ERP.db (rules), {PREFIX}_BOM.db (dictionary), output.db (orders + compiled result).
1
C_Order — the Building Definition output.db
Two fields ARE the entire building definition:
C_DocType.DocSubType = WHO (DX = Duplex, SH = SampleHouse, TB = TerraceBlock)
AABB = HOW BIG (width × depth × height in mm)

Everything downstream — which floors, which rooms, which furniture — cascades from these two. The order starts in DocStatus='DR' (Draft) and moves to 'CO' (Complete) after compilation.
C_DocType_IDC_DocType (in {PREFIX}_BOM.db). DocBaseType drives template selection (RE→Residential). DocSubType scopes which BOMs are visible (SH/DX/TB).
C_BPartner in iDempiere = the customer who placed the order (contractor, architect, client). Present at release.
C_Order Duplex
  C_DocType_ID = 'RE_DX' ← DocSubType=DX (WHO)
  aabb_width_mm = 14000
  aabb_depth_mm = 10000
  aabb_height_mm = 7000 ← HOW BIG
2
C_OrderLine — WHAT to Build (Order Topics Only) output.db
WHAT-only: Each line selects an M_BOM from the catalog. No placement columns — HOW is in PP_Order_Node, WHERE is in co_empty_space_line.
Two sources: (1) User-specified lines in {PREFIX}_BOM.db (design-time), (2) compiler-generated from WALK THRU walk.
C_OrderLine #1 family_ref='BUILDING_DX_STD' discipline=FURN [user]
C_OrderLine #2 family_ref='FLOOR_DX_L1_STD' discipline=FURN [user]
C_OrderLine #3 family_ref='LIVING_SET' discipline=FURN [user]
C_OrderLine #4 family_ref='Doors_IntSgl' discipline=ARC [generated]
PP_ model: iDempiere C_OrderLine = "customer wants 100 chairs." PP_Order_Node = "cut, assemble, paint."
Our c_orderline = WHAT. PP_Order_Node = HOW. co_empty_space_line = WHERE. §11.9.
3
BOM Explosion — Recursive Tree Walk {PREFIX}_BOM.db
M_BOM → M_BOM_Line → child M_BOM → ... recursively.
Each node carries: dx/dy/dz (offset from parent), rotation_rule (abstract, e.g. FACE_INTO_ROOM), SpaceSize (AABB of this construct), BOMCategory (RE/L1/L2/SL/RF/GF/FR/ST).
Buffer children (category ST) fill the remainder — they are explicit BOM nodes, not computed gaps.
Invariant: parent AABB = SUM of all children AABBs per locator strip.
BUILDING_DX_STD (RE) 14000×10000×7000mm
  ├─ FLOOR_SLAB_GF (SL) dZ=0
  ├─ FLOOR_DX_L1_STD (L1) dZ=0 → 14000×10000×3000mm
  │   ├─ Rm_Living_1 (RM)
  │   │   ├─ Piano (FN) dx=0 dy=0 rotation_rule=PARALLEL_TO_WALL
  │   │   ├─ Sofa (FN) dx=1500 rotation_rule=FACE_INTO_ROOM
  │   │   └─ Buffer_NW (ST) fills remainder
  │   └─ Rm_Bedroom_1 ...
  ├─ FLOOR_SLAB_L2 (SL) dZ=3000
  ├─ FLOOR_DX_L2_STD (L2) dZ=3000
  └─ ROOF_ASSEMBLY (RF) dZ=6000
4
Template Composition — ST Mode Only {PREFIX}_BOM.db
Only runs for DocSubType='ST' (Standard Mode builds). Skipped for owner-matched (SH/DX/TB).
Walks M_BomCategoryLine tree (RE→SL/GF/RF, GF→LI/BD/DN/KT/BT) to select best-fit BOMs from the full catalog using only the building AABB + num_units. No pre-wired C_OrderLine needed.
GF selection owner (e.g. SH) then resolves the UNIT BOM and feeds CO_EmptySpace L2 lines.
When composition is complete (0 gaps), header is marked CO directly — ProveStage is skipped.
M_BomCategoryLine walk for ST_SH (16867×8667×3945mm, numUnits=1):
  L0 RE → <envelope>
  L1 SL → FLOOR_SLAB_GF
  L1 GF → FLOOR_SH_GF_STD owner=SH → BUILDING_SH_STD
  L2 LI → LIVING_PREFAB_MY (best-fit from catalog)
  L2 BD → BEDROOM_PREFAB_MY_3100
  L2 KT → KITCHEN_CABINET_SET
  L1 RF → ROOF_ASSEMBLY
5
CO_EmptySpace — Construction Site Envelope output.db
One record per C_Order. Holds the AABB of the whole construction site and lifecycle state.
is_available = Y throughout processing. Flips to N ONLY after translation to output + all witness tests GREEN. If tests fail → stays Y, space not consumed.
ST mode: L2 lines written from template leaf selections. Header marked CO when composition complete.
co_empty_space
  c_order_id = 'Duplex'
  aabb_*_mm = 14000 × 10000 × 7000
  is_available = YN after compile+tests pass
6
CO_EmptySpaceLine — WHERE + Orientation output.db
One line per BOM construct placed in space. Does NOT repeat the BOM — it only says where it lands.
before/next = GPD anchor chain in mm (before is entry point, next is exit for the next item).
orientation_rad = resolved concrete angle (FACE_INTO_ROOM → π for north-wall rooms).
remaining_mm = buffer still available (queryable: "does a 300mm lampshade fit here?").
co_empty_space_line
  #7 bom=LIVING_SET before=(208,-5246,0) orient=π
  #15 bom=Piano before=(1620,3308,0) next=(3120,3308,0)
  #16 bom=Buffer_NW remaining=254mm
  #17 bom=Sofa_3Seat before=(3374,3308,0) next=(5374,3308,0)
6b
VerbStage — BIM COBOL Production Operations output.db {PREFIX}_BOM.db
PP_Order_Node dispatch: Reads PP_Order_Node by SeqNo. Each verb invocation targets an ESLine (S_Resource workstation) and produces IFC elements.
Verbs: TILE SURFACE (grid placement), ARRAY (rebar spacing), ROUTE SPRINKLERS, CONNECT FITTINGS, WIRE LIGHTING, etc.
iDempiere parallel: PP_Order_Node = operation step on S_Resource workstation. Multiple verbs target same ESLine.
PP_Order_Node seq=10 verb=TILE SURFACE target_ESLine=#7
  params: GRID_NX=15 GRID_NY=294 STEP_DX=495mm STEP_DY=150mm
  → emits 4,410 IfcPlate elements into output.db
  → doc_status DRCO, witness stored in last_result

PP_Order_Node seq=20 verb=ARRAY target_ESLine=#12
  params: LENGTH=6000mm SPACING=150mm COVER=40mm
  → emits 40 rebar elements, cover compliance=PASS
7
Translation — BOM Offsets + ESL Anchor → World XYZ output.db
The actual math step. Takes each BOM leaf's abstract dx/dy/dz, rotates it by orientation_rad, then adds the CO_EmptySpaceLine.before anchor to get world coordinates.
Geometry hash is resolved via M_Product_Image + LOD_Object in component_library.db.
BOM offset: Piano dx=0 dy=0 rotation_rule=PARALLEL_TO_WALL
ESL anchor: origin=(208, -5246, 0) orient=π
──────────────────────────────────────────
world_xyz = origin + rotate(dx,dy, π) = (208, -5246, 0)

BOM offset: Sofa dx=1500 dy=0 rotation_rule=FACE_INTO_ROOM
world_xyz = origin + rotate(1500,0, π) = (-1292, -5246, 0)
8
Output DB + Witness Tests output.db component_library.db
elements_meta — final IFC elements: guid, ifc_class, storey, world xyz.
element_instances — geometry transform matrix + material (resolved from component_library).
element_assemblies — parent/child grouping for IFC IfcRelAggregates.

Witness tests then run (G8 centroids, F4 edges, W-SPACESIZE-1 …). If ALL pass:
co_empty_space.is_available = N (space consumed, construction confirmed).
If any fail → is_available stays Y, output is rolled back.
RE — Residential
L1/L2 — Floor
SL — Slab
RF — Roof
RM — Room
FN — Furniture
ST — Buffer/Spacer
  • BUILDING_DX_STD [UN · DX] 14000×10000×7000mm
    BOMCategoryRE (Residential) DocSubTypeDX (Duplex)
    AABB14000 × 10000 × 7000 mm
    children5 (slabs + floors + roof)

Translation in practice — Living Room, orient=π

Item BOM dx,dy (abstract) + ESL origin (208,−5246,0) world_xyz
Piano 0, 0 rotate(π) 208, −5246, 0 208, −5246, 0
Sofa 1500, 0 rotate(π) 208, −5246, 0 −1292, −5246, 0
Buffer_NW 3500, 0 254mm remaining (no geometry)
rotate(dx, π) = (−dx, 0) — at 180° the axis flips. Piano at dx=0 stays at origin; Sofa at dx=1500 steps −1500mm in X.