discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

input a vector of vectors via the customizer pane

K
ken@volksswitch.org
Tue, Feb 16, 2021 5:17 PM

I'd like to input a vector of the type [[a,b],[c,d]] via the Customizer
pane.

I am able to input  a simple vector with a line that looks like this:

Variable = [];

Then I can paste the value [a,b,c,d,e] into the Customizer pane and process
that vector within the code.

For a vector of vectors, I've tried:

Variable = [[],[]];

But I can't change the displayed value by pasting [[a,b],[c,d]].

I'd be OK with using a string input variable and then using some conversion
function to take the string "[[a,b],[c,d]]" and turn it into a vector, but I
don't see that functionality in vanilla OpenSCAD.

Any ideas?

Thanks,

Ken

I'd like to input a vector of the type [[a,b],[c,d]] via the Customizer pane. I am able to input a simple vector with a line that looks like this: Variable = []; Then I can paste the value [a,b,c,d,e] into the Customizer pane and process that vector within the code. For a vector of vectors, I've tried: Variable = [[],[]]; But I can't change the displayed value by pasting [[a,b],[c,d]]. I'd be OK with using a string input variable and then using some conversion function to take the string "[[a,b],[c,d]]" and turn it into a vector, but I don't see that functionality in vanilla OpenSCAD. Any ideas? Thanks, Ken
P
Parkinbot
Wed, Feb 17, 2021 10:46 AM

how about

--
Sent from: http://forum.openscad.org/

how about -- Sent from: http://forum.openscad.org/
K
ken@volksswitch.org
Wed, Feb 17, 2021 6:46 PM

Yes, though that creates two inputs in the customizer rather than one.

From: Parkinbot rudolf@digitaldocument.de
Sent: Wednesday, February 17, 2021 3:46 AM
To: discuss@lists.openscad.org
Subject: Re: [OpenSCAD] input a vector of vectors via the customizer pane

how about

ab=[5, 10];//[[-100:100], [-100:100]]
cd=[5, 10];//[[-100:100], [-100:100]]
abcd = [ab, cd];
echo(abcd);


Sent from the OpenSCAD mailing list archive http://forum.openscad.org/  at
Nabble.com.

Yes, though that creates two inputs in the customizer rather than one. From: Parkinbot <rudolf@digitaldocument.de> Sent: Wednesday, February 17, 2021 3:46 AM To: discuss@lists.openscad.org Subject: Re: [OpenSCAD] input a vector of vectors via the customizer pane how about ab=[5, 10];//[[-100:100], [-100:100]] cd=[5, 10];//[[-100:100], [-100:100]] abcd = [ab, cd]; echo(abcd); _____ Sent from the OpenSCAD mailing list archive <http://forum.openscad.org/> at Nabble.com.
P
Parkinbot
Thu, Feb 18, 2021 12:30 PM

To get a single input line, you obviously can write:

abcd=[5, 10, 5, 10];//[[-100:100], [-100:100], [-100:100], [-100:100]]
variable= [[abcd[0],abcd[1]], [abcd[2], abcd[3]]];

echo(variable);

However, you are right, this is just a work around, as the customizer isn't
as structure sensitive as it could/should be.

--
Sent from: http://forum.openscad.org/

To get a single input line, you obviously can write: abcd=[5, 10, 5, 10];//[[-100:100], [-100:100], [-100:100], [-100:100]] variable= [[abcd[0],abcd[1]], [abcd[2], abcd[3]]]; echo(variable); However, you are right, this is just a work around, as the customizer isn't as structure sensitive as it could/should be. -- Sent from: http://forum.openscad.org/