73 lines
4.5 KiB
JavaScript
73 lines
4.5 KiB
JavaScript
// Типовий проект «Залізнична станція» (магазин держави, будівельні тендери): a station building in the quarter's
|
|
// brick style, a platform 3 x 24 under a slab canopy on posts, and one straight Create track on ballast along it.
|
|
// The platform and the building's floor are one level (y 2), a step above the track bed, so a Create train's
|
|
// carriage floor lines up with the platform. The street is to the north (steps up to the waiting room), the track
|
|
// to the south. The train station block and signals are the owner's: they need a track network to link to.
|
|
// The schematic starts at y 1 (ballast and platform base); the plot's ground is the buyer's.
|
|
const K = require('../civic/kit')
|
|
const { C, P, post, beam } = K
|
|
|
|
const X1 = 0; const X2 = 23 // platform and track length
|
|
const stairs = (facing, mat = 'stone_brick', half = 'bottom') => [mat + '_stairs', { facing, half, shape: 'straight' }]
|
|
|
|
function build () {
|
|
const ctx = K.start(); const { w, R } = ctx
|
|
w.box(X1, 0, 0, X2, 0, 15, 'grass_block') // only for the renders: below the schematic
|
|
const B = K.body(ctx, { x1: 7, z1: 2, x2: 16, z2: 8, storeys: 1, y0: 2, name: 'waiting' })
|
|
|
|
// street side: steps up to a landing and the door into the waiting room
|
|
for (let x = 10; x <= 13; x++) { w.set(x, 1, 0, ...stairs('south')); w.set(x, 1, 1, P.plinth); w.set(x, 2, 1, P.plinth) }
|
|
for (let x = 10; x <= 13; x++) w.clear(x, 3, 1)
|
|
B.door('north', 11, 0)
|
|
for (const a of [8, 15]) B.window('north', a, 0, { width: 1 })
|
|
for (const side of ['east', 'west']) B.window(side, 5, 0, { width: 1 })
|
|
// platform side: a double door and the ticket window
|
|
B.door('south', 11, 0)
|
|
B.window('south', 8, 0, { width: 2 }); B.window('south', 14, 0, { width: 2 })
|
|
|
|
// platform z 9..11 at the floor level, a light edge stone along the track
|
|
for (let x = X1; x <= X2; x++) for (let z = 9; z <= 11; z++) {
|
|
w.set(x, 1, z, P.plinth); w.set(x, 2, z, z === 11 ? 'polished_andesite' : P.pave)
|
|
}
|
|
for (let x = 11; x <= 12; x++) w.clear(x, 3, 9) // the facade strip stays clear in front of the door
|
|
// ballast and the track
|
|
for (let x = X1; x <= X2; x++) {
|
|
for (let z = 12; z <= 14; z++) w.set(x, 1, z, 'gravel')
|
|
w.set(x, 2, 13, C('track'), { shape: 'xo', turn: false, waterlogged: false })
|
|
}
|
|
|
|
// canopy: posts on the building side of the platform, a beam, a slab roof reaching over the platform edge
|
|
const posts = [0, 4, 19, 23]
|
|
for (const x of posts) for (let y = 3; y <= 6; y++) w.set(x, y, 9, ...post)
|
|
// brackets under the cantilever: upside-down stairs from each post (and from the wall under the building)
|
|
for (const x of [...posts, B.x1, B.x2]) w.set(x, 5, 10, ...stairs('north', 'dark_oak', 'top'))
|
|
for (let x = X1; x <= X2; x++) {
|
|
const underBuilding = x >= B.x1 && x <= B.x2
|
|
if (!underBuilding && !posts.includes(x)) w.set(x, 6, 9, ...beam('x'))
|
|
for (let z = 10; z <= 11; z++) w.set(x, 6, z, 'spruce_slab', { type: 'top' })
|
|
w.set(x, 6, 12, 'dark_oak_slab', { type: 'top' })
|
|
if (underBuilding) w.set(x, 6, 9, 'spruce_slab', { type: 'top' })
|
|
}
|
|
for (const x of [2, 6, 10, 13, 17, 21]) w.set(x, 5, 10, 'lantern', { hanging: true })
|
|
// benches against the wall and the posts, facing the track
|
|
for (const x of [1, 2, 20, 21]) w.set(x, 3, 9, ...stairs('north', 'spruce'))
|
|
for (const x of [8, 9, 14, 15]) w.set(x, 3, 9, ...stairs('north', 'spruce'))
|
|
w.set(5, 3, 9, 'barrel', { facing: 'up' }); w.set(18, 3, 9, 'barrel', { facing: 'up' })
|
|
|
|
// waiting room: ticket counter of industrial iron, benches, the clock and lanterns
|
|
for (let x = 13; x <= 15; x++) w.set(x, 3, 6, P.iron)
|
|
w.set(15, 3, 4, 'lectern', { facing: 'west' }) // timetable
|
|
for (const x of [8, 9]) { w.set(x, 3, 4, ...stairs('south', 'spruce')); w.set(x, 3, 6, ...stairs('north', 'spruce')) }
|
|
w.set(13, 4, 6, 'lantern', { hanging: false }); w.set(10, 4, 3, 'lantern', { hanging: false }) // no ceiling: they stand
|
|
w.set(10, 3, 3, 'barrel', { facing: 'up' })
|
|
|
|
R.gable(B.x1, B.z1, B.x2, B.z2, B.top, { axis: 'x', pitch: '1:1', overhang: 1, mat: 'spruce' })
|
|
const { roofCells, needCeiling } = R.finish(ctx.interiors)
|
|
K.trimRoof(w, roofCells, { axis: 'x', from: 6, to: 17, step: 4 })
|
|
B.gable('east', { width: 2, rows: 2 }); B.gable('west', { width: 2, rows: 2 })
|
|
|
|
return K.finish(ctx, { roofCells, needCeiling, entrance: { outside: [11, 3, 0], door: [11, 3, 2], side: 'north' },
|
|
reach: { counter: [12, 3, 5], platform: [11, 3, 10], platformEnd: [22, 3, 10] } })
|
|
}
|
|
module.exports = { build }
|