2025年6月10日 星期二

Hazard Detection: 3D Scenes Rebuilt from Photos with Claude

In this exercise Claude turns one real photo into an interactive 3D scene that points out the hazards in it. Each scene is a single web page built with three.js: it rebuilds the place in the photo, marks every hazard with a risk level and a reason, and lets you look around, walk through or tour the scene to see each hazard up close. This page shows the six sample scenes, five of them next to the photo they were built from, and lists what to check before trusting one. The exercise belongs to Unit 5: 環境安全檢測與評估視覺化 and is part 2 of HW#15 Fractals.

  • The task. One photo and a one-line prompt. Four follow-up requests sharpen the result: build the scene in three.js, grow the trees as fractals, reveal each hazard's label only when the tour reaches it, and put things where they are in the photo.
  • Six scenes, 4 to 10 hazards each. All six still open (3 November 2026). Four grow fractal trees and label their hazards in the scene one at a time, as a tour reaches them; the other two build trees from cylinders and spheres and show every hazard at once.
  • Same walkway, two scenes. Two photos of one walkway gave a scene with 7 hazards and a scene with 9. Each found the cart or vehicle in its own photo, but they rated the same bollards, tank and grate differently.
  • Specific beats generic. The strongest scenes name hazards you can point at in the photo: an e-scooter narrowing the walkway, nine cones across lanes 2–7. The plaza scene lists categories such as Lighting Gap and Weather Exposure, which fit almost any plaza, and the banyan scene's side panel describes its own algorithm instead of the grove.
  • Scope. Every hazard and risk level is Claude's reading of a single photo. Nobody checked them on site, sizes are estimates, and each scene uses its own risk scale. See Limits.

The task · The six scenes · Tank walkway · Bollard walkway · Banyan grove · Running track · Plaza · How to check a scene · Limits · Links and sources

Updated 3 November 2026. The previous version of this post, first published on 10 June 2025 and last edited on 17 July 2026, is kept at its own address.

1. The task

Choose a photo of a real place, from the photo gallery (影像庫) or one of your own, and give it to Claude with this prompt:

English. Identify hazards in a fractal 3D assessment display, first-person perspective, according to a real-world photo.
中文. 依據照片重建三維碎形場景,辨識其中可能的危險部位,需考慮視角與觀測位置轉換以便可以瀏覽各處細節。

The Chinese prompt spells out a little more: rebuild the photo as a 3D fractal scene, find the parts that may be dangerous, and let the viewer change viewpoint and position to inspect every detail. The first answer is rarely the last. The sample scenes came from these follow-up requests:

  1. Add a 3D model in three.js. Each scene is one HTML page that loads the three.js library (r128 or r134) from a CDN and builds the place from simple shapes.
  2. Fractal 3D trees. Grow each tree by recursive branching, every branch splitting into smaller ones, instead of a cylinder topped with spheres.
  3. A node's label only resolves once the probe reaches it. Labels in the scene stay hidden until a tour, a camera or a moving probe arrives at each hazard, so the viewer meets the hazards one at a time instead of all at once.
  4. Faithful positioning (like the photo). Put each object where it stands in the photo. The track scene adds a camera at eye height that reproduces the photo's viewpoint.

Short requests work too. In the shared chat behind the banyan-grove scene, five of them turn a plain tour into one that names a hazard at every node it visits: show a label when a node is visited, make it low-profile, say why the node is a hazard rather than giving an id or a height, use low-key fonts, and slow the tour to one fifth of its speed.

2. The six scenes

Table 1 lists the scenes in the order this page discusses them. Scenes 2 and 3 come from two photos of the same walkway; the photo behind scene 6 is not in the post.

#Scene and photoHazardsTreesLabels appearWays to look
13D Safety Assessment
walkway by a water tank, scooters behind bollards
5: 1 critical, 1 high, 2 medium, 1 lowcylinders, spheresall at onceorbit, auto-rotate
2Campus Safety Assessment 3D
walkway with stone bollards and a wheelbarrow
7: 1 critical, 2 high, 2 moderate, 2 lowcylinders, spheresall at onceorbit, top view, auto-rotate
3Walkway Hazard Survey
the same walkway, an e-scooter parked on it
9: 3 high, 5 medium, 1 lowfractalwhen the probe arrivesfirst-person scan, free look
4Fractal Forest Safety
banyan trees with exposed roots
4: 2 high, 2 mediumfractalwhen the tour arrivesfirst-person walk, tour
5跑道三維碎形場景重建
eight-lane track at dusk, cones and people
6: 2 high, 2 medium, 2 lowfractalwhen visitedseven views, incl. the photo's viewpoint
63D Plaza Scene with Fractal Nature
photo not posted
10: 4 critical, 4 moderate, 2 lowfractalat each tour stopfour viewpoints, keyboard, tour
Table 1. The six scenes as their published code defines them, checked 3 November 2026. Risk levels are in each scene's own words. All load three.js r128 except scene 2, which loads r134.

