SolidCode / SolidPython

A python frontend for solid modelling that compiles to OpenSCAD
1.11k stars 173 forks source link

Importing OpenSCAD code with Python keywords as arguments fails #99

Closed etjones closed 5 years ago

etjones commented 5 years ago

If we put this code in test.scad:

module bad_arg(arg, or)
{
    cube(1);
}

then try to include it with this SolidPython code:

from solid import *
use('test.scad')
a = bad_arg( 1, 2)
scad_render_to_file(a, 'test.py')

There should be a compilation error, since the OpenSCAD module is valid code, but or as an argument name is a syntax error in Python.

One SCAD source for this in the wild is: here Thanks to Phillip Anderson for pointing this out.