module Slatwall
Overview
Slat panel TV media wall calculator.
Works out how many slat (acoustic) wall panels a media wall section needs, how many slats fit on one panel with a minimum gap, the real gap when the slats are spread evenly, and the size of a 16:9 TV from its diagonal. All lengths are in inches.
require "slatwall"
plan = Slatwall.plan(Slatwall::Wall.new(width: 120, height: 96))
plan.panels_across # => 5
plan.slats_per_panel # => 12
plan.gap.round(2) # => 0.9
plan.order_with_spare # => 6
w, h = Slatwall.tv_size(65)
w.round(1) # => 56.7
The arithmetic is the same as the interactive planner at getmediawall.com/design-your-wall and the GetMediaWall tools for other languages, so every tool gives the same numbers.
Defined in:
slatwall.crConstant Summary
-
EPS =
1e-9 -
Tolerance used so that, for example, exactly 120 in of wall with 24 in panels gives 5 panels and not 6 after floating point rounding.
-
VERSION =
"1.0.0"
Class Method Summary
-
.plan(wall : Wall) : Plan
Plans a slat wall section.
-
.tv_size(diagonal : Number) : Tuple(Float64, Float64)
Width and height (inches) of a 16:9 TV screen from its diagonal (inches).
Class Method Detail
Plans a slat wall section.
plan = Slatwall.plan(Slatwall::Wall.new(width: 192, height: 108))
plan.panels_across # => 8
plan.rows # => 2
plan.order # => 16
Width and height (inches) of a 16:9 TV screen from its diagonal (inches).
w, h = Slatwall.tv_size(65)
{w.round(2), h.round(2)} # => {56.65, 31.87}