media_wall 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 422a613f44e387736e176c8ea6410f26abe6b92596bc651f8678795c2f8574a8
4
+ data.tar.gz: 2c665a773146682da76bd29aefaa845220d1538837856d6370bcd0e21f95f494
5
+ SHA512:
6
+ metadata.gz: f84d6c769c35fb7b0fb4162d69b9266db9a88f97baa66a65d09353e654c8e9cab8e4d67b053a5a0477f507c42f7c6210218d67a4b0c52ecb06daaac190e007d5
7
+ data.tar.gz: 4051de68d95ed82125976aa5e396683bf447a8782dcde9e7e1012d1f8f69a2bc9016b292e7ed4c6de7dca47ffdac2b85827dff235c8eb2b38aef260a4f05f576
data/LICENSE.txt ADDED
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Dmytro Voznyi (GetMediaWall)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,88 @@
1
+ # media_wall
2
+
3
+ Small, dependency-free Ruby helpers for planning a TV media wall: slat panel count and cost,
4
+ TV mounting height from seated eye level, 16:9 screen height, and viewing distance / screen size
5
+ rules of thumb.
6
+
7
+ ![Illustration of a living room with a slat media wall, a wall-mounted TV and a floating console](https://raw.githubusercontent.com/getmediawall/media_wall/main/images/hero.jpg)
8
+
9
+ <sub>Illustration (AI-generated) of the kind of wall these numbers are for.</sub>
10
+
11
+ ## Install
12
+
13
+ ```sh
14
+ gem install media_wall
15
+ ```
16
+
17
+ or in a Gemfile:
18
+
19
+ ```ruby
20
+ gem "media_wall"
21
+ ```
22
+
23
+ Ruby 2.6 or newer. No runtime dependencies.
24
+
25
+ ## Usage
26
+
27
+ ```ruby
28
+ require "media_wall"
29
+
30
+ MediaWall.panels_needed(144) # => 6 (24 in panels)
31
+ MediaWall.panels_cost(144, price_per_panel: 135) # => 810.0
32
+ MediaWall.screen_height_16x9(65) # => 31.9
33
+ MediaWall.bottom_edge_height(31.9) # => 26.1 (screen center at 42 in)
34
+ MediaWall.viewing_distance(65) # => 78.0..104.0
35
+ MediaWall.screen_size_for_distance(96) # => 60.0..80.0
36
+ ```
37
+
38
+ A 12 ft (144 in) wall behind a 65" TV, as one script:
39
+
40
+ ```ruby
41
+ require "media_wall"
42
+
43
+ diagonal = 65
44
+ height = MediaWall.screen_height_16x9(diagonal) # 31.9 in
45
+ bottom = MediaWall.bottom_edge_height(height) # 26.1 in from the floor
46
+ seats = MediaWall.viewing_distance(diagonal) # 78.0..104.0 in
47
+ panels = MediaWall.panels_needed(144) # 6
48
+
49
+ puts "Mount the TV with its bottom edge #{bottom} in above the floor."
50
+ puts "Sit #{(seats.min / 12).round(1)}-#{(seats.max / 12).round(1)} ft away."
51
+ puts "Order #{panels} slat panels (24 in wide) for the 144 in wall."
52
+ ```
53
+
54
+ ## API
55
+
56
+ All lengths are in inches. Invalid input (zero, negative or non-numeric) raises `MediaWall::Error`.
57
+
58
+ | Method | Returns |
59
+ | --- | --- |
60
+ | `panels_needed(wall_width, panel_width: 24)` | Panels to cover the width, rounded up (Integer) |
61
+ | `panels_cost(wall_width, price_per_panel:, panel_width: 24)` | Panel count x price (Float, 2 decimals) |
62
+ | `screen_height_16x9(diagonal)` | Screen height of a 16:9 TV (Float) |
63
+ | `bottom_edge_height(screen_height, eye_level: 42)` | Bottom edge height so the screen center sits at eye level |
64
+ | `viewing_distance(diagonal)` | Seating distance range, immersive (1.2x) to relaxed (1.6x) |
65
+ | `screen_size_for_distance(distance)` | Diagonal range that suits a seating distance |
66
+
67
+ The viewing-distance helpers use common rules of thumb (about 1.2x the diagonal for an immersive
68
+ picture, 1.6x for relaxed watching). `bottom_edge_height` uses the TV's screen height; add the
69
+ bezel if you need the height of the TV body. Always follow the mount maker's instructions for
70
+ fixing to the wall.
71
+
72
+ ## Plan it visually
73
+
74
+ Want to see the wall instead of numbers? The free visual planner at
75
+ [GetMediaWall Design Your Wall](https://getmediawall.com/design-your-wall) draws a slat media wall
76
+ to scale with a TV, fireplace or console and counts panels and cost as you type.
77
+ [GetMediaWall](https://getmediawall.com) also lists local media wall builders and TV installers.
78
+
79
+ ## Development
80
+
81
+ ```sh
82
+ ruby -Ilib test/media_wall_test.rb
83
+ gem build media_wall.gemspec
84
+ ```
85
+
86
+ ## License
87
+
88
+ MIT. See [LICENSE.txt](LICENSE.txt).
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MediaWall
4
+ VERSION = "0.1.0"
5
+ end
data/lib/media_wall.rb ADDED
@@ -0,0 +1,87 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "media_wall/version"
4
+
5
+ # MediaWall: small, dependency-free helpers for planning a TV media wall.
6
+ #
7
+ # * slat panel count for a wall (default panel width 24 in)
8
+ # * TV mounting height from seated eye level
9
+ # * viewing distance <-> screen size rules of thumb (about 1.2x to 1.6x the diagonal)
10
+ #
11
+ # All lengths are in inches.
12
+ #
13
+ # Planning a real wall? Try the free visual planner at https://getmediawall.com/design-your-wall
14
+ # or compare local installers at https://getmediawall.com
15
+ module MediaWall
16
+ class Error < StandardError; end
17
+
18
+ DEFAULT_PANEL_WIDTH = 24.0 # inches per slat panel
19
+ DEFAULT_EYE_LEVEL = 42.0 # seated eye level for a typical sofa, inches from the floor
20
+ IMMERSIVE_RATIO = 1.2 # viewing distance / diagonal for an immersive picture
21
+ RELAXED_RATIO = 1.6 # viewing distance / diagonal for relaxed TV watching
22
+
23
+ module_function
24
+
25
+ # Number of slat panels needed to cover a wall width (rounded up).
26
+ #
27
+ # @param wall_width [Numeric] wall width in inches
28
+ # @param panel_width [Numeric] width of one panel in inches
29
+ # @return [Integer]
30
+ def panels_needed(wall_width, panel_width: DEFAULT_PANEL_WIDTH)
31
+ positive!(wall_width, "wall_width")
32
+ positive!(panel_width, "panel_width")
33
+ (wall_width.to_f / panel_width).ceil
34
+ end
35
+
36
+ # Material cost for the panels.
37
+ #
38
+ # @param wall_width [Numeric] inches
39
+ # @param price_per_panel [Numeric] price of one panel in your currency
40
+ # @return [Float]
41
+ def panels_cost(wall_width, price_per_panel:, panel_width: DEFAULT_PANEL_WIDTH)
42
+ positive!(price_per_panel, "price_per_panel")
43
+ (panels_needed(wall_width, panel_width: panel_width) * price_per_panel.to_f).round(2)
44
+ end
45
+
46
+ # Height of the TV's bottom edge so that the screen center sits at eye level.
47
+ #
48
+ # @param screen_height [Numeric] height of the TV body in inches
49
+ # @param eye_level [Numeric] seated eye level in inches
50
+ # @return [Float] inches from the floor to the bottom edge of the TV
51
+ def bottom_edge_height(screen_height, eye_level: DEFAULT_EYE_LEVEL)
52
+ positive!(screen_height, "screen_height")
53
+ (eye_level.to_f - screen_height.to_f / 2.0).round(1)
54
+ end
55
+
56
+ # Visible screen height of a 16:9 TV from its diagonal.
57
+ #
58
+ # @param diagonal [Numeric] screen diagonal in inches
59
+ # @return [Float]
60
+ def screen_height_16x9(diagonal)
61
+ positive!(diagonal, "diagonal")
62
+ (diagonal.to_f * 9.0 / Math.sqrt(16.0**2 + 9.0**2)).round(1)
63
+ end
64
+
65
+ # Comfortable viewing distance range for a screen diagonal.
66
+ #
67
+ # @param diagonal [Numeric] inches
68
+ # @return [Range<Float>] immersive..relaxed distance in inches
69
+ def viewing_distance(diagonal)
70
+ positive!(diagonal, "diagonal")
71
+ (diagonal * IMMERSIVE_RATIO).round(1)..(diagonal * RELAXED_RATIO).round(1)
72
+ end
73
+
74
+ # Screen diagonal range that suits a seating distance.
75
+ #
76
+ # @param distance [Numeric] seating distance in inches
77
+ # @return [Range<Float>] relaxed..immersive diagonal in inches
78
+ def screen_size_for_distance(distance)
79
+ positive!(distance, "distance")
80
+ (distance / RELAXED_RATIO).round(1)..(distance / IMMERSIVE_RATIO).round(1)
81
+ end
82
+
83
+ def positive!(value, name)
84
+ raise Error, "#{name} must be a positive number" unless value.is_a?(Numeric) && value.positive?
85
+ end
86
+ private_class_method :positive!
87
+ end
metadata ADDED
@@ -0,0 +1,49 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: media_wall
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - GetMediaWall
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies: []
12
+ description: 'Dependency-free helpers for planning a TV media wall: how many slat
13
+ panels cover a wall, panel cost, TV mounting height from seated eye level, 16:9
14
+ screen height, and viewing distance / screen size rules of thumb. Made by GetMediaWall.'
15
+ email:
16
+ - team@getmediawall.com
17
+ executables: []
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - LICENSE.txt
22
+ - README.md
23
+ - lib/media_wall.rb
24
+ - lib/media_wall/version.rb
25
+ homepage: https://getmediawall.com/design-your-wall
26
+ licenses:
27
+ - MIT
28
+ metadata:
29
+ homepage_uri: https://getmediawall.com/design-your-wall
30
+ documentation_uri: https://www.rubydoc.info/gems/media_wall
31
+ source_code_uri: https://github.com/getmediawall/media_wall
32
+ rdoc_options: []
33
+ require_paths:
34
+ - lib
35
+ required_ruby_version: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '2.6'
40
+ required_rubygems_version: !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ version: '0'
45
+ requirements: []
46
+ rubygems_version: 3.6.9
47
+ specification_version: 4
48
+ summary: 'Plan a TV media wall: slat panel count, TV mounting height and viewing distance.'
49
+ test_files: []