discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

vector element arithmetic

JD
Jerry Davis
Wed, Jul 12, 2017 5:51 PM

This gives me an error. Any way of doing this?

v[2] = v[2] * 2;

Is the only way of doing this:

v1 = [v[0], v[1], v[2]*2];
and use v1?

--
Extra Ham Operator: K7AZJ
Registered Linux User: 275424
Raspberry Pi and Openscad developer

The most exciting phrase to hear in science - the one that heralds new
discoveries - is not "Eureka!" but "That's funny...".
- Isaac. Asimov

This gives me an error. Any way of doing this? v[2] = v[2] * 2; Is the only way of doing this: v1 = [v[0], v[1], v[2]*2]; and use v1? -- Extra Ham Operator: K7AZJ Registered Linux User: 275424 Raspberry Pi and Openscad developer *The most exciting phrase to hear in science - the one that heralds new discoveries - is not "Eureka!" but "That's funny...".*- Isaac. Asimov
NH
nop head
Wed, Jul 12, 2017 6:03 PM

Yes, you can never change a variable in OpenSCAD, even if it is a vector.

On 12 July 2017 at 18:51, Jerry Davis jdawgaz@gmail.com wrote:

This gives me an error. Any way of doing this?

v[2] = v[2] * 2;

Is the only way of doing this:

v1 = [v[0], v[1], v[2]*2];
and use v1?

--
Extra Ham Operator: K7AZJ
Registered Linux User: 275424
Raspberry Pi and Openscad developer

The most exciting phrase to hear in science - the one that heralds new
discoveries - is not "Eureka!" but "That's funny...".
- Isaac. Asimov


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

Yes, you can never change a variable in OpenSCAD, even if it is a vector. On 12 July 2017 at 18:51, Jerry Davis <jdawgaz@gmail.com> wrote: > This gives me an error. Any way of doing this? > > v[2] = v[2] * 2; > > Is the only way of doing this: > > v1 = [v[0], v[1], v[2]*2]; > and use v1? > > -- > Extra Ham Operator: K7AZJ > Registered Linux User: 275424 > Raspberry Pi and Openscad developer > > > *The most exciting phrase to hear in science - the one that heralds new > discoveries - is not "Eureka!" but "That's funny...".*- Isaac. Asimov > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > >