I keep hitting this thread when trying to find a good example of using concat
for a particular task, which i've just figured out, so thought i'd post my
example.
I was wanting to generate a polygon given a start point, and a vector of
offset vectors. I used the pseudo-code provided above and came up with
this:
--
View this message in context: http://forum.openscad.org/concat-for-vectors-tp6348p13667.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
That's handy, thanks for sharing.
Note that using 'raw text' causes that bit to not go to the mailing list,
just the forum, unless you tick the 'Message is in HTML Format' box. (bug
with Nabble IMO)
Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above.
View this message in context: http://forum.openscad.org/concat-for-vectors-tp6348p13668.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
This is handy for debugging.
numeratePoints(calculatedPoints,every=2,start=1);
module numeratePoints(pointList,every=1,size=2,start=0) {
// every=2 gives even points
// every=2 & start=1 gives odd points
for(i=[start:every:len(pointList)])
translate([pointList[i].x,pointList[i].y,10])
%text(str(i),size=size,halign="center",valign="center");
}
Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above.
View this message in context: http://forum.openscad.org/concat-for-vectors-tp6348p13670.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
Very cool, thanks for that.
-----Original Message-----
From: Discuss [mailto:discuss-bounces@lists.openscad.org] On Behalf Of MichaelAtOz
Sent: Tuesday, 1 September 2015 3:18 p.m.
To: discuss@lists.openscad.org
Subject: Re: [OpenSCAD] concat() for vectors
This is handy for debugging.
numeratePoints(calculatedPoints,every=2,start=1);
module numeratePoints(pointList,every=1,size=2,start=0) { // every=2 gives even points // every=2 & start=1 gives odd points
for(i=[start:every:len(pointList)])
translate([pointList[i].x,pointList[i].y,10])
%text(str(i),size=size,halign="center",valign="center");
}
Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above.
View this message in context: http://forum.openscad.org/concat-for-vectors-tp6348p13670.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Oops that should be
len(pointList)-1
Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above.
View this message in context: http://forum.openscad.org/concat-for-vectors-tp6348p13676.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
Hi Chalmes,
Do you have any particular licensing of you contribution? Or public domain?
Michael
Newly minted Admin - PM me if you need anything, or if I've done something stupid...
Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) - Obviously inclusion of works of previous authors is not included in the above.
View this message in context: http://forum.openscad.org/concat-for-vectors-tp6348p13684.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
Oh, public domain, free for all. Just use it already! :)
On 2/09/2015, at 3:21 pm, MichaelAtOz oz.at.michael@gmail.com wrote:
Hi Chalmes,
Do you have any particular licensing of you contribution? Or public domain?
Michael
Newly minted Admin - PM me if you need anything, or if I've done something stupid...
Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) - Obviously inclusion of works of previous authors is not included in the above.
View this message in context: http://forum.openscad.org/concat-for-vectors-tp6348p13684.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org