discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

showing vector within vector in user manual

LB
L Boyd
Fri, Sep 18, 2015 4:21 PM

I am plying in my sandbox, trying to add a polygon example without a hole to
the user manual.

It works fine in OpenSCAD, but whenI try to show it with WikiBooks I run
into a problem.

when I try to show:
polygon(points=[[0,0],[100,0],[130,50],[30,50]], paths=[[0,1,2,3]]);
the result is this:
polygon(points=[[0,0],[100,0],[130,50],[30,50]], paths=0,1,2,3);

The following all display what is specified:
a=[[0,0],[100,0],[130,50],[30,50]];
b=[[0,1,2,3],[]];
b=[0,1,2,3];

but this, which is the correct syntax:
b=[[0,1,2,3]];
shows this:
b=0,1,2,3;

where the brackets are removed and the numbers highlighted in red.

--
View this message in context: http://forum.openscad.org/showing-vector-within-vector-in-user-manual-tp13885.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

I am plying in my sandbox, trying to add a polygon example without a hole to the user manual. It works fine in OpenSCAD, but whenI try to show it with WikiBooks I run into a problem. when I try to show: polygon(points=[[0,0],[100,0],[130,50],[30,50]], paths=[[0,1,2,3]]); the result is this: polygon(points=[[0,0],[100,0],[130,50],[30,50]], paths=0,1,2,3); The following all display what is specified: a=[[0,0],[100,0],[130,50],[30,50]]; b=[[0,1,2,3],[]]; b=[0,1,2,3]; but this, which is the correct syntax: b=[[0,1,2,3]]; shows this: b=0,1,2,3; where the brackets are removed and the numbers highlighted in red. -- View this message in context: http://forum.openscad.org/showing-vector-within-vector-in-user-manual-tp13885.html Sent from the OpenSCAD mailing list archive at Nabble.com.
TP
Torsten Paul
Fri, Sep 18, 2015 5:23 PM

On 09/18/2015 06:21 PM, L Boyd wrote:

but this, which is the correct syntax:
b=[[0,1,2,3]];
shows this:
b=0,1,2,3;

where the brackets are removed and the numbers highlighted in red.

That's because [[ is wiki markup.

Looking at https://www.mediawiki.org/wiki/Help:Formatting the following
might work:

<nowiki>b=[[0,1,2,3]];</nowiki>

ciao,
Torsten.

On 09/18/2015 06:21 PM, L Boyd wrote: > but this, which is the correct syntax: > b=[[0,1,2,3]]; > shows this: > b=0,1,2,3; > > where the brackets are removed and the numbers highlighted in red. > That's because [[ is wiki markup. Looking at https://www.mediawiki.org/wiki/Help:Formatting the following might work: <nowiki>b=[[0,1,2,3]];</nowiki> ciao, Torsten.
M
MichaelAtOz
Fri, Sep 18, 2015 10:14 PM

The wiki also uses the following construct;

<source lang="javascript"> // generate a list with all values defined by a range list1 = [ for (i = [0 : 2 : 10]) i ]; echo(list1); // ECHO: [0, 2, 4, 6, 8, 10] </source>

Newly minted Admin - PM me if you need anything, or if I've done something stupid...

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.”  Fight it! http://www.ourfairdeal.org/  time is running out!

View this message in context: http://forum.openscad.org/showing-vector-within-vector-in-user-manual-tp13885p13892.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

The wiki also uses the following construct; <source lang="javascript"> // generate a list with all values defined by a range list1 = [ for (i = [0 : 2 : 10]) i ]; echo(list1); // ECHO: [0, 2, 4, 6, 8, 10] </source> ----- Newly minted Admin - PM me if you need anything, or if I've done something stupid... Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above. The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out! -- View this message in context: http://forum.openscad.org/showing-vector-within-vector-in-user-manual-tp13885p13892.html Sent from the OpenSCAD mailing list archive at Nabble.com.
LB
L Boyd
Sat, Sep 19, 2015 11:18 AM

<nowiki>b=[[0,1,2,3]];</nowiki>  does the job. tnx

--
View this message in context: http://forum.openscad.org/showing-vector-within-vector-in-user-manual-tp13885p13896.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

<nowiki>b=[[0,1,2,3]];</nowiki> does the job. tnx -- View this message in context: http://forum.openscad.org/showing-vector-within-vector-in-user-manual-tp13885p13896.html Sent from the OpenSCAD mailing list archive at Nabble.com.