Score a floor plan against Vastu rules — get an AutoCAD DXF on the same call

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.

Pure compute — free during beta. 21 rules, severity-weighted score, no GPU credits used. Rate-limited 30 requests / minute / IP, plenty for an architect's working session. Both endpoints return in under 5 seconds for a typical residential plan.

What you'll build

By the end of this you'll have:


1

Describe your plot

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.

2

Score it

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.

3

Get the AutoCAD DXF

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 boundary on its own PLOT layer.
  • The 3×3 Vastu zone grid as dashed lines, each cell labelled with cardinal direction + Sanskrit name (NE / Ishanya, SE / Agneya, SW / Nairutya, NW / Vayavya, plus Brahmasthan in the centre).
  • Each room as a closed polyline, colour-coded by compliance: green = pass, yellow = warning, red = fail, white = no positional rule.
  • The main entrance as a triangle pointing inward from the wall it's on.
  • Water tank / septic tank as labelled circles on the FEATURES layer.
  • A printable compliance report (score + bucket + Issues + Recommendations) in the right margin so it shows up on the same plotted sheet.

Use AutoCAD's Layer Manager (LA) to toggle the zone grid or the report off if you only want the rooms.

4

Iterate

Most real plans don't score 100 first time. Here's the fast loop:

  1. Run /analyze.
  2. Look at the failing rules in findings.
  3. Apply the suggestion for the highest-severity failure.
  4. Re-run.

The engine is deterministic — same input always returns the same output, so an A/B between two layouts is straightforward.


Python end-to-end

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.")

JavaScript end-to-end

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();

What the engine catches

Twenty-one rules across these categories:

AreaRules
KitchenSE preferred (Agneya, fire) · never NE (critical)
Master bedroomSW preferred (Nairutya, stability) · never NE
Pooja / prayer roomNE mandated (Ishanya, sacred) — critical if elsewhere
Bathroom / toiletNever NE or centre (critical) · NW or W preferred
Main entranceN / NE / E preferred · SW strongly discouraged
Water tank / wellNE (best) / N / E acceptable
Septic tankNever NE (critical) · NW or W preferred
StaircaseSW / W / S preferred · never NE
Brahmasthan (centre)Must stay open — heavy rooms here = critical fail
Other roomsLiving N / E / NE · Dining W / E · Children W / NW · Study N / NE / E / SW · Storage SW · Garage NW / SE · Guest NW
AdjacenciesKitchen wall not touching pooja wall
PlotAspect ratio not heavily skewed

Full rule list (with rule IDs, severities, and one-line descriptions): see the API docs.

Limitations to know about

Try it without writing any code

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].