A standalone graph + 3D viewer platform for parsed IFC outputs.
This repository consumes outputs from IFC2StructuredData (attribute.csv, relationships.csv, geometry_instance.csv, geometry_library.csv, optional OBJ files) and provides:
- Property-graph ingest (Neo4j optional)
- Backend API for object/graph/geometry queries
- Dual-pane frontend (3D model + graph) with bidirectional selection
- Viewer asset builder (
model.glb+object_index.json) - Acceptance checks and test suite
backend/ # FastAPI app and graph services
frontend/ # Web UI (Three.js + Cytoscape)
graph_ingest/ # CSV -> graph dataset + Neo4j importer
viewer_assets/ # IFC -> GLB + object index builder
scripts/ # CLI entrypoints
tests/ # Unit tests
docs/ # Runbook, acceptance, limits, backlog
cd /Users/zijian/Desktop/IFCGraphViewer
pip install -r requirements.txtThis repo includes a runnable sample IFC model:
example_room/simple-room.ifcexample_room/parsed_output/*(CSV outputs +viewer/model.glb+viewer/object_index.json)
Run the viewer directly with the bundled sample:
GRAPH_STORE_MODE=csv \
GRAPH_OUTPUT_DIR=/Users/zijian/Desktop/IFCGraphViewer/example_room/parsed_output \
VIEWER_INDEX_PATH=/Users/zijian/Desktop/IFCGraphViewer/example_room/parsed_output/viewer/object_index.json \
VIEWER_FILES_DIR=/Users/zijian/Desktop/IFCGraphViewer/example_room/parsed_output/viewer \
FRONTEND_DIR=/Users/zijian/Desktop/IFCGraphViewer/frontend \
VIEWER_MODEL_URL=/viewer-files/model.glb \
python -m uvicorn backend.app:create_app --factory --host 127.0.0.1 --port 8000Open:
http://127.0.0.1:8000/http://127.0.0.1:8000/docs
To regenerate example_room/parsed_output from IFC, use IFC2StructuredData on branch dev/pm:
cd /Users/zijian/Desktop/IFC2StructuredData
git checkout dev/pm
python ifc2structureddata.py \
/Users/zijian/Desktop/IFCGraphViewer/example_room/simple-room.ifc \
/Users/zijian/Desktop/IFCGraphViewer/example_room/parsed_output
cd /Users/zijian/Desktop/IFCGraphViewer
python scripts/build_viewer_assets.py \
/Users/zijian/Desktop/IFCGraphViewer/example_room/simple-room.ifc \
/Users/zijian/Desktop/IFCGraphViewer/example_room/parsed_output \
--threads 4python scripts/import_graph_to_neo4j.py /abs/path/parsed_output --dry-run
# real import
export NEO4J_URI=bolt://localhost:7687
export NEO4J_USER=neo4j
export NEO4J_PASSWORD='your_password'
export NEO4J_DATABASE=neo4j
python scripts/import_graph_to_neo4j.py /abs/path/parsed_output --replacepython scripts/build_viewer_assets.py /abs/path/model.ifc /abs/path/parsed_output --threads 4Outputs:
/abs/path/parsed_output/viewer/model.glb/abs/path/parsed_output/viewer/object_index.json
Notes:
IfcOpeningElementis excluded from GLB rendering in V1.
GRAPH_STORE_MODE=csv \
GRAPH_OUTPUT_DIR=/abs/path/parsed_output \
VIEWER_INDEX_PATH=/abs/path/parsed_output/viewer/object_index.json \
VIEWER_FILES_DIR=/abs/path/parsed_output/viewer \
FRONTEND_DIR=/Users/zijian/Desktop/IFCGraphViewer/frontend \
VIEWER_MODEL_URL=/viewer-files/model.glb \
python -m uvicorn backend.app:create_app --factory --host 127.0.0.1 --port 8000Startup guard:
- Backend validates overlap between
VIEWER_INDEX_PATHand graph object IDs. - If overlap is too low, startup fails with a clear mismatch error.
- Tuning knobs:
VIEWER_INDEX_MIN_OVERLAP(default1)VIEWER_INDEX_VALIDATION_SAMPLE_SIZE(default5000)
Open:
http://127.0.0.1:8000/http://127.0.0.1:8000/docs
GRAPH_STORE_MODE=neo4j \
NEO4J_URI=bolt://localhost:7687 \
NEO4J_USER=neo4j \
NEO4J_PASSWORD='your_password' \
NEO4J_DATABASE=neo4j \
VIEWER_INDEX_PATH=/abs/path/parsed_output/viewer/object_index.json \
VIEWER_FILES_DIR=/abs/path/parsed_output/viewer \
FRONTEND_DIR=/Users/zijian/Desktop/IFCGraphViewer/frontend \
VIEWER_MODEL_URL=/viewer-files/model.glb \
python -m uvicorn backend.app:create_app --factory --host 127.0.0.1 --port 8000python -m unittest discover -s tests -vAcceptance:
python scripts/acceptance_check.py \
--output-dir /abs/path/parsed_output \
--report-path docs/acceptance_report.json- Node/edge inspector
- Double-click expansion
- Edge-name inspection
- Topology highlighting (
IfcSite,IfcBuilding,IfcBuildingStorey) Topology Focustoggle to fade non-topology nodes
Parser repository: