discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Re: [OpenSCAD] Commandline & array?

K
kintel
Mon, Mar 23, 2015 5:18 PM

You need to specify -D for each parameter:
$ openscad -o test.stl -D 'x=[0,1,2,3,0]' -D 'y=[0,1,2,3,4]' test.scad

--
View this message in context: http://forum.openscad.org/Commandline-array-tp12113p12155.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

You need to specify -D for each parameter: $ openscad -o test.stl -D 'x=[0,1,2,3,0]' -D 'y=[0,1,2,3,4]' test.scad -- View this message in context: http://forum.openscad.org/Commandline-array-tp12113p12155.html Sent from the OpenSCAD mailing list archive at Nabble.com.
B
barryp
Mon, Mar 23, 2015 8:09 PM

I've also tried this (note: I'm using a Mac, so OSX no Windows), but then got
a strange 'input cursor' in my Terminal screen (and no output..)

See screenshot at:
https://www.dropbox.com/s/iazlowaro5xw11c/openscad_commandline.png?dl=0

Barry

--
View this message in context: http://forum.openscad.org/Commandline-array-tp12113p12160.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

I've also tried this (note: I'm using a Mac, so OSX no Windows), but then got a strange 'input cursor' in my Terminal screen (and no output..) See screenshot at: https://www.dropbox.com/s/iazlowaro5xw11c/openscad_commandline.png?dl=0 Barry -- View this message in context: http://forum.openscad.org/Commandline-array-tp12113p12160.html Sent from the OpenSCAD mailing list archive at Nabble.com.
B
barryp
Mon, Mar 23, 2015 8:47 PM

New test on Windows 7 machine:

It results in a syntax error.. Strange...

OpenSCAD testscript:

translate ([7x[0],0,0]) { cylinder(h=5,r=5);
}
translate ([7
x[1],0,0]) {
cylinder(h=5,r=5);
}

translate ([7*x[2],0,0]) {
cylinder(h=5,r=5);
}

Command prompt and result:

C:\Program Files\OpenSCAD>OpenSCAD.com -o c:\temp\test.stl -D 'x=[123]'
c:\temp
test1.scad
ERROR: Parser error in line 8: syntax error

Can't parse file 'c:\temp\test1.scad'!

--
View this message in context: http://forum.openscad.org/Commandline-array-tp12113p12161.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

New test on Windows 7 machine: It results in a syntax error.. Strange... OpenSCAD testscript: translate ([7*x[0],0,0]) { cylinder(h=5,r=5); } translate ([7*x[1],0,0]) { cylinder(h=5,r=5); } translate ([7*x[2],0,0]) { cylinder(h=5,r=5); } Command prompt and result: C:\Program Files\OpenSCAD>OpenSCAD.com -o c:\temp\test.stl -D 'x=[123]' c:\temp\ test1.scad ERROR: Parser error in line 8: syntax error Can't parse file 'c:\temp\test1.scad'! -- View this message in context: http://forum.openscad.org/Commandline-array-tp12113p12161.html Sent from the OpenSCAD mailing list archive at Nabble.com.
BV
Bram Vaessen
Mon, Mar 23, 2015 9:04 PM

Seems like you try to access 3 elements of a  array with only 1
element (123)...?

2015-03-23 21:47 GMT+01:00 barryp barry.peet@gmail.com:

New test on Windows 7 machine:

It results in a syntax error.. Strange...

OpenSCAD testscript:

translate ([7x[0],0,0]) { cylinder(h=5,r=5);
}
translate ([7
x[1],0,0]) {
cylinder(h=5,r=5);
}

translate ([7*x[2],0,0]) {
cylinder(h=5,r=5);
}

Command prompt and result:

C:\Program Files\OpenSCAD>OpenSCAD.com -o c:\temp\test.stl -D 'x=[123]'
c:\temp
test1.scad
ERROR: Parser error in line 8: syntax error

Can't parse file 'c:\temp\test1.scad'!

--
View this message in context: http://forum.openscad.org/Commandline-array-tp12113p12161.html
Sent from the OpenSCAD mailing list archive at Nabble.com.


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

Seems like you try to access 3 elements of a array with only 1 element (123)...? 2015-03-23 21:47 GMT+01:00 barryp <barry.peet@gmail.com>: > New test on Windows 7 machine: > > It results in a syntax error.. Strange... > > OpenSCAD testscript: > > translate ([7*x[0],0,0]) { cylinder(h=5,r=5); > } > translate ([7*x[1],0,0]) { > cylinder(h=5,r=5); > } > > translate ([7*x[2],0,0]) { > cylinder(h=5,r=5); > } > > Command prompt and result: > > C:\Program Files\OpenSCAD>OpenSCAD.com -o c:\temp\test.stl -D 'x=[123]' > c:\temp\ > test1.scad > ERROR: Parser error in line 8: syntax error > > Can't parse file 'c:\temp\test1.scad'! > > > > -- > View this message in context: http://forum.openscad.org/Commandline-array-tp12113p12161.html > Sent from the OpenSCAD mailing list archive at Nabble.com. > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
LG
Laurence Gonsalves
Mon, Mar 23, 2015 9:19 PM

In your screenshot it looks like you're using "curly quotes" for the first
three of those single-quotes. The fourth one looks like a
straight-single-quote (ie: straight apostrophe). Since bash doesn't
recognize curly quotes as special characters, only the fourth quote is
treated as a quotation mark, and hence the end of your line is still
"inside quotes" from its point of view. That's why you get the weird
prompt: it wants you to close the string.

In short, avoid using curly-quotes in the shell/terminal.

On Mar 23, 2015 1:09 PM, "barryp" barry.peet@gmail.com wrote:

I've also tried this (note: I'm using a Mac, so OSX no Windows), but then
got
a strange 'input cursor' in my Terminal screen (and no output..)

See screenshot at:
https://www.dropbox.com/s/iazlowaro5xw11c/openscad_commandline.png?dl=0

Barry

--
View this message in context:
http://forum.openscad.org/Commandline-array-tp12113p12160.html
Sent from the OpenSCAD mailing list archive at Nabble.com.


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

In your screenshot it looks like you're using "curly quotes" for the first three of those single-quotes. The fourth one looks like a straight-single-quote (ie: straight apostrophe). Since bash doesn't recognize curly quotes as special characters, only the fourth quote is treated as a quotation mark, and hence the end of your line is still "inside quotes" from its point of view. That's why you get the weird prompt: it wants you to close the string. In short, avoid using curly-quotes in the shell/terminal. On Mar 23, 2015 1:09 PM, "barryp" <barry.peet@gmail.com> wrote: > I've also tried this (note: I'm using a Mac, so OSX no Windows), but then > got > a strange 'input cursor' in my Terminal screen (and no output..) > > See screenshot at: > https://www.dropbox.com/s/iazlowaro5xw11c/openscad_commandline.png?dl=0 > > Barry > > > > -- > View this message in context: > http://forum.openscad.org/Commandline-array-tp12113p12160.html > Sent from the OpenSCAD mailing list archive at Nabble.com. > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >