• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
changesbyjames

changesbyjames

SpaceCalc

Public
Like
SpaceCalc
Home
Code
3
backend
1
frontend
2
README.md
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
README.md
Code
/
README.md
Search
…
Viewing readonly version of main branch: v12
View latest version
README.md

Room Fitting Calculator

A web application that calculates and visualizes whether objects can fit in a specific room with a sloped ceiling, taking into account existing blockers/obstacles.

Room Specifications

  • Width: 155 cm
  • Left wall height: 115 cm
  • Right wall height: 255 cm
  • Ceiling: Straight slope from left to right

Features

  • Blocker Management: Add arbitrary blockers with custom dimensions and positioning
    • Define blockers by width, height, and position (from left or right wall)
    • Visual representation in both side and top views
    • Automatic collision detection between blockers
    • Easy removal of existing blockers
  • Real-time calculation: Enter object dimensions and see instant results
  • Visual feedback: Color-coded results (green = fits, red = doesn't fit)
  • Collision detection: Prevents overlapping objects and highlights conflicts
  • Dual visualization:
    • Side view showing the sloped ceiling, blockers, and object placement
    • Top view showing the floor plan and positioning
  • Detailed results: Shows exact positioning, clearance, collision info, and failure reasons

How to Use

Adding Blockers

  1. In the "Existing Blockers" section, enter the blocker's dimensions
  2. Specify position using either:
    • From Left Wall: Distance from the left (short) wall
    • From Right Wall: Distance from the right (tall) wall
  3. Click "Add Blocker" to place it in the room
  4. Blockers are shown in gray in both visualizations
  5. Remove blockers using the "Remove" button

Testing Object Fit

  1. Enter your object's width (cm) - how wide it is along the floor
  2. Enter your object's height (cm) - how tall it is
  3. Enter the offset (cm) - gap you want from the tall wall
  4. View the results and visualizations

Algorithm

The application uses a precise geometric calculation that:

  1. Checks for collisions with existing blockers first
  2. Positions the object against the tall wall with the specified offset
  3. Calculates the maximum ceiling height at the object's position
  4. Determines if the object fits within the sloped ceiling constraints
  5. Provides detailed feedback on positioning, clearance, and any conflicts

Blocker System

  • Collision Detection: Prevents overlapping blockers and objects
  • Flexible Positioning: Position blockers from either wall
  • Visual Feedback: Conflicting blockers are highlighted in red
  • Ceiling Validation: Blockers must fit under the sloped ceiling
  • Dynamic Updates: All visualizations update in real-time

Project Structure

├── backend/
│   └── index.ts          # Hono server serving static files
├── frontend/
│   ├── index.html        # Main HTML interface with blocker management
│   └── script.js         # Enhanced fitting algorithm with blocker support
└── README.md

The core fitting algorithm handles edge cases like negative dimensions, objects extending beyond room boundaries, blocker collisions, and precise height calculations along the sloped ceiling.

FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2026 Val Town, Inc.