bimr-engine/samples/python/building.py
2026-09-01 15:32:49 +02:00

30 lines
775 B
Python

# Welcome to BIMR.NET!
# This is a live editor, try tweaking this Python example
N_STOREYS = 8
N_SEGMENTS = 50
FRAME_W, FRAME_H, FRAME_D, FRAME_T = 200, 180, 35, 10
SLAB_T = 150
STOREY_H = FRAME_H + 2 * SLAB_T
BASE = [
(-1500, -300),
(0, 1000),
(850, 800),
(300, 0),
(500, -800),
(0, -1000),
(-500, -800),
(-300, 0),
]
for storey in range(N_STOREYS):
z = storey * STOREY_H
base = List(*[Point(x, y, z) for x, y in BASE])
pts = Random(base, seed=128 + storey, min=-150, max=150, dims=2)
curve = Curve(pts)
s_down = Slab(curve, SLAB_T, z)
s_up = Slab(curve, SLAB_T, z + SLAB_T + FRAME_H)
segments = Cut(curve, N_SEGMENTS)
pairs = Explode(segments)
frames = Frame(pairs, FRAME_W, FRAME_H, FRAME_D, FRAME_T)