This walks you through using POST /v1/vastu/analyze and POST /v1/vastu/export-dxf end-to-end. From a JSON description of your plot to a printable, AutoCAD-openable plan with each room colour-coded for compliance.
By the end of this you'll have:
.dxf file you can double-click to open in AutoCAD, DraftSight, LibreCAD, or BricsCAD — with each room colour-coded green/yellow/red and a printable Issues + Recommendations block in the right margin.The engine wants axis-aligned rectangles, all in feet. Coordinate origin is the south-west corner of the plot; +x goes east, +y goes north.
Sketch your plan on graph paper, mark the SW corner as (0, 0), and note each room's SW corner plus its width and depth. You only need rooms whose placement matters for Vastu — corridors and unlabelled spaces can stay out.
{
"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": "bedroom", "x": 2, "y": 40, "w": 13, "h": 15},
{"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}}
}
Recognised room names: kitchen, dining_room, living_room, master_bedroom, bedroom, children_bedroom, guest_room, bathroom, toilet, pooja_room, study, office, storage, garage, staircase. Anything else is accepted but won't trigger zone-specific rules.
Save this as my-plan.json.
One curl away:
curl -X POST https://api.pixelapi.dev/v1/vastu/analyze \
-H "Content-Type: application/json" \
-d @my-plan.json
You'll get back JSON like this:
{
"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": ""
},
...
]
}
The interesting field is findings — one entry per rule. When a rule fails or warns, the suggestion field carries a concrete fix ("Move kitchen to SE if you can; NW is the second-best option").
The score is severity-weighted: critical=5, high=3, medium=2, low=1. pass earns full weight, warning half, fail zero, na doesn't count. So missing one critical rule hurts more than missing three low-severity ones, which matches how Vastu is actually practised.
Same payload, different endpoint. The response body is the DXF file itself:
curl -X POST https://api.pixelapi.dev/v1/vastu/export-dxf \
-H "Content-Type: application/json" \
-d @my-plan.json \
-o my-house.dxf
Open my-house.dxf in AutoCAD (or DraftSight / LibreCAD / BricsCAD — the file is R2010, decimal feet, opens in everything). You'll see:
PLOT layer.FEATURES layer.Use AutoCAD's Layer Manager (LA) to toggle the zone grid or the report off if you only want the rooms.
Most real plans don't score 100 first time. Here's the fast loop:
/analyze.findings.suggestion for the highest-severity failure.The engine is deterministic — same input always returns the same output, so an A/B between two layouts is straightforward.
import json, requests
with open("my-plan.json") as f:
plan = json.load(f)
# 1. Score
r = requests.post("https://api.pixelapi.dev/v1/vastu/analyze", json=plan)
r.raise_for_status()
result = r.json()
print(f"Score {result['score']}/100 — {result['bucket']}")
for f in result["findings"]:
if f["status"] in ("fail", "warning"):
emoji = "❌" if f["status"] == "fail" else "⚠️"
print(f"{emoji} [{f['severity']}] {f['name']}")
if f["suggestion"]:
print(f" → {f['suggestion']}")
# 2. AutoCAD DXF
r = requests.post("https://api.pixelapi.dev/v1/vastu/export-dxf", json=plan)
r.raise_for_status()
with open("my-house.dxf", "wb") as f:
f.write(r.content)
print("\nSaved my-house.dxf — open in AutoCAD.")
const plan = { /* same shape as my-plan.json */ };
// 1. Score
const a = await fetch("https://api.pixelapi.dev/v1/vastu/analyze", {
method: "POST",
headers: {"Content-Type": "application/json"},
body: JSON.stringify(plan),
});
const result = await a.json();
console.log(`Score ${result.score}/100 — ${result.bucket}`);
// 2. DXF download
const d = await fetch("https://api.pixelapi.dev/v1/vastu/export-dxf", {
method: "POST",
headers: {"Content-Type": "application/json"},
body: JSON.stringify(plan),
});
const blob = await d.blob();
const url = URL.createObjectURL(blob);
Object.assign(document.createElement("a"),
{href: url, download: "my-house.dxf"}).click();
Twenty-one rules across these categories:
| Area | Rules |
|---|---|
| Kitchen | SE preferred (Agneya, fire) · never NE (critical) |
| Master bedroom | SW preferred (Nairutya, stability) · never NE |
| Pooja / prayer room | NE mandated (Ishanya, sacred) — critical if elsewhere |
| Bathroom / toilet | Never NE or centre (critical) · NW or W preferred |
| Main entrance | N / NE / E preferred · SW strongly discouraged |
| Water tank / well | NE (best) / N / E acceptable |
| Septic tank | Never NE (critical) · NW or W preferred |
| Staircase | SW / W / S preferred · never NE |
| Brahmasthan (centre) | Must stay open — heavy rooms here = critical fail |
| Other rooms | Living N / E / NE · Dining W / E · Children W / NW · Study N / NE / E / SW · Storage SW · Garage NW / SE · Guest NW |
| Adjacencies | Kitchen wall not touching pooja wall |
| Plot | Aspect ratio not heavily skewed |
Full rule list (with rule IDs, severities, and one-line descriptions): see the API docs.
facing; facing currently affects entrance-rule preferences only.Sign in to your PixelAPI dashboard and click 🪔 Vastu Compliance in the left sidebar — there's a small editor with a sample 2BHK payload, an Analyze button that prints the per-rule findings, and a Download DXF button. No API key needed when you're using the dashboard.
Last reviewed: 2026-05-08. Engine version 1.0 · 21 rules · 46 unit tests pass on every deploy. Questions or a Vastu rule we missed? Email [email protected].