From 00351ebe277aeb90e7463d1b0bd55402249c4687 Mon Sep 17 00:00:00 2001 From: Hiroshi Murayama Date: Thu, 12 Sep 2019 23:44:50 +0900 Subject: add IP command handling function --- README.md | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index 271573d..6c879f2 100644 --- a/README.md +++ b/README.md @@ -151,3 +151,62 @@ This example board image is generated by following scripts from [these source da

description

+ +## Notes + +### Equivalence of output +pcb-tools-extension generate data block stream to focus equivalence of final image, but not focus equivalence of data block sequence. +There are some difference between input data and output data as below. + +- **File Scope Modifier [RS-274x]**
+ Sometimes, commands that affect entire image and should be specified only once in a file, such as ```MI``` (Mirror Image) command, cause contradiction when multiple gerber file are merged.
+ For example, when mergeing a file containing ```%MIA1B0*%``` command and a file containing ```%MIA0B1*``` command, which command should remain as output? + Of cause, it is impossible that generate correct merged image by specifiing any ```MI``` command.
+ pcb-tools-extension translate coordinate data reflecting these file socpe modifier to address this probrem, then ommit these modifier command.
+ ```MI```, ```OF```, ```SF```, ```AS```, ```IP```, and ```IR``` are in a this category. + +- **Coodinate Normalizing [RS-274x, Excellon]**
+ RS-274x specification and Excellon specification allow various notation to express a coordinate. However pcb-tools-extension normalize coordinate notation in order to correct deprecated notation and ease internal process as below. + + - Relative coordinates are translated to absolute coordinates. + - Ommited coordinate values are compensated. + - Leading zeros are ommited. + +- **Unimportant Command [RS-274x, Excellon]**
+ Commands not affecting final image such as comment are ommited. + +### Negative image polarity +Sometimes, ```%IPNEG*%``` is specified at header of RS-274x file to create negative image.
+As mentioned [above](#Equivalence%20of%20output), ```IP``` command is ommited when pcb-tools-extension generate output file. In this case, image polarity is nagated by using ```LP``` command. However this generated file doesn't equal to original file since it does'nt contain base dark image.
+Please merge base dark rectangle explicitly when you handle negative image file as below. + +```python +import gerberex + +ctx = gerberex.GerberComposition() +base = gerberex.rectangle(width=30, height=30, left=-5, bottom=-5, units='metric') +base.draw_mode = base.DM_FILL +ctx.merge(base) +metal = gerberex.read('negative_image.gtl') +ctx.merge(metal) +``` + +## Limitations + +### RS-274x +pcb-tools-extension cannot handle all commands that the RS-274x parser implemented in +[pcb-tool](https://github.com/curtacircuitos/pcb-tools) doesn't handle so far.
+From the imaging point of view, pcb-tools-extension has following limitations. + +- Files contains ```IJ``` and ```IO``` commands, that affect entire image, cannot be handled correctly. +- Files contains ```SR``` command to specify repeated pattern cannot be handled correctly. +- Aperture block defined by ```AB``` command cannot be handled correctly. + +### Excellon +pcb-tools-extension extends excellon parser in [pcb-tool](https://github.com/curtacircuitos/pcb-tools) to support routing operation. However following limitations still remain. + +- User defined stored pattern defined by ```M99``` command cannot be handled. +- Canned text specified by ```M97``` command cannot be handled. +- Patten defined by ```M25``` command cannot be handled. + + -- cgit