3. Tank walkway (scene 1)

Brick walkway beside a large stainless water tank, scooters parked behind a row of bollards, a large tree on the left
Fig. 1. The photo behind scene 1: a brick walkway beside a large water tank, with scooters parked behind a row of bollards and a large tree on the left.

Scene 1 rebuilds this corner from simple shapes: the tank, the parked scooters, the bollards, the drain grate in the paving, and a tree made of a cylinder trunk, four branches, eight spheres of foliage and five exposed roots. Translucent zones in risk colours mark the hazards, and a badge rates the whole area MODERATE. Drag to rotate, scroll to zoom, right-drag to pan, and hover over an object for its details (Table 2).

LevelHazardWhat the scene says
criticalWater Storage Tankindustrial tank with electrical connections; restricted access zone required
highScooter Parking Zoneuncontrolled parking, frequent conflicts between pedestrians and vehicles, limited visibility
mediumLarge Treeexposed roots are a trip hazard; the canopy extends over the walkway
mediumDrainage Infrastructuremetal grate in the walkway; trip hazard, slippery when wet
lowBrick Walkwaypaved path in generally good condition
Table 2. Scene 1's five hazards, condensed from the scene. Each also comes with four recommendations, such as fencing off the tank or adding warning signs for the roots.

Two things to check against the photo. The bollards are drawn but not listed, although they stand in a row across the walkway in front of the scooters, and the pile of cut branches at the foot of the tree is not in the scene at all. The tank's critical rating rests on electrical connections; look for them in the photo before accepting it.

4. Bollard walkway: two photos, two scenes (scenes 2 and 3)

Tiled walkway with granite bollards in front, a blue wheelbarrow further on, a water tank with a red plate on the left
The same walkway with a yellow e-scooter parked in front of the bollards
Fig. 2. Two photos of the same walkway. Left, behind scene 2: a wheelbarrow beyond the bollards. Right, behind scene 3: an e-scooter parked across the path. The tank with its red plate, the bollards, the drain grate and the tree are the same.

Scene 2 is built like scene 1: an orbit view with a top view and auto-rotate, translucent hazard zones, and a list of seven hazards. Clicking a hazard opens a panel with its description and recommendations. Its trees are a cylinder with five spheres.

Scene 3 at the start of its scan: brick walls, fractal trees, bollards and the scooter, with an empty hazard ledger on the right
Fig. 3. Scene 3 as it opens. The teal probe has not reached any hazard yet, so nothing is labelled, the ledger on the right reads 0/9 and the composite risk index 0/20. The scooter stands in front, the bollards to its left, and the tank behind the tree on the left.

Scene 3 opens as a scan. A small teal probe flies from hazard to hazard; when it arrives, the hazard's label appears in the scene, its row in the ledger lights up, and its weight is added to the composite risk index (high 3, medium 2, low 1, so 20 for all nine). After the ninth the panel reads SURVEY COMPLETE. Replay scan starts again, and Free look lets you drag to look around and scroll to zoom. If the browser is set to reduce motion, all nine labels appear at once.

Each hazard also carries a Chinese name and a list of risk factors. The scooter is 機車佔用人行道, with the factors egress width, protrusion, tip-over and unmarked, and the note on the drain grate warns that its slots can catch a heel or a cane tip.

HazardScene 2 (wheelbarrow photo)Scene 3 (scooter photo)
Cart or vehicle on the pathWheelbarrow Obstruction, highScooter blocking walkway, high
Stone bollardsBollard Array, lowStone bollards, medium
Drain grateDrainage Grate, moderateDrainage grate, medium
Water tankWater Storage Tank, moderateWater tanks & marked downpipe, high
Pipes and utilitiesUtility Infrastructure, critical
Overhead Pipe System, high
Low overhead pipes, high
TreeTree & Vegetation, lowTree limbs & ground debris, medium
Paving–Cracked & uneven pavers, medium
Manhole cover–Manhole / utility cover, low
Narrow passage–Narrow pinch-point passage, medium
Total79
Table 3. The two scenes' hazards matched by object. A dash means the scene does not list one.

