#!/bin/sh

#@@example acy(300)

#@@purpose Generate axial lead through-hole component

#@@desc Generate axial lead through-hole component with 2 pins (typical use: resistor)
#@@params spacing,type,pol,dia

#@@param:spacing spacing between the two pins
#@@dim:spacing

#@@param:type silk symbol type
#@@enum:type:block eu-style block resistor symbol
#@@enum:type:endcap block resistor with caps on the ends
#@@enum:type:zigzag us-style zigzag resistor symbol
#@@enum:type:line a single line (e.g. for jumper wires)
#@@enum:type:standing vertically aligned, body standing on pin 1, pin 2 bent back
#@@enum:type:coil wavy coil symbol
#@@enum:type:core wavy coil symbol with a parallel line
#@@enum:type:core2 wavy coil symbol with two parallel lines
#@@optional:type
#@@default:type block
#@@preview_args:type 300

#@@param:pol how to mark polarity
#@@enum:pol:none no marking
#@@enum:pol:sign + and - signs; pin 1 is +
#@@enum:pol:bar bar next to pin 1
#@@enum:pol:dot dot next to pin 1
#@@optional:pol
#@@default:pol none
#@@preview_args:pol 300

#@@param:dia body diameter - affects silk size
#@@dim:dia 
#@@optional:dia
#@@default:dia spacing/6


#@@param:wiper silk symbol wiper type
#@@enum:wiper:none no wiper
#@@enum:wiper:parrow perpendicular arrow, pointing inwards
#@@enum:wiper:aarrow angled arrow, pointing outwards
#@@enum:wiper:looparrow arrow starting at pin 2 looping back to point inwards on the body
#@@enum:wiper:thermistor wiper of a thermistor symbol
#@@optional:wiper
#@@default:wiper none
#@@preview_args:wiper 400

#@@param:3dbody 3d model body shape; if not specified, guessed from silk graphics
#@@enum:3dbody:resistor resistor
#@@enum:3dbody:wire jumper wire
#@@enum:3dbody:coil similar to resistor
#@@enum:3dbody:bead ferrite bead
#@@enum:3dbody:elco electrolytic capacitor
#@@enum:3dbody:diode diode with cathode marking
#@@enum:3dbody:brick wirewound power resistor, brick style
#@@enum:3dbody:monocap axial monolithic capacitor
#@@enum:3dbody:diskcap ceramic capacitor, standing disk shaped
#@@enum:3dbody:monoblock monolithic capacitor, vertical
#@@enum:3dbody:pot two pin trim/potmeter
#@@enum:3dbody:greencap polyester/greencap capacitor, vertical
#@@enum:3dbody:tantalum tantalum, vertical
#@@optional:3dbody

#@@param:3dbodydia the diameter (or width) of the body on the 3d model
#@@optional:3dbodydia
#@@dim:3dbodydia

#@@thumbsize 2

#@@include common_subc.awk

awk -f `dirname $0`/common_subc.awk -f `dirname $0`/acy.awk -v "args=$*" -v gen=`basename $0` -v "genfull=$0"

