Skip to content

Commit 27705e6

Browse files
stedrewclaude
andcommitted
Fix furniture scale using measured FBX bounding boxes (#15)
Loaded each hospital FBX model in Playwright, measured its bounding box, and calculated the exact scale factor to fit each equipment type within its target tile footprint: bed: 1403.7 mm → 0.00085 (1.2 tiles) chair: 371.6 mm → 0.00135 (0.5 tiles) waiting_chair: 1826.7 mm → 0.00044 (0.8 tiles) computer: 328.5 mm → 0.00122 (0.4 tiles) medical_equipment:327.8 mm → 0.00122 (0.4 tiles) wheelchair: 646.7 mm → 0.00093 (0.6 tiles) diagnostic_table: 1244.8 mm → 0.00080 (1.0 tiles) The models are authored in millimetres (not centimetres as previously assumed), so the previous scale of 0.006 was ~7x too large for beds. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 6521788 commit 27705e6

5 files changed

Lines changed: 20 additions & 11 deletions

File tree

-28.2 KB
Binary file not shown.
-38.1 KB
Binary file not shown.
-35.1 KB
Binary file not shown.
Binary file not shown.

environment/react_frontend/src/components/ThreeFloorPlan.tsx

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,28 @@ const MODEL_URLS: Record<string, string> = {
6868
const TEXTURE_ATLAS_URL = '/models/hospital/Texture_Atlas_Colors_2.png';
6969

7070
/**
71-
* Scale factors per equipment type. Hospital FBX models are authored
72-
* in centimetres; these factors convert to Three.js units where 1
73-
* unit = 1 map tile (~3 ft / ~1 m). A hospital bed is ~200 cm long
74-
* in the FBX, and should occupy ~1.2 tiles on screen → scale ≈ 0.006.
71+
* Scale factors per equipment type, calculated from measured FBX
72+
* bounding boxes. The hospital FBX models are authored in millimetres
73+
* (a bed is ~1404 mm long). Each factor converts the model to
74+
* Three.js units where 1 unit = 1 map tile.
75+
*
76+
* Measured bounding boxes (width × depth × height in mm):
77+
* bed: 589.7 × 1403.7 × 533.4 → target 1.2 tiles
78+
* chair: 319.2 × 371.6 × 520.2 → target 0.5 tiles
79+
* waiting_chair: 1826.7 × 385.7 × 579.2 → target 0.8 tiles
80+
* computer: 328.5 × 47.4 × 221.5 → target 0.4 tiles
81+
* medical_equipment:327.8 × 298.8 × 765.6 → target 0.4 tiles
82+
* wheelchair: 399.7 × 646.7 × 565.0 → target 0.6 tiles
83+
* diagnostic_table: 456.1 × 1244.8 × 653.8 → target 1.0 tiles
7584
*/
7685
const MODEL_SCALE: Record<string, number> = {
77-
bed: 0.006,
78-
chair: 0.008,
79-
waiting_room_chair: 0.007,
80-
computer: 0.008,
81-
diagnostic_table: 0.006,
82-
medical_equipment: 0.007,
83-
wheelchair: 0.007
86+
bed: 0.00085,
87+
chair: 0.00135,
88+
waiting_room_chair: 0.00044,
89+
computer: 0.00122,
90+
diagnostic_table: 0.0008,
91+
medical_equipment: 0.00122,
92+
wheelchair: 0.00093
8493
};
8594

8695
/* ZONE_COLORS and CANVAS_BACKGROUND_COLOR imported from @/theme/colors */

0 commit comments

Comments
 (0)