Skip to content

Room Studio · Calculation

Room measurement adjustment

Apply the default Manhattan snap, a tape calibration, or both in that order, then derive the corrected plan takeoff.

Related HT Calc tool: Renovation Planner

Room Studio has no public screen on htcalc.com. Its renovation handoff uses this planner for project costs. This HT Calc screen includes a Plus sample for visitors.

Example result · plan.schemaVersion: 1 See output

Cost per success
1 calculation credit
Production plans
Standard, Business, Scale, Enterprise
Plan allowances
Free sandbox
Not available

Integration example

Make a request

Use a production key scoped to room-studio-plan-adjustment.

Keep the key on your server. A successful call uses 1 calculation credit.

Production request

Set HT_PRODUCTION_KEY on your server. Save as example.mjs and run node example.mjs with Node.js 18 or later.

import { randomUUID } from "node:crypto";

const key = process.env.HT_PRODUCTION_KEY;
if (!key) throw new Error("Set HT_PRODUCTION_KEY on your server.");
const endpoint = "https://calc.hasstechapi.com/v2/calc/room-studio-plan-adjustment";
const input = {
  "rooms": [
    {
      "id": "control",
      "label": "Control",
      "unit": "m",
      "height": 2,
      "shape": {
        "type": "rectangle",
        "width": 4,
        "depth": 3
      }
    }
  ],
  "snap": true,
  "calibration": {
    "roomId": "control",
    "wallIndex": 0,
    "enteredLength": 4
  }
};
const requestId = process.env.HT_REQUEST_ID || Date.now() + "." + randomUUID();
// Keep this ID to look up usage if the connection is interrupted.
console.error("Usage lookup ID:", requestId);

const response = await fetch(endpoint, {
  method: "POST",
  redirect: "error",
  headers: {
    "Authorization": "Bearer " + key,
    "Content-Type": "application/json",
    "Idempotency-Key": requestId
  },
  body: JSON.stringify(input)
});
if (!response.ok) {
  const problem = await response.json().catch(() => null);
  const code = problem?.error?.code || response.statusText;
  const delay = response.headers.get("retry-after");
  if (delay) console.error("Retry-After (seconds):", delay);
  console.error("HTTP " + response.status + " " + code + ". Usage lookup ID: " + requestId);
  if (Array.isArray(problem?.error?.details)) {
    for (const issue of problem.error.details) console.error("Input issue:", JSON.stringify(issue));
  }
  process.exitCode = 1;
} else {
  console.log(JSON.stringify(await response.json(), null, 2));
}
cURL (shell)

Set HT_PRODUCTION_KEY on your server. Run in a POSIX shell with cURL 7.76+ and Python 3.7+ to create a request ID.

(
  set -eu
  : "${HT_PRODUCTION_KEY:?Set HT_PRODUCTION_KEY on your server}"
  request_id="${HT_REQUEST_ID:-}"
  if [ -z "$request_id" ]; then
    request_id=$(python3 -c 'import time, uuid; print(str(time.time_ns() // 1000000) + "." + str(uuid.uuid4()))')
  fi
  printf 'Usage lookup ID: %s\n' "$request_id" >&2
  # On INVALID_INPUT, read error.details in the JSON response body.
  curl --disable --silent --show-error --fail-with-body --include \
    --request POST 'https://calc.hasstechapi.com/v2/calc/room-studio-plan-adjustment' \
    --header "Authorization: Bearer $HT_PRODUCTION_KEY" \
    --header 'Content-Type: application/json' \
    --header "Idempotency-Key: $request_id" \
    --data-binary @- <<'HT_INPUT'
{
  "rooms": [
    {
      "id": "control",
      "label": "Control",
      "unit": "m",
      "height": 2,
      "shape": {
        "type": "rectangle",
        "width": 4,
        "depth": 3
      }
    }
  ],
  "snap": true,
  "calibration": {
    "roomId": "control",
    "wallIndex": 0,
    "enteredLength": 4
  }
}
HT_INPUT
)
If your request fails
400 INVALID_INPUT

Read error.details when present. Node prints each issue. cURL returns the JSON body. Each path points into your request. An empty path refers to the whole body.

Check the accepted inputs for required fields, units and ranges. Send the corrected JSON as a new request.

401 or 403
Check that the server has the bearer key for the endpoint’s environment and that the key includes room-studio-plan-adjustment.
429
Read the service error code, check your allowance, and wait for the Retry-After interval when supplied before trying again.
Lost response, 409 or 503
Open Request lookup, select the same environment and enter the printed usage lookup ID. A settled ID has already consumed credits. To retry the same calculation, set HT_REQUEST_ID to the original ID and reuse the same inputs. A settled request does not return its result again. Unset the variable for a new request, which can consume credits.

The usage lookup ID is the Idempotency-Key your server sends. The response’s x-request-id identifies the HTTP exchange for support.

Output

Example result

These values come from running this operation on the example inputs.

plan.schemaVersion
1
plan.units
imperial
plan.totals.schemaVersion
1
How to interpret this result
  • Ceilings have the same area as the wall-centerline floor polygon. Flooring includes 10% waste. Wall paint assumes two coats and 350 sq ft per gallon.
  • When snapping and calibrating together, the reference index is the post-weld wall index. One tape ratio scales every room, including heights.
Full example response (JSON)
{
  "status": "available",
  "result": {
    "plan": {
      "schemaVersion": 1,
      "units": "imperial",
      "rooms": [
        {
          "schemaVersion": 1,
          "roomId": "control",
          "roomLabel": "Control",
          "units": "imperial",
          "floorAreaSqft": 129.2,
          "ceilingAreaSqft": 129.2,
          "wallAreaGrossSqft": 301.4,
          "openingsAreaSqft": 0,
          "wallAreaNetSqft": 301.4,
          "flooringAreaSqft": 129.2,
          "flooringWithWasteSqft": 143,
          "perimeterLf": 45.9,
          "baseboardTrimLf": 45.9,
          "crownMoldingLf": 45.9,
          "doorCasingLf": 0,
          "windowCasingLf": 0,
          "doorCount": 0,
          "windowCount": 0,
          "openingCount": 0,
          "fixtureCount": 0,
          "avgCeilingHeightFt": 6.6,
          "boundingBoxFt": {
            "width": 13.1,
            "depth": 9.8
          },
          "paintGallonsTwoCoats": 2
        }
      ],
      "totals": {
        "schemaVersion": 1,
        "units": "imperial",
        "roomCount": 1,
        "floorAreaSqft": 129.2,
        "ceilingAreaSqft": 129.2,
        "wallAreaGrossSqft": 301.4,
        "openingsAreaSqft": 0,
        "wallAreaNetSqft": 301.4,
        "flooringAreaSqft": 129.2,
        "flooringWithWasteSqft": 143,
        "perimeterLf": 45.9,
        "baseboardTrimLf": 45.9,
        "crownMoldingLf": 45.9,
        "doorCasingLf": 0,
        "windowCasingLf": 0,
        "doorCount": 0,
        "windowCount": 0,
        "openingCount": 0,
        "fixtureCount": 0,
        "avgCeilingHeightFt": 6.6,
        "paintGallonsTwoCoats": 2
      }
    },
    "calibration": {
      "roomId": "control",
      "wallIndex": 0,
      "measuredM": 4,
      "enteredM": 4,
      "scaleApplied": 1
    },
    "snapReports": [
      {
        "roomId": "control",
        "nonManhattan": false,
        "report": {
          "wallsSnapped": 4,
          "wallsTotal": 4,
          "maxCorrectionDeg": 0,
          "dominantAxisDeg": 0,
          "closureResidualBeforeM": 0,
          "closureResidualAfterM": 0,
          "weldedWallCount": 0
        }
      }
    ]
  },
  "formulaVersion": "room-studio-v1",
  "units": {
    "length": "ft",
    "area": "sq ft",
    "trim": "linear ft",
    "paint": "US gal",
    "calibration": "m",
    "angle": "deg"
  },
  "assumptions": [
    "Ceilings have the same area as the wall-centerline floor polygon. Flooring includes 10% waste. Wall paint assumes two coats and 350 sq ft per gallon.",
    "When snapping and calibrating together, the reference index is the post-weld wall index. One tape ratio scales every room, including heights."
  ],
  "warnings": [],
  "creditCost": 1
}

Request contract

Accepted inputs

Fields for this example. Expand the schema for all supported combinations and limits.

FieldType, units and limits

roomsRequired
array

Rooms in caller order, each with a unique id. Shared walls count once per room face.

Min items 1 · Max items 12
rooms[].idRequired
string

