Data centres: multi-storey shell, racks and pods, cooling, fire safety, power
Deploy web Studio / deploy (push) Successful in 1m4s
Deploy web Studio / deploy (push) Successful in 1m4s
datacentre.rhai (palette groups Data centre, Cooling, Fire safety, Power): - dc_building: multi-storey shell (storeys of storey_h), walls in pieces, slabs, roof with parapet, louvres, front door and loading dock; levels cut it open storey by storey - raised_floor; rack_row and dc_pod (cabinets by U, width, depth, equipment, fill, doors, LEDs; in-row coolers; cold / hot aisle containment with vent tiles, roof, end doors, ceiling duct, airflow); dc_cage for colocation - crah, chiller (air-cooled, dry, adiabatic), cooling_tower, pipe_run - smoke_detectors (grid + coverage), fire_pipe (VESDA, sprinkler, gas), gas_bank (Novec 1230, FM-200, Inergen sized for its halls), fire_device (panels, call points, abort switches, beacons, extinguishers) - power_cab (UPS, battery, PDU, switchgear, RPP), busway, cable_tray, transformer - tooltips sum IT load, kW/m2, cooling redundancy per storey, UPS load, battery runtime, plant cooling and agent quantity (warning when short) Engine and stdlib: - part_hidden(o) in house.rhai: parts on closed storeys inside a dc_building are not drawn (they only made sort cycles under the slab above); house parts, furniture and people use it. Existing examples render byte-identical. - overhead services sort in their own "ceiling" layer with tight boxes - sort records which sprites each broken cycle involved; isokit check names them (Rendered.cycle_at) examples/datacentre (three storeys and a roof plant), Data centre demo in the web Studio, tests, SCRIPTING/README/ROADMAP, MCP instructions.
This commit is contained in:
1 parent
c8becc2e59
commit
2810477f1b
22 files changed
+2281
-18
No files matched your search
File diff suppressed because it is too large.
Load diff
@@ -3,7 +3,7 @@
|
||||
// on its object's z, so it can sit on any storey (see isokit/house). Pieces
|
||||
// on storeys above the one a level cuts open are left out.
|
||||
|
||||
fn furniture_hidden(o) { house_view(o) == 2 }
|
||||
fn furniture_hidden(o) { part_hidden(o) }
|
||||
fn wood_choices() { ["wood", "woodd", "furnw", "steel", "kitchenc"] }
|
||||
fn fabric_choices() { ["uph1", "uph2", "uph3", "uph4", "sofa", "bed", "cloth"] }
|
||||
|
||||
|
||||
@@ -27,11 +27,26 @@ fn house_view(o) {
|
||||
if s < k { 0 } else if s == k { 1 } else { 2 }
|
||||
}
|
||||
|
||||
/// Leave part o out? On a storey above the one a level cuts open, or on a
|
||||
/// closed storey inside a data centre shell (dc_building), whose walls and
|
||||
/// slabs hide it anyway (and would sort badly against what stands above).
|
||||
fn part_hidden(o) {
|
||||
let hv = house_view(o);
|
||||
if hv == 2 { return true; }
|
||||
if hv == 1 { return false; }
|
||||
let s = storey_of(o.z);
|
||||
for b in objects_at(["dc_building"], o.x, o.y) {
|
||||
let s0 = storey_of(b.z);
|
||||
if s >= s0 && s < s0 + b.p.storeys { return true; }
|
||||
}
|
||||
false
|
||||
}
|
||||
|
||||
fn wall_cut_h() { 1.0 }
|
||||
fn wall_types() { ["house_wall"] }
|
||||
fn opening_types() { ["window", "door"] }
|
||||
fn room_types() { ["floor"] }
|
||||
fn house_wall_materials() { ["render", "render2", "brick", "wood", "wall", "wall2", "wallp", "concb", "office", "furnw"] }
|
||||
fn room_types() { ["floor", "raised_floor"] }
|
||||
fn house_wall_materials() { ["render", "render2", "brick", "wood", "wall", "wall2", "wallp", "concb", "office", "furnw", "firewall"] }
|
||||
fn flooring_materials() { ["f-oak", "f-wood", "f-tile", "f-stone", "f-carpet", "f-conc", "z-floor", "z-living", "z-kitchen", "z-bed", "z-wc"] }
|
||||
fn house_roof_materials() { ["rooft", "roofr", "roof", "roof2", "roof3", "roofcap", "canopy"] }
|
||||
|
||||
@@ -116,7 +131,7 @@ fn meta_house_wall() {
|
||||
|
||||
fn prefab_house_wall(o) {
|
||||
let p = o.p;
|
||||
if house_view(o) == 2 { return; }
|
||||
if part_hidden(o) { return; }
|
||||
let top = wall_top(o);
|
||||
let cap = if top < p.h { "cut" } else { p.mat };
|
||||
let t = p.t / 2.0;
|
||||
@@ -203,7 +218,7 @@ fn meta_window() {
|
||||
fn prefab_window(o) {
|
||||
let c = opening_at(o);
|
||||
let w = c.wall;
|
||||
if house_view(w) == 2 { return; }
|
||||
if part_hidden(w) { return; }
|
||||
let H = w.p.h;
|
||||
let t = w.p.t / 2.0;
|
||||
let top = wall_top(w);
|
||||
@@ -247,7 +262,7 @@ fn meta_door() {
|
||||
fn prefab_door(o) {
|
||||
let c = opening_at(o);
|
||||
let w = c.wall;
|
||||
if house_view(w) == 2 { return; }
|
||||
if part_hidden(w) { return; }
|
||||
let p = o.p;
|
||||
let H = w.p.h;
|
||||
let t = w.p.t / 2.0;
|
||||
@@ -314,7 +329,7 @@ fn meta_floor() {
|
||||
}
|
||||
|
||||
fn prefab_floor(o) {
|
||||
if house_view(o) == 2 { return; }
|
||||
if part_hidden(o) { return; }
|
||||
let p = o.p;
|
||||
let w = p.w / 2.0;
|
||||
let d = p.d / 2.0;
|
||||
@@ -495,7 +510,7 @@ fn meta_stairs() {
|
||||
}
|
||||
|
||||
fn prefab_stairs(o) {
|
||||
if house_view(o) == 2 { return; }
|
||||
if part_hidden(o) { return; }
|
||||
let p = o.p;
|
||||
let w = p.w / 2.0;
|
||||
let n = fmax(2.0, (p.rise / 0.18).round()).to_int();
|
||||
|
||||
@@ -3,30 +3,37 @@
|
||||
fn people_colours() { ["hivis", "guest1", "guest2", "guest3", "guest4", "guide", "suit"] }
|
||||
|
||||
fn meta_person() {
|
||||
#{ label: "Person", category: "People", icon: "🧍",
|
||||
#{ label: "Person", category: "People", icon: "🧍", storey: true,
|
||||
props: [
|
||||
#{ key: "cls", type: "choice", def: "hivis", choices: people_colours(), label: "Clothes" },
|
||||
#{ key: "seated", type: "bool", def: false, label: "Seated" },
|
||||
] }
|
||||
}
|
||||
// People are left out like house parts (on a storey above the one a level
|
||||
// cuts open, or inside a closed data centre storey); on a raised floor they
|
||||
// stand on its top.
|
||||
fn prefab_person(o) {
|
||||
if part_hidden(o) { return; }
|
||||
let z = dc_lift(o);
|
||||
let s = sprite();
|
||||
if o.p.seated { s.sit(0.0, 0.0, 0.0, o.p.cls); } else { s.person(0.0, 0.0, 0.0, o.p.cls); }
|
||||
if o.p.seated { s.sit(0.0, 0.0, z, o.p.cls); } else { s.person(0.0, 0.0, z, o.p.cls); }
|
||||
}
|
||||
|
||||
fn meta_crowd() {
|
||||
#{ label: "Crowd", category: "People", icon: "👥",
|
||||
#{ label: "Crowd", category: "People", icon: "👥", storey: true,
|
||||
props: [
|
||||
#{ key: "n", type: "int", def: 5, min: 2, max: 40, step: 1, label: "People" },
|
||||
#{ key: "r", type: "float", def: 2.0, min: 0.6, max: 15.0, step: 0.1, label: "Spread (m)" },
|
||||
] }
|
||||
}
|
||||
fn prefab_crowd(o) {
|
||||
if part_hidden(o) { return; }
|
||||
let z = dc_lift(o);
|
||||
let cols = ["guest1", "guest2", "guest3", "guest4", "hivis"];
|
||||
for i in 0..o.p.n {
|
||||
// one sprite each, scattered deterministically in a disc
|
||||
let a = hash(i * 1.7 + o.x) * 6.2832;
|
||||
let r = o.p.r * hash(i * 3.3 + o.y).sqrt();
|
||||
sprite().person(r * a.cos(), r * a.sin(), 0.0, cols[i % 5]);
|
||||
sprite().person(r * a.cos(), r * a.sin(), z, cols[i % 5]);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user