Skip to main content

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:

FieldTypeExample
unitIdString (PK)2bhk_corner_96
bhkTypeString1BHK, 2BHK, 2.5BHK, 3BHK, 4BHK
areaSqmFloat96.5
entranceDirectionStringNORTH, SOUTH, EAST, WEST
isCornerBooleantrue
dimsJSON{ left_ext, right_ext, top_ext, bottom_ext, total_w }
geometryJSONArray of CAD entities (LINE, ARC, INSERT, etc.)
cleanedGeometryJSON?Simplified geometry for rendering

DXF Processing

When a floorplan DXF is uploaded:

  1. ODAFileConverter converts DWG to DXF (if needed)
  2. Python script (scripts/process_floorplan_dxf.py) parses the DXF to extract:
    • Individual unit boundaries
    • Room labels and dimensions
    • BHK classification
    • Entrance direction
  3. Extracted units are stored as CatalogUnit records

Endpoints

MethodPathDescription
GET/catalog/unitsList all catalog units
GET/catalog/units/:idGet a specific unit
POST/catalog/uploadUpload and process a floorplan DXF
DELETE/catalog/units/:idDelete a catalog unit

Usage in Simulation

The simulation engine queries the catalog to assemble floorplates:

  1. Frontend sends a product mix (e.g., 40% 2BHK, 30% 3BHK, 30% 2.5BHK)
  2. Simulation engine fetches matching catalog units
  3. Units are arranged on floorplates using the geometry dimensions
  4. Multiple tower configurations are generated and scored