Re: [Kicad-developers] Gerber output units?
On Wed, 05 Aug 2015 16:56:02 +0200, Wayne Stambaugh wrote: There is a technical reason to not do inch plotting. I recently explained it. Seems a pretty good reason, actually... sorry I don't ready every thread on the list. Therefore, until someone give me a *very good reason* why inches are better than mm in Gerber files, I *do not want* a inch option in Gerber plot menu ( or, if this option exists, commit an algo to avoid self intersecting polygons). Silly question: couldn't we raise the decimal figures on MOIN too, to avoid the problem or is it already at the max? Or maybe the rounding creep is of that kind that couldn't by fixed by brute force but only using 'correctly directed' rounding (i.e. point on the left rounded up, point on right rounded down or something like that). Just curious, I don't actually expect that someone could reject a MOMM gerber file... (OTOH I know people which would reject a metric gencad file :( -- Lorenzo Marcantonio Logos Srl ___ Mailing list: https://launchpad.net/~kicad-developers Post to : kicad-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~kicad-developers More help : https://help.launchpad.net/ListHelp
Re: [Kicad-developers] Gerber output units?
Le 06/08/2015 08:39, Lorenzo Marcantonio a écrit : On Wed, 05 Aug 2015 16:56:02 +0200, Wayne Stambaugh wrote: There is a technical reason to not do inch plotting. I recently explained it. Seems a pretty good reason, actually... sorry I don't ready every thread on the list. Therefore, until someone give me a *very good reason* why inches are better than mm in Gerber files, I *do not want* a inch option in Gerber plot menu ( or, if this option exists, commit an algo to avoid self intersecting polygons). Silly question: couldn't we raise the decimal figures on MOIN too, to avoid the problem or is it already at the max? It is currently the max (6 digits max both in inches and mm), unless I missed something. 6 digits for mantissa is the value given as best value in Gerber file format spec. Or maybe the rounding creep is of that kind that couldn't by fixed by brute force but only using 'correctly directed' rounding (i.e. point on the left rounded up, point on right rounded down or something like that). Yes, an algo is needed to modify corners coordinates. The tests are not easy. I remember difficulties when I had to debug such an issue in a Gerber file, just to see if a corner was on the left or on the right of a outline segment. The best way (from the point of view on Gerber format) is to use a representation not sensible to rounding coordinates (namely a polygon with no hole linked to the main outline, and holes given as negative objects). (See last gerber file format spec, chapters 4.6.10 to 4.6.14) Just curious, I don't actually expect that someone could reject a MOMM gerber file... (OTOH I know people which would reject a metric gencad file :( Gencad always creates issues: I saw data mandatory with a gencad reader, and not accepted by an other reader. -- Jean-Pierre CHARRAS ___ Mailing list: https://launchpad.net/~kicad-developers Post to : kicad-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~kicad-developers More help : https://help.launchpad.net/ListHelp
Re: [Kicad-developers] Gerber output units?
Gerber generation is the heart and soul of a board layout program. Get this wrong, and all of the fancy editing features are completely meaningless. I applaud JP for being very conservative about making changes to this code. The last thing we need is for users to end up with bad boards due to units conversion error in KiCad. That being said, I do believe that it is a problem that can be solved. It is a matter of whether or not I makes sense to allocate the manpower to solve a complex issue when our current solution is correct. Internally pcbnew units are nanometers stored as integers. Generating millimeter gerbers with six significant digits is the key. We never have to leave the integer domain to generate gerber coordinates. We get a 1 to 1 representation of the board. Where things get murky is when we starting decreasing the number of significant digits and/or converting to inches and rounding. The primary issue is with the polygons used fill zones. Each polygon would have to be tested for self intersection and potential gaps and/or overlaps with adjacent polygons when making the conversions. This would most likely have be an iterative process until all of the polygons where converted and verified against all of the surrounding polygons for any potential issues. Again, it's not impossible but it is a significant amount of work to get it correct. On 8/5/2015 11:00 AM, Chris Pavlina wrote: Agreed 90%. I don't have so much of a problem with fixing the dimensions as long as they're only fixed in the Gerber export, not in the master - it's just part of exporting, you're rendering things with the features available to you in the destination format. But that's a minor point, obviously I don't want to turn the alternative units back on if they don't work. I wasn't aware of this problem. On Wed, Aug 05, 2015 at 10:56:02AM -0400, Wayne Stambaugh wrote: On 8/4/2015 3:03 PM, jp charras wrote: Le 04/08/2015 08:29, Lorenzo Marcantonio a écrit : On Tue, 04 Aug 2015 05:38:26 +0200, Chris Pavlina wrote: pcbnew used to be able to plot Gerbers in imperial units. What happened to that? Some (particularly older and non-Asian) board houses still expect those... Is there any reason they were removed, or did they just fall out? And can they be put back in? Since the new plotting infrastructure the gerber plotter already supported both units; the IN was simply the compatibility default and it only needed an UI option to be bound. If someone changed the default without adding a radio button or something then blame to him:P AFAIK there would be no technical reason to not do inch plotting... There is a technical reason to not do inch plotting. I recently explained it. Pcbnew internally uses nanometers, corresponding to 6 digits mantissa in Gerber. If we use a 6 digits mantissa and mm in Gerber, there is no rounding issue. If we convert these values to inches, I am pretty sure rounding issues will appear. For most of coordinates, a rounding issue has no matter. However, for complex polygons (copper zones) rounding coordinates can create self intersecting polygons from non intersecting polygons. Self intersecting polygons are not allowed in Gerber files (see gerber file format spec). The advice from Ucamco is (especially for this issue) is: use the max resolution for coordinates (see also the gerber file format spec). The only one reason the 5 digits mantissa option exists in Pcbnew is the fact Ucamco told me a few Gerbers tools do not accept the 6 digits. I verified some Gerber files which are OK with 6 digits mantissa create self intersecting polygons when using 5 digits from the same board. (Tests with GC-Preview) (to tell the True, the Gerber image on screen was the same) We already have a bug report about self intersecting polygons in Gerber files from Kicad. It also explains why a Gerber reader can gives warnings about that issue, and an other Gerber reader does not find any issue: it depends also on internal units of the reader. Therefore, until someone give me a *very good reason* why inches are better than mm in Gerber files, I *do not want* a inch option in Gerber plot menu ( or, if this option exists, commit an algo to avoid self intersecting polygons). I'm going to side with JP on this one. Simply enabling the conversion from the internal nanometer units to inches for gerber plotting is not an acceptable solution no matter how harmless it may seem on the surface. The combination of loss of precision and the floating point rounding errors can potentially lead to self intersecting polygons as JP has mentioned. Whether or not these errors are significant is design dependent. It's most likely that they would not result in an issue for most designs but I would rather error on the side of caution on this issue. Any solution to this problem must include an algorithm to detect and potentially correct the problem. The
Re: [Kicad-developers] Gerber output units?
Agreed 90%. I don't have so much of a problem with fixing the dimensions as long as they're only fixed in the Gerber export, not in the master - it's just part of exporting, you're rendering things with the features available to you in the destination format. But that's a minor point, obviously I don't want to turn the alternative units back on if they don't work. I wasn't aware of this problem. On Wed, Aug 05, 2015 at 10:56:02AM -0400, Wayne Stambaugh wrote: On 8/4/2015 3:03 PM, jp charras wrote: Le 04/08/2015 08:29, Lorenzo Marcantonio a écrit : On Tue, 04 Aug 2015 05:38:26 +0200, Chris Pavlina wrote: pcbnew used to be able to plot Gerbers in imperial units. What happened to that? Some (particularly older and non-Asian) board houses still expect those... Is there any reason they were removed, or did they just fall out? And can they be put back in? Since the new plotting infrastructure the gerber plotter already supported both units; the IN was simply the compatibility default and it only needed an UI option to be bound. If someone changed the default without adding a radio button or something then blame to him:P AFAIK there would be no technical reason to not do inch plotting... There is a technical reason to not do inch plotting. I recently explained it. Pcbnew internally uses nanometers, corresponding to 6 digits mantissa in Gerber. If we use a 6 digits mantissa and mm in Gerber, there is no rounding issue. If we convert these values to inches, I am pretty sure rounding issues will appear. For most of coordinates, a rounding issue has no matter. However, for complex polygons (copper zones) rounding coordinates can create self intersecting polygons from non intersecting polygons. Self intersecting polygons are not allowed in Gerber files (see gerber file format spec). The advice from Ucamco is (especially for this issue) is: use the max resolution for coordinates (see also the gerber file format spec). The only one reason the 5 digits mantissa option exists in Pcbnew is the fact Ucamco told me a few Gerbers tools do not accept the 6 digits. I verified some Gerber files which are OK with 6 digits mantissa create self intersecting polygons when using 5 digits from the same board. (Tests with GC-Preview) (to tell the True, the Gerber image on screen was the same) We already have a bug report about self intersecting polygons in Gerber files from Kicad. It also explains why a Gerber reader can gives warnings about that issue, and an other Gerber reader does not find any issue: it depends also on internal units of the reader. Therefore, until someone give me a *very good reason* why inches are better than mm in Gerber files, I *do not want* a inch option in Gerber plot menu ( or, if this option exists, commit an algo to avoid self intersecting polygons). I'm going to side with JP on this one. Simply enabling the conversion from the internal nanometer units to inches for gerber plotting is not an acceptable solution no matter how harmless it may seem on the surface. The combination of loss of precision and the floating point rounding errors can potentially lead to self intersecting polygons as JP has mentioned. Whether or not these errors are significant is design dependent. It's most likely that they would not result in an issue for most designs but I would rather error on the side of caution on this issue. Any solution to this problem must include an algorithm to detect and potentially correct the problem. The issue I see with this is the correction algorithm. Programmatically fixing the self intersecting polygons when they occur may or may not be what the user intended. The question then becomes what to do about. One option is to warn the user and tell them to fix the offending object dimensions. Another option is to fix the offending object and warn the user of the change. I would oppose silently fixing the offending objects without the user's knowledge. ___ Mailing list: https://launchpad.net/~kicad-developers Post to : kicad-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~kicad-developers More help : https://help.launchpad.net/ListHelp ___ Mailing list: https://launchpad.net/~kicad-developers Post to : kicad-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~kicad-developers More help : https://help.launchpad.net/ListHelp
Re: [Kicad-developers] Gerber output units?
On 8/4/2015 3:03 PM, jp charras wrote: Le 04/08/2015 08:29, Lorenzo Marcantonio a écrit : On Tue, 04 Aug 2015 05:38:26 +0200, Chris Pavlina wrote: pcbnew used to be able to plot Gerbers in imperial units. What happened to that? Some (particularly older and non-Asian) board houses still expect those... Is there any reason they were removed, or did they just fall out? And can they be put back in? Since the new plotting infrastructure the gerber plotter already supported both units; the IN was simply the compatibility default and it only needed an UI option to be bound. If someone changed the default without adding a radio button or something then blame to him:P AFAIK there would be no technical reason to not do inch plotting... There is a technical reason to not do inch plotting. I recently explained it. Pcbnew internally uses nanometers, corresponding to 6 digits mantissa in Gerber. If we use a 6 digits mantissa and mm in Gerber, there is no rounding issue. If we convert these values to inches, I am pretty sure rounding issues will appear. For most of coordinates, a rounding issue has no matter. However, for complex polygons (copper zones) rounding coordinates can create self intersecting polygons from non intersecting polygons. Self intersecting polygons are not allowed in Gerber files (see gerber file format spec). The advice from Ucamco is (especially for this issue) is: use the max resolution for coordinates (see also the gerber file format spec). The only one reason the 5 digits mantissa option exists in Pcbnew is the fact Ucamco told me a few Gerbers tools do not accept the 6 digits. I verified some Gerber files which are OK with 6 digits mantissa create self intersecting polygons when using 5 digits from the same board. (Tests with GC-Preview) (to tell the True, the Gerber image on screen was the same) We already have a bug report about self intersecting polygons in Gerber files from Kicad. It also explains why a Gerber reader can gives warnings about that issue, and an other Gerber reader does not find any issue: it depends also on internal units of the reader. Therefore, until someone give me a *very good reason* why inches are better than mm in Gerber files, I *do not want* a inch option in Gerber plot menu ( or, if this option exists, commit an algo to avoid self intersecting polygons). I'm going to side with JP on this one. Simply enabling the conversion from the internal nanometer units to inches for gerber plotting is not an acceptable solution no matter how harmless it may seem on the surface. The combination of loss of precision and the floating point rounding errors can potentially lead to self intersecting polygons as JP has mentioned. Whether or not these errors are significant is design dependent. It's most likely that they would not result in an issue for most designs but I would rather error on the side of caution on this issue. Any solution to this problem must include an algorithm to detect and potentially correct the problem. The issue I see with this is the correction algorithm. Programmatically fixing the self intersecting polygons when they occur may or may not be what the user intended. The question then becomes what to do about. One option is to warn the user and tell them to fix the offending object dimensions. Another option is to fix the offending object and warn the user of the change. I would oppose silently fixing the offending objects without the user's knowledge. ___ Mailing list: https://launchpad.net/~kicad-developers Post to : kicad-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~kicad-developers More help : https://help.launchpad.net/ListHelp
[Kicad-developers] Gerber output units?
On Wed, 5 Aug 2015, Wayne Stambaugh wrote: to that? Some (particularly older and non-Asian) board houses still expect those... Is there any reason they were removed so, an articulated use case for the inch output AFAIK there would be no technical reason to not do inch plotting... If we use a 6 digits mantissa and mm in Gerber, there is no rounding issue. or perhaps it just crops up more rarely? Absent edge path interference auditting, it would seem so I guess I don't see how using any numbering system in the output side does not carry the prospect for potential overlap. I _think_ you are saying 'using the same precision' for internal representation rather than transitions 'back and forth' and so having accumulating 'roundoff indeterminancy / error' terms in play helps avoid inadvertently producing: Self intersecting polygons at gerber output time, minimizes this occurring? We already have a bug report about self intersecting polygons in Gerber files from Kicad. This seems like 'papering over' an issue, rather than detecting closure (and, so, an inadvertent failure to close), and 'intrusion' by adjacent entities (a convex hull / boundry problem) -- Russ herrold ___ Mailing list: https://launchpad.net/~kicad-developers Post to : kicad-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~kicad-developers More help : https://help.launchpad.net/ListHelp
Re: [Kicad-developers] Gerber output units?
I do not understand why 6 significant digit will cause rounding error if Gerber generation uses inches as unit. you have a nanometer resolution which provides 6 decimals for millimeter units. When you divide this number by 25.4 to convert to inches, you might loose a bit of resolution, but you will not generate a rounding error. 123.456789mm = 4.86050350” wich is now 4.860503 when using only 6 decimals. Where is the rounding error coming from? From the software processing gerber data? I really doubt that CAM software will care about 1 micro-inch error. Just curious, Jean-Paul AC9GH On Aug 4, 2015, at 3:03 PM, jp charras jp.char...@wanadoo.fr wrote: Le 04/08/2015 08:29, Lorenzo Marcantonio a écrit : On Tue, 04 Aug 2015 05:38:26 +0200, Chris Pavlina wrote: pcbnew used to be able to plot Gerbers in imperial units. What happened to that? Some (particularly older and non-Asian) board houses still expect those... Is there any reason they were removed, or did they just fall out? And can they be put back in? Since the new plotting infrastructure the gerber plotter already supported both units; the IN was simply the compatibility default and it only needed an UI option to be bound. If someone changed the default without adding a radio button or something then blame to him:P AFAIK there would be no technical reason to not do inch plotting... There is a technical reason to not do inch plotting. I recently explained it. Pcbnew internally uses nanometers, corresponding to 6 digits mantissa in Gerber. If we use a 6 digits mantissa and mm in Gerber, there is no rounding issue. If we convert these values to inches, I am pretty sure rounding issues will appear. For most of coordinates, a rounding issue has no matter. However, for complex polygons (copper zones) rounding coordinates can create self intersecting polygons from non intersecting polygons. Self intersecting polygons are not allowed in Gerber files (see gerber file format spec). The advice from Ucamco is (especially for this issue) is: use the max resolution for coordinates (see also the gerber file format spec). The only one reason the 5 digits mantissa option exists in Pcbnew is the fact Ucamco told me a few Gerbers tools do not accept the 6 digits. I verified some Gerber files which are OK with 6 digits mantissa create self intersecting polygons when using 5 digits from the same board. (Tests with GC-Preview) (to tell the True, the Gerber image on screen was the same) We already have a bug report about self intersecting polygons in Gerber files from Kicad. It also explains why a Gerber reader can gives warnings about that issue, and an other Gerber reader does not find any issue: it depends also on internal units of the reader. Therefore, until someone give me a *very good reason* why inches are better than mm in Gerber files, I *do not want* a inch option in Gerber plot menu ( or, if this option exists, commit an algo to avoid self intersecting polygons). -- Jean-Pierre CHARRAS ___ Mailing list: https://launchpad.net/~kicad-developers Post to : kicad-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~kicad-developers More help : https://help.launchpad.net/ListHelp ___ Mailing list: https://launchpad.net/~kicad-developers Post to : kicad-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~kicad-developers More help : https://help.launchpad.net/ListHelp
Re: [Kicad-developers] Gerber output units?
Le 05/08/2015 19:41, Jean-Paul Louis a écrit : I do not understand why 6 significant digit will cause rounding error if Gerber generation uses inches as unit. you have a nanometer resolution which provides 6 decimals for millimeter units. When you divide this number by 25.4 to convert to inches, you might loose a bit of resolution, but you will not generate a rounding error. 123.456789mm = 4.86050350” wich is now 4.860503 when using only 6 decimals. Where is the rounding error coming from? From the software processing gerber data? I really doubt that CAM software will care about 1 micro-inch error. Just curious, Jean-Paul AC9GH When rounding a coordinate, you slightly move corners of polygons. 1 micro-inch (25 pcbnew internal units) error has no matter for CAM software (and users...) as long it does not create self intersecting polygons. If happens, an error report is made. I am guessing this issue does not create actual problems (at least, when happens, I did not see any issue with Gerber viewers I used). But I already received bug reports about that issue. And what is the reason a Gerber file needs inches ? Currently I do not yet see the answer to my question. I understand a Gerber reader (for instance Gerbview) has to accept a Gerber file both in inches and mm (like all Gerber readers), but why this is needed for Gerber file creation? Moreover, there are many other parameters for Gerber coordinates notation. First versions of Pcbnew have these options in plot dialog. But because very few users are able to correctly choose these options, they are now removed. I never saw a board house which is unable to read Gerbers files in mm. I cannot even imagine it could exist in 2015. But if happens to me, be sure I will use an other board house. -- Jean-Pierre CHARRAS ___ Mailing list: https://launchpad.net/~kicad-developers Post to : kicad-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~kicad-developers More help : https://help.launchpad.net/ListHelp
Re: [Kicad-developers] Gerber output units?
On Tue, 04 Aug 2015 05:38:26 +0200, Chris Pavlina wrote: pcbnew used to be able to plot Gerbers in imperial units. What happened to that? Some (particularly older and non-Asian) board houses still expect those... Is there any reason they were removed, or did they just fall out? And can they be put back in? Since the new plotting infrastructure the gerber plotter already supported both units; the IN was simply the compatibility default and it only needed an UI option to be bound. If someone changed the default without adding a radio button or something then blame to him:P AFAIK there would be no technical reason to not do inch plotting... -- Lorenzo Marcantonio Logos Srl ___ Mailing list: https://launchpad.net/~kicad-developers Post to : kicad-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~kicad-developers More help : https://help.launchpad.net/ListHelp
Re: [Kicad-developers] Gerber output units?
Le 04/08/2015 08:29, Lorenzo Marcantonio a écrit : On Tue, 04 Aug 2015 05:38:26 +0200, Chris Pavlina wrote: pcbnew used to be able to plot Gerbers in imperial units. What happened to that? Some (particularly older and non-Asian) board houses still expect those... Is there any reason they were removed, or did they just fall out? And can they be put back in? Since the new plotting infrastructure the gerber plotter already supported both units; the IN was simply the compatibility default and it only needed an UI option to be bound. If someone changed the default without adding a radio button or something then blame to him:P AFAIK there would be no technical reason to not do inch plotting... There is a technical reason to not do inch plotting. I recently explained it. Pcbnew internally uses nanometers, corresponding to 6 digits mantissa in Gerber. If we use a 6 digits mantissa and mm in Gerber, there is no rounding issue. If we convert these values to inches, I am pretty sure rounding issues will appear. For most of coordinates, a rounding issue has no matter. However, for complex polygons (copper zones) rounding coordinates can create self intersecting polygons from non intersecting polygons. Self intersecting polygons are not allowed in Gerber files (see gerber file format spec). The advice from Ucamco is (especially for this issue) is: use the max resolution for coordinates (see also the gerber file format spec). The only one reason the 5 digits mantissa option exists in Pcbnew is the fact Ucamco told me a few Gerbers tools do not accept the 6 digits. I verified some Gerber files which are OK with 6 digits mantissa create self intersecting polygons when using 5 digits from the same board. (Tests with GC-Preview) (to tell the True, the Gerber image on screen was the same) We already have a bug report about self intersecting polygons in Gerber files from Kicad. It also explains why a Gerber reader can gives warnings about that issue, and an other Gerber reader does not find any issue: it depends also on internal units of the reader. Therefore, until someone give me a *very good reason* why inches are better than mm in Gerber files, I *do not want* a inch option in Gerber plot menu ( or, if this option exists, commit an algo to avoid self intersecting polygons). -- Jean-Pierre CHARRAS ___ Mailing list: https://launchpad.net/~kicad-developers Post to : kicad-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~kicad-developers More help : https://help.launchpad.net/ListHelp
[Kicad-developers] Gerber output units?
+1 from me for adding back imperial Gerber support. There was a recent discussion regarding this in the following ticket. A small patch is included as well to add the option for imperial output into the UI. https://bugs.launchpad.net/bugs/1475730 On Aug 4, 2015 2:31 AM, Lorenzo Marcantonio l.marcanto...@logossrl.com javascript:_e(%7B%7D,'cvml','l.marcanto...@logossrl.com'); wrote: On Tue, 04 Aug 2015 05:38:26 +0200, Chris Pavlina wrote: pcbnew used to be able to plot Gerbers in imperial units. What happened to that? Some (particularly older and non-Asian) board houses still expect those... Is there any reason they were removed, or did they just fall out? And can they be put back in? Since the new plotting infrastructure the gerber plotter already supported both units; the IN was simply the compatibility default and it only needed an UI option to be bound. If someone changed the default without adding a radio button or something then blame to him:P AFAIK there would be no technical reason to not do inch plotting... -- Lorenzo Marcantonio Logos Srl ___ Mailing list: https://launchpad.net/~kicad-developers Post to : kicad-developers@lists.launchpad.net javascript:_e(%7B%7D,'cvml','kicad-developers@lists.launchpad.net'); Unsubscribe : https://launchpad.net/~kicad-developers More help : https://help.launchpad.net/ListHelp ___ Mailing list: https://launchpad.net/~kicad-developers Post to : kicad-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~kicad-developers More help : https://help.launchpad.net/ListHelp
[Kicad-developers] Gerber output units?
pcbnew used to be able to plot Gerbers in imperial units. What happened to that? Some (particularly older and non-Asian) board houses still expect those... Is there any reason they were removed, or did they just fall out? And can they be put back in? -- Chris ___ Mailing list: https://launchpad.net/~kicad-developers Post to : kicad-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~kicad-developers More help : https://help.launchpad.net/ListHelp