discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Combinations of points

VB
Verachten Bruno
Fri, Jul 9, 2021 7:56 PM

Hi there,

Let's say I have a set of points (4 or more) on the same plane.

feet = [[0,0,0], [77,0,0], [14,45.50,0], [63,45.5,0]];

They represent the holes in PCBs; my goal is to generate simple supports.
For the time being, I link the four points with a cross like
https://github.com/MerryKombo/3DDesign/blob/master/assets/Server%20Rack/1U/boards/orangepi%20zero.png
.
I now need to generate something sturdier, with more links for bigger
boards with holes not forming a square like in
https://github.com/MerryKombo/3DDesign/blob/master/assets/Server%20Rack/1U/boards/zdcHZN2bVy.png
.

I was thinking of making a mesh (a mess?) of all points with the help
of BOSL2 combinations() and pairs() functions (so that I get each
point connected to every other point), but it looks like these
functions are not adapted to lists of points, just to arrays.

Would there be anything in more or less standard libraries to get the
job done, or am I on my own?

Thanks for your help.

Bruno Verachten

Hi there, Let's say I have a set of points (4 or more) on the same plane. feet = [[0,0,0], [77,0,0], [14,45.50,0], [63,45.5,0]]; They represent the holes in PCBs; my goal is to generate simple supports. For the time being, I link the four points with a cross like https://github.com/MerryKombo/3DDesign/blob/master/assets/Server%20Rack/1U/boards/orangepi%20zero.png . I now need to generate something sturdier, with more links for bigger boards with holes not forming a square like in https://github.com/MerryKombo/3DDesign/blob/master/assets/Server%20Rack/1U/boards/zdcHZN2bVy.png . I was thinking of making a mesh (a mess?) of all points with the help of BOSL2 combinations() and pairs() functions (so that I get each point connected to every other point), but it looks like these functions are not adapted to lists of points, just to arrays. Would there be anything in more or less standard libraries to get the job done, or am I on my own? Thanks for your help. -- Bruno Verachten
AM
Adrian Mariano
Fri, Jul 9, 2021 11:25 PM

If you just want to construct all pairs of distinct points then you can do
something like

pair_list = [for(p1=points, p2=points) if (p1!=p2) [p1,p2]];

On Fri, Jul 9, 2021 at 3:57 PM Verachten Bruno gounthar@gmail.com wrote:

Hi there,

Let's say I have a set of points (4 or more) on the same plane.

feet = [[0,0,0], [77,0,0], [14,45.50,0], [63,45.5,0]];

They represent the holes in PCBs; my goal is to generate simple supports.
For the time being, I link the four points with a cross like

https://github.com/MerryKombo/3DDesign/blob/master/assets/Server%20Rack/1U/boards/orangepi%20zero.png
.
I now need to generate something sturdier, with more links for bigger
boards with holes not forming a square like in

https://github.com/MerryKombo/3DDesign/blob/master/assets/Server%20Rack/1U/boards/zdcHZN2bVy.png
.

I was thinking of making a mesh (a mess?) of all points with the help
of BOSL2 combinations() and pairs() functions (so that I get each
point connected to every other point), but it looks like these
functions are not adapted to lists of points, just to arrays.

Would there be anything in more or less standard libraries to get the
job done, or am I on my own?

Thanks for your help.

Bruno Verachten


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

If you just want to construct all pairs of distinct points then you can do something like pair_list = [for(p1=points, p2=points) if (p1!=p2) [p1,p2]]; On Fri, Jul 9, 2021 at 3:57 PM Verachten Bruno <gounthar@gmail.com> wrote: > Hi there, > > Let's say I have a set of points (4 or more) on the same plane. > > feet = [[0,0,0], [77,0,0], [14,45.50,0], [63,45.5,0]]; > > They represent the holes in PCBs; my goal is to generate simple supports. > For the time being, I link the four points with a cross like > > https://github.com/MerryKombo/3DDesign/blob/master/assets/Server%20Rack/1U/boards/orangepi%20zero.png > . > I now need to generate something sturdier, with more links for bigger > boards with holes not forming a square like in > > https://github.com/MerryKombo/3DDesign/blob/master/assets/Server%20Rack/1U/boards/zdcHZN2bVy.png > . > > I was thinking of making a mesh (a mess?) of all points with the help > of BOSL2 combinations() and pairs() functions (so that I get each > point connected to every other point), but it looks like these > functions are not adapted to lists of points, just to arrays. > > Would there be anything in more or less standard libraries to get the > job done, or am I on my own? > > Thanks for your help. > -- > Bruno Verachten > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
VB
Verachten Bruno
Sat, Jul 10, 2021 6:51 AM

Nice, thank you Adrian.
I will give it a go.

On Sat, Jul 10, 2021 at 1:25 AM Adrian Mariano avm4@cornell.edu wrote:

If you just want to construct all pairs of distinct points then you can do something like

pair_list = [for(p1=points, p2=points) if (p1!=p2) [p1,p2]];

On Fri, Jul 9, 2021 at 3:57 PM Verachten Bruno gounthar@gmail.com wrote:

Hi there,

Let's say I have a set of points (4 or more) on the same plane.

feet = [[0,0,0], [77,0,0], [14,45.50,0], [63,45.5,0]];

They represent the holes in PCBs; my goal is to generate simple supports.
For the time being, I link the four points with a cross like
https://github.com/MerryKombo/3DDesign/blob/master/assets/Server%20Rack/1U/boards/orangepi%20zero.png
.
I now need to generate something sturdier, with more links for bigger
boards with holes not forming a square like in
https://github.com/MerryKombo/3DDesign/blob/master/assets/Server%20Rack/1U/boards/zdcHZN2bVy.png
.

I was thinking of making a mesh (a mess?) of all points with the help
of BOSL2 combinations() and pairs() functions (so that I get each
point connected to every other point), but it looks like these
functions are not adapted to lists of points, just to arrays.

Would there be anything in more or less standard libraries to get the
job done, or am I on my own?

Thanks for your help.

Bruno Verachten


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


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

--
Bruno Verachten

Nice, thank you Adrian. I will give it a go. On Sat, Jul 10, 2021 at 1:25 AM Adrian Mariano <avm4@cornell.edu> wrote: > > If you just want to construct all pairs of distinct points then you can do something like > > pair_list = [for(p1=points, p2=points) if (p1!=p2) [p1,p2]]; > > On Fri, Jul 9, 2021 at 3:57 PM Verachten Bruno <gounthar@gmail.com> wrote: >> >> Hi there, >> >> Let's say I have a set of points (4 or more) on the same plane. >> >> feet = [[0,0,0], [77,0,0], [14,45.50,0], [63,45.5,0]]; >> >> They represent the holes in PCBs; my goal is to generate simple supports. >> For the time being, I link the four points with a cross like >> https://github.com/MerryKombo/3DDesign/blob/master/assets/Server%20Rack/1U/boards/orangepi%20zero.png >> . >> I now need to generate something sturdier, with more links for bigger >> boards with holes not forming a square like in >> https://github.com/MerryKombo/3DDesign/blob/master/assets/Server%20Rack/1U/boards/zdcHZN2bVy.png >> . >> >> I was thinking of making a mesh (a mess?) of all points with the help >> of BOSL2 combinations() and pairs() functions (so that I get each >> point connected to every other point), but it looks like these >> functions are not adapted to lists of points, just to arrays. >> >> Would there be anything in more or less standard libraries to get the >> job done, or am I on my own? >> >> Thanks for your help. >> -- >> Bruno Verachten >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org -- Bruno Verachten