Add the fire hydrant: one stepped revolve carrying every casting feature it has, with three caps that each hinge about their own tangent because one anchor only has one axis.
This commit is contained in:
parent
ce52875d2c
commit
dcbe967a70
6 changed files with 691 additions and 27 deletions
13
PROGRESS.md
13
PROGRESS.md
|
|
@ -209,6 +209,15 @@ is `latheGeometry`'s and always was: walk from the bottom of the outer wall
|
||||||
upward. Write the profile whichever way round reads best and reverse it at the
|
upward. Write the profile whichever way round reads best and reverse it at the
|
||||||
call site.
|
call site.
|
||||||
|
|
||||||
|
**One anchor has one axis, so a part that must swing about its own placed
|
||||||
|
frame needs its own part -- and a rotation ORDER.** The hydrant's three caps
|
||||||
|
hinge about three different tangents. Built as one part, any rotation carries
|
||||||
|
them round the barrel rather than down its side. Each is now its own part with
|
||||||
|
the outlet as its origin, its geometry written in the UNROTATED frame, and its
|
||||||
|
anchor set to `YXZ` with a fixed Y that places it and an X that swings it. The
|
||||||
|
Y-then-X order is the whole trick: X applied second happens in the placed frame,
|
||||||
|
which is the tangent.
|
||||||
|
|
||||||
**`chamferedBoxGeometry`'s length is its height, and this is the third model to
|
**`chamferedBoxGeometry`'s length is its height, and this is the third model to
|
||||||
get it wrong.** The cable drum's spokes stood on end; the boom barrier's colour
|
get it wrong.** The cable drum's spokes stood on end; the boom barrier's colour
|
||||||
bands came out one section thick along the boom and a band long across it --
|
bands came out one section thick along the boom and a band long across it --
|
||||||
|
|
@ -551,13 +560,13 @@ asking GitHub Support to purge actually closes it.
|
||||||
|
|
||||||
## Open
|
## Open
|
||||||
|
|
||||||
- **`contemporary-props`**: 23 of the core 100 modelled, and the build order is
|
- **`contemporary-props`**: 24 of the core 100 modelled, and the build order is
|
||||||
now DOMAIN FIRST. The catalogue's own section 5 argued against spreading the
|
now DOMAIN FIRST. The catalogue's own section 5 argued against spreading the
|
||||||
first hundred across nine domains and named the failure mode: nine domains at
|
first hundred across nine domains and named the failure mode: nine domains at
|
||||||
a third each, with the helper set shaped by whichever got built first. Fifteen
|
a third each, with the helper set shaped by whichever got built first. Fifteen
|
||||||
models in, that had happened -- five street, four kitchen, two tools, one each
|
models in, that had happened -- five street, four kitchen, two tools, one each
|
||||||
of four more -- so the remaining street rows are being finished before
|
of four more -- so the remaining street rows are being finished before
|
||||||
anything else starts. Four to go after the boom barrier. The reasoning is written into `CATALOGUE.md` under
|
anything else starts. Three to go after the fire hydrant. The reasoning is written into `CATALOGUE.md` under
|
||||||
"Decided: street first"; the short version is that seventeen street objects is
|
"Decided: street first"; the short version is that seventeen street objects is
|
||||||
a scene somebody can assemble, and what carried the medieval kit was one
|
a scene somebody can assemble, and what carried the medieval kit was one
|
||||||
flythrough rather than a model count.
|
flythrough rather than a model count.
|
||||||
|
|
|
||||||
15
contemporary-props/models/fire-hydrant/meta.json
Normal file
15
contemporary-props/models/fire-hydrant/meta.json
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
"title": "Fire Hydrant",
|
||||||
|
"description": "A dry-barrel hydrant: one stepped revolve carrying a break flange, a bonnet flange, bolt heads and radial outlets, with caps that swing off on chains. The profile is the model.",
|
||||||
|
"category": "Street",
|
||||||
|
"tags": ["contemporary", "street", "safety", "procedural"],
|
||||||
|
"controls": {
|
||||||
|
"height": { "type": "number", "label": "Height", "min": 0.5, "max": 1.4, "step": 0.01, "unit": "m" },
|
||||||
|
"outlets": { "type": "number", "label": "Outlets", "min": 1, "max": 3, "step": 1 },
|
||||||
|
"unscrewed": { "type": "number", "label": "Caps off", "min": 0, "max": 1, "step": 0.05 },
|
||||||
|
"segments": { "type": "number", "label": "Sides", "min": 12, "max": 48, "step": 1 },
|
||||||
|
"seed": { "type": "number", "label": "Variation seed", "min": 1, "max": 64, "step": 1 }
|
||||||
|
},
|
||||||
|
"materialSlots": ["retroreflective", "stainless"],
|
||||||
|
"parts": ["body", "chains", "capA", "capB", "capC"]
|
||||||
|
}
|
||||||
310
contemporary-props/models/fire-hydrant/model.ts
Normal file
310
contemporary-props/models/fire-hydrant/model.ts
Normal file
|
|
@ -0,0 +1,310 @@
|
||||||
|
/**
|
||||||
|
* @contemporary-props/fire-hydrant
|
||||||
|
*
|
||||||
|
* Bonnet, bolted flanges and radial outlets: a stepped lathe stack that names
|
||||||
|
* itself at fifty metres, which is what the catalogue puts it sixty-second for
|
||||||
|
* and is the honest description of the whole model. There is no clever
|
||||||
|
* geometry here. There is a profile with eleven steps in it, and every one of
|
||||||
|
* them is a step somebody cast for a reason.
|
||||||
|
*
|
||||||
|
* Measured off the reference against a 900 mm hydrant, as fractions of that:
|
||||||
|
*
|
||||||
|
* 0.000 the foot flange, and the break flange bolted above it
|
||||||
|
* 0.157 the lower barrel
|
||||||
|
* 0.282 the raised band where the barrel changes section
|
||||||
|
* 0.580 the outlets, three of them on one radial array
|
||||||
|
* 0.737 the bonnet flange
|
||||||
|
* 0.965 the fluted dome
|
||||||
|
* 1.000 the operating nut, which is a pentagon so nothing but a hydrant
|
||||||
|
* wrench will turn it
|
||||||
|
*
|
||||||
|
* The caps swing on their chains, which is the catalogue's action, and it is
|
||||||
|
* the one place this model is not a lathe. Each cap is its own part with the
|
||||||
|
* hinge as its origin, and the anchor carries TWO rotations in YXZ order: a
|
||||||
|
* fixed Y that places the cap round the barrel, and an X that is the swing.
|
||||||
|
* Written with one part for all three, the swing would carry them round the
|
||||||
|
* hydrant rather than down its side, because a single anchor has a single axis.
|
||||||
|
*/
|
||||||
|
import { type BufferGeometry, type Object3D } from 'three'
|
||||||
|
|
||||||
|
import {
|
||||||
|
bakeOcclusion,
|
||||||
|
createKitModel,
|
||||||
|
createTinter,
|
||||||
|
jitter,
|
||||||
|
latheGeometry,
|
||||||
|
mergeColoured,
|
||||||
|
smoothNormals,
|
||||||
|
tubeGeometry,
|
||||||
|
type RuntimeContext,
|
||||||
|
type Vec3,
|
||||||
|
} from '../core/index.ts'
|
||||||
|
|
||||||
|
export interface FireHydrantConfig {
|
||||||
|
/** Height to the top of the operating nut (metres). */
|
||||||
|
readonly height: number
|
||||||
|
/** Outlets round the barrel. */
|
||||||
|
readonly outlets: number
|
||||||
|
/** How far the caps are swung off, 0 shut to 1 hanging. */
|
||||||
|
readonly unscrewed: number
|
||||||
|
/** Sides on the barrel's revolve. */
|
||||||
|
readonly segments: number
|
||||||
|
readonly seed: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export const fireHydrantDefaults: FireHydrantConfig = {
|
||||||
|
height: 0.9,
|
||||||
|
outlets: 3,
|
||||||
|
unscrewed: 0,
|
||||||
|
segments: 26,
|
||||||
|
seed: 97,
|
||||||
|
}
|
||||||
|
|
||||||
|
export type FireHydrantParts = 'body' | 'chains' | 'capA' | 'capB' | 'capC'
|
||||||
|
|
||||||
|
export interface FireHydrantActions {
|
||||||
|
/** Swings the caps off their outlets. 1 is hanging on the chain. */
|
||||||
|
unscrew(amount?: number): void
|
||||||
|
}
|
||||||
|
|
||||||
|
const CAPS = ['capA', 'capB', 'capC'] as const
|
||||||
|
|
||||||
|
function applyUnscrew(
|
||||||
|
runtime: RuntimeContext<FireHydrantConfig, FireHydrantParts>,
|
||||||
|
amount: number,
|
||||||
|
): void {
|
||||||
|
const outlets = Math.max(1, Math.min(3, Math.round(runtime.getConfig().outlets)))
|
||||||
|
const swing = Math.min(1, Math.max(0, amount)) * 2.1
|
||||||
|
for (let i = 0; i < CAPS.length; i += 1) {
|
||||||
|
const anchor = runtime.parts[CAPS[i]!].anchor as Object3D
|
||||||
|
// YXZ, so the Y that places the cap round the barrel is applied FIRST and
|
||||||
|
// the X swing then happens in that placed frame -- which is the tangential
|
||||||
|
// axis a cap actually hinges about.
|
||||||
|
anchor.rotation.order = 'YXZ'
|
||||||
|
anchor.rotation.y = (i / outlets) * Math.PI * 2
|
||||||
|
anchor.rotation.x = i < outlets ? swing : 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function createModel(overrides: Partial<FireHydrantConfig> = {}) {
|
||||||
|
let heldUnscrew = 0
|
||||||
|
let seenUnscrew = Number.NaN
|
||||||
|
|
||||||
|
return createKitModel<
|
||||||
|
FireHydrantConfig, 'retroreflective' | 'stainless', FireHydrantParts, FireHydrantActions
|
||||||
|
>({
|
||||||
|
id: 'fire-hydrant',
|
||||||
|
defaults: fireHydrantDefaults,
|
||||||
|
slots: ['retroreflective', 'stainless'],
|
||||||
|
|
||||||
|
build: ({ config, random }) => {
|
||||||
|
const tint = createTinter(random)
|
||||||
|
const H = Math.min(1.4, Math.max(0.5, config.height))
|
||||||
|
const outlets = Math.max(1, Math.min(3, Math.round(config.outlets)))
|
||||||
|
const segments = Math.max(12, Math.round(config.segments))
|
||||||
|
|
||||||
|
const red = tint('retroreflective', -0.03 + jitter(random, 0.02), 0.8)
|
||||||
|
const deep = tint('retroreflective', -0.1, 0.6)
|
||||||
|
const steel = tint('stainless', -0.04, 0.3).offsetHSL(0, -1, 0)
|
||||||
|
|
||||||
|
const R = H * 0.122
|
||||||
|
const outletY = H * 0.58
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The barrel, as ONE lathe.
|
||||||
|
*
|
||||||
|
* Every step in it is a casting feature: the foot the hydrant is bolted
|
||||||
|
* down through, the break flange it is designed to shear at when a car
|
||||||
|
* hits it, the band where the barrel changes section, the shoulder the
|
||||||
|
* outlets grow out of, the bonnet flange. Stacked as separate cylinders
|
||||||
|
* this is a dozen pieces with a dozen pairs of coincident faces; as one
|
||||||
|
* profile it is a solid with no interior at all.
|
||||||
|
*/
|
||||||
|
const bodyPieces: BufferGeometry[] = [latheGeometry([
|
||||||
|
{ y: 0, radius: R * 1.42 },
|
||||||
|
{ y: H * 0.022, radius: R * 1.42 },
|
||||||
|
{ y: H * 0.03, radius: R * 1.28 },
|
||||||
|
{ y: H * 0.058, radius: R * 1.28 },
|
||||||
|
{ y: H * 0.07, radius: R * 1.4 },
|
||||||
|
{ y: H * 0.1, radius: R * 1.4 },
|
||||||
|
{ y: H * 0.112, radius: R * 1.02 },
|
||||||
|
{ y: H * 0.157, radius: R * 0.99 },
|
||||||
|
{ y: H * 0.268, radius: R * 0.96 },
|
||||||
|
// The band, which is where a dry-barrel hydrant's two castings meet.
|
||||||
|
{ y: H * 0.282, radius: R * 1.06 },
|
||||||
|
{ y: H * 0.31, radius: R * 1.06 },
|
||||||
|
{ y: H * 0.322, radius: R * 0.9 },
|
||||||
|
{ y: H * 0.47, radius: R * 0.87 },
|
||||||
|
// The shoulder the outlets come out of: the barrel swells to take them
|
||||||
|
// and this bulge is most of what reads as a hydrant in silhouette.
|
||||||
|
{ y: outletY, radius: R * 0.98 },
|
||||||
|
{ y: H * 0.66, radius: R * 0.86 },
|
||||||
|
{ y: H * 0.72, radius: R * 0.84 },
|
||||||
|
{ y: H * 0.737, radius: R * 1.36 },
|
||||||
|
{ y: H * 0.79, radius: R * 1.36 },
|
||||||
|
{ y: H * 0.806, radius: R * 1.24 },
|
||||||
|
{ y: H * 0.831, radius: R * 1.24 },
|
||||||
|
// The dome.
|
||||||
|
{ y: H * 0.87, radius: R * 1.02 },
|
||||||
|
{ y: H * 0.915, radius: R * 0.74 },
|
||||||
|
{ y: H * 0.95, radius: R * 0.34 },
|
||||||
|
{ y: H * 0.965, radius: R * 0.22 },
|
||||||
|
], segments, [0, 0, 0], red, { colourTop: deep, capBottom: true, capTop: true })]
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The dome's RIBS.
|
||||||
|
*
|
||||||
|
* A hydrant's bonnet is a casting with vertical ribs running over it, and
|
||||||
|
* without them the dome is a plain hemisphere that could belong to a
|
||||||
|
* bollard. They are a radial array of thin blades following the same
|
||||||
|
* profile the dome does, standing a couple of millimetres proud.
|
||||||
|
*/
|
||||||
|
const domeLevels = [
|
||||||
|
[0.831, 1.24], [0.87, 1.02], [0.915, 0.74], [0.95, 0.34],
|
||||||
|
] as const
|
||||||
|
for (let i = 0; i < 10; i += 1) {
|
||||||
|
const a = (i / 10) * Math.PI * 2
|
||||||
|
const rib = latheGeometry(
|
||||||
|
domeLevels.map(([y, r]) => ({ y: H * y, radius: R * r * 1.022 })),
|
||||||
|
3, [0, 0, 0], deep, { capBottom: false, capTop: false },
|
||||||
|
)
|
||||||
|
rib.rotateY(a)
|
||||||
|
bodyPieces.push(rib)
|
||||||
|
}
|
||||||
|
|
||||||
|
// The operating nut: a PENTAGON, which is the whole point of it. A hex
|
||||||
|
// nut can be turned by anything in a toolbox; five sides is what makes a
|
||||||
|
// hydrant need a hydrant wrench.
|
||||||
|
bodyPieces.push(latheGeometry([
|
||||||
|
{ y: H * 0.96, radius: R * 0.3 },
|
||||||
|
{ y: H * 0.972, radius: R * 0.27 },
|
||||||
|
{ y: H * 1, radius: R * 0.25 },
|
||||||
|
], 5, [0, 0, 0], red, { capBottom: false, capTop: true }))
|
||||||
|
|
||||||
|
/** Bolt heads round a flange, which is what says a casting was bolted. */
|
||||||
|
const bolts = (y: number, radius: number, count: number): void => {
|
||||||
|
for (let i = 0; i < count; i += 1) {
|
||||||
|
const a = ((i + 0.5) / count) * Math.PI * 2
|
||||||
|
bodyPieces.push(latheGeometry([
|
||||||
|
{ y: 0, radius: R * 0.1 },
|
||||||
|
{ y: H * 0.012, radius: R * 0.092 },
|
||||||
|
{ y: H * 0.016, radius: R * 0.05 },
|
||||||
|
], 6, [Math.sin(a) * radius, y, Math.cos(a) * radius], steel,
|
||||||
|
{ capBottom: false, capTop: true }))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
bolts(H * 0.102, R * 1.26, 8)
|
||||||
|
bolts(H * 0.792, R * 1.24, 8)
|
||||||
|
|
||||||
|
/* ------------------------------------------------------ the outlets */
|
||||||
|
/**
|
||||||
|
* The spigots stay on the body; only the caps come off.
|
||||||
|
*
|
||||||
|
* Built at angle zero and turned into place, so one description makes all
|
||||||
|
* three -- and the caps, which are separate parts, are built in exactly
|
||||||
|
* the same unrotated frame so their anchors can place them the same way.
|
||||||
|
*/
|
||||||
|
// Three quarters of the barrel across, off the reference: at half it read
|
||||||
|
// as a bolt boss rather than as something a hose couples to, and the
|
||||||
|
// outlets are most of what names a hydrant in silhouette.
|
||||||
|
const spigotR = R * 0.72
|
||||||
|
const reach = R * 1.5
|
||||||
|
const capPieces: BufferGeometry[][] = [[], [], []]
|
||||||
|
const chainPieces: BufferGeometry[] = []
|
||||||
|
|
||||||
|
for (let i = 0; i < outlets; i += 1) {
|
||||||
|
const a = (i / outlets) * Math.PI * 2
|
||||||
|
|
||||||
|
const spigot = latheGeometry([
|
||||||
|
{ y: R * 0.5, radius: spigotR * 1.14 },
|
||||||
|
{ y: reach - R * 0.2, radius: spigotR * 1.08 },
|
||||||
|
{ y: reach - R * 0.1, radius: spigotR * 1.22 },
|
||||||
|
{ y: reach, radius: spigotR * 1.22 },
|
||||||
|
], 18, [0, 0, 0], red, { capBottom: false, capTop: false })
|
||||||
|
spigot.rotateX(Math.PI / 2)
|
||||||
|
spigot.rotateY(a)
|
||||||
|
spigot.translate(0, outletY, 0)
|
||||||
|
bodyPieces.push(spigot)
|
||||||
|
|
||||||
|
// The cap, in the UNROTATED frame with the hinge at the origin: the
|
||||||
|
// anchor's Y puts it round the barrel and its X swings it down.
|
||||||
|
const cap = mergeColoured([
|
||||||
|
latheGeometry([
|
||||||
|
{ y: 0, radius: spigotR * 1.26 },
|
||||||
|
{ y: R * 0.18, radius: spigotR * 1.26 },
|
||||||
|
{ y: R * 0.26, radius: spigotR * 1.1 },
|
||||||
|
], 18, [0, 0, 0], red, { capBottom: false, capTop: true }),
|
||||||
|
// The hex the cap is turned by.
|
||||||
|
latheGeometry([
|
||||||
|
{ y: R * 0.24, radius: spigotR * 0.52 },
|
||||||
|
{ y: R * 0.44, radius: spigotR * 0.46 },
|
||||||
|
], 6, [0, 0, 0], red, { capBottom: false, capTop: true }),
|
||||||
|
])
|
||||||
|
cap.rotateX(Math.PI / 2)
|
||||||
|
cap.translate(0, 0, reach)
|
||||||
|
capPieces[i] = [cap]
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The chain, which is what makes a cap a cap rather than a lid.
|
||||||
|
*
|
||||||
|
* It hangs in a real catenary rather than a straight line: a chain
|
||||||
|
* drawn taut between two points reads as a rod, and the sag is the only
|
||||||
|
* thing that says the thing is flexible. Three sample points and a
|
||||||
|
* sine are enough at this size.
|
||||||
|
*/
|
||||||
|
const from: Vec3 = [0, outletY - R * 0.18, reach * 0.78]
|
||||||
|
const to: Vec3 = [0, outletY - R * 1.15, R * 0.82]
|
||||||
|
const path: Vec3[] = []
|
||||||
|
for (let k = 0; k <= 8; k += 1) {
|
||||||
|
const t = k / 8
|
||||||
|
path.push([
|
||||||
|
0,
|
||||||
|
from[1] + (to[1] - from[1]) * t - Math.sin(t * Math.PI) * R * 0.5,
|
||||||
|
from[2] + (to[2] - from[2]) * t,
|
||||||
|
])
|
||||||
|
}
|
||||||
|
// No caps: both ends are buried, one in the cap's boss and one in the
|
||||||
|
// barrel, and the discs there were three pairs of coincident faces.
|
||||||
|
const chain = tubeGeometry(path, R * 0.05, 6, steel, { capStart: false, capEnd: false })
|
||||||
|
chain.rotateY(a)
|
||||||
|
chainPieces.push(chain)
|
||||||
|
}
|
||||||
|
|
||||||
|
bakeOcclusion(bodyPieces, { strength: 0.35 })
|
||||||
|
|
||||||
|
const hinge = [0, outletY, 0] as const
|
||||||
|
const capPart = (i: number): {
|
||||||
|
slot: 'retroreflective'
|
||||||
|
geometry: BufferGeometry
|
||||||
|
origin: readonly [number, number, number]
|
||||||
|
} | undefined => (capPieces[i]!.length === 0 ? undefined : {
|
||||||
|
slot: 'retroreflective' as const,
|
||||||
|
geometry: smoothNormals(mergeColoured(capPieces[i]!), 34),
|
||||||
|
origin: hinge,
|
||||||
|
})
|
||||||
|
|
||||||
|
return {
|
||||||
|
body: { slot: 'retroreflective' as const, geometry: smoothNormals(mergeColoured(bodyPieces), 34) },
|
||||||
|
chains: chainPieces.length === 0
|
||||||
|
? undefined
|
||||||
|
: { slot: 'stainless' as const, geometry: smoothNormals(mergeColoured(chainPieces), 40) },
|
||||||
|
capA: capPart(0),
|
||||||
|
capB: capPart(1),
|
||||||
|
capC: capPart(2),
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
actions: (runtime) => {
|
||||||
|
heldUnscrew = runtime.getConfig().unscrewed
|
||||||
|
seenUnscrew = heldUnscrew
|
||||||
|
applyUnscrew(runtime, heldUnscrew)
|
||||||
|
return { unscrew: (amount = 1) => { heldUnscrew = amount; applyUnscrew(runtime, amount) } }
|
||||||
|
},
|
||||||
|
|
||||||
|
update: (_dt, runtime) => {
|
||||||
|
const wanted = runtime.getConfig().unscrewed
|
||||||
|
if (wanted !== seenUnscrew) { seenUnscrew = wanted; heldUnscrew = wanted }
|
||||||
|
applyUnscrew(runtime, heldUnscrew)
|
||||||
|
},
|
||||||
|
}, overrides)
|
||||||
|
}
|
||||||
|
|
@ -677,7 +677,7 @@
|
||||||
"address": "@contemporary-props/core",
|
"address": "@contemporary-props/core",
|
||||||
"source": "file:contemporary-props/dist/registry.json",
|
"source": "file:contemporary-props/dist/registry.json",
|
||||||
"version": "workspace",
|
"version": "workspace",
|
||||||
"installedAt": "2026-09-04T22:13:41.820Z",
|
"installedAt": "2026-09-04T22:21:51.128Z",
|
||||||
"files": [
|
"files": [
|
||||||
{
|
{
|
||||||
"path": "src\\models\\contemporary-props\\core\\geometry.ts",
|
"path": "src\\models\\contemporary-props\\core\\geometry.ts",
|
||||||
|
|
@ -724,7 +724,7 @@
|
||||||
"address": "@contemporary-props/ceramic-vase",
|
"address": "@contemporary-props/ceramic-vase",
|
||||||
"source": "file:contemporary-props/dist/registry.json",
|
"source": "file:contemporary-props/dist/registry.json",
|
||||||
"version": "workspace",
|
"version": "workspace",
|
||||||
"installedAt": "2026-09-04T22:13:41.825Z",
|
"installedAt": "2026-09-04T22:21:51.134Z",
|
||||||
"files": [
|
"files": [
|
||||||
{
|
{
|
||||||
"path": "src\\models\\contemporary-props\\ceramic-vase\\model.ts",
|
"path": "src\\models\\contemporary-props\\ceramic-vase\\model.ts",
|
||||||
|
|
@ -739,7 +739,7 @@
|
||||||
"address": "@contemporary-props/coffee-mug",
|
"address": "@contemporary-props/coffee-mug",
|
||||||
"source": "file:contemporary-props/dist/registry.json",
|
"source": "file:contemporary-props/dist/registry.json",
|
||||||
"version": "workspace",
|
"version": "workspace",
|
||||||
"installedAt": "2026-09-04T22:13:41.826Z",
|
"installedAt": "2026-09-04T22:21:51.135Z",
|
||||||
"files": [
|
"files": [
|
||||||
{
|
{
|
||||||
"path": "src\\models\\contemporary-props\\coffee-mug\\model.ts",
|
"path": "src\\models\\contemporary-props\\coffee-mug\\model.ts",
|
||||||
|
|
@ -754,7 +754,7 @@
|
||||||
"address": "@contemporary-props/pepper-mill",
|
"address": "@contemporary-props/pepper-mill",
|
||||||
"source": "file:contemporary-props/dist/registry.json",
|
"source": "file:contemporary-props/dist/registry.json",
|
||||||
"version": "workspace",
|
"version": "workspace",
|
||||||
"installedAt": "2026-09-04T22:13:41.837Z",
|
"installedAt": "2026-09-04T22:21:51.148Z",
|
||||||
"files": [
|
"files": [
|
||||||
{
|
{
|
||||||
"path": "src\\models\\contemporary-props\\pepper-mill\\model.ts",
|
"path": "src\\models\\contemporary-props\\pepper-mill\\model.ts",
|
||||||
|
|
@ -769,7 +769,7 @@
|
||||||
"address": "@contemporary-props/stockpot",
|
"address": "@contemporary-props/stockpot",
|
||||||
"source": "file:contemporary-props/dist/registry.json",
|
"source": "file:contemporary-props/dist/registry.json",
|
||||||
"version": "workspace",
|
"version": "workspace",
|
||||||
"installedAt": "2026-09-04T22:13:41.839Z",
|
"installedAt": "2026-09-04T22:21:51.151Z",
|
||||||
"files": [
|
"files": [
|
||||||
{
|
{
|
||||||
"path": "src\\models\\contemporary-props\\stockpot\\model.ts",
|
"path": "src\\models\\contemporary-props\\stockpot\\model.ts",
|
||||||
|
|
@ -784,7 +784,7 @@
|
||||||
"address": "@contemporary-props/traffic-cone",
|
"address": "@contemporary-props/traffic-cone",
|
||||||
"source": "file:contemporary-props/dist/registry.json",
|
"source": "file:contemporary-props/dist/registry.json",
|
||||||
"version": "workspace",
|
"version": "workspace",
|
||||||
"installedAt": "2026-09-04T22:13:41.842Z",
|
"installedAt": "2026-09-04T22:21:51.154Z",
|
||||||
"files": [
|
"files": [
|
||||||
{
|
{
|
||||||
"path": "src\\models\\contemporary-props\\traffic-cone\\model.ts",
|
"path": "src\\models\\contemporary-props\\traffic-cone\\model.ts",
|
||||||
|
|
@ -799,7 +799,7 @@
|
||||||
"address": "@contemporary-props/wine-glass",
|
"address": "@contemporary-props/wine-glass",
|
||||||
"source": "file:contemporary-props/dist/registry.json",
|
"source": "file:contemporary-props/dist/registry.json",
|
||||||
"version": "workspace",
|
"version": "workspace",
|
||||||
"installedAt": "2026-09-04T22:13:41.845Z",
|
"installedAt": "2026-09-04T22:21:51.158Z",
|
||||||
"files": [
|
"files": [
|
||||||
{
|
{
|
||||||
"path": "src\\models\\contemporary-props\\wine-glass\\model.ts",
|
"path": "src\\models\\contemporary-props\\wine-glass\\model.ts",
|
||||||
|
|
@ -814,7 +814,7 @@
|
||||||
"address": "@contemporary-props/kit",
|
"address": "@contemporary-props/kit",
|
||||||
"source": "file:contemporary-props/dist/registry.json",
|
"source": "file:contemporary-props/dist/registry.json",
|
||||||
"version": "workspace",
|
"version": "workspace",
|
||||||
"installedAt": "2026-09-04T22:13:41.845Z",
|
"installedAt": "2026-09-04T22:21:51.158Z",
|
||||||
"files": [],
|
"files": [],
|
||||||
"dependencies": []
|
"dependencies": []
|
||||||
},
|
},
|
||||||
|
|
@ -822,7 +822,7 @@
|
||||||
"address": "@contemporary-props/street-bollard",
|
"address": "@contemporary-props/street-bollard",
|
||||||
"source": "file:contemporary-props/dist/registry.json",
|
"source": "file:contemporary-props/dist/registry.json",
|
||||||
"version": "workspace",
|
"version": "workspace",
|
||||||
"installedAt": "2026-09-04T22:13:41.840Z",
|
"installedAt": "2026-09-04T22:21:51.152Z",
|
||||||
"files": [
|
"files": [
|
||||||
{
|
{
|
||||||
"path": "src\\models\\contemporary-props\\street-bollard\\model.ts",
|
"path": "src\\models\\contemporary-props\\street-bollard\\model.ts",
|
||||||
|
|
@ -837,7 +837,7 @@
|
||||||
"address": "@contemporary-props/gas-cylinder",
|
"address": "@contemporary-props/gas-cylinder",
|
||||||
"source": "file:contemporary-props/dist/registry.json",
|
"source": "file:contemporary-props/dist/registry.json",
|
||||||
"version": "workspace",
|
"version": "workspace",
|
||||||
"installedAt": "2026-09-04T22:13:41.828Z",
|
"installedAt": "2026-09-04T22:21:51.139Z",
|
||||||
"files": [
|
"files": [
|
||||||
{
|
{
|
||||||
"path": "src\\models\\contemporary-props\\gas-cylinder\\model.ts",
|
"path": "src\\models\\contemporary-props\\gas-cylinder\\model.ts",
|
||||||
|
|
@ -852,7 +852,7 @@
|
||||||
"address": "@contemporary-props/fire-extinguisher",
|
"address": "@contemporary-props/fire-extinguisher",
|
||||||
"source": "file:contemporary-props/dist/registry.json",
|
"source": "file:contemporary-props/dist/registry.json",
|
||||||
"version": "workspace",
|
"version": "workspace",
|
||||||
"installedAt": "2026-09-04T22:13:41.827Z",
|
"installedAt": "2026-09-04T22:21:51.136Z",
|
||||||
"files": [
|
"files": [
|
||||||
{
|
{
|
||||||
"path": "src\\models\\contemporary-props\\fire-extinguisher\\model.ts",
|
"path": "src\\models\\contemporary-props\\fire-extinguisher\\model.ts",
|
||||||
|
|
@ -867,7 +867,7 @@
|
||||||
"address": "@contemporary-props/pedestal-basin",
|
"address": "@contemporary-props/pedestal-basin",
|
||||||
"source": "file:contemporary-props/dist/registry.json",
|
"source": "file:contemporary-props/dist/registry.json",
|
||||||
"version": "workspace",
|
"version": "workspace",
|
||||||
"installedAt": "2026-09-04T22:13:41.836Z",
|
"installedAt": "2026-09-04T22:21:51.147Z",
|
||||||
"files": [
|
"files": [
|
||||||
{
|
{
|
||||||
"path": "src\\models\\contemporary-props\\pedestal-basin\\model.ts",
|
"path": "src\\models\\contemporary-props\\pedestal-basin\\model.ts",
|
||||||
|
|
@ -882,7 +882,7 @@
|
||||||
"address": "@contemporary-props/jersey-barrier",
|
"address": "@contemporary-props/jersey-barrier",
|
||||||
"source": "file:contemporary-props/dist/registry.json",
|
"source": "file:contemporary-props/dist/registry.json",
|
||||||
"version": "workspace",
|
"version": "workspace",
|
||||||
"installedAt": "2026-09-04T22:13:41.829Z",
|
"installedAt": "2026-09-04T22:21:51.140Z",
|
||||||
"files": [
|
"files": [
|
||||||
{
|
{
|
||||||
"path": "src\\models\\contemporary-props\\jersey-barrier\\model.ts",
|
"path": "src\\models\\contemporary-props\\jersey-barrier\\model.ts",
|
||||||
|
|
@ -897,7 +897,7 @@
|
||||||
"address": "@contemporary-props/picnic-table",
|
"address": "@contemporary-props/picnic-table",
|
||||||
"source": "file:contemporary-props/dist/registry.json",
|
"source": "file:contemporary-props/dist/registry.json",
|
||||||
"version": "workspace",
|
"version": "workspace",
|
||||||
"installedAt": "2026-09-04T22:13:41.838Z",
|
"installedAt": "2026-09-04T22:21:51.149Z",
|
||||||
"files": [
|
"files": [
|
||||||
{
|
{
|
||||||
"path": "src\\models\\contemporary-props\\picnic-table\\model.ts",
|
"path": "src\\models\\contemporary-props\\picnic-table\\model.ts",
|
||||||
|
|
@ -912,7 +912,7 @@
|
||||||
"address": "@contemporary-props/park-bench",
|
"address": "@contemporary-props/park-bench",
|
||||||
"source": "file:contemporary-props/dist/registry.json",
|
"source": "file:contemporary-props/dist/registry.json",
|
||||||
"version": "workspace",
|
"version": "workspace",
|
||||||
"installedAt": "2026-09-04T22:13:41.834Z",
|
"installedAt": "2026-09-04T22:21:51.145Z",
|
||||||
"files": [
|
"files": [
|
||||||
{
|
{
|
||||||
"path": "src\\models\\contemporary-props\\park-bench\\model.ts",
|
"path": "src\\models\\contemporary-props\\park-bench\\model.ts",
|
||||||
|
|
@ -927,7 +927,7 @@
|
||||||
"address": "@contemporary-props/pavement-sign-board",
|
"address": "@contemporary-props/pavement-sign-board",
|
||||||
"source": "file:contemporary-props/dist/registry.json",
|
"source": "file:contemporary-props/dist/registry.json",
|
||||||
"version": "workspace",
|
"version": "workspace",
|
||||||
"installedAt": "2026-09-04T22:13:41.835Z",
|
"installedAt": "2026-09-04T22:21:51.146Z",
|
||||||
"files": [
|
"files": [
|
||||||
{
|
{
|
||||||
"path": "src\\models\\contemporary-props\\pavement-sign-board\\model.ts",
|
"path": "src\\models\\contemporary-props\\pavement-sign-board\\model.ts",
|
||||||
|
|
@ -942,7 +942,7 @@
|
||||||
"address": "@contemporary-props/lectern",
|
"address": "@contemporary-props/lectern",
|
||||||
"source": "file:contemporary-props/dist/registry.json",
|
"source": "file:contemporary-props/dist/registry.json",
|
||||||
"version": "workspace",
|
"version": "workspace",
|
||||||
"installedAt": "2026-09-04T22:13:41.831Z",
|
"installedAt": "2026-09-04T22:21:51.141Z",
|
||||||
"files": [
|
"files": [
|
||||||
{
|
{
|
||||||
"path": "src\\models\\contemporary-props\\lectern\\model.ts",
|
"path": "src\\models\\contemporary-props\\lectern\\model.ts",
|
||||||
|
|
@ -957,7 +957,7 @@
|
||||||
"address": "@contemporary-props/bike-rack",
|
"address": "@contemporary-props/bike-rack",
|
||||||
"source": "file:contemporary-props/dist/registry.json",
|
"source": "file:contemporary-props/dist/registry.json",
|
||||||
"version": "workspace",
|
"version": "workspace",
|
||||||
"installedAt": "2026-09-04T22:13:41.822Z",
|
"installedAt": "2026-09-04T22:21:51.130Z",
|
||||||
"files": [
|
"files": [
|
||||||
{
|
{
|
||||||
"path": "src\\models\\contemporary-props\\bike-rack\\model.ts",
|
"path": "src\\models\\contemporary-props\\bike-rack\\model.ts",
|
||||||
|
|
@ -972,7 +972,7 @@
|
||||||
"address": "@contemporary-props/cable-drum",
|
"address": "@contemporary-props/cable-drum",
|
||||||
"source": "file:contemporary-props/dist/registry.json",
|
"source": "file:contemporary-props/dist/registry.json",
|
||||||
"version": "workspace",
|
"version": "workspace",
|
||||||
"installedAt": "2026-09-04T22:13:41.824Z",
|
"installedAt": "2026-09-04T22:21:51.133Z",
|
||||||
"files": [
|
"files": [
|
||||||
{
|
{
|
||||||
"path": "src\\models\\contemporary-props\\cable-drum\\model.ts",
|
"path": "src\\models\\contemporary-props\\cable-drum\\model.ts",
|
||||||
|
|
@ -987,7 +987,7 @@
|
||||||
"address": "@contemporary-props/litter-bin",
|
"address": "@contemporary-props/litter-bin",
|
||||||
"source": "file:contemporary-props/dist/registry.json",
|
"source": "file:contemporary-props/dist/registry.json",
|
||||||
"version": "workspace",
|
"version": "workspace",
|
||||||
"installedAt": "2026-09-04T22:13:41.832Z",
|
"installedAt": "2026-09-04T22:21:51.142Z",
|
||||||
"files": [
|
"files": [
|
||||||
{
|
{
|
||||||
"path": "src\\models\\contemporary-props\\litter-bin\\model.ts",
|
"path": "src\\models\\contemporary-props\\litter-bin\\model.ts",
|
||||||
|
|
@ -1002,7 +1002,7 @@
|
||||||
"address": "@contemporary-props/temporary-fence-panel",
|
"address": "@contemporary-props/temporary-fence-panel",
|
||||||
"source": "file:contemporary-props/dist/registry.json",
|
"source": "file:contemporary-props/dist/registry.json",
|
||||||
"version": "workspace",
|
"version": "workspace",
|
||||||
"installedAt": "2026-09-04T22:13:41.841Z",
|
"installedAt": "2026-09-04T22:21:51.153Z",
|
||||||
"files": [
|
"files": [
|
||||||
{
|
{
|
||||||
"path": "src\\models\\contemporary-props\\temporary-fence-panel\\model.ts",
|
"path": "src\\models\\contemporary-props\\temporary-fence-panel\\model.ts",
|
||||||
|
|
@ -1017,7 +1017,7 @@
|
||||||
"address": "@contemporary-props/wheeled-waste-bin",
|
"address": "@contemporary-props/wheeled-waste-bin",
|
||||||
"source": "file:contemporary-props/dist/registry.json",
|
"source": "file:contemporary-props/dist/registry.json",
|
||||||
"version": "workspace",
|
"version": "workspace",
|
||||||
"installedAt": "2026-09-04T22:13:41.844Z",
|
"installedAt": "2026-09-04T22:21:51.157Z",
|
||||||
"files": [
|
"files": [
|
||||||
{
|
{
|
||||||
"path": "src\\models\\contemporary-props\\wheeled-waste-bin\\model.ts",
|
"path": "src\\models\\contemporary-props\\wheeled-waste-bin\\model.ts",
|
||||||
|
|
@ -1032,7 +1032,7 @@
|
||||||
"address": "@contemporary-props/utility-cabinet",
|
"address": "@contemporary-props/utility-cabinet",
|
||||||
"source": "file:contemporary-props/dist/registry.json",
|
"source": "file:contemporary-props/dist/registry.json",
|
||||||
"version": "workspace",
|
"version": "workspace",
|
||||||
"installedAt": "2026-09-04T22:13:41.843Z",
|
"installedAt": "2026-09-04T22:21:51.155Z",
|
||||||
"files": [
|
"files": [
|
||||||
{
|
{
|
||||||
"path": "src\\models\\contemporary-props\\utility-cabinet\\model.ts",
|
"path": "src\\models\\contemporary-props\\utility-cabinet\\model.ts",
|
||||||
|
|
@ -1047,7 +1047,7 @@
|
||||||
"address": "@contemporary-props/parcel-locker-bank",
|
"address": "@contemporary-props/parcel-locker-bank",
|
||||||
"source": "file:contemporary-props/dist/registry.json",
|
"source": "file:contemporary-props/dist/registry.json",
|
||||||
"version": "workspace",
|
"version": "workspace",
|
||||||
"installedAt": "2026-09-04T22:13:41.833Z",
|
"installedAt": "2026-09-04T22:21:51.144Z",
|
||||||
"files": [
|
"files": [
|
||||||
{
|
{
|
||||||
"path": "src\\models\\contemporary-props\\parcel-locker-bank\\model.ts",
|
"path": "src\\models\\contemporary-props\\parcel-locker-bank\\model.ts",
|
||||||
|
|
@ -1062,7 +1062,7 @@
|
||||||
"address": "@contemporary-props/boom-barrier",
|
"address": "@contemporary-props/boom-barrier",
|
||||||
"source": "file:contemporary-props/dist/registry.json",
|
"source": "file:contemporary-props/dist/registry.json",
|
||||||
"version": "workspace",
|
"version": "workspace",
|
||||||
"installedAt": "2026-09-04T22:13:41.823Z",
|
"installedAt": "2026-09-04T22:21:51.131Z",
|
||||||
"files": [
|
"files": [
|
||||||
{
|
{
|
||||||
"path": "src\\models\\contemporary-props\\boom-barrier\\model.ts",
|
"path": "src\\models\\contemporary-props\\boom-barrier\\model.ts",
|
||||||
|
|
@ -1072,6 +1072,21 @@
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
"three@>=0.185.0"
|
"three@>=0.185.0"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"@contemporary-props/fire-hydrant": {
|
||||||
|
"address": "@contemporary-props/fire-hydrant",
|
||||||
|
"source": "file:contemporary-props/dist/registry.json",
|
||||||
|
"version": "workspace",
|
||||||
|
"installedAt": "2026-09-04T22:21:51.137Z",
|
||||||
|
"files": [
|
||||||
|
{
|
||||||
|
"path": "src\\models\\contemporary-props\\fire-hydrant\\model.ts",
|
||||||
|
"sourceHash": "4fcce06d8d26d762cccee89a85be09f1a55b266425d7abadf7ccf0a6b4e1af15"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"dependencies": [
|
||||||
|
"three@>=0.185.0"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,7 @@ import { createModel as createCpWasteBin } from '@/models/contemporary-props/whe
|
||||||
import { createModel as createCpUtilityCabinet } from '@/models/contemporary-props/utility-cabinet/model.ts'
|
import { createModel as createCpUtilityCabinet } from '@/models/contemporary-props/utility-cabinet/model.ts'
|
||||||
import { createModel as createCpLockerBank } from '@/models/contemporary-props/parcel-locker-bank/model.ts'
|
import { createModel as createCpLockerBank } from '@/models/contemporary-props/parcel-locker-bank/model.ts'
|
||||||
import { createModel as createCpBoomBarrier } from '@/models/contemporary-props/boom-barrier/model.ts'
|
import { createModel as createCpBoomBarrier } from '@/models/contemporary-props/boom-barrier/model.ts'
|
||||||
|
import { createModel as createCpFireHydrant } from '@/models/contemporary-props/fire-hydrant/model.ts'
|
||||||
import { createModel as createCpPavementSign } from '@/models/contemporary-props/pavement-sign-board/model.ts'
|
import { createModel as createCpPavementSign } from '@/models/contemporary-props/pavement-sign-board/model.ts'
|
||||||
import { createModel as createCpLectern } from '@/models/contemporary-props/lectern/model.ts'
|
import { createModel as createCpLectern } from '@/models/contemporary-props/lectern/model.ts'
|
||||||
import cpMetaCeramicVase from '../contemporary-props/models/ceramic-vase/meta.json'
|
import cpMetaCeramicVase from '../contemporary-props/models/ceramic-vase/meta.json'
|
||||||
|
|
@ -95,6 +96,7 @@ import cpMetaWasteBin from '../contemporary-props/models/wheeled-waste-bin/meta.
|
||||||
import cpMetaUtilityCabinet from '../contemporary-props/models/utility-cabinet/meta.json'
|
import cpMetaUtilityCabinet from '../contemporary-props/models/utility-cabinet/meta.json'
|
||||||
import cpMetaLockerBank from '../contemporary-props/models/parcel-locker-bank/meta.json'
|
import cpMetaLockerBank from '../contemporary-props/models/parcel-locker-bank/meta.json'
|
||||||
import cpMetaBoomBarrier from '../contemporary-props/models/boom-barrier/meta.json'
|
import cpMetaBoomBarrier from '../contemporary-props/models/boom-barrier/meta.json'
|
||||||
|
import cpMetaFireHydrant from '../contemporary-props/models/fire-hydrant/meta.json'
|
||||||
import cpMetaPavementSign from '../contemporary-props/models/pavement-sign-board/meta.json'
|
import cpMetaPavementSign from '../contemporary-props/models/pavement-sign-board/meta.json'
|
||||||
import cpMetaLectern from '../contemporary-props/models/lectern/meta.json'
|
import cpMetaLectern from '../contemporary-props/models/lectern/meta.json'
|
||||||
import { createModel as createShield } from '@/models/medieval-kit/round-shield/model.ts'
|
import { createModel as createShield } from '@/models/medieval-kit/round-shield/model.ts'
|
||||||
|
|
@ -322,6 +324,7 @@ const CONTEMPORARY_ORDER = [
|
||||||
'utility-cabinet',
|
'utility-cabinet',
|
||||||
'parcel-locker-bank',
|
'parcel-locker-bank',
|
||||||
'boom-barrier',
|
'boom-barrier',
|
||||||
|
'fire-hydrant',
|
||||||
] as const
|
] as const
|
||||||
|
|
||||||
const CONTEMPORARY_FACTORIES: Readonly<Record<string, () => KitModel>> = {
|
const CONTEMPORARY_FACTORIES: Readonly<Record<string, () => KitModel>> = {
|
||||||
|
|
@ -346,6 +349,7 @@ const CONTEMPORARY_FACTORIES: Readonly<Record<string, () => KitModel>> = {
|
||||||
'utility-cabinet': as(createCpUtilityCabinet),
|
'utility-cabinet': as(createCpUtilityCabinet),
|
||||||
'parcel-locker-bank': as(createCpLockerBank),
|
'parcel-locker-bank': as(createCpLockerBank),
|
||||||
'boom-barrier': as(createCpBoomBarrier),
|
'boom-barrier': as(createCpBoomBarrier),
|
||||||
|
'fire-hydrant': as(createCpFireHydrant),
|
||||||
'pavement-sign-board': as(createCpPavementSign),
|
'pavement-sign-board': as(createCpPavementSign),
|
||||||
'lectern': as(createCpLectern),
|
'lectern': as(createCpLectern),
|
||||||
}
|
}
|
||||||
|
|
@ -372,6 +376,7 @@ const CONTEMPORARY_META: Readonly<Record<string, ModelMetaLike>> = {
|
||||||
'utility-cabinet': cpMetaUtilityCabinet as ModelMetaLike,
|
'utility-cabinet': cpMetaUtilityCabinet as ModelMetaLike,
|
||||||
'parcel-locker-bank': cpMetaLockerBank as ModelMetaLike,
|
'parcel-locker-bank': cpMetaLockerBank as ModelMetaLike,
|
||||||
'boom-barrier': cpMetaBoomBarrier as ModelMetaLike,
|
'boom-barrier': cpMetaBoomBarrier as ModelMetaLike,
|
||||||
|
'fire-hydrant': cpMetaFireHydrant as ModelMetaLike,
|
||||||
'pavement-sign-board': cpMetaPavementSign as ModelMetaLike,
|
'pavement-sign-board': cpMetaPavementSign as ModelMetaLike,
|
||||||
'lectern': cpMetaLectern as ModelMetaLike,
|
'lectern': cpMetaLectern as ModelMetaLike,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
310
src/models/contemporary-props/fire-hydrant/model.ts
Normal file
310
src/models/contemporary-props/fire-hydrant/model.ts
Normal file
|
|
@ -0,0 +1,310 @@
|
||||||
|
/**
|
||||||
|
* @contemporary-props/fire-hydrant
|
||||||
|
*
|
||||||
|
* Bonnet, bolted flanges and radial outlets: a stepped lathe stack that names
|
||||||
|
* itself at fifty metres, which is what the catalogue puts it sixty-second for
|
||||||
|
* and is the honest description of the whole model. There is no clever
|
||||||
|
* geometry here. There is a profile with eleven steps in it, and every one of
|
||||||
|
* them is a step somebody cast for a reason.
|
||||||
|
*
|
||||||
|
* Measured off the reference against a 900 mm hydrant, as fractions of that:
|
||||||
|
*
|
||||||
|
* 0.000 the foot flange, and the break flange bolted above it
|
||||||
|
* 0.157 the lower barrel
|
||||||
|
* 0.282 the raised band where the barrel changes section
|
||||||
|
* 0.580 the outlets, three of them on one radial array
|
||||||
|
* 0.737 the bonnet flange
|
||||||
|
* 0.965 the fluted dome
|
||||||
|
* 1.000 the operating nut, which is a pentagon so nothing but a hydrant
|
||||||
|
* wrench will turn it
|
||||||
|
*
|
||||||
|
* The caps swing on their chains, which is the catalogue's action, and it is
|
||||||
|
* the one place this model is not a lathe. Each cap is its own part with the
|
||||||
|
* hinge as its origin, and the anchor carries TWO rotations in YXZ order: a
|
||||||
|
* fixed Y that places the cap round the barrel, and an X that is the swing.
|
||||||
|
* Written with one part for all three, the swing would carry them round the
|
||||||
|
* hydrant rather than down its side, because a single anchor has a single axis.
|
||||||
|
*/
|
||||||
|
import { type BufferGeometry, type Object3D } from 'three'
|
||||||
|
|
||||||
|
import {
|
||||||
|
bakeOcclusion,
|
||||||
|
createKitModel,
|
||||||
|
createTinter,
|
||||||
|
jitter,
|
||||||
|
latheGeometry,
|
||||||
|
mergeColoured,
|
||||||
|
smoothNormals,
|
||||||
|
tubeGeometry,
|
||||||
|
type RuntimeContext,
|
||||||
|
type Vec3,
|
||||||
|
} from '../core/index.ts'
|
||||||
|
|
||||||
|
export interface FireHydrantConfig {
|
||||||
|
/** Height to the top of the operating nut (metres). */
|
||||||
|
readonly height: number
|
||||||
|
/** Outlets round the barrel. */
|
||||||
|
readonly outlets: number
|
||||||
|
/** How far the caps are swung off, 0 shut to 1 hanging. */
|
||||||
|
readonly unscrewed: number
|
||||||
|
/** Sides on the barrel's revolve. */
|
||||||
|
readonly segments: number
|
||||||
|
readonly seed: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export const fireHydrantDefaults: FireHydrantConfig = {
|
||||||
|
height: 0.9,
|
||||||
|
outlets: 3,
|
||||||
|
unscrewed: 0,
|
||||||
|
segments: 26,
|
||||||
|
seed: 97,
|
||||||
|
}
|
||||||
|
|
||||||
|
export type FireHydrantParts = 'body' | 'chains' | 'capA' | 'capB' | 'capC'
|
||||||
|
|
||||||
|
export interface FireHydrantActions {
|
||||||
|
/** Swings the caps off their outlets. 1 is hanging on the chain. */
|
||||||
|
unscrew(amount?: number): void
|
||||||
|
}
|
||||||
|
|
||||||
|
const CAPS = ['capA', 'capB', 'capC'] as const
|
||||||
|
|
||||||
|
function applyUnscrew(
|
||||||
|
runtime: RuntimeContext<FireHydrantConfig, FireHydrantParts>,
|
||||||
|
amount: number,
|
||||||
|
): void {
|
||||||
|
const outlets = Math.max(1, Math.min(3, Math.round(runtime.getConfig().outlets)))
|
||||||
|
const swing = Math.min(1, Math.max(0, amount)) * 2.1
|
||||||
|
for (let i = 0; i < CAPS.length; i += 1) {
|
||||||
|
const anchor = runtime.parts[CAPS[i]!].anchor as Object3D
|
||||||
|
// YXZ, so the Y that places the cap round the barrel is applied FIRST and
|
||||||
|
// the X swing then happens in that placed frame -- which is the tangential
|
||||||
|
// axis a cap actually hinges about.
|
||||||
|
anchor.rotation.order = 'YXZ'
|
||||||
|
anchor.rotation.y = (i / outlets) * Math.PI * 2
|
||||||
|
anchor.rotation.x = i < outlets ? swing : 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function createModel(overrides: Partial<FireHydrantConfig> = {}) {
|
||||||
|
let heldUnscrew = 0
|
||||||
|
let seenUnscrew = Number.NaN
|
||||||
|
|
||||||
|
return createKitModel<
|
||||||
|
FireHydrantConfig, 'retroreflective' | 'stainless', FireHydrantParts, FireHydrantActions
|
||||||
|
>({
|
||||||
|
id: 'fire-hydrant',
|
||||||
|
defaults: fireHydrantDefaults,
|
||||||
|
slots: ['retroreflective', 'stainless'],
|
||||||
|
|
||||||
|
build: ({ config, random }) => {
|
||||||
|
const tint = createTinter(random)
|
||||||
|
const H = Math.min(1.4, Math.max(0.5, config.height))
|
||||||
|
const outlets = Math.max(1, Math.min(3, Math.round(config.outlets)))
|
||||||
|
const segments = Math.max(12, Math.round(config.segments))
|
||||||
|
|
||||||
|
const red = tint('retroreflective', -0.03 + jitter(random, 0.02), 0.8)
|
||||||
|
const deep = tint('retroreflective', -0.1, 0.6)
|
||||||
|
const steel = tint('stainless', -0.04, 0.3).offsetHSL(0, -1, 0)
|
||||||
|
|
||||||
|
const R = H * 0.122
|
||||||
|
const outletY = H * 0.58
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The barrel, as ONE lathe.
|
||||||
|
*
|
||||||
|
* Every step in it is a casting feature: the foot the hydrant is bolted
|
||||||
|
* down through, the break flange it is designed to shear at when a car
|
||||||
|
* hits it, the band where the barrel changes section, the shoulder the
|
||||||
|
* outlets grow out of, the bonnet flange. Stacked as separate cylinders
|
||||||
|
* this is a dozen pieces with a dozen pairs of coincident faces; as one
|
||||||
|
* profile it is a solid with no interior at all.
|
||||||
|
*/
|
||||||
|
const bodyPieces: BufferGeometry[] = [latheGeometry([
|
||||||
|
{ y: 0, radius: R * 1.42 },
|
||||||
|
{ y: H * 0.022, radius: R * 1.42 },
|
||||||
|
{ y: H * 0.03, radius: R * 1.28 },
|
||||||
|
{ y: H * 0.058, radius: R * 1.28 },
|
||||||
|
{ y: H * 0.07, radius: R * 1.4 },
|
||||||
|
{ y: H * 0.1, radius: R * 1.4 },
|
||||||
|
{ y: H * 0.112, radius: R * 1.02 },
|
||||||
|
{ y: H * 0.157, radius: R * 0.99 },
|
||||||
|
{ y: H * 0.268, radius: R * 0.96 },
|
||||||
|
// The band, which is where a dry-barrel hydrant's two castings meet.
|
||||||
|
{ y: H * 0.282, radius: R * 1.06 },
|
||||||
|
{ y: H * 0.31, radius: R * 1.06 },
|
||||||
|
{ y: H * 0.322, radius: R * 0.9 },
|
||||||
|
{ y: H * 0.47, radius: R * 0.87 },
|
||||||
|
// The shoulder the outlets come out of: the barrel swells to take them
|
||||||
|
// and this bulge is most of what reads as a hydrant in silhouette.
|
||||||
|
{ y: outletY, radius: R * 0.98 },
|
||||||
|
{ y: H * 0.66, radius: R * 0.86 },
|
||||||
|
{ y: H * 0.72, radius: R * 0.84 },
|
||||||
|
{ y: H * 0.737, radius: R * 1.36 },
|
||||||
|
{ y: H * 0.79, radius: R * 1.36 },
|
||||||
|
{ y: H * 0.806, radius: R * 1.24 },
|
||||||
|
{ y: H * 0.831, radius: R * 1.24 },
|
||||||
|
// The dome.
|
||||||
|
{ y: H * 0.87, radius: R * 1.02 },
|
||||||
|
{ y: H * 0.915, radius: R * 0.74 },
|
||||||
|
{ y: H * 0.95, radius: R * 0.34 },
|
||||||
|
{ y: H * 0.965, radius: R * 0.22 },
|
||||||
|
], segments, [0, 0, 0], red, { colourTop: deep, capBottom: true, capTop: true })]
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The dome's RIBS.
|
||||||
|
*
|
||||||
|
* A hydrant's bonnet is a casting with vertical ribs running over it, and
|
||||||
|
* without them the dome is a plain hemisphere that could belong to a
|
||||||
|
* bollard. They are a radial array of thin blades following the same
|
||||||
|
* profile the dome does, standing a couple of millimetres proud.
|
||||||
|
*/
|
||||||
|
const domeLevels = [
|
||||||
|
[0.831, 1.24], [0.87, 1.02], [0.915, 0.74], [0.95, 0.34],
|
||||||
|
] as const
|
||||||
|
for (let i = 0; i < 10; i += 1) {
|
||||||
|
const a = (i / 10) * Math.PI * 2
|
||||||
|
const rib = latheGeometry(
|
||||||
|
domeLevels.map(([y, r]) => ({ y: H * y, radius: R * r * 1.022 })),
|
||||||
|
3, [0, 0, 0], deep, { capBottom: false, capTop: false },
|
||||||
|
)
|
||||||
|
rib.rotateY(a)
|
||||||
|
bodyPieces.push(rib)
|
||||||
|
}
|
||||||
|
|
||||||
|
// The operating nut: a PENTAGON, which is the whole point of it. A hex
|
||||||
|
// nut can be turned by anything in a toolbox; five sides is what makes a
|
||||||
|
// hydrant need a hydrant wrench.
|
||||||
|
bodyPieces.push(latheGeometry([
|
||||||
|
{ y: H * 0.96, radius: R * 0.3 },
|
||||||
|
{ y: H * 0.972, radius: R * 0.27 },
|
||||||
|
{ y: H * 1, radius: R * 0.25 },
|
||||||
|
], 5, [0, 0, 0], red, { capBottom: false, capTop: true }))
|
||||||
|
|
||||||
|
/** Bolt heads round a flange, which is what says a casting was bolted. */
|
||||||
|
const bolts = (y: number, radius: number, count: number): void => {
|
||||||
|
for (let i = 0; i < count; i += 1) {
|
||||||
|
const a = ((i + 0.5) / count) * Math.PI * 2
|
||||||
|
bodyPieces.push(latheGeometry([
|
||||||
|
{ y: 0, radius: R * 0.1 },
|
||||||
|
{ y: H * 0.012, radius: R * 0.092 },
|
||||||
|
{ y: H * 0.016, radius: R * 0.05 },
|
||||||
|
], 6, [Math.sin(a) * radius, y, Math.cos(a) * radius], steel,
|
||||||
|
{ capBottom: false, capTop: true }))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
bolts(H * 0.102, R * 1.26, 8)
|
||||||
|
bolts(H * 0.792, R * 1.24, 8)
|
||||||
|
|
||||||
|
/* ------------------------------------------------------ the outlets */
|
||||||
|
/**
|
||||||
|
* The spigots stay on the body; only the caps come off.
|
||||||
|
*
|
||||||
|
* Built at angle zero and turned into place, so one description makes all
|
||||||
|
* three -- and the caps, which are separate parts, are built in exactly
|
||||||
|
* the same unrotated frame so their anchors can place them the same way.
|
||||||
|
*/
|
||||||
|
// Three quarters of the barrel across, off the reference: at half it read
|
||||||
|
// as a bolt boss rather than as something a hose couples to, and the
|
||||||
|
// outlets are most of what names a hydrant in silhouette.
|
||||||
|
const spigotR = R * 0.72
|
||||||
|
const reach = R * 1.5
|
||||||
|
const capPieces: BufferGeometry[][] = [[], [], []]
|
||||||
|
const chainPieces: BufferGeometry[] = []
|
||||||
|
|
||||||
|
for (let i = 0; i < outlets; i += 1) {
|
||||||
|
const a = (i / outlets) * Math.PI * 2
|
||||||
|
|
||||||
|
const spigot = latheGeometry([
|
||||||
|
{ y: R * 0.5, radius: spigotR * 1.14 },
|
||||||
|
{ y: reach - R * 0.2, radius: spigotR * 1.08 },
|
||||||
|
{ y: reach - R * 0.1, radius: spigotR * 1.22 },
|
||||||
|
{ y: reach, radius: spigotR * 1.22 },
|
||||||
|
], 18, [0, 0, 0], red, { capBottom: false, capTop: false })
|
||||||
|
spigot.rotateX(Math.PI / 2)
|
||||||
|
spigot.rotateY(a)
|
||||||
|
spigot.translate(0, outletY, 0)
|
||||||
|
bodyPieces.push(spigot)
|
||||||
|
|
||||||
|
// The cap, in the UNROTATED frame with the hinge at the origin: the
|
||||||
|
// anchor's Y puts it round the barrel and its X swings it down.
|
||||||
|
const cap = mergeColoured([
|
||||||
|
latheGeometry([
|
||||||
|
{ y: 0, radius: spigotR * 1.26 },
|
||||||
|
{ y: R * 0.18, radius: spigotR * 1.26 },
|
||||||
|
{ y: R * 0.26, radius: spigotR * 1.1 },
|
||||||
|
], 18, [0, 0, 0], red, { capBottom: false, capTop: true }),
|
||||||
|
// The hex the cap is turned by.
|
||||||
|
latheGeometry([
|
||||||
|
{ y: R * 0.24, radius: spigotR * 0.52 },
|
||||||
|
{ y: R * 0.44, radius: spigotR * 0.46 },
|
||||||
|
], 6, [0, 0, 0], red, { capBottom: false, capTop: true }),
|
||||||
|
])
|
||||||
|
cap.rotateX(Math.PI / 2)
|
||||||
|
cap.translate(0, 0, reach)
|
||||||
|
capPieces[i] = [cap]
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The chain, which is what makes a cap a cap rather than a lid.
|
||||||
|
*
|
||||||
|
* It hangs in a real catenary rather than a straight line: a chain
|
||||||
|
* drawn taut between two points reads as a rod, and the sag is the only
|
||||||
|
* thing that says the thing is flexible. Three sample points and a
|
||||||
|
* sine are enough at this size.
|
||||||
|
*/
|
||||||
|
const from: Vec3 = [0, outletY - R * 0.18, reach * 0.78]
|
||||||
|
const to: Vec3 = [0, outletY - R * 1.15, R * 0.82]
|
||||||
|
const path: Vec3[] = []
|
||||||
|
for (let k = 0; k <= 8; k += 1) {
|
||||||
|
const t = k / 8
|
||||||
|
path.push([
|
||||||
|
0,
|
||||||
|
from[1] + (to[1] - from[1]) * t - Math.sin(t * Math.PI) * R * 0.5,
|
||||||
|
from[2] + (to[2] - from[2]) * t,
|
||||||
|
])
|
||||||
|
}
|
||||||
|
// No caps: both ends are buried, one in the cap's boss and one in the
|
||||||
|
// barrel, and the discs there were three pairs of coincident faces.
|
||||||
|
const chain = tubeGeometry(path, R * 0.05, 6, steel, { capStart: false, capEnd: false })
|
||||||
|
chain.rotateY(a)
|
||||||
|
chainPieces.push(chain)
|
||||||
|
}
|
||||||
|
|
||||||
|
bakeOcclusion(bodyPieces, { strength: 0.35 })
|
||||||
|
|
||||||
|
const hinge = [0, outletY, 0] as const
|
||||||
|
const capPart = (i: number): {
|
||||||
|
slot: 'retroreflective'
|
||||||
|
geometry: BufferGeometry
|
||||||
|
origin: readonly [number, number, number]
|
||||||
|
} | undefined => (capPieces[i]!.length === 0 ? undefined : {
|
||||||
|
slot: 'retroreflective' as const,
|
||||||
|
geometry: smoothNormals(mergeColoured(capPieces[i]!), 34),
|
||||||
|
origin: hinge,
|
||||||
|
})
|
||||||
|
|
||||||
|
return {
|
||||||
|
body: { slot: 'retroreflective' as const, geometry: smoothNormals(mergeColoured(bodyPieces), 34) },
|
||||||
|
chains: chainPieces.length === 0
|
||||||
|
? undefined
|
||||||
|
: { slot: 'stainless' as const, geometry: smoothNormals(mergeColoured(chainPieces), 40) },
|
||||||
|
capA: capPart(0),
|
||||||
|
capB: capPart(1),
|
||||||
|
capC: capPart(2),
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
actions: (runtime) => {
|
||||||
|
heldUnscrew = runtime.getConfig().unscrewed
|
||||||
|
seenUnscrew = heldUnscrew
|
||||||
|
applyUnscrew(runtime, heldUnscrew)
|
||||||
|
return { unscrew: (amount = 1) => { heldUnscrew = amount; applyUnscrew(runtime, amount) } }
|
||||||
|
},
|
||||||
|
|
||||||
|
update: (_dt, runtime) => {
|
||||||
|
const wanted = runtime.getConfig().unscrewed
|
||||||
|
if (wanted !== seenUnscrew) { seenUnscrew = wanted; heldUnscrew = wanted }
|
||||||
|
applyUnscrew(runtime, heldUnscrew)
|
||||||
|
},
|
||||||
|
}, overrides)
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue