diff --git a/docs/fabrication/jlcpcb.md b/docs/fabrication/jlcpcb.md index 92900074..b6af6c54 100644 --- a/docs/fabrication/jlcpcb.md +++ b/docs/fabrication/jlcpcb.md @@ -61,6 +61,41 @@ the intended origin in footprint editor and mark the coordinates. Note that first the rotation correction is applied, then the translation. Usually, you will need only the rotation correction. +## Correction Pattern Files + +Specifying corrections for individual components can quickly become tedious. +It is also possible to specify correction patterns using CSV files. The +correction pattern files have the following format: + +``` +"Pattern","X correction","Y correction","Rotation" +"^U101$",0,0,180 +"^COS1333TR$",0,0,-90 +":PinHeader_2x06_P2.54mm_",1.27,6.35,90 +":SOIC-8_3.9x4.9mm_P1.27mm",0,0,-90 +":VQFN-20-1EP_3x3mm_P0.4mm_EP1.7x1.7mm",0,0,-90 +":SS5U100_TO-277",0.8,0,0 +":SOT-23",0,0,180 +``` + +The X and Y correction values are in millimeters and refer to the +component footprint original orientation. The rotation correction is in degrees, +with positive values meaning counter-clockwise rotation. + +The Pattern field is a regular expression that is matched against the +reference, value and footprint fields of the component (in this order). For +all footprints, the first matching pattern and field values are used. The +pattern is matched against the whole string, so you should use `^` and `$` +characters to match the beginning and the end of the string if you want to +match the whole string. + +In the example above, the first row matches a specific component with +reference `U101`. The second row matches all components with value +`COS1333TR`. The following rows match all components with a given footprint. +For footprints, the pattern is matched against the whole footprint name, +including the library - for example, `Package_TO_SOT_SMD:SOT-23-5`. To only +match the name part, all footprint patterns in the example start with `:`. + ## Using Corrections to Configure Jumpers If your board features solder jumpers you can use the corrections to specify @@ -69,7 +104,7 @@ Ohm resistor in suitable size. Then specify an order code of the zero Ohm resistor for the jumper and adjust correction so it fits the default position. Note that you can specify multiple correction fields by `--corrections `. The first found correction field is +separated list of correction field names>`. The first found correction field is used. This allows you to keep several configuration of the solder jumpers in your design e.g., in fields `JLCPCB_CORRECTION_CFG_1` and `JLCPCB_CORRECTION_CFG_2`. Then you can simply change the board configuration by