discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Re: How does concat() actually work ?

NH
nop head
Sun, May 29, 2022 7:14 PM

Use a list comprehension or recursion.

On Sun, 29 May 2022 at 20:06, Bogdan Caramalac via Discuss <
discuss@lists.openscad.org> wrote:

---------- Forwarded message ----------
From: fxeconomist@yahoo.com
To: discuss@lists.openscad.org
Cc:
Bcc:
Date: Sun, 29 May 2022 19:05:37 +0000
Subject: [OpenSCAD] Re: How does concat() actually work ?

I noticed it returns to an echo or to a new array, however it cannot
reassign arrays.

This works

piecePoints0=[ B0, A0, A1, B1 ]; piecePoints1=concat(piecePoints0,side0);

However, piecePoints0=concat(piecePoints(),side0); fills piecePoints()
only with side0 array.

How can I go around this ? I need to add a dynamic number of points
calculated inside a for loop.

---------- Forwarded message ----------
From: Bogdan Caramalac via Discuss discuss@lists.openscad.org
To: discuss@lists.openscad.org
Cc: fxeconomist@yahoo.com
Bcc:
Date: Sun, 29 May 2022 19:05:37 +0000
Subject: [OpenSCAD] Re: How does concat() actually work ?


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Use a list comprehension or recursion. On Sun, 29 May 2022 at 20:06, Bogdan Caramalac via Discuss < discuss@lists.openscad.org> wrote: > > > > ---------- Forwarded message ---------- > From: fxeconomist@yahoo.com > To: discuss@lists.openscad.org > Cc: > Bcc: > Date: Sun, 29 May 2022 19:05:37 +0000 > Subject: [OpenSCAD] Re: How does concat() actually work ? > > I noticed it returns to an echo or to a new array, however it cannot > reassign arrays. > > This works > > piecePoints0=[ B0, A0, A1, B1 ]; piecePoints1=concat(piecePoints0,side0); > > However, piecePoints0=concat(piecePoints(),side0); fills piecePoints() > only with side0 array. > > How can I go around this ? I need to add a dynamic number of points > calculated inside a for loop. > > > > > > > ---------- Forwarded message ---------- > From: Bogdan Caramalac via Discuss <discuss@lists.openscad.org> > To: discuss@lists.openscad.org > Cc: fxeconomist@yahoo.com > Bcc: > Date: Sun, 29 May 2022 19:05:37 +0000 > Subject: [OpenSCAD] Re: How does concat() actually work ? > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
F
fxeconomist@yahoo.com
Mon, May 30, 2022 10:16 AM

Thank you all for helping me on this. The syntax is undoubtedly obfuscated, but I’m starting to get used to it.

Thank you all for helping me on this. The syntax is undoubtedly obfuscated, but I’m starting to get used to it.