// file : /home2/designs/boards/BVDC_24/Work/Geometries/rn55c_resistor
//
// date : Monday     8-OCT-2007    Initial draft
//
//
//
//     RN55C  Metal Film Resistor
//
//     This geometry is for a standard RN55C axial lead metal film resistor.
//
//
//     Design of the pad stack
//
//         pin spacing if 2.54mm
//         The axial leads on this resistor are 25 mil diameter.
//         It can use a 38 mil hole  1.00mm hole
//         2.54 - 1.00 = 1.54      1.54 divided by 5 is 0.31mm
//         so have about 0.31mm of Cu ring,
//         then about 0.31 of space and then about a 0.31mm trace
//         this implies a pad diameter of about  1.62mm
//
//     Actual numbers used in the pad stack
//
//         hole diameter       1.00 mm    39.4 mils
//         pad land diameter   1.64 mm    64.6 mils
//            ==> ring width   0.32 mm    12.6 mils
//         plane relief        2.24 mm    88.2 mils
//            ==> air gap      0.30 mm    11.8 mils
//
//




$abort_enable = @false;
$$lock_windows(@on) ;
$$snap_diagonal(@off) ;
$$snap_orthogonal(@off) ;


//----------------------------------------------------------------------------

$$create_pin("term_thd_rn55c", @replace);

$$page(0.0,0.0,0.0, @mm, 0.0, 0.0, [0.0, 0.0, 'PI$term_thd_rn55c']);

$$point_mode(@vertex);

$$attribute( "TERMINAL_THRUHOLE_DEFINITION", "default");

$$attribute( "TERMINAL_DRILL_SIZE", "", , @scale , , [1.0, 0.0]);

$$circle( "PAD",         0.0, 0.0,  1.64,  0.0);

$$circle( "SIGNAL",      0.0, 0.0,  1.64,  0.0);

$$circle( "SOLDER_MASK", 0.0, 0.0,  1.64,  0.0);

$$circle( "POWER",       0.0, 0.0,  2.24,  0.0);


//----------------------------------------------------------------------------



$$create_component("rn55c_resistor", @replace);

$$page(0.0,0.0,0.0, @mm, 0.0, 0.0, [0.0, 0.0, 'CO$rn55c_resistor']);

$$point_mode(@vertex);


$$attribute( "COMPONENT_LAYOUT_SURFACE", "both");


$$attribute( "COMPONENT_HEIGHT", "", , @scale , , [2.30, 0.0]);

$$attribute( "COMPONENT_OUTLINE_OVERHANG", "no");


$$attribute( "COMPONENT_PLACEMENT_OUTLINE", "", , @scale , , [-7.20, -1.20,   7.20, -1.20,   7.20, 1.20,   -7.20, 1.20] );



//  Draw the Skilscreen    4 lines  1mm outside of the component

$$path( "SILKSCREEN", 0.254 , , [-3.50,  1.20,     3.50,  1.20] );
$$path( "SILKSCREEN", 0.254 , , [-3.50, -1.20,     3.50, -1.20] );

$$path( "SILKSCREEN", 0.254 , , [-3.50,  1.20,    -3.50, -1.20] );
$$path( "SILKSCREEN", 0.254 , , [ 3.50,  1.20,     3.50, -1.20] );

$$text( "SILKSCREEN_1", "^$ref", 0.0, 0.0, 1.8, @CC, 0, 0.7, 0.20, "std", "None", 0.0, 0.0 );
$$text( "SILKSCREEN_2", "^$ref", 0.0, 0.0, 1.8, @CC, 0, 0.7, 0.20, "std", "None", 0.0, 0.0 );




//  The component pins

$$attribute( "COMPONENT_PIN_DEFINITION",     "1", , @scale , , [ -6.00,  0.00]);
$$attribute( "COMPONENT_PADSTACK_OVERRIDE",  "1, term_thd_rn55c");

$$attribute( "COMPONENT_PIN_DEFINITION",     "2", , @scale , , [  6.00,  0.00]);
$$attribute( "COMPONENT_PADSTACK_OVERRIDE",  "2, term_thd_rn55c");

