Web based service IFC handling service. (Under construction)
Next.js, React, Three.js (No R3F used)
- The IFC file is sent to FastAPI Server as request body.
- The server will parse the data from ifc file via IfcOpenShell.
Parsed data contains basically geometric values as mesh (vertices, faces, and so on). - Finally the server returns response the parsed data as JSON response, and Front-end read it and render the objects.
# Python
geometry_data = {
"id": element.id(),
"type": "IfcSlab",
"geometryType": geometry_type,
"vertices": vertices,
"vertices_count": len(vertices),
"faces": faces,
"faces_count": len(faces),
"normals": normals,
"normals_count": len(normals),
"edges": edges,
"edges_count": len(edges),
"location": location,
}
Through this process, the IFC File rendering can be done on three.js canvas.
- Slab (IfcSlab)
Parsable elements will be updated gradually.
- Currently, I'm concentrating on three.js viewport pagg. Thus, please follow below steps
-
Run the server app. Server app repository link is on the below of this README.MD
-
Run terminal at the directory of this repository, and type this command.
npm run dev
- Open the address
http://localhost:3000/viewer
Actually, this app uses dotenv to resolve server config. So please make .env file on the root directory.
...
// env section of next.config.mjs
env: {
IFC_SERVER_HOST: process.env.SERVER_HOST,
IFC_SERVER_PORT: process.env.SERVER_PORT,
}
...
SERVER_HOST=<YOUR HOST>
SERVER_PORT=<YOUR PORT>
Please match values with FastAPI based server on the bottom of this document.
Server Repository : https://github.com/JakkeLab-AEC/amountslicer-server-core