Metadata-Version: 2.4
Name: bolt_pattern_elastic_method
Version: 1.0.0
Summary: Bolt pattern force distribution analysis
Project-URL: Homepage, https://github.com/A-Thomas-eng/bolt_pattern_elastic_method
License: MIT License
        
        Copyright (c) 2026 A-Thomas-eng
        
        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:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        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.
License-File: LICENSE.txt
Requires-Python: >=3.10
Requires-Dist: matplotlib
Requires-Dist: numpy
Description-Content-Type: text/markdown

Implements the methodology from NASA RP-1228. 

Given a bolt pattern (positions + areas) and applied loads at arbitrary
locations, this module computes the axial and shear force on each bolt.

Outputs verified against the calulator here:
https://mechanicalc.com/reference/bolt-pattern-force-distribution

Example usage:

if __name__ == "__main__":
    import os
    import bolt_pattern_elastic_method

    HERE = os.path.dirname(os.path.abspath(__file__))

    positions_1 = [(-3.5, 15), (3.5, 15), (-3.5, -15), (3.5, -15)
                   , (10, -15), (18.82, -12.14), (24.27, -4.635)
                   , (24.27, 4.635), (18.82, 12.14), (10, 15)
                   , (-10, 15), (-18.82, 12.14), (-24.27, 4.635)
                   , (-24.27, -4.635), (-18.82, -12.14), (-10, -15)] #[x,y]

    # ------------------------------------------------------------------
    # Example 1: 4-bolt rectangular pattern, in-plane eccentric shear
    # A 1000 N force applied in X at (y=5) – creates torsion about Z
    # ------------------------------------------------------------------
    print("\nEXAMPLE 1 – General 3-D loading")
    save_path="bolt_pattern_ex1.png"
    analysis_1 = BoltPatternAnalysis(
        bolts=[Bolt(x, y) for (x, y) in positions_1],
        loads=[AppliedLoad(Fx=1500.0, Fy=500.0, Fz=5000.0, z=15.0),
               AppliedLoad(Mz=1000.0)],
    )
    results_1 = analysis_1.solve()
    print_results(results_1, analysis_1)
    plot_bolt_pattern_3d(
        analysis_1, results_1,
        title="Example 1 - General 3-D loading",
        show=False,
        save_path=os.path.join(HERE, "save_path"),
    )
    print(f"  → saved {save_path}")


    # ------------------------------------------------------------------
    # Example 2: general 3-D loading using the convenience function
    # ------------------------------------------------------------------
    print("\nEXAMPLE 2 - General 3-D loading (convenience function)")
    analysis_2 = BoltPatternAnalysis(
        bolts=[Bolt(x, y, label=lbl) for (x, y), lbl in zip(
            [(-3, -3), (3, -3), (3, 3), (-3, 3)], ["TL", "TR", "BR", "BL"]
        )],
        loads=[AppliedLoad(Fx=200, Fy=-150, Fz=300,
                           Mx=500, My=-400, Mz=1000,
                           x=1.0, y=2.0, z=50.0)],
    )
    results_2 = analysis_2.solve()
    print_results(results_2, analysis_2)
    plot_bolt_pattern_3d(
        analysis_2, results_2,
        title="Example 2 - General 3-D Loading",
        show=False,
        save_path=os.path.join(HERE, "bolt_pattern_ex2.png"),
    )
    print("  → saved bolt_pattern_ex2.png")