Mail Archives: geda-user/2014/08/12/20:04:41
----- Original Message -----
> From: Dave Curtis <davecurtis AT sonic DOT net>
> To: geda-user AT delorie DOT com
> Cc:
> Sent: Wednesday, August 13, 2014 8:57 AM
> Subject: Re: [geda-user] rs-274x nits
>
>
> On Aug 12, 2014, at 3:20 PM, Cirilo Bernardo wrote:
>
>>
>>
>>
>>
>> ----- Original Message -----
>>> From: Dave Curtis <davecurtis AT sonic DOT net>
>>> To: geda-user AT delorie DOT com
>>> Cc:
>>> Sent: Wednesday, August 13, 2014 7:26 AM
>>> Subject: Re: [geda-user] rs-274x nits
>>>
>>> On 08/12/2014 01:49 PM, Cirilo Bernardo wrote:
>>>> ----- Original Message -----
>>>>
>>>>> From: Dave Curtis <davecurtis AT sonic DOT net>
>>>>> To: geda-user AT delorie DOT com
>>>>> Cc:
>>>>> Sent: Wednesday, August 13, 2014 3:51 AM
>>>>> Subject: [geda-user] rs-274x nits
>>>>>
>>>>> I'm trying to interpret the gerber format specification
> document
>>>>> authored by Ucamco.
>>>>>
>>>>> 1. On page 35 it says:
>>>>> The line separators CR and LF have no effect; they can be
> ignored when
>>>>> processing the file. It
>>>>> is recommended to use line separators to improve human
> readability.
>>>>>
>>>>> 2. On page 36 it says:
>>>>> It is recommended to add line separators between data blocks
> for
>>>>> readability. Do not
>>>>> put a line separator within a data block, except after a comma
>>> separator
>>>>> in long data blocks.
>>>>> The line separators have no effect on the image.
>>>>>
>>>>>
>>>>> 3. on page 40, talking about closing parameter blocks it says:
>>>>> The ‘%’ must immediately follow the ‘*’ of the last data block
> without
>>>>> intervening line separators.
>>>>> This is an exception to the general rule that a data block can
> be
>>>>> followed by a line separator.
>>>>>
>>>>> #3 is clear enough.
>>>>>
>>>>> #1 and #2 seem to be in conflict. A strict reading of #1 would
> say
>>> that
>>>>> CR and LF should simply be expunged, and that CR/LF could even
> split
>>>>> G-coded, numbers, etc., like this:
>>>>> G
>>>>> 03
>>>>> X
>>>>> 123
>>>>> *
>>>>> Which seems odd, but is a result of strict reading of #1. But
> is in
>>>>> conflict with the advice of #2.
>>>>>
>>>>> It's easy enough to comply with the advice of #2 while
> writing.Â
>>> But if
>>>>> reading RS-274X, should CR/LF's that split lexical units be
>
>>> ignored?
>>>>> Although I realize that even if legal, I doubt if anyone writes
> gerber
>>>>> that way.
>>>>>
>>>>> -dave
>>>>>
>>>>
>>>> There is no conflict at all:
>>>>
>>>> 1. The CR/LF are optional; you do not need them but they are
> recommended
>>>> to make the file look better to humans.
>>>>
>>>> 2. If you use CR/LF to make a data block look prettier, you can
> only use
>>>> CR/LF after a comma.
>>>
>>> NO! That directly conflicts with #1 "CR and LF no effect."Â
> Which is
>>> it?
>>>
>>
>>
>> Well, as 2 of us have already said, it's both. If you look at #2 the
>> specification does state that data blocks are an exception and that
>> CR/LF are only allowed after a ',' within a data block. The
> specification
>> is very clear that this is an exception, so why do you insist that it
>> violates the other general rule?
>>
>
> Because if "CR and LF have no effect", then why the admonition against
> CR/LF against places after a comma? I suppose you could say that the operative
> word in placing CR/LF only after comma is *recommendation*, which would then by
> my reading allow CR/LF arbitrarily. Certainly it would make the file look like
> hash, but if the aim is a reader that accepts all correct RS-274X files, then
> these pedantic nits matter.Â
>
> As you suggest, it is probably worth inconveniencing a few electrons by sending
> an e-mail to Ucamco. I'm not holding my breath about getting a reply, but
> I'd be happy to be wrong about that.
>
>
> -dave
>
I can only suggest that you read the specifications carefully, make notes,
maybe read over the specs again, and formulate a letter to UCAMCO. They
promise they'll respond (gerber at UCAMCO com), but out of professional
courtesy make sure that you did read the specs carefully. Specifications
are rarely if ever perfect, but I think this is one case where there is
a good opportunity to clarify some issues and make the specification
more solid. Your issue with splitting a lexical unit with CR/LF is a good
example of ambiguity in the specification - was the text really intended
that way or did they intend to recommend using CR/LF only at the end of
a command block and after a comma within a data block.
With regards to CR/LF and the comma, I see no ambiguity at all. CR/LF is
optional but recommended for human readability, but within any data block
it may only be placed immediately after a comma.
- Cirilo
- Raw text -