Caller-assigned stable room identifier, unique in the plan.

Min length 1 · Max length 80
rooms[].labelRequired
string

Display label for the room.

Min length 1 · Max length 160
rooms[].unitRequired
string

Unit of every input coordinate, length, height, sill and offset in this room. Use decimal feet for feet/inches (6 ft 8 in = 6 + 8/12).

Allowed: "ft", "m"
rooms[].heightOptional
number

Ceiling height in input units; defaults to 8 feet if omitted.

Max 1000 · Greater than 0
rooms[].shapeRequired
object

Rectangle, right-angle perimeter walk, or measured ordered polygon.

rooms[].shape.typeRequired
stringMust equal "rectangle"
rooms[].shape.widthRequired
number

Length in room input units.

Max 1000 · Greater than 0
rooms[].shape.depthRequired
number

Length in room input units.

Max 1000 · Greater than 0
rooms[].openingsOptional
array

Caller-measured apertures. Missing list means none.

Min items 0 · Max items 32
rooms[].openings[].typeRequired
string

A hinged door, window or uncased pass-through.

Allowed: "door", "window", "opening"
rooms[].openings[].wallIndexRequired
integer

Zero-based host wall index in the room.

Min 0 · Max 63
rooms[].openings[].widthRequired
number

Length in room input units.

Max 1000 · Greater than 0
rooms[].openings[].heightRequired
number

Length in room input units.

Max 1000 · Greater than 0
rooms[].openings[].offsetOptional
number

Offset from the start of the host wall in input units. Defaults to 0.

Min 0 · Max 1000
rooms[].openings[].sillHeightOptional
number

Distance above the floor in input units. Defaults to 0. The manual wizard uses a sill only for windows.

Min 0 · Max 1000
rooms[].fixtureCountOptional
integer

Count of caller-identified fixtures; defaults to 0.

Min 0 · Max 64
snapOptional
boolean

Snap to the app’s default 45 degree grid before calibration; defaults to false.

calibrationOptional
object
calibration.roomIdRequired
string

Caller-assigned stable room identifier, unique in the plan.

Min length 1 · Max length 80
calibration.wallIndexRequired
integer

Zero-based host wall index in the room.

Min 0 · Max 63
calibration.enteredLengthRequired
number

Tape measurement in the reference room’s input units; allowed correction is around ±15% as in the app.

