Bigger houses (Gitea #7): a second row of roof on a wider house, a Roof Ridge for a 6 m-wide one, and a Half Wall and Ridge Gable to close their taller ends; also no error when a piece is dismantled straight after it's placed

This commit is contained in:
Paul Bailey
2026-11-08 19:56:16 +00:00
parent 415e673b28
commit 31f8e0d22c
10 changed files with 363 additions and 5 deletions

View File

@@ -61,6 +61,15 @@ static func _define() -> Dictionary:
"snaps": [Vector3(-1, 0, 0), Vector3(0, 0, 0), Vector3(1, 0, 0), Vector3(1, 1, 0)],
"center": Vector3(0.33, 0.33, 0),
}
# Half wall: 2 m wide, 1 m tall (0.6.2, Gitea #7). On a wall's top, under
# a gable, it closes the end of a taller roof (a wider house, with a
# second row of roof panels); on a floor, it's a low wall or a railing.
k["half_wall"] = {
"shapes": [_box(Vector3(0, 0.5, 0), Vector3(2, 1, 0.2))],
"snaps": [Vector3(-1, 0, 0), Vector3(0, 0, 0), Vector3(1, 0, 0),
Vector3(-1, 1, 0), Vector3(0, 1, 0), Vector3(1, 1, 0)],
"center": Vector3(0, 0.5, 0),
}
# --- P2 (docs/PROGRESSION_DESIGN.md §3) ---
# Pillar: a 0.4 m post standing on a floor corner or edge, carrying what's
# on top (a floor's corner meets its top).
@@ -95,6 +104,29 @@ static func _define() -> Dictionary:
"snaps": [Vector3(-1, 0, 0), Vector3(0, 0, 0), Vector3(1, 0, 0)],
"center": Vector3(0, 1.5, 0),
}
# Roof ridge (0.6.2, Gitea #7): a 2 m cap, an upside-down V at the roof's
# slope, for houses whose width leaves a 2 m gap between the two sides'
# top rows (6 m, 10 m). Origin = centre at the level of the rows' top
# edges (local z = +-1), rising 0.5 m to the peak along z = 0.
var ns := Vector3(0, cos(ROOF_ANGLE), sin(ROOF_ANGLE))
var nn := Vector3(0, cos(ROOF_ANGLE), -sin(ROOF_ANGLE))
var half := sqrt(1.25)
k["roof_ridge"] = {
"shapes": [
{"type": "box", "center": Vector3(0, 0.25, 0.5) + ns * ROOF_T * 0.5, "size": Vector3(2, ROOF_T, half), "basis": Basis(Vector3.RIGHT, ROOF_ANGLE)},
{"type": "box", "center": Vector3(0, 0.25, -0.5) + nn * ROOF_T * 0.5, "size": Vector3(2, ROOF_T, half), "basis": Basis(Vector3.RIGHT, -ROOF_ANGLE)},
_box(Vector3(0, 0.55, 0), Vector3(2, 0.08, 0.3))], # (the ridge board: no gap at the peak for rain, or the shelter test)
"snaps": [Vector3(-1, 0, 1), Vector3(0, 0, 1), Vector3(1, 0, 1),
Vector3(-1, 0, -1), Vector3(0, 0, -1), Vector3(1, 0, -1)],
"center": Vector3(0, 0.25, 0),
}
# Ridge gable: the small triangle (2 m wide, 0.5 m tall, peak in the
# middle) that closes the end under a roof ridge, on a half wall or a wall.
k["ridge_gable"] = {
"shapes": [_prism([Vector2(-1, 0), Vector2(1, 0), Vector2(0, 0.5)], 0.2)],
"snaps": [Vector3(-1, 0, 0), Vector3(0, 0, 0), Vector3(1, 0, 0), Vector3(0, 0.5, 0)],
"center": Vector3(0, 0.17, 0),
}
var n := Vector3(0, cos(ROOF_ANGLE), sin(ROOF_ANGLE)) # panel normal (up and out)
# (Ends exactly at the ridge. The seam where two roofs meet is handled by
# build_system.roofed_at sampling several rays.)