mirror of
https://github.com/DramaticShape/DramaticShapeVoxelMod.git
synced 2026-08-12 17:40:51 +02:00
console class: a machine on furniture, without the furniture's edging
The Poke Mart register shares its two tiles with the counter, which draws a full-height black rule down each outer edge. Black always survives the shade flood, so the billboard pool extruded those rules too and the machine stood flanked by a pair of tall black slabs. A white column separates them from the register body, so they are their own connected components -- which is exactly what `cutout`'s one-object contract drops. `cutout` is a single voxel though, and a register wants body, so this adds `console`: the billboard treatment at ten voxels with that same contract. It cannot be the default for the thick pools, because a cluster there may legitimately hold several objects (two stools side by side, a leaf beside a vase).
This commit is contained in:
+11
-6
@@ -69,7 +69,7 @@ local OBJECT_DEPTH = 6 -- voxel thickness of a detected prop
|
||||
-- `signpost` is a plate on a stick -- 2 voxels, the thinnest that still
|
||||
-- shows an edge
|
||||
local PINNED_DEPTH = { billboard = 10, prop = 5, stool = 10, cutout = 1,
|
||||
post = 6, signpost = 2 }
|
||||
console = 10, post = 6, signpost = 2 }
|
||||
|
||||
local MAX_ROWS = 6 -- volume height cap: 48px
|
||||
|
||||
@@ -1994,13 +1994,18 @@ function Structures.buildObject(S, map, region, cluster,
|
||||
c.z1 = c.z0 + depth
|
||||
end
|
||||
|
||||
-- A `cutout` pin is ONE object by contract: keep only the largest
|
||||
-- connected drawing. Loose black scraps -- a cast shadow's drawn
|
||||
-- edge, a seam -- are background even though black pixels always
|
||||
-- survive the shade flood, and this is what removes them.
|
||||
-- A `cutout` or `console` pin is ONE object by contract: keep only
|
||||
-- the largest connected drawing. Loose black scraps -- a cast
|
||||
-- shadow's drawn edge, a seam, the vertical rules the surrounding
|
||||
-- furniture draws down its own edges -- are background even though
|
||||
-- black pixels always survive the shade flood, and this is what
|
||||
-- removes them. Every other pool may hold several objects per
|
||||
-- cluster (two stools side by side, a leaf beside a vase), so this
|
||||
-- cannot be the default.
|
||||
if force then
|
||||
local cs = S.shapeAt[keyOf(cluster.tiles[1][1], cluster.tiles[1][2])]
|
||||
if cs and cs.class == "cutout" and #comps > 1 then
|
||||
if cs and (cs.class == "cutout" or cs.class == "console")
|
||||
and #comps > 1 then
|
||||
local biggest = comps[1]
|
||||
for _, c in ipairs(comps) do
|
||||
if c.n > biggest.n then biggest = c end
|
||||
|
||||
Reference in New Issue
Block a user