Comments (12)
@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.
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.
@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.
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.
Thank you very much to everyone!
from kicad-3d-models-in-freecad.
@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.
@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.
@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.
@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.
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.
@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.
You guys are awesome! Thanks!
from kicad-3d-models-in-freecad.
Related Issues (20)
- python2 should die HOT 1
- Hard-coded paths in python scripts HOT 1
- Using the scripts with CADquery 1.2.0 and FreeCAD 0.18.3 HOT 3
- Using the scripts with CADquery 1.2.0 and FreeCAD 0.18.4 HOT 26
- Best way to add a new 3D model? HOT 5
- Support JST SMD connectors and SH Series
- SM resistors HOT 1
- BRepSweep_Translation error with epad line HOT 4
- DFN generator fails in FreeCAD 0.19 HOT 1
- Exception while processing file: main_generator.py [global name 'math' is not defined] HOT 3
- Buzzer_Beeper generator: Black screen in FC 0.18 HOT 2
- metric fuses HOT 5
- Problems running the scripts HOT 8
- move more stuff inside _tools ? HOT 1
- Add option for origin offset to scripts
- bugfix HOT 1
- Resistor_THT script can omit lead bends HOT 7
- Feedback concerning an often faced KiCad StepUp issue HOT 1
- Need PinSocket_1x08_2.54mm_Stacking for shields
- ./main_generator.py [No module named '_tools']
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kicad-3d-models-in-freecad.