plancaliber_cad 1.0.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.
Files changed (5) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +21 -0
  3. data/README.md +18 -0
  4. data/lib/plancaliber_cad.rb +58 -0
  5. metadata +51 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 74d4cff990c0333442505ac49838273c15fa2d134b21a0ea4eed997f8e28c9d1
4
+ data.tar.gz: 39b7b42fca33dad2281ce4afa727081976d27078cbb34408eaa3ccaeb17dbd2c
5
+ SHA512:
6
+ metadata.gz: 41164b58daa0bb52a1dab41315935bd5cadb3ab4000ee11ee87a20e9cc73c3138be9f41e1c161b6e91ee6f499cdf87877e067f7a54fe298d94d062367ead2c3d
7
+ data.tar.gz: 33fb8d70941981a8fdb1c4f78ce21b3b1ee2fa2845e427552ece922b8d9100f4a739d70d4b667a723c1c0285758de5434f9daed94da7cdfcd6375966cb3b6132
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 PlanCaliber
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,18 @@
1
+ # PlanCaliber US Imperial CAD & Building-Code Geometry (`plancaliber_cad`)
2
+
3
+ Lightweight Ruby 3.0+ helper library for US imperial `1/4"=1'-0"` residential floor plan geometry, fractional feet-inches formatting, IRC R802 roof rafter length math, ANSI Z765 preliminary area calculations, and AutoCAD R12 (`AC1009`, `$INSUNITS=1` US inches) ASCII `.DXF` entity generation.
4
+
5
+ Built by [PlanCaliber](https://www.plancaliber.com), a browser-based US 2D/3D Floor Plan, AI Sketch/PDF-to-CAD, Site Plan, and Blueprint Studio (San Francisco, CA).
6
+
7
+ ## Live Browser Tools & Calculators
8
+ - **Interactive 2D/3D Floor Plan & AutoCAD R12 DXF Studio**: https://www.plancaliber.com/blueprint-dxf-maker
9
+ - **50 Free US Residential Code Calculators**: https://www.plancaliber.com/calculators
10
+ - **Roof Pitch & Rafter Length Calculator (IRC R802)**: https://www.plancaliber.com/calculators/roof-pitch-rafter-length-calculator
11
+ - **40 Editable US Floor Plan Templates (Barndominium, Tiny House, Cabin, ADU, Garage)**: https://www.plancaliber.com/templates
12
+ - **Transparent One-Time Pricing & 14-Day Instant Refunds**: https://www.plancaliber.com/pricing | https://www.plancaliber.com/refunds
13
+
14
+ ## Pricing Note for the Web Studio
15
+ The browser studio is free ($0) to draw, run 2 free AI sketch/PDF scans per day, and export `1400x1050` watermarked proof PNGs. Optional one-time passes unlock unwatermarked 2-sheet `1/4"=1'-0"` vector PDF ($9) or 5-sheet CAD PDF + layered AutoCAD R12 `.DXF` + 3D `.OBJ` + Takeoff `.CSV` ($19), backed by 14-day instant no-questions-asked refunds.
16
+
17
+ ## Disclaimer
18
+ Preliminary space-planning and estimating reference only. Always verify dimensions, structural loads, property boundaries, and local IRC/NEC/NKBA/ANSI Z765 requirements with your local AHJ and qualified licensed professionals before construction or MLS listing publication.
@@ -0,0 +1,58 @@
1
+ # frozen_string_literal: true
2
+
3
+ # PlanCaliber US Imperial CAD & Building-Code Geometry helpers.
4
+ # Preliminary space-planning & estimating reference only; verify dimensions,
5
+ # structural loads, and local building codes with your AHJ and qualified
6
+ # professionals before construction.
7
+ #
8
+ # Interactive 2D/3D CAD Studio & 50 free US calculators: https://www.plancaliber.com
9
+ module PlanCaliberCad
10
+ VERSION = "1.0.0"
11
+
12
+ AIA_LAYERS = {
13
+ "A-WALL" => 7,
14
+ "A-DOOR" => 30,
15
+ "A-GLAZ" => 4,
16
+ "A-CABN" => 8,
17
+ "A-FURN" => 9,
18
+ "E-POWR" => 2,
19
+ "A-ROOM" => 3,
20
+ "A-DIMS" => 6
21
+ }.freeze
22
+
23
+ module_function
24
+
25
+ def format_feet_inches(total_inches)
26
+ sign = total_inches < 0 ? "-" : ""
27
+ sixteenths = (total_inches.abs * 16.0).round
28
+ feet, rem = sixteenths.divmod(192)
29
+ inches, frac = rem.divmod(16)
30
+ return format("%s%d'-%d\"", sign, feet, inches) if frac.zero?
31
+
32
+ g = frac.gcd(16)
33
+ format("%s%d'-%d %d/%d\"", sign, feet, inches, frac / g, 16 / g)
34
+ end
35
+
36
+ def roof_rafter_length_ft(run_ft, pitch_per_12, overhang_in = 12.0)
37
+ total_run = run_ft.to_f + (overhang_in.to_f / 12.0)
38
+ rise = total_run * (pitch_per_12.to_f / 12.0)
39
+ Math.hypot(total_run, rise).round(4)
40
+ end
41
+
42
+ def rectangle_dxf(width_ft, depth_ft, layer = "A-WALL")
43
+ w = width_ft.to_f * 12.0
44
+ d = depth_ft.to_f * 12.0
45
+ lines = [
46
+ "0", "SECTION", "2", "HEADER",
47
+ "9", "$ACADVER", "1", "AC1009",
48
+ "9", "$INSUNITS", "70", "1",
49
+ "0", "ENDSEC",
50
+ "0", "SECTION", "2", "ENTITIES"
51
+ ]
52
+ [[0.0, 0.0, w, 0.0], [w, 0.0, w, d], [w, d, 0.0, d], [0.0, d, 0.0, 0.0]].each do |x1, y1, x2, y2|
53
+ lines.push("0", "LINE", "8", layer, "10", format("%.4f", x1), "20", format("%.4f", y1), "11", format("%.4f", x2), "21", format("%.4f", y2))
54
+ end
55
+ lines.push("0", "ENDSEC", "0", "EOF")
56
+ "#{lines.join("\n")}\n"
57
+ end
58
+ end
metadata ADDED
@@ -0,0 +1,51 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: plancaliber_cad
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Clara Sutton
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2026-12-05 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: US imperial 1/4-inch scale blueprint geometry, IRC R802 roof rafter length math, ANSI Z765 preliminary area helpers, and AutoCAD R12 AC1009 ASCII DXF ($INSUNITS=1) emitters by PlanCaliber (https://www.plancaliber.com). Preliminary space-planning reference only; verify with your AHJ and qualified professionals.
14
+ email: clara@plancaliber.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files:
18
+ - README.md
19
+ - LICENSE
20
+ files:
21
+ - lib/plancaliber_cad.rb
22
+ - README.md
23
+ - LICENSE
24
+ homepage: https://www.plancaliber.com/blueprint-dxf-maker
25
+ licenses:
26
+ - MIT
27
+ metadata:
28
+ homepage_uri: https://www.plancaliber.com/blueprint-dxf-maker
29
+ documentation_uri: https://www.plancaliber.com/calculators
30
+ source_code_uri: https://gitlab.com/plancaliber/us-space-planning-building-code-reference
31
+ bug_tracker_uri: https://www.plancaliber.com/refunds
32
+ post_install_message:
33
+ rdoc_options: []
34
+ require_paths:
35
+ - lib
36
+ required_ruby_version: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '3.0'
41
+ required_rubygems_version: !ruby/object:Gem::Requirement
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ requirements: []
47
+ rubygems_version: 3.5.0
48
+ signing_key:
49
+ specification_version: 4
50
+ summary: US imperial 1/4-inch scale floor plan geometry, IRC R802 roof rafter math, and AutoCAD R12 DXF helpers.
51
+ test_files: []