keygen
keygen copied to clipboard
Example does not run
I can't run the example on macOS Mojave Version 10.14.5:
Alexs-MacBook-Pro-2124:keygen alex$ bin/keygen.py scad/kwikset.scad --bitting 25536 -o housekey.stl
Traceback (most recent call last):
File "bin/keygen.py", line 36, in <module>
r = subprocess.call([scad, args.filename, "-o", args.output] + opts + remaining)
File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 323, in call
with Popen(*popenargs, **kwargs) as p:
File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 775, in __init__
restore_signals, start_new_session)
File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 1522, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'openscad': 'openscad'
Running export SCAD=/Applications/OpenSCAD.app/Contents/MacOS/OpenSCAD
prior to bin/keygen.py scad/kwikset.scad --bitting 25536 -o housekey.stl
fixes the error above but then I get
Alexs-MacBook-Pro-2124:keygen alex$ bin/keygen.py scad/kwikset.scad --bitting 25536 -o housekey.stl
WARNING: Can't open include file 'kwikset.gen.scad'.
WARNING: Ignoring unknown variable 'outline_points', in file kwikset.scad, line 16.
WARNING: Ignoring unknown variable 'outline_paths', in file kwikset.scad, line 16.
WARNING: Ignoring unknown variable 'outline_points', in file kwikset.scad, line 17.
WARNING: Ignoring unknown variable 'outline_points', in file kwikset.scad, line 17.
WARNING: Ignoring unknown variable 'engrave_points', in file kwikset.scad, line 18.
WARNING: Ignoring unknown variable 'engrave_paths', in file kwikset.scad, line 19.
WARNING: Ignoring unknown variable 'warding_kw1_points', in file kwikset.scad, line 21.
WARNING: min() parameter could not be converted, in file keygen.scad, line 81
WARNING: min() parameter could not be converted, in file keygen.scad, line 81
WARNING: max() parameter could not be converted, in file keygen.scad, line 82
WARNING: max() parameter could not be converted, in file keygen.scad, line 82
WARNING: abs() parameter could not be converted, in file keygen.scad, line 98
WARNING: abs() parameter could not be converted, in file keygen.scad, line 99
WARNING: Unable to convert square(size=[36, undef], ...) parameter to a number or a vec2 of numbers, in file keygen.scad, line 50
WARNING: Unable to convert square(size=[36, undef], ...) parameter to a number or a vec2 of numbers, in file keygen.scad, line 50
WARNING: Unable to convert translate([undef, 0, 0]) parameter to a vec3 or vec2 of numbers, in file keygen.scad, line 61
WARNING: Unable to convert translate([undef, 0, 0]) parameter to a vec3 or vec2 of numbers, in file keygen.scad, line 61
WARNING: Scaling a 2D object with 0 - removing object
Current top level object is empty.
It looks like your OpenSCAD isn't finding the included file kwikset.gen.scad
.
According to this page on OpenSCAD's wiki,
Library files are searched for in the same folder as the design was open from
but your OpenSCAD doesn't seem to be searching there.
It might be searching the current working directory. Try this:
cd scad
../bin/keygen.py kwikset.scad --bitting 25536 -o housekey.stl
What version of OpenSCAD do you have?
Did you get this running? I would like to close this issue.
I am having the same issue on Mac. I was getting the same error above of:
Traceback (most recent call last):
File "bin/keygen.py", line 36, in <module>
r = subprocess.call([scad, args.filename, "-o", args.output] + opts + remaining)
File "/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 323, in call
with Popen(*popenargs, **kwargs) as p:
File "/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 775, in __init__
restore_signals, start_new_session)
File "/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 1522, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'openscad': 'openscad'
I then tried export SCAD=/Applications/OpenSCAD.app/Contents/MacOS/OpenSCAD
as @alexbirkett suggested and got the same type of errors:
WARNING: Can't open include file 'kwikset.gen.scad'.
WARNING: Ignoring unknown variable 'outline_points'.
WARNING: Ignoring unknown variable 'outline_paths'.
WARNING: Ignoring unknown variable 'outline_points'.
WARNING: Ignoring unknown variable 'outline_points'.
WARNING: Ignoring unknown variable 'engrave_points'.
WARNING: Ignoring unknown variable 'engrave_paths'.
WARNING: Ignoring unknown variable 'warding_kw1_points'.
Current top level object is empty.
I also tried starting in the scad
directory as you suggested but the same errors above persisted.
for me, there is no kwikset.gen.scad
file - I'm getting the same errors as above on Mac with OpenSCAD 2019.05.
FYI, I got this working by checking out a really old release. The kwikset.gen.scad
was in the repo.
I have added the .gen.scad
files to the repo. They can be re-generated by running make
, but this requires Inkscape to be installed.
Thanks @ervanalb-vs