keygen icon indicating copy to clipboard operation
keygen copied to clipboard

Example does not run

Open alexbirkett opened this issue 5 years ago • 8 comments

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'

alexbirkett avatar May 30 '19 15:05 alexbirkett

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.

alexbirkett avatar May 30 '19 16:05 alexbirkett

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?

ervanalb avatar May 31 '19 03:05 ervanalb

Did you get this running? I would like to close this issue.

ervanalb avatar Jul 24 '19 02:07 ervanalb

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.

tvirelli avatar Sep 03 '19 14:09 tvirelli

for me, there is no kwikset.gen.scad file - I'm getting the same errors as above on Mac with OpenSCAD 2019.05.

ukd1 avatar Oct 20 '19 20:10 ukd1

FYI, I got this working by checking out a really old release. The kwikset.gen.scad was in the repo.

ukd1 avatar Oct 25 '19 18:10 ukd1

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.

ervanalb-vs avatar Oct 27 '19 16:10 ervanalb-vs

Thanks @ervanalb-vs

ukd1 avatar Oct 28 '19 19:10 ukd1