Both scenes find the object that is new in their photo, the wheelbarrow in one and the scooter in the other, and both rate it high. On the fixed objects they disagree: scene 2 puts the utilities at critical and the bollards at low, while scene 3 has nothing above high and rates the bollards medium and the tank high. Scene 3 also adds the paving, the manhole cover and the narrow passage. Neither ranking is wrong on its face, but a second photo of the same place gives a different one, so a risk level is a judgment to discuss, not a measurement.

5. Banyan grove (scene 4)

Row of banyan trees with exposed roots spreading over a lawn
Scene 4: fractal trunks and branches seen from inside the grove, with the hazard and control panels
Fig. 4. Scene 4. Left, the photo: banyan trees with exposed roots on a lawn. Right, the scene's earlier version on 27 May 2025: fractal trunks and branches seen from inside the grove. The linked version adds an Auto Tour button.

Scene 4 is a first-person walk through a grove of fractal trees. Click to capture the mouse, move it to look around, walk with W/A/S/D, rise and sink with Space and Shift, and press Esc to release the mouse. Four markers flag the hazards: Dead Branch Overhang and Leaning Tree Structure (high), Root Exposure Tripping and Uneven Ground Surface (medium). Auto Tour flies to each in turn, 2.8 s apart, and shows its label as the camera arrives; Cycle Lighting switches between Daylight, Dramatic, Inspection and Night.

The side panel, Identified Safety Hazards, names the same four differently, and its reasons describe the model rather than the grove: Fractal Branch Complexity, Mathematical Root Exposure, Procedural Ground Variance (“algorithmically generated terrain features create navigation challenges”) and Recursive Structural Weakness. A hazard report should be about the place, not about the algorithm that drew it, and when two lists in one scene disagree on the names, one of them was probably never checked.

The shared chat is a separate remix of this scene. Its tour walks along the branches of a fractal tree node by node, and each label is picked by the node's height: exposed root (trip hazard) near the ground, then low limb (head strike), weak fork (split or break) and dead branch overhang (fall risk) in the canopy. These labels follow the shape of the tree rather than anything in the photo, so read them as a demonstration of the reveal, not as findings.

6. Running track (scene 5)

Blue eight-lane running track at dusk with a row of orange cones, three people standing behind them and runners on the outer lanes
Scene 5 in free view: the hazard registry H1 to H6 on the left, people on the track and labels for H1 and H2
Fig. 5. Scene 5. Left, the photo: a blue eight-lane track at dusk, a row of orange cones, three people standing behind it and runners on the outer lanes. Right, the scene in free view, with the hazard registry H1–H6 on the left and the labels of H1 and H2, already visited, above the track.

Scene 5 is the most complete of the six. The track has the standard eight lanes of 1.22 m, the cones stand in one row across lanes 2–7, and the sky is a dusk gradient like the photo's. Seven views sit on keys 1–7: 自由視角 (free orbit); 照片視角, a fixed camera at eye height (1.7 m) placed to reproduce the photo; 第一人稱避障, a runner's view from just behind the shoulder, with a readout of the distance to the obstacle ahead, the time to collision (TTC), speed and plan; 鳥瞰偵測, a bird's-eye view; 危險巡檢, a patrol that holds 5 s at each hazard and shows a card with its description and advice; 節點走訪, a third-person view that follows the runner from hazard to hazard; and 影院運鏡, a sequence of cinematic shots. Space pauses and H toggles the markers. A hazard's ground ring and label stay hidden until it has been visited.

HazardRiskWhat the scene says, condensed
H1錐筒障礙列
row of cones
高 highNine cones across lanes 2–7 close the middle lanes and are hard to make out at dusk from far away. 15 m before them, move out to lane 8 or in to lane 1 and slow to 70%.
H2跑道上站立人員
people standing on the track
高 highThree people talk in lanes 3–5 right behind the cones, their backs to oncoming runners, and may move at any moment. Leave 1.5 m to the side and call out when passing.
H3動態跑者群(同向)
runners going the same way
中 mediumThree runners in lanes 7–8 at 3.3–3.9 m/s. Check the speed difference before overtaking and pass on the left, one lane apart.
H4落葉/碎屑滑倒點
leaves and debris
低 lowLeaves and litter in lanes 5–7, visible in the photo's foreground; wet leaves cut the grip of the PU surface. Shorten your stride; after rain the risk rises to medium.
H5內側欄杆立柱
posts of the inner railing
低 lowA metal railing between grass and track, posts 2.4 m apart, catches anyone cutting across. Stay inside lane 1; runners with low vision are safer in lane 2.
H6黃昏逆光視線遮蔽
dusk glare
中 mediumThe low western sun causes glare and long shadows, so beyond 30 m the cones and people lose contrast against the blue track. Wear a cap with a brim and add reflective tape to obstacles.
Table 4. Scene 5's six hazards. Names are the scene's own; descriptions and advice are condensed from its hazard cards.

