Skip to main content

Client wrapper for procedural architectural floorplan layout generator

Project description

RoomRubiksPack (Client Library)

PyPI version GitHub repo

Links:

RoomRubiksPack is a lightweight Python package for generating architectural floorplan layouts using procedural generation and an Elitist Genetic Algorithm.

This client library maintains a local, stateful API for creating room models, local graphing/connectivity check, local plotting/visualisation via matplotlib, and local CAD exports via ezdxf. The computationally heavy layout generation (GA) and auto-dimensioning are offloaded to a RoomRubiks API Server.


Installation

Option 1: Install from PyPI

Once published, install the package via:

pip install roomrubikspack

Option 2: Install from GitHub

pip install git+https://github.com/architectvijeshkumarv/roomrubikspack-0.1.0-Public.git

Option 3: Local Installation (After Downloading)

Navigate to the directory containing pyproject.toml and run:

pip install .

For local developers who want to modify the source code, run in editable mode:

pip install -e .

Configuring the Server Connection

By default, the client library will look for your live API server running at https://roomrubikspack-0-1-0-private-942524616275.asia-south1.run.app.

You can point to a different server endpoint in two ways:

1. In Python Code (Recommended)

Set the URL dynamically via rr.settings():

import roomrubikspack as rr

rr.init()
rr.settings(server_url="https://roomrubikspack-0-1-0-private-942524616275.asia-south1.run.app")

2. Via Environment Variable

Before running your script, set the ROOMRUBIKSPACK_SERVER_URL environment variable:

# Windows PowerShell
$env:ROOMRUBIKSPACK_SERVER_URL="https://roomrubikspack-0-1-0-private-942524616275.asia-south1.run.app"

# Windows Command Prompt
set ROOMRUBIKSPACK_SERVER_URL=https://roomrubikspack-0-1-0-private-942524616275.asia-south1.run.app

# Linux/macOS
export ROOMRUBIKSPACK_SERVER_URL="https://roomrubikspack-0-1-0-private-942524616275.asia-south1.run.app"

Quick Start

Here is a complete example. Make sure your local or remote RoomRubiks server is running before executing this script.

import roomrubikspack as rr

# Initialize session
rr.init()

# Configure the server (defaults to your live Cloud Run URL if omitted)
rr.settings(unit="m", server_url="https://roomrubikspack-0-1-0-private-942524616275.asia-south1.run.app")

# Define Rooms
rr.room("living",   "Living Room",  area=20.0, startSpace=True)
rr.room("kitchen",  "Kitchen",      w=3.0, h=3.0)
rr.room("bed1",     "Master Bed",   area=16.0)
rr.room("bath1",    "Attached Bath", area=4.0, attachedSpace=True)

# Define site boundary
rr.site([{"x": 0, "y": 0}, {"x": 20, "y": 0}, {"x": 20, "y": 20}, {"x": 0, "y": 20}])

# Define connectivity
rr.connectivity(
    ("living", "kitchen"),
    ("living", "bed1"),
    ("bed1",   "bath1")
)

# Optional: Draw connectivity graph locally
rr.connectivityshow()

# Add constraints to guide layout generation
rr.constraint("position", "bed1", "N")
rr.constraint("area", None, 120)
rr.constraint("perimeter", None, "minimize")

# Generate sizes for rooms missing width/height
rr.dimensiongen()

# Generate layout variations (sent to the server engine)
rr.generatelayout()

# View first variation locally
rr.showlayout(n=1, label=["name", "dim", "area"])

# Export layout to DXF locally
rr.exportlayout(n=1, filepath="output_layout.dxf")

# Blocks execution until plots are closed
rr.wait_for_plots()

API Reference

  • rr.init(): Clears all current session state.
  • rr.settings(unit, server_url): Set global measurement units ('m' or 'f') and configure the solver backend API endpoint.
  • rr.constructiongrid(add, remove, reset): View or manipulate the base construction grid sizes locally.
  • rr.room(id, name, w, h, area, startSpace, attachedSpace, ...): Register a room.
  • rr.site(points): Set an optional site boundary polygon.
  • rr.connectivity(*pairs): Define room connections. Planarity check runs instantly on the client.
  • rr.connectivityshow(): Opens a Matplotlib window showing the adjacency graph.
  • rr.constraint(type, room_id, value): Registers a layout constraint.
  • rr.dimensiongen(avar, mar): Requests standard room dimensions from the server.
  • rr.generatelayout(lvar, sgap, max_variations): Sends session state to the server to run the GA layout engine.
  • rr.showlayout(n, label): Plots the n-th generated variation using Matplotlib.
  • rr.exportlayout(n, filepath): Saves the n-th layout to JSON or DXF.
  • rr.wait_for_plots(): Helper to keep visual plots open.

Citation

If you use RoomRubiks in your academic or professional work, please cite the following paper:

APA: Valiyappurakkal, V. K. (2026). RoomRubiks: An Application for Floor Layout Generation Using a Nonfragmented Rectangular Approach. Journal of Architectural Engineering, 32(3). https://doi.org/10.1061/JAEIED.AEENG-2207

BibTeX:

@article{Valiyappurakkal2026RoomRubiks,
  author  = {Valiyappurakkal, Vijesh Kumar},
  title   = {RoomRubiks: An Application for Floor Layout Generation Using a Nonfragmented Rectangular Approach},
  journal = {Journal of Architectural Engineering},
  year    = {2026},
  volume  = {32},
  number  = {3},
  doi     = {10.1061/JAEIED.AEENG-2207},
  url     = {https://doi.org/10.1061/JAEIED.AEENG-2207}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

roomrubikspack-0.1.5.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

roomrubikspack-0.1.5-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file roomrubikspack-0.1.5.tar.gz.

File metadata

  • Download URL: roomrubikspack-0.1.5.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for roomrubikspack-0.1.5.tar.gz
Algorithm Hash digest
SHA256 84e68add8ca47445fef8094d9d1904638536f4b2d9838553e88ce02e4439be8a
MD5 aef6292a2f0b64885abe5b8f779f7da8
BLAKE2b-256 b99f2a8c6c38ffd0f67367dc5caca4d9dd5c49cb8a23713efb316891aa114850

See more details on using hashes here.

File details

Details for the file roomrubikspack-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: roomrubikspack-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for roomrubikspack-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 68417aeb5819a0033b1c9edcb6598257b87b9ef52e97873d357762adc495fcf0
MD5 5343a2c91d20709b33bd69fb10665afa
BLAKE2b-256 ae1fb895ae0244e7d61eb3c638256d52378e34318cb0d9123a13d46ebbaa3f00

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page