Max 1000 · Greater than 0
Example request body (JSON)
{
  "rooms": [
    {
      "id": "control",
      "label": "Control",
      "unit": "m",
      "height": 2,
      "shape": {
        "type": "rectangle",
        "width": 4,
        "depth": 3
      }
    }
  ],
  "snap": true,
  "calibration": {
    "roomId": "control",
    "wallIndex": 0,
    "enteredLength": 4
  }
}
Full JSON schema
{
  "type": "object",
  "properties": {
    "rooms": {
      "type": "array",
      "description": "Rooms in caller order, each with a unique id. Shared walls count once per room face.",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Caller-assigned stable room identifier, unique in the plan.",
            "minLength": 1,
            "maxLength": 80
          },
          "label": {
            "type": "string",
            "description": "Display label for the room.",
            "minLength": 1,
            "maxLength": 160
          },
          "unit": {
            "type": "string",
            "description": "Unit of every input coordinate, length, height, sill and offset in this room. Use decimal feet for feet/inches (6 ft 8 in = 6 + 8/12).",
            "enum": [
              "ft",
              "m"
            ]
          },
          "height": {
            "type": "number",
            "description": "Ceiling height in input units; defaults to 8 feet if omitted.",
            "exclusiveMinimum": 0,
            "maximum": 1000
          },
          "shape": {
            "description": "Rectangle, right-angle perimeter walk, or measured ordered polygon.",
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "rectangle"
                  },
                  "width": {
                    "type": "number",
                    "description": "Length in room input units.",
                    "exclusiveMinimum": 0,
                    "maximum": 1000
                  },
                  "depth": {
                    "type": "number",
                    "description": "Length in room input units.",
                    "exclusiveMinimum": 0,
                    "maximum": 1000
                  }
                },
                "required": [
                  "type",
                  "width",
                  "depth"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "perimeter"
                  },
                  "segments": {
                    "type": "array",
                    "description": "Ordered wall lengths; start along positive X and turn after each wall.",
                    "items": {
                      "type": "object",
                      "properties": {
                        "length": {
                          "type": "number",
                          "description": "Length in room input units.",
                          "exclusiveMinimum": 0,
                          "maximum": 1000
                        },
                        "turn": {
                          "type": "string",
                          "description": "Turn after the segment.",
                          "enum": [
                            "left",
                            "right"
                          ]
                        }
                      },
                      "required": [
                        "length",
                        "turn"
                      ],
                      "additionalProperties": false
                    },
                    "minItems": 3,
                    "maxItems": 64
                  }
                },
                "required": [
                  "type",
                  "segments"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "polygon"
                  },
                  "corners": {
                    "type": "array",
                    "description": "Ordered corners (clockwise or counterclockwise); omit the repeated final vertex. Wall i connects corner i to the next corner.",
                    "items": {
                      "type": "array",
                      "description": "Wall-start point [x,y] on the floor plane.",
                      "items": {
                        "type": "number",
                        "description": "Signed coordinate in room input units.",
                        "minimum": -1000,
                        "maximum": 1000
                      },
                      "minItems": 2,
                      "maxItems": 2
                    },
                    "minItems": 3,
                    "maxItems": 64
                  },
                  "wallHeights": {
                    "type": "array",
                    "description": "Optional per-wall heights in input units, one per corner. A zero wall height falls back to room height in the takeoff.",
                    "items": {
                      "type": "number",
                      "description": "Wall height in input units.",
                      "minimum": 0,
                      "maximum": 1000
                    },
                    "minItems": 3,
                    "maxItems": 64
                  }
                },
                "required": [
                  "type",
                  "corners"
                ],
                "additionalProperties": false
              }
            ]
          },
          "openings": {
            "type": "array",
            "description": "Caller-measured apertures. Missing list means none.",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "description": "A hinged door, window or uncased pass-through.",
                  "enum": [
                    "door",
                    "window",
                    "opening"
                  ]
                },
                "wallIndex": {
                  "type": "integer",
                  "description": "Zero-based host wall index in the room.",
                  "minimum": 0,
                  "maximum": 63
                },
                "width": {
                  "type": "number",
                  "description": "Length in room input units.",
                  "exclusiveMinimum": 0,
                  "maximum": 1000
                },
                "height": {
                  "type": "number",
                  "description": "Length in room input units.",
                  "exclusiveMinimum": 0,
                  "maximum": 1000
                },
                "offset": {
                  "type": "number",
                  "description": "Offset from the start of the host wall in input units. Defaults to 0.",
                  "minimum": 0,
                  "maximum": 1000
                },
                "sillHeight": {
                  "type": "number",
                  "description": "Distance above the floor in input units. Defaults to 0. The manual wizard uses a sill only for windows.",
                  "minimum": 0,
                  "maximum": 1000
                }
              },
              "required": [
                "type",
                "wallIndex",
                "width",
                "height"
              ],
              "additionalProperties": false
            },
            "minItems": 0,
            "maxItems": 32
          },
          "fixtureCount": {
            "type": "integer",
            "description": "Count of caller-identified fixtures; defaults to 0.",
            "minimum": 0,
            "maximum": 64
          }
        },
        "required": [
          "id",
          "label",
          "unit",
          "shape"
        ],
        "additionalProperties": false
      },
      "minItems": 1,
      "maxItems": 12
    },
    "snap": {
      "type": "boolean",
      "description": "Snap to the app’s default 45 degree grid before calibration; defaults to false."
    },
    "calibration": {
      "type": "object",
      "properties": {
        "roomId": {
          "type": "string",
          "description": "Caller-assigned stable room identifier, unique in the plan.",
          "minLength": 1,
          "maxLength": 80
        },
        "wallIndex": {
          "type": "integer",
          "description": "Zero-based host wall index in the room.",
          "minimum": 0,
          "maximum": 63
        },
        "enteredLength": {
          "type": "number",
          "description": "Tape measurement in the reference room’s input units; allowed correction is around ±15% as in the app.",
          "exclusiveMinimum": 0,
          "maximum": 1000
        }
      },
      "required": [
        "roomId",
        "wallIndex",
        "enteredLength"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "rooms"
  ],
  "additionalProperties": false
}

Production endpoint: POST https://calc.hasstechapi.com/v2/calc/room-studio-plan-adjustment
Formula: room-studio-v1

Related PDF reports