SpaceCalc
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.
Viewing readonly version of main branch: v5View latest version
A web application that calculates and visualizes whether objects can fit in a specific room with a sloped ceiling.
- Width: 155 cm
- Left wall height: 115 cm
- Right wall height: 255 cm
- Ceiling: Straight slope from left to right
- Real-time calculation: Enter object dimensions and see instant results
- Visual feedback: Color-coded results (green = fits, red = doesn't fit)
- Dual visualization:
- Side view showing the sloped ceiling and object placement
- Top view showing the floor plan and positioning
- Detailed results: Shows exact positioning, clearance, and failure reasons
- Enter your object's width (cm) - how wide it is along the floor
- Enter your object's height (cm) - how tall it is
- Enter the offset (cm) - gap you want from the tall wall
- View the results and visualizations
The application uses a precise geometric calculation that:
- Positions the object against the tall wall with the specified offset
- Calculates the maximum ceiling height at the object's position
- Determines if the object fits within the sloped ceiling constraints
- Provides detailed feedback on positioning and clearance
├── backend/
│ └── index.ts # Hono server serving static files
├── frontend/
│ ├── index.html # Main HTML interface
│ └── script.js # Fitting algorithm and visualization
└── README.md
The core fitting algorithm handles edge cases like negative dimensions, objects extending beyond room boundaries, and precise height calculations along the sloped ceiling.
