feat: functional gridfinity calculator app
This commit is contained in:
32
docs/Architecture.md
Normal file
32
docs/Architecture.md
Normal file
@@ -0,0 +1,32 @@
|
||||
# Architecture - Gridfinity Calculator
|
||||
|
||||
## 1. System Design
|
||||
The application is a client-side only web tool.
|
||||
|
||||
```mermaid
|
||||
graph TD
|
||||
A[index.html] --> B[main.ts]
|
||||
B --> C[calculator.ts]
|
||||
B --> D[DOM Update]
|
||||
E[User Input] --> B
|
||||
```
|
||||
|
||||
## 2. Components
|
||||
- **Input Form:** Collects drawer dimensions and unit preferences.
|
||||
- **Spec Controls:** Accordion or settings panel for overriding Gridfinity defaults.
|
||||
- **Calculation Engine:** Pure TS module for unit conversion and Gridfinity math.
|
||||
- **Results Display:** Visual cards/readouts showing calculated values.
|
||||
|
||||
## 3. Data Flow
|
||||
1. User changes an input.
|
||||
2. `main.ts` catches the event.
|
||||
3. `main.ts` gathers all current values from the DOM.
|
||||
4. `main.ts` calls `calculator.ts` functions.
|
||||
5. `calculator.ts` returns a results object.
|
||||
6. `main.ts` updates the results section of the DOM.
|
||||
|
||||
## 4. Technical Stack
|
||||
- **Vite:** Asset bundling and dev server.
|
||||
- **TypeScript:** Type-safe logic.
|
||||
- **Tailwind CSS:** Utility-first styling for speed and responsiveness.
|
||||
- **Vitest:** Unit testing logic in isolation.
|
||||
31
docs/PRD.md
Normal file
31
docs/PRD.md
Normal file
@@ -0,0 +1,31 @@
|
||||
# PRD - Gridfinity Calculator
|
||||
|
||||
## 1. Overview
|
||||
The Gridfinity Calculator is a web tool designed to help makers plan their Gridfinity layouts. It calculates the number of baseplates that fit in a specific container and the maximum bin height allowed.
|
||||
|
||||
## 2. Target Audience
|
||||
- 3D printing enthusiasts using the Gridfinity system.
|
||||
- Workshop organizers and hobbyists.
|
||||
|
||||
## 3. Key Features
|
||||
- **Dimension Input:** Width, Length (Depth), and Height of the target drawer/container.
|
||||
- **Unit Toggle:** Support for Inches (decimal/fractional) and Millimeters.
|
||||
- **Spec Overrides:** Modify standard 42mm grid and 7mm height unit.
|
||||
- **Dynamic Results:**
|
||||
- Total full grid squares (e.g., "5x4 grids").
|
||||
- Fit percentage/fractional grids (e.g., "5.2 x 4.1 grids").
|
||||
- Vertical Unit Height (U) for bins (e.g., "6U").
|
||||
- Remaining space (gap) in mm/inches.
|
||||
|
||||
## 4. Technical Constraints
|
||||
- Must be fast and lightweight.
|
||||
- Must work offline once loaded (single-page build).
|
||||
- Mobile-responsive design.
|
||||
|
||||
## 5. Calculation Logic
|
||||
- `Grid Count = Floor(Drawer Dimension / Grid Spec)`
|
||||
- `Exact Fit = Drawer Dimension / Grid Spec`
|
||||
- `Bin Unit Height (U) = Floor((Drawer Height - Base Thickness) / Height Unit)`
|
||||
- *Default Base Thickness:* 4.8mm
|
||||
- *Default Grid Spec:* 42mm
|
||||
- *Default Height Unit:* 7mm
|
||||
Reference in New Issue
Block a user