Giter Site home page Giter Site logo

Comments (12)

easyw avatar easyw commented on July 18, 2024

@antoniovazquezblanco
would you please post the footprint you loaded in FC? does it have a value in z rotation angle?

from kicad-3d-models-in-freecad.

antoniovazquezblanco avatar antoniovazquezblanco commented on July 18, 2024

No Z rotation. I am starting to use the new https://github.com/KiCad/kicad-packages3D repo with https://github.com/KiCad/kicad-footprints.

The other repos have been declared legacy.

from kicad-3d-models-in-freecad.

easyw avatar easyw commented on July 18, 2024

@terjeio
would you please have a look at this...
moreover I tried to build a model in FC win64b launching
create_model-example.bat
and I get:

Exception while processing file: main_generator.py [coercing to Unicode: need string or buffer, NoneType found]

from kicad-3d-models-in-freecad.

terjeio avatar terjeio commented on July 18, 2024

I have not made a PR for the updated models yet, the first PR for the generator itself was for the legacy footprints - rotation has obvoiusly changed in the new repository and the script was updated in my latest PR to match that. I'll make a new PR for the updated models, perhaps later today.

I have not updated the example.bat files, sorry for that. A command that works for me is:

start "" "C:\Program Files\FreeCAD 0.16\bin\FreeCAD.exe" main_generator.py SW_DIP_x5_W8.61mm_Slide_LowProfile

If you still get the error something else is tripping up the code, maybe the UTF-declaration? I am running on Win7 64bit with FreeCad 0.16/CadQuery 1.0.0.

To list the available model names use:

start "" "C:\Program Files\FreeCAD 0.16\bin\FreeCAD.exe" main_generator.py list

This can be handy to get the names that could be used as basis for (wildcarded) input to the script.

from kicad-3d-models-in-freecad.

antoniovazquezblanco avatar antoniovazquezblanco commented on July 18, 2024

Thank you very much to everyone!

from kicad-3d-models-in-freecad.

easyw avatar easyw commented on July 18, 2024

@terjeio
'list' is a very handy option...
Please update the bat/sh file, this is giving a simple way to test the generator...
Thx a lot
Maurice

from kicad-3d-models-in-freecad.

easyw avatar easyw commented on July 18, 2024

@terjeio
still I have an issue launching
start "" "C:\FreeCAD_016\bin\freecad" main_generator.py SW_DIP_x5_W8.61mm_Slide_LowProfile

CadQuery 1.0.0
CadQuery is a parametric scripting API for creating and traversing CAD models
Author: David Cowden
License: Apache-2.0
Website: https://github.com/dcowden/cadquery
FC Version
['0', '16', '6706 (Git)', 'git://github.com/FreeCAD/FreeCAD.git releases/FreeCAD-0-16', '2016/07/02 10:32:16', 'releases/FreeCAD-0-16', 'f86a4e411ff7848dea98d7242f43b7774bee8fa0']FC Version 016
CQ 030 doesn't open example file
Exception while processing file: main_generator.py [coercing to Unicode: need string or buffer, NoneType found]
File format not supported: SW_DIP_x5_W8.61mm_Slide_LowProfile

I'm on win10 64b and FC0.16-6712 64b

also the command
start "" "C:\FreeCAD\bin\FreeCAD.exe" main_generator.py list
is generating errors

from kicad-3d-models-in-freecad.

terjeio avatar terjeio commented on July 18, 2024

@easyw
I get this when I run the script:

CadQuery 1.0.0
CadQuery is a parametric scripting API for creating and traversing CAD models
Author: David Cowden
License: Apache-2.0
Website: https://github.com/dcowden/cadquery
FC Version 
['0', '16', '6712 (Git)', 'git://github.com/FreeCAD/FreeCAD.git releases/FreeCAD-0-16', '2017/07/17 17:27:47', 'releases/FreeCAD-0-16', 'da2d364457257a7a8c6fb2137cea12c45becd71a']FC Version 016

Running...

When you run the code a exception is triggered for this:

try:
    close_CQ_Example(FreeCAD, Gui)
except: # catch *all* exceptions
    print "CQ 030 doesn't open example file"

For me it does not. But I have no idea why and if it is relevant, neither do I know why the code is there (in cq_model_generator.py).

Can you try to print something to the console at various places the __init__ method of the ModelGenerator class in cq_model_generator.py? Does the crash happen there and if so can you narrow it down?
I set up the script environment there and to make it seamless I read from the environment variables KISYS3DMOD and KISYSMOD, perhaps the issue is related to those?

I will update the .bat/.sh files later.

Terje

from kicad-3d-models-in-freecad.

terjeio avatar terjeio commented on July 18, 2024

@easyw
I've found it, the bug is in the __init__ method as I suspected, correct code is:

        self.footprints_dir = os.getenv('KISYSMOD')
        if self.footprints_dir != None and not os.path.isdir(self.footprints_dir):
            self.footprints_dir = None

It is due to KISYSMOD not beeing set on your machine. I'll add that to the forthcoming PR.
If you have time can you please verify the fix first?

Terje

from kicad-3d-models-in-freecad.

easyw avatar easyw commented on July 18, 2024

Hi Terje,
still not working for me... it is in cq_model_generator.py file?
I don't use the environment variables because not all the users place them outside KiCad (they can be set locally inside KiCad)
P.S. if you can, it is better to use 'is not' instead of '!=' and 'is' instead of '==' for testing an 'if' condition to 'None'

from kicad-3d-models-in-freecad.

terjeio avatar terjeio commented on July 18, 2024

@easyw
I have update the code and made a new PR, hopefully it works now. I need to check out Python idiosyncrasies, there are a few that so far has bitten me.

@antoniovazquezblanco
3Models should now be ok, a PR was just merged.

from kicad-3d-models-in-freecad.

antoniovazquezblanco avatar antoniovazquezblanco commented on July 18, 2024

You guys are awesome! Thanks!

from kicad-3d-models-in-freecad.

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.