← Back to team overview

kicad-developers team mailing list archive

Re: [PATCH] Fix for 3D model offset

 

I believe he has a point. The footprint files do not have version information so if you load and save a footprint multiple times, the "offset" (if non zero) will continuously be multiplied by 2.54x
This is not true if the footprint importer will be patched to read the data as mm from now on...

I think there are two ways forward:

1. Revert my patch and live with the file format unit inconsistency
If I could vote, I would vote for this option that will reduce to zero the disturb to users... We would just need to add a note to docs that offset in fp are written and read in inches. The user will never notice that because the sw already does the right conversion inside... you could notice this 'inconsistency' only if you open the fp in text editor Footprint editor, 3D viewer, Vrml exporter already were managing correctly this 'inconsistency' internally In more than one year from the new 3D viewer release, I noticed no bugs/issues reported on this matter

M


On 11/22/2017 12:16 PM, Oliver Walters wrote:
Wayne,


I believe he has a point. The footprint files do not have version information so if you load and save a footprint multiple times, the "offset" (if non zero) will continuously be multiplied by 2.54x

I think there are two ways forward:

1. Revert my patch and live with the file format unit inconsistency
2. I can provide a patch for my original idea of writing "offset" instead of "at". We make a clean break and "at" is legacy and always read as inches. "offset" is new and is mm.

Let me know what you want to do.

Thanks,
Oliver

On Wed, Nov 22, 2017 at 8:25 PM, easyw <easyw@xxxxxxxxxxxx <mailto:easyw@xxxxxxxxxxxx>> wrote:

    Hi Wayne,

        I'm not sure I understand what the issue is.  Once an offset is
        changed
        to mm when either a footprint in a board or a library is parsed, why
would it not be saved as mm.  If it isn't, then this is a bug. Once the
        footprint offset is converted to mm, there should be no
        expectation that
        it will be correct for older versions of KiCad.  Is there
        something else
        at play here?


    this issue is related to the footprint editor...

    1) The fp exporter button exports correctly the footprint with
    offset in mm
    2) The fp importer button imports always reading the data as
    deci-mils and multiplies it internally
    3) To fix this issue the patch needs to manage the footprint
    importer code to read the values in mm instead of deci-mils.

        What if you open the same file again, how can it tell it's in mm
        or inches?

    @Jose ... this is an issue already addressed...
    The decision to change offset values to mm will break previous
    footprints that have non zero offset.
    But I think this has been considered a 'small' disturb for users
    when the patch has been committed, as stated in a previous mail:

        This is not a big issue because the only effects the footprints
        embedded
        in the board.  Users with custom footprint libraries that contain 3D
        model offsets will just have to fix the offsets.  I'm guessing
        this is a
        fairly small number of users.

    https://lists.launchpad.net/kicad-developers/msg31589.html
    <https://lists.launchpad.net/kicad-developers/msg31589.html>

    M


    On 11/22/2017 2:19 AM, Wayne Stambaugh wrote:

        I'm not sure I understand what the issue is.  Once an offset is
        changed
        to mm when either a footprint in a board or a library is parsed, why
would it not be saved as mm.  If it isn't, then this is a bug. Once the
        footprint offset is converted to mm, there should be no
        expectation that
        it will be correct for older versions of KiCad.  Is there
        something else
        at play here?

        On 11/21/2017 04:26 PM, Oliver Walters wrote:

            Wayne,

            Not sure how you want to handle this but I feel that making
            a clean
            break and using "offset" for mm solves all the issues
            associated with
            embedded footprints without version info, as Maurice says
            above. Let me
            know if want me to implement.

            On Wed, Nov 22, 2017 at 8:24 AM, easyw <easyw@xxxxxxxxxxxx
            <mailto:easyw@xxxxxxxxxxxx>
            <mailto:easyw@xxxxxxxxxxxx <mailto:easyw@xxxxxxxxxxxx>>> wrote:

                  Hi,
                  first headache symptom...

                  Testing conditions:
                  latest KiCad patched
                  Application: pcbnew
                  Version: (2017-11-21 revision 8de70f3)-master, release
            build

                  If you edit a footprint adding 3D models offset and
            then export it,
                  it will be saved with the new mm convention...
                  but when re-imported it will be read with deci-mils
            and displayed
                  with wrong convention...
                  Moreover if the imported footprint will be inserted
            into the board,
                  the footprint will conserve the wrong values...
                  Those wrong values will be then saved with the new
            kicad_pcb board....


    _______________________________________________
    Mailing list: https://launchpad.net/~kicad-developers
    <https://launchpad.net/~kicad-developers>
    Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
    <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
    Unsubscribe : https://launchpad.net/~kicad-developers
    <https://launchpad.net/~kicad-developers>
    More help   : https://help.launchpad.net/ListHelp
    <https://help.launchpad.net/ListHelp>




References