Giter VIP home page Giter VIP logo

Comments (6)

Misca1234 avatar Misca1234 commented on June 23, 2024

I found the reason

If you create the 3D model like this

f.append(Model(filename="${{KISYS3DMOD}}/Valve.3dshapes/{}.wrl".format(s), at=(0, 0, socket_H)))

The result in the .kicad_mod file is

  (model ${KISYS3DMOD}/Valve.3dshapes/Valve_Socket_Belton_VT9_PT-B9A-D21.00mm_Tap.wrl
    (at (xyz 0 0 3.5))
    (scale (xyz 1 1 1))
    (rotate (xyz 0 0 0))

but kicad itself will scale up 3.5 with 25.4 so the z position will become 88.9000 when 3D-viewing the foot print in the foot print editor.

If you change it back to 3.5 and save the foot print, kicad change it to this

  (model ${KISYS3DMOD}/Valve.3dshapes/Valve_Socket_Belton_VT9_PT-B9A-D21.00mm_Tap.wrl
    (offset (xyz 0 0 3.5))
    (scale (xyz 1 1 1))
    (rotate (xyz 0 0 0))

so apparently kicad re scale distance if you use (at (xyz 0 0 3.5)) but not if yo use (offset (xyz 0 0 3.5)) this is clearly some mistake in kicad.

from kicad-footprint-generator.

Misca1234 avatar Misca1234 commented on June 23, 2024

Also

There is a serializer function in Model.py but that is not used becaouse KicadFileHandler.py is ignoring this function and use it's own, def _serialize_Model(self, node): at line 149

So, it is not possible to modify Model.py to handle both at and offset arguments to Model.py

from kicad-footprint-generator.

Misca1234 avatar Misca1234 commented on June 23, 2024

With the valve push I will include a fix both in KicadFileHandler.py and Model.py so it will handle both at and offset where at supersede offset

from kicad-footprint-generator.

Misca1234 avatar Misca1234 commented on June 23, 2024

Closing, see push
KiCad/kicad-footprints#1111

from kicad-footprint-generator.

evanshultz avatar evanshultz commented on June 23, 2024

When I create a new footprint just for testing and add a 3D model in v5 I see this:

  (model ${KISYS3DMOD}/Button_Switch_SMD.3dshapes/SW_DIP_x10_W6.15mm_Slide_Omron_A6H.wrl
    (at (xyz 0 0 0))
    (scale (xyz 1 1 1))
    (rotate (xyz 0 0 0))
  )

For what it's worth, I think the wording has changed and offset is no longer used.

from kicad-footprint-generator.

Misca1234 avatar Misca1234 commented on June 23, 2024

I can not use 'at' for the valve socket + valve (2 3D models in one foot print)

If 'at' is used, then kicad automatically will multiply with 25.4 first time (and convert it into an offset and save it like that)

But the 'offset' is not recalculated but stays as it should be and the second 3D model is placed in the correct place

from kicad-footprint-generator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.