コード例 #1
0
ファイル: conecalc.py プロジェクト: slott56/HamCalc-2.1
def sheet_to_cone():
    print( picture )
    A= input_float(" ENTER: smaller dimension of the sheet .......A=? " )
    B= input_float(" ENTER: larger dimension of the sheet ........B=? " )

    report= [ defaultdict( str ) for d in range(6) ]
    results= conecalc.cone( A=A, B=B )
    report[results.next] = results
    while results.next:
        results= conecalc.cone( **results )
        report[results.next if results.next is not None else 5] = results
    print( report[1] )
    print( report[2] )
    print( report[3] )
    print( report[4] )
    print( report[5] )

    template= """\
Pattern sheet:  (A) {3.A:6.2f} in. x  (B) {3.B:6.2f} in.

Type    Height  Base Diameter  Base Circum    Radius      Arc

1       {1.H:7.3f}      {1.D:7.3f}      {1.C:7.3f}      {1.L:7.3f}      {1.theta_d:7.3f}
2       {2.H:7.3f}      {2.D:7.3f}      {2.C:7.3f}      {2.L:7.3f}      {2.theta_d:7.3f}
3       {3.H:7.3f}      {3.D:7.3f}      {3.C:7.3f}      {3.L:7.3f}      {3.theta_d:7.3f}
4       {4.H:7.3f}      {4.D:7.3f}      {4.C:7.3f}      {4.L:7.3f}      {4.theta_d:7.3f}
5       {5.H:7.3f}      {5.D:7.3f}      {5.C:7.3f}      {5.L:7.3f}      {5.theta_d:7.3f}

Type      Location of Arc Center
                                    B
1         X = {1.X:7.3f}; Y = {1.Y:7.3f}   ┌─────────┐
2         X = {2.X:7.3f}; Y = {2.Y:7.3f}  y│         │A
3         X = {3.X:7.3f}; Y = {3.Y:7.3f}  ││         │
4         X = {4.X:7.3f}; Y = {4.Y:7.3f}   └─────────┘
5         X = {5.X:7.3f}; Y = {5.Y:7.3f}     ───x
"""

    print( template.format( *report ) )
コード例 #2
0
ファイル: conecalc.py プロジェクト: slott56/HamCalc-2.1
def cone_to_sheet():
    D= input_float(" ENTER: cone base diameter...............D=? " )
    H= input_float(" ENTER: cone height......................H=? " )
    results= conecalc.cone( D=D, H=H )

    template="""\
Cone base dia ............... {D:7.3f}
Cone height ................. {H:7.3f}
Base circumference........... {C:7.3f}
Arc angle ................... {theta_d:7.3f}°
Arc radius .................. {L:7.3f}
Arc center coordinates...  X= {X:7.3f}
                           Y= {Y:7.3f}
Pattern sheet ........... (A) {A:7.3f} x (B) {B:7.3f}
"""

    print("CONE PATTERN")
    print()
    print( template.format( **results ) )
    print()
    print( picture )