← Back to PixelAPI · All docs · Blog
Score any floor plan against 21 traditional Vastu Shastra rules. Get a per-rule report and an AutoCAD-openable DXF on the same call.
A structured floor plan as JSON. All distances in feet. Coordinate origin is the south-west corner of the plot; +x goes east and +y goes north. Each room is an axis-aligned rectangle described by its SW corner plus width and height.
| Field | Type | Required | Notes |
|---|---|---|---|
facing | string | yes | One of north, north-east, east, south-east, south, south-west, west, north-west (long form, short form, and capitalisation are all accepted). |
plot.width_ft | number | yes | Plot width (east-west extent). |
plot.depth_ft | number | yes | Plot depth (north-south extent). |
rooms[] | array | no | Each room is {name, x, y, w, h}. name is normalised to lower_snake_case, so "Master Bedroom" and "master_bedroom" are equivalent. |
main_entrance | {x, y} | no | Point on the plot perimeter where the main door is. |
features | {key: {x, y}} | no | Optional point markers. Recognised keys: water_tank, well, septic_tank. |
Recognised room names (each one has at least one rule attached): kitchen, dining_room, living_room, drawing_room, master_bedroom, bedroom, children_bedroom, guest_room, bathroom, toilet, pooja_room, prayer_room, study, office, home_office, storage, store_room, garage, staircase. Any other name is accepted but won't trigger zone-specific rules (it'll still count toward the centre-occlusion check).
/v1/vastu/analyzeRun the rules engine on a layout. Returns a 0–100 score plus per-rule findings.
curl -X POST https://api.pixelapi.dev/v1/vastu/analyze \
-H "Content-Type: application/json" \
-d '{
"facing": "north",
"plot": {"width_ft": 40, "depth_ft": 60},
"rooms": [
{"name": "kitchen", "x": 30, "y": 3, "w": 8, "h": 12},
{"name": "master_bedroom", "x": 2, "y": 3, "w": 13, "h": 12},
{"name": "toilet", "x": 16, "y": 3, "w": 6, "h": 6},
{"name": "pooja_room", "x": 34, "y": 55, "w": 6, "h": 5},
{"name": "living_room", "x": 18, "y": 40, "w": 18, "h": 15}
],
"main_entrance": {"x": 20, "y": 58},
"features": {"water_tank": {"x": 36, "y": 56}}
}'
{
"score": 100.0,
"bucket": "excellent",
"summary": "Strong Vastu alignment overall.",
"rule_counts": {"pass": 14, "fail": 0, "warning": 0, "na": 7},
"findings": [
{
"rule_id": "kitchen_se",
"name": "Kitchen in Southeast (Agneya)",
"status": "pass",
"severity": "high",
"detail": "Kitchen is in SE — ideal Agneya placement (fire element).",
"suggestion": ""
},
{
"rule_id": "kitchen_not_ne",
"name": "Kitchen NOT in Northeast",
"status": "pass",
"severity": "critical",
"detail": "Kitchen is in SE, not NE — good.",
"suggestion": ""
}
// ... 19 more findings
]
}
| Field | Description |
|---|---|
score | 0–100. Severity-weighted: critical=5, high=3, medium=2, low=1. pass earns full weight, warning half, fail zero. na rules don't count toward the denominator. |
bucket | One of excellent (≥85), good (≥70), fair (≥50), poor (<50). |
summary | One-sentence human-readable interpretation. |
rule_counts | How many rules ended in each status. |
findings[] | One entry per rule. status is pass/warning/fail/na. suggestion is filled with a concrete fix when the rule fails or warns. |
| Code | Meaning |
|---|---|
| 400 | Invalid layout — message includes the specific field. e.g. {"detail":"Invalid layout: unknown direction: 'upward'"} |
| 422 | Schema mismatch — Pydantic-level error before reaching the engine. |
| 429 | Rate limit (30/min/IP). Retry in < 60s. |
/v1/vastu/export-dxfSame input as /analyze. Returns the layout as an AutoCAD-openable DXF file (R2010, decimal feet).
curl -X POST https://api.pixelapi.dev/v1/vastu/export-dxf \
-H "Content-Type: application/json" \
-d @my-layout.json \
-o my-layout.dxf
Response headers:
HTTP/2 200
content-type: application/dxf
content-disposition: attachment; filename="vastu-layout.dxf"
The DXF carries these layers (toggle them in AutoCAD's Layer Manager):
PLOT — outer plot boundary.VASTU_ZONES — 3×3 dashed grid.ZONE_LABELS — each cell labelled with cardinal direction + Sanskrit name (NE / Ishanya, SE / Agneya, SW / Nairutya, NW / Vayavya, plus Brahmasthan in the centre).ROOMS_PASS (green) / ROOMS_WARN (yellow) / ROOMS_FAIL (red) / ROOMS_NA (white) — colour-coded room polylines.ROOM_LABELS — name + zone tag + status per room.ENTRANCE — triangle pointing inward from the wall the door is on.FEATURES — water tank and septic tank as labelled circles.REPORT — score, bucket, Issues list, Recommendations list, printed in the right margin so it shows up on the same plotted sheet.Units are decimal feet ($INSUNITS=2). The file ID's as AutoCAD Drawing Exchange Format, version 2010 on the file command and opens cleanly in AutoCAD, DraftSight, LibreCAD, BricsCAD, and other DXF-compatible tools.
/v1/vastu/rulesList every rule the engine evaluates. Useful for client UIs that want to render a checklist before submission.
curl https://api.pixelapi.dev/v1/vastu/rules
{
"count": 21,
"rules": [
{"rule_id": "kitchen_se", "name": "Kitchen in Southeast (Agneya)", "severity": "high"},
{"rule_id": "kitchen_not_ne", "name": "Kitchen NOT in Northeast", "severity": "critical"},
{"rule_id": "master_bedroom_sw", "name": "Master bedroom in Southwest (Nairutya)", "severity": "high"},
{"rule_id": "pooja_ne", "name": "Pooja/prayer room in Northeast", "severity": "critical"}
// ... 17 more
]
}
import requests, json
payload = {
"facing": "north",
"plot": {"width_ft": 40, "depth_ft": 60},
"rooms": [
{"name": "kitchen", "x": 30, "y": 3, "w": 8, "h": 12},
{"name": "master_bedroom", "x": 2, "y": 3, "w": 13, "h": 12},
{"name": "pooja_room", "x": 34, "y": 55, "w": 6, "h": 5},
],
"main_entrance": {"x": 20, "y": 58},
}
# 1. Score
r = requests.post("https://api.pixelapi.dev/v1/vastu/analyze", json=payload)
r.raise_for_status()
result = r.json()
print(f"Score: {result['score']} ({result['bucket']})")
for f in result["findings"]:
if f["status"] in ("fail", "warning"):
print(f" [{f['status']}] {f['name']}: {f['suggestion']}")
# 2. Download DXF for AutoCAD
r = requests.post("https://api.pixelapi.dev/v1/vastu/export-dxf", json=payload)
with open("my-house.dxf", "wb") as f:
f.write(r.content)
print("Saved my-house.dxf — open in AutoCAD")
const payload = { facing: "north", plot: {width_ft: 40, depth_ft: 60}, rooms: [...] };
// Analyze
const a = await fetch("https://api.pixelapi.dev/v1/vastu/analyze", {
method: "POST",
headers: {"Content-Type": "application/json"},
body: JSON.stringify(payload),
});
const result = await a.json();
console.log(`Score ${result.score} (${result.bucket})`);
// Download DXF
const d = await fetch("https://api.pixelapi.dev/v1/vastu/export-dxf", {
method: "POST",
headers: {"Content-Type": "application/json"},
body: JSON.stringify(payload),
});
const blob = await d.blob();
const url = URL.createObjectURL(blob);
Object.assign(document.createElement("a"), {href: url, download: "layout.dxf"}).click();
| Rule ID | Severity | What it checks |
|---|---|---|
kitchen_se | high | Kitchen primary zone is SE (Agneya, fire element). |
kitchen_not_ne | critical | Kitchen is NOT in NE — fire element clashes with the Ishanya water/study zone. |
master_bedroom_sw | high | Master bedroom in SW (Nairutya, stability). |
master_bedroom_not_ne | high | Master bedroom not in NE. |
pooja_ne | critical | Pooja / prayer room in NE. |
toilet_not_ne_or_center | critical | No bathroom or toilet in NE or overlapping the central Brahmasthan. |
toilet_nw_w_pref | low | At least one toilet in NW or W (preferred). |
entrance_n_ne_e | high | Main entrance lies in N, NE, or E zone. |
water_ne | medium | Water tank or well in NE / N / E. |
septic_not_ne | high | Septic tank NOT in NE (and ideally NW or W). |
stairs_sw_w_s | medium | Staircase in SW, W, or S. |
center_open | critical | Brahmasthan (central 1/3 × 1/3 cell) not occupied by kitchen / toilet / master bedroom / staircase / heavy storage. |
guest_room_nw | low | Guest room in NW (Vayavya, transient stays). |
children_bedroom_w_nw | low | Children's bedroom in W, NW, or E. |
study_n_ne_e | low | Study / office in N / NE / E or SW (knowledge or authority zones). |
living_room_n_e_ne | medium | Living / drawing room in N, E, or NE. |
dining_w_e | low | Dining room in W or E. |
storage_sw | low | Heavy storage in SW / S / W. |
garage_nw_se | low | Garage in NW or SE. |
kitchen_not_under_or_above_pooja | low | Kitchen wall doesn't touch the pooja-room wall. |
plot_ratio_reasonable | low | Plot ratio not heavily skewed (max:min ≤ 2.5). |
The engine takes structured input — a JSON description of the layout. It does not yet read a floor-plan image directly; that needs OCR plus room segmentation, which is on the roadmap. If you have a CAD file you can pull the room rectangles out programmatically and feed them in. If you have a hand sketch, you'll need to type the room boxes (or use the tutorial's small starter form).
Multi-floor buildings are modelled as one plan at a time — call the API once per floor and combine the scores yourself.
Last reviewed: 2026-05-08. Engine version 1.0 (21 rules). 46 unit tests passing on every deploy.