
//
//  File:  varistor_smd_geom.txt
//
//  Date:  8-Apr-2024    original version
//
//
//  Geometry for the  Varistor  SMD  e.g.
//                   TDK  B72660M0950K072
//                   Bourns  PV95K4032
//
//
//  This is a SMD part with its long axis horizontal
//  and with its pin #1 to the left.
//
//  This part is being made for the DK Board.
//
//  This is a  4032  size SMD geometry.
//
//  The Reference Designator is on the SilkScreen Layer.
//



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


//----------------------------------------------------------------------------
//
//  SMD Varistor  pads:   2.9 mm in X  by  3.5 mm in Y
//                        with a c_to_c spacing of  9.4 mm in X
//

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

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

$$point_mode(@vertex);

$$polygon( "PAD", ,         [ -1.45, -1.75,    1.45, -1.75,     1.45, 1.75,    -1.45, 1.75 ] );

$$polygon( "SOLDER_MASK", , [ -1.50, -1.80,    1.50, -1.80,     1.50, 1.80,    -1.50, 1.80 ] );

$$polygon( "PASTE_MASK", ,  [ -1.45, -1.75,    1.45, -1.75,     1.45, 1.75,    -1.45, 1.75 ] );

$$attribute( "TERMINAL_SURFACE_DEFINITION", "");

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


//
//  Now start the layout of the component geometry
//

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

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

$$point_mode(@vertex); 

$$attribute( "COMPONENT_LAYOUT_TYPE", "surface");

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

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



//
//  Component Placement Outline for the  Varistor SMD
//

$$initial([  -6.30,  -4.00 ], , @nosnap );
$$terminal([ -6.30,   4.00 ] );
$$terminal([  6.30,   4.00 ] );
$$terminal([  6.30,  -4.00 ] );

$$attribute( "COMPONENT_PLACEMENT_OUTLINE", "", @mark, @scale );



//
//  Silkscreen
//

$$template_line_style( @Solid );

$$path( "SILKSCREEN", 0.20, , [ -5.00,  4.00,    5.00,  4.00 ]);
$$path( "SILKSCREEN", 0.20, , [ -5.00, -4.00,    5.00, -4.00 ]);

$$path( "SILKSCREEN", 0.20, , [ -5.00,  4.00,   -5.00,  2.15 ]);
$$path( "SILKSCREEN", 0.20, , [  5.00,  4.00,    5.00,  2.15 ]);

$$path( "SILKSCREEN", 0.20, , [ -5.00, -4.00,   -5.00, -2.15 ]);
$$path( "SILKSCREEN", 0.20, , [  5.00, -4.00,    5.00, -2.15 ]);




// Reference Designator is on the SILKSCREEN Layer.

$$text( "SILKSCREEN", "^$ref", 0.0, 4.7, 1.5, @BC, 0, 0.7, 0.20, "std", "None", 0.0, 0.0 );




//  Define the two equivalent pins on the   Varistor SMD:
//    pin #1 is to the left,  pin #2 to the right,  the axis is horizontal


$$attribute( "COMPONENT_PIN_DEFINITION", "1", , @scale , , [ -4.70, 0.00 ]);

$$attribute( "COMPONENT_PIN_DEFINITION", "2", , @scale , , [  4.70, 0.00 ]);


$$attribute( "COMPONENT_PADSTACK_OVERRIDE", "1, varistor_smd_pad");

$$attribute( "COMPONENT_PADSTACK_OVERRIDE", "2, varistor_smd_pad");