Every hazard here can be checked against the photo: count the cones, find the three people behind them, the runners on the outer lanes, the leaves in the foreground and the railing at the edge of the infield. The advice is written for the person at risk, a runner or a pedestrian with low vision, which makes the scene more useful than a list of labels.

7. Plaza (scene 6)

Scene 6: a plaza with fractal trees, buildings and pedestrians, and a Hazard Assessment panel on the right
Fig. 6. Scene 6: fractal trees, buildings and pedestrians on a plaza, with the Hazard Assessment panel listing the hazards from critical down. The photo behind this scene is not in the post.

Scene 6 has four viewpoints on keys 1–4 (Ground Level, Elevated Overview, Bird's Eye, Building Perspective). Drag to rotate and scroll to zoom; W/A/S/D or the arrow keys pan, Q/E zoom and R/F move up and down. P starts the Hazard Tour, which glides 3.5 s to each hazard and holds 2.8 s with its label shown, and N grows a new set of fractal trees. Its ten hazards are in Table 5.

LevelHazardWhat the scene says
criticalTrip Hazarduneven brick pavement, potential ankle injury
criticalBlind Spota building corner blocks visibility
criticalFall Risklow railing near an elevated area
criticalEmergency Accessnarrow passage restricts access for emergency vehicles
moderateSlip Risksmooth stone surface becomes slippery when wet
moderateSharp Edgemetal railing with sharp corners at child height
moderateCongestion Zonecentral area prone to pedestrian bottlenecks
moderateLighting Gapinsufficient lighting for evening visibility
lowWeather Exposureno overhead protection from rain or sun
lowDebris Collectiona corner collects leaves and debris
Table 5. Scene 6's ten hazards with the scene's own descriptions.

Compare this list with Table 4. Each entry is a general category with a one-line reason that would fit most plazas, and several describe conditions a single photo can rarely show: a wet surface, evening light, rain. Without the photo there is no way to tell which ones are real. Asking Claude to tie every hazard to something visible in the photo is the fix.

8. How to check a scene

Before using a scene, or handing one in, go through these five checks.

  1. Photo next to scene. Every listed hazard should point at something you can find in the photo, and every large object in the photo should be in the scene. Scene 1 draws the bollards but does not list them; scene 6 cannot be checked at all without its photo.
  2. A reason for each hazard. Who gets hurt, and how: a trip, a head strike, a slip when wet, a cane tip caught in a grate. A category name alone, such as Lighting Gap, is a guess, and a reason about the model, such as scene 4's “algorithmically generated terrain”, describes the drawing, not the place.
  3. Risk levels as a ranking. Read them as an order within one scene, not as measurements. Scenes 2 and 3 rate the same bollards low and medium.
  4. Walk it. Use the first-person view or the tour, make sure every hazard can be reached and read at eye height, and that labels appear as the tour arrives rather than all at once.
  5. Sizes and places. Compare positions and distances with the photo. Only scene 5 gives its own dimensions (eight lanes of 1.22 m, railing posts 2.4 m apart); elsewhere sizes are guesses.

9. Limits

  • One photo per scene. The hazards, reasons and risk levels are Claude's reading of that photo, not a site survey; nothing was measured or checked on site.
  • Each scene has its own risk scale. Scene 1 uses critical, high, medium and low; scene 2 critical, high, moderate and low; scene 3 high, medium and low, weighted 3, 2 and 1; scene 5 高, 中 and 低; scene 6 critical, moderate and low, with no high. Counts and levels cannot be compared across scenes.
  • The scenes are browser demos built on three.js r128 or r134 from cdnjs. Their mouse and keyboard controls are made for a desktop browser.
  • One older scene is gone. “Warning of hazards”, built from the photo in a Liberty Times report of 29 October 2024 on a slope collapse beside a trail in the Lalashan National Forest Recreation Area, was published on claude.site; its address now leads to “page not found”.
  • The banyan scene's shared chat and its linked page are different versions (Section 5).

沒有留言:

張貼留言