Menu

#65 Patch to support Gerber X2 format: Extended metadata

Unstable (example)
open
nobody
X2 (1)
2
2016-11-12
2016-07-10
No

This patch adds support for Gerber X2 to gerbv.
In practice, this prevents piles of spurious console errors as an X2 layer is loaded in.
Longer term X2 commands could be used to set the polarity of the layer properly, and to put copper layers in their stackup order by default.

Gerber X2 is so easy to implement, support is growing fast. Altium now outputs Gerber X2.

1 Attachments

Discussion

  • Bryce Nesbitt

    Bryce Nesbitt - 2016-07-10

    Example Gerber X2 format file.

     
  • Sergey Alyoshin

    Sergey Alyoshin - 2016-07-12

    Sorry, Bryce I can't accept this patch.

    1. callbacks.c
      It is not X2 support it is just a stub, and about window can't say it
      yet. Also X2 metadata will be lost by gerbv on layer save, and for now
      user even won't be warned.

    2. X2 metadate should be saved if file is overwriten by gerbv.

    3. gerber.c
      printf() here is just for debug? It is useless for gerbv users.
      I think X2 metadata can be shown in Analyse > Gerber window.

    In "case A2I('T','F'):", I think "string" pointer should not change (and
    be freed with g_free() before break), and other variable as pointer is
    used in strcmp(). This is for similar use of "string" pointer as in other
    case's in gerber.c file.

    1. README
      You should make separate patch with REAMDE changes about building gerbv
      from git. And if you are not against log record in git log, patch file
      should contain From: field with name and e-mail (git format-patch can
      make this automatically).

    2. Please, make patch with nicely formatted code.

     
    • Bryce Nesbitt

      Bryce Nesbitt - 2016-07-12

      String pointer cannot be freed directly, as program will crash.

      X2 support is complete: there's almost nothing in X2 that gerbv needs
      (unless you want to set the sort order). So it is in fact complete X2
      support.
      Remember Gerber X2 is Gerber X with a few extensions. It is not a new
      format.

      I will update patch, and add support for the upcoming extension to X2 that
      the Ucamco developer just clued me into.

       
      • Sergey Alyoshin

        Sergey Alyoshin - 2016-07-12

        String pointer cannot be freed directly, as program will crash.

        Yes it can: don't use "string" in strsep() , use other pointer.

        X2 support is complete: there's almost nothing in X2 that gerbv needs
        (unless you want to set the sort order). So it is in fact complete X2
        support.

        How can anyone call lost metadate if file is saved as support?

         
        • Bryce Nesbitt

          Bryce Nesbitt - 2016-11-12

          Present situation is Gerbv reads X2 files, and strips X2 metadata. As such
          this seems like an improvement.
          A large fraction of Gerbv use is read only, so consider if it really is a
          dealbreaker.

           
  • Sergey Alyoshin

    Sergey Alyoshin - 2016-07-12

    Sorry for garbled numbering, it is sourceforge contribution.

     
  • Bryce Nesbitt

    Bryce Nesbitt - 2016-11-12

    Here's an example Gerber X2 file, created from Altium.

     

Log in to post a comment.