Catalog Module
The catalog module manages a library of pre-defined apartment unit templates (floorplans) that are used by the simulation engine during floorplate generation.
CatalogUnit Model
Each unit is a standardized apartment template with geometry data extracted from DXF files:
| Field | Type | Example |
|---|---|---|
unitId | String (PK) | 2bhk_corner_96 |
bhkType | String | 1BHK, 2BHK, 2.5BHK, 3BHK, 4BHK |
areaSqm | Float | 96.5 |
entranceDirection | String | NORTH, SOUTH, EAST, WEST |
isCorner | Boolean | true |
dims | JSON | { left_ext, right_ext, top_ext, bottom_ext, total_w } |
geometry | JSON | Array of CAD entities (LINE, ARC, INSERT, etc.) |
cleanedGeometry | JSON? | Simplified geometry for rendering |
DXF Processing
When a floorplan DXF is uploaded:
- ODAFileConverter converts DWG to DXF (if needed)
- Python script (
scripts/process_floorplan_dxf.py) parses the DXF to extract:- Individual unit boundaries
- Room labels and dimensions
- BHK classification
- Entrance direction
- Extracted units are stored as
CatalogUnitrecords
Endpoints
| Method | Path | Description |
|---|---|---|
GET | /catalog/units | List all catalog units |
GET | /catalog/units/:id | Get a specific unit |
POST | /catalog/upload | Upload and process a floorplan DXF |
DELETE | /catalog/units/:id | Delete a catalog unit |
Usage in Simulation
The simulation engine queries the catalog to assemble floorplates:
- Frontend sends a product mix (e.g., 40% 2BHK, 30% 3BHK, 30% 2.5BHK)
- Simulation engine fetches matching catalog units
- Units are arranged on floorplates using the geometry dimensions
- Multiple tower configurations are generated and scored