echo([1]+[1,2] );
echo([2]([1]+[1,2]));
echo([2][1] + [2]*[1,2]);
// ECHO: [2] ???
// ECHO: 4
// ECHO: undef
Is this intentional or a bug?
Would you expect a 1D or a 2D value as sum of a 1D vector and a 2D vector?
OpenSCAD silently returns a value procrusted to the lowest dimension. Matlab
returns a 2D value and doesn't differentiate between [1] and 1. Is it, what
you are opting for?
echo([1]+[1,2] ); // [2]
echo([1, 2, 3]+[1, 2]); //[1, 4]
echo(1+[1,2] ); // undef
--
Sent from: http://forum.openscad.org/
I would expect undef as the sum. So, [2]([1]+[1,2]) == [2][1]+[2]*[1,2])
== undef
Em qua, 5 de dez de 2018 às 17:07, Parkinbot rudolf@digitaldocument.de
escreveu:
Would you expect a 1D or a 2D value as sum of a 1D vector and a 2D vector?
OpenSCAD silently returns a value procrusted to the lowest dimension.
Matlab
returns a 2D value and doesn't differentiate between [1] and 1. Is it, what
you are opting for?
echo([1]+[1,2] ); // [2]
echo([1, 2, 3]+[1, 2]); //[1, 4]
echo(1+[1,2] ); // undef
--
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
I would not expect the truncation, so:
echo([1]+[1,2] ); // [2, 2]
echo([1, 2, 3]+[1, 2]); //[2, 4, 3]
echo(1+[1,2] ); // undef
On Wed, 5 Dec 2018 at 17:34, Ronaldo Persiano rcmpersiano@gmail.com wrote:
I would expect undef as the sum. So, [2]([1]+[1,2]) == [2][1]+[2]*[1,2])
== undef
Em qua, 5 de dez de 2018 às 17:07, Parkinbot rudolf@digitaldocument.de
escreveu:
Would you expect a 1D or a 2D value as sum of a 1D vector and a 2D
vector?
OpenSCAD silently returns a value procrusted to the lowest dimension.
Matlab
returns a 2D value and doesn't differentiate between [1] and 1. Is it,
what
you are opting for?
echo([1]+[1,2] ); // [2]
echo([1, 2, 3]+[1, 2]); //[1, 4]
echo(1+[1,2] ); // undef
--
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
I would expect
echo([1]+[2,3]) // undef
echo(1+[2,3]) // [3,4]
echo(1+[1,2,3]) // [2,3,4]
following the pattern
echo(5*[1,2]); // [5,10]
echo([5]*[1,2]); // undef
--
Sent from: http://forum.openscad.org/