input a vector of vectors via the customizer pane

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

input a vector of vectors via the customizer pane

khackbarth

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


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: input a vector of vectors via the customizer pane

Parkinbot
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 at Nabble.com.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: input a vector of vectors via the customizer pane

khackbarth

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

 

From: Parkinbot <[hidden email]>
Sent: Wednesday, February 17, 2021 3:46 AM
To: [hidden email]
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 at Nabble.com.


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: input a vector of vectors via the customizer pane

Parkinbot
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 the OpenSCAD mailing list archive at Nabble.com.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org