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

@@ -69,6 +69,9 @@ static func build(key: String) -> ArrayMesh:
"wood_door_panel": m = _door_panel()
"wood_roof": m = _roof()
"wood_gable": m = _gable()
"wood_half_wall": m = _half_wall()
"wood_roof_ridge": m = _roof_ridge()
"wood_ridge_gable": m = _ridge_gable()
"bed": m = _bed()
"raw_meat": m = _meat(MEAT_RAW)
"cooked_meat": m = _meat(MEAT_COOKED)
@@ -546,6 +549,17 @@ static func _wall() -> ArrayMesh:
_box(st, Vector3(0, y, 0), Vector3(1.68, 0.12, 0.2), BEAM)
return P._commit(st)
## Half wall: the wall's boards and frame, 2 x 1 m.
static func _half_wall() -> ArrayMesh:
var st := P._begin()
var r := _rng(75)
_wall_body(st, r, -0.84, 0.84, 0.1, 0.9)
for x in [-0.92, 0.92]:
_box(st, Vector3(x, 0.5, 0), Vector3(0.16, 1.0, 0.2), BEAM)
for y in [0.06, 0.94]:
_box(st, Vector3(0, y, 0), Vector3(1.68, 0.12, 0.2), BEAM)
return P._commit(st)
## Door frame (1.1 x 1.9 m opening); `with_panel` adds the closed door, for the
## inventory icon and the placement ghost.
static func _door(with_panel: bool) -> ArrayMesh:
@@ -597,6 +611,37 @@ static func _roof() -> ArrayMesh:
_box(st, along * s + n * 0.085, Vector3(2.04, 0.05, (length + 0.3) / rows + 0.1), _board(r, SHINGLE), tilt)
return P._commit(st)
## Roof ridge: two short shingled panels meeting at a peak 0.5 m up (an
## upside-down V across local Z), origin at the centre of the low edges'
## level. Bridges the gap between two roof rows on a 6 m-wide house.
static func _roof_ridge() -> ArrayMesh:
var st := P._begin()
var r := _rng(91)
var a := 0.4636476
var half := sqrt(1.25)
for side in [1.0, -1.0]:
var b := Basis(Vector3.RIGHT, a * side)
var n := Vector3(0, cos(a), sin(a) * side)
var mid := Vector3(0, 0.25, 0.5 * side)
_box(st, mid + n * 0.03, Vector3(2.0, 0.06, half + 0.06), _board(r, BEAM), b)
for i in range(2):
var along := Vector3(0, -sin(a), cos(a) * side) * (half * (0.25 - 0.5 * i))
_box(st, mid + along + n * 0.085, Vector3(2.04, 0.05, half * 0.5 + 0.1), _board(r, SHINGLE), Basis(Vector3.RIGHT, (a + 0.06) * side))
_box(st, Vector3(0, 0.55, 0), Vector3(2.06, 0.08, 0.16), BEAM) # (the ridge board)
return P._commit(st)
## Ridge gable: a small triangle, 2 m wide and 0.5 m tall, peak in the middle.
static func _ridge_gable() -> ArrayMesh:
var st := P._begin()
var r := _rng(98)
for i in range(2):
var y0 := 0.25 * i
var hw := 0.92 * (1.0 - y0 / 0.5) - 0.06
_box(st, Vector3(0, y0 + 0.125, 0), Vector3(hw * 2.0, 0.25 - 0.015, 0.12), _board(r))
_box(st, Vector3(0, 0.06, 0), Vector3(2.0, 0.12, 0.2), BEAM)
_box(st, Vector3(0, 0.25, 0), Vector3(0.14, 0.5, 0.2), BEAM)
return P._commit(st)
## Triangular gable end: 0 m tall at -X, 1 m tall at +X.
static func _gable() -> ArrayMesh:
var st := P._begin()