Qbort
June 16, 2020, 2:39pm
1
I’m trying to help out the librarians by attempting to improve the 3D model script generators
I have created an issue in GitHub about this but thought I’d also post here for help: https://github.com/easyw/kicad-3d-models-in-freecad/issues/373
I am on Windows 10, FreeCAD version 0.17 and cadquery_module installed from within FreeCAD.
I have opened command prompt and navigated to cadquery\FCAD_script_generator\QFN_packages and run below two commands:
taskkill -im freecad.exe /f
start "" "C:\Program Files\FreeCAD 0.17\bin\freecad" main_generator.py QFN-16-1EP_3x3mm_Pitch0.5mm
When FreeCAD opens I get below error message in the FreeCAD console:
QFN-16-1EP_3x3mm_Pitch0.5mmException while processing file: main_generator.py [global name 'math' is not defined] File format not supported: QFN-16-1EP_3x3mm_Pitch0.5mm
Is this a bug or is my configuration incorrect?
Thanks.
What version of the cadquerry module do you have?
What python version is used by your freecad?
Qbort
June 16, 2020, 3:38pm
3
My FreeCad version is 0.17
I just checked the python version within FreeCad. It is 2.7.14
I installed cadquery from within FreeCad - I’m not sure how to check the version. I read somewhere in the documentation that this is how you do it: Tools -> Addon Manager
Qbort
June 16, 2020, 11:27pm
4
Just a quick note in case it helps someone else: I followed advice from easyw in github and installed FreeCad 0.18 and now it works perfectly!
It appears the script is no longer compatible with Python 2 and therefore not compatible with FreeCad 0.17 and earlier.
3 Likes
maui
June 18, 2020, 8:16am
5
the error you are having is related to math…
simply adding in ‘main_generator.py’ before the line:
http://easyw/kicad-3d-models-in-freecad/cadquery/FCAD_script_generator/QFN_packages/main_generator.py#L57
from math import tan, radians, sqrt
the following code:
import math
from math import tan, radians, sqrt
the script will also run in FC0.17
1 Like
Qbort
June 18, 2020, 10:59am
6
@maui - yes sorry I forgot to update this thread.
I created a pull request last night to fix this and other issues: https://github.com/easyw/kicad-3d-models-in-freecad/pull/374
Link to specific fix for the issue of ‘math’ not defined (I did same as you suggested above of adding import math
: https://github.com/easyw/kicad-3d-models-in-freecad/pull/374/commits/23601629eaed8e6943e8d6a5f6f687ddb29e0fc1#diff-9f0f6028899f51cd72d95a19564e85c7
Note the pull request is still work in progress - please do not merge it just yet until I have completed all changes.
1 Like
system
Closed
September 16, 2020, 11:06am
7
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.