craiyon logo

A modern rooftop balcony with a small table, two chairs, a bench, and a potted plant, overlooking a hazy city skyline.

A modern rooftop balcony with a small table, two chairs, a bench, and a potted plant, overlooking a hazy city skyline.

# 3D-Balkon mit Sitzbank, Tisch und Gartenstühlen import matplotlib.pyplot as plt from mpl_toolkits.mplot3d.art3d import Poly3DCollection import numpy as np # Balkonmaße in Metern balkon_laenge = 4.8 # 480 cm balkon_breite = 1.6 # 160 cm fig = plt.figure(figsize=(12,6)) ax = fig.add_subplot(111, projection='3d') # Balkonboden boden = [[0,0,0], [balkon_laenge,0,0], [balkon_laenge,balkon_breite,0], [0,balkon_breite,0]] ax.add_collection3d(Poly3DCollection([boden], facecolors='lightgrey')) # Sitzbank an der 160 cm Wand (1.6 m) - 1.4 m lang, 0.5 m tief, 0.45 m hoch bank_laenge = 1.4 bank_tiefe = 0.5 bank_hoehe = 0.45 bx, by, bz = 0.2, 0.05, 0 # kleine Wandabstände bank = [[bx,by,bz], [bx+bank_laenge, by, bz], [bx+bank_laenge, by+bank_tiefe, bz], [bx, by+bank_tiefe, bz], [bx,by,bz+bank_hoehe], [bx+bank_laenge, by, bz+bank_hoehe], [bx+bank_laenge, by+bank_tiefe, bz+bank_hoehe], [bx, by+bank_tiefe, bz+bank_hoehe]] verts_bank = [[bank[0],bank[1],bank[2],bank[3]], [bank[4],bank[5],bank[6],bank[7]], [bank[0],bank[1],bank[5],bank[4]], [bank[1],bank[2],bank[6],bank[5]], [bank[2],bank[3],bank[7],bank[6]], [bank[3],bank[0],bank[4],bank[7]]] ax.add_collection3d(Poly3DCollection(verts_bank, facecolors='dimgray')) # Runder Tisch vor der Sitzbank tisch_radius = 0.3 # 60 cm Durchmesser tisch_hoehe = 0.7 tisch_x = bx + bank_laenge/2 tisch_y = by + bank_tiefe + 0.3 theta = np.linspace(0, 2*np.pi, 30) x_circle = tisch_radius * np.cos(theta) + tisch_x y_circle = tisch_radius * np.sin(theta) + Mehr sehen