discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

thought it was a simple geometry problem....

BB
Bruno Boettcher
Fri, Dec 16, 2022 4:28 PM

Hello!

wanted to play around with printed ball bearings (or sort of)
The math looked simple enough (added the Kugellager svg to illustrate what
i tried)
with that formula, depending on n i can fill a ring with circles around the
original circle....
since i am starting there are no concerns for clearings, that will come
later....

this works well up to n=10..... and afterwards it goes sideways... :'( At
some point I get a fused circle around the original circle..... that
doesn't bode well for a functioning part....

So even if I am able to test it up to 10 bearing balls, if anybody has a
hint  on where my error lies?

BTW i put the files as attachments, would there have been a better way to
pass them on?

ciao
Bruno

---==========
http://nohkumado.eu/, http://bboett.free.frhttp://aikido.nohkumado.eu/,
http://bboett.free.fr
http://aikido.zorn.free.fr

Hello! wanted to play around with printed ball bearings (or sort of) The math looked simple enough (added the Kugellager svg to illustrate what i tried) with that formula, depending on n i can fill a ring with circles around the original circle.... since i am starting there are no concerns for clearings, that will come later.... this works well up to n=10..... and afterwards it goes sideways... :'( At some point I get a fused circle around the original circle..... that doesn't bode well for a functioning part.... So even if I am able to test it up to 10 bearing balls, if anybody has a hint on where my error lies? BTW i put the files as attachments, would there have been a better way to pass them on? -- ciao Bruno =========================================== http://nohkumado.eu/, <http://bboett.free.fr>http://aikido.nohkumado.eu/, <http://bboett.free.fr> http://aikido.zorn.free.fr
JB
Jordan Brown
Fri, Dec 16, 2022 5:36 PM

I didn't really try to understand the program - I only observed that
something went bad abruptly at a particular point, which suggested that
there was a boolean at work.

One of the key variables in the creation of your "balls" is

      dx = (rk<wd)? wd: rk,

If you set it to rk, and never to wd, you seem to get the right answer. 
If you set it to wd, you get the wrong answer, pretty much all the time.

I think wd is setting a minimum size on the "balls", and when there are
more balls than will fit around the core, it's bad.

I didn't really try to understand the program - I only observed that something went bad abruptly at a particular point, which suggested that there was a boolean at work. One of the key variables in the creation of your "balls" is dx = (rk<wd)? wd: rk, If you set it to rk, and never to wd, you seem to get the right answer.  If you set it to wd, you get the wrong answer, pretty much all the time. I think wd is setting a minimum size on the "balls", and when there are more balls than will fit around the core, it's bad.
DM
Douglas Miller
Fri, Dec 16, 2022 5:49 PM

I think your problem is with this line in function halbrund():

dx = (rk<wd)? wd: rk,

It's not clear to me what the purpose of this line is, but I think
you'll see better results if you replace it with this:

dx = rk,

On 12/16/2022 11:28 AM, Bruno Boettcher wrote:

Hello!

wanted to play around with printed ball bearings (or sort of)
The math looked simple enough (added the Kugellager svg to illustrate
what i tried)
with that formula, depending on n i can fill a ring with circles
around the original circle....
since i am starting there are no concerns for clearings, that will
come later....

this works well up to n=10..... and afterwards it goes sideways... :'(
At some point I get a fused circle around the original circle.....
that doesn't bode well for a functioning part....

So even if I am able to test it up to 10 bearing balls, if anybody has
a hint  on where my error lies?

BTW i put the files as attachments, would there have been a better way
to pass them on?

ciao
Bruno

---==========
http://nohkumado.eu/,
http://bboett.free.frhttp://aikido.nohkumado.eu/,
http://bboett.free.fr
http://aikido.zorn.free.fr

I think your problem is with this line in function halbrund(): dx = (rk<wd)? wd: rk, It's not clear to me what the purpose of this line is, but I think you'll see better results if you replace it with this: dx = rk, On 12/16/2022 11:28 AM, Bruno Boettcher wrote: > Hello! > > wanted to play around with printed ball bearings (or sort of) > The math looked simple enough (added the Kugellager svg to illustrate > what i tried) > with that formula, depending on n i can fill a ring with circles > around the original circle.... > since i am starting there are no concerns for clearings, that will > come later.... > > this works well up to n=10..... and afterwards it goes sideways... :'( > At some point I get a fused circle around the original circle..... > that doesn't bode well for a functioning part.... > > So even if I am able to test it up to 10 bearing balls, if anybody has > a hint  on where my error lies? > > BTW i put the files as attachments, would there have been a better way > to pass them on? > -- > ciao > Bruno > > =========================================== > http://nohkumado.eu/, > <http://bboett.free.fr>http://aikido.nohkumado.eu/, > <http://bboett.free.fr> > http://aikido.zorn.free.fr
FS
FF Systems
Fri, Dec 16, 2022 7:42 PM

It is an arcane C form of "if/else".  Arcane, but it still works in most
compilers and apparently OpenSCAD.

The "?" specifies the boolean test.  The next statement is "if true", and
the ":" separates the final statement which is "if false".

So, it reads as "if (rk<wd) dx = wd else dx = rk;".

On Fri, Dec 16, 2022 at 1:21 PM Douglas Miller doug@milmac.com wrote:

I think your problem is with this line in function halbrund():

dx = (rk<wd)? wd: rk,

It's not clear to me what the purpose of this line is, but I think you'll
see better results if you replace it with this:

dx = rk,

On 12/16/2022 11:28 AM, Bruno Boettcher wrote:

Hello!

wanted to play around with printed ball bearings (or sort of)
The math looked simple enough (added the Kugellager svg to illustrate what
i tried)
with that formula, depending on n i can fill a ring with circles around
the original circle....
since i am starting there are no concerns for clearings, that will come
later....

this works well up to n=10..... and afterwards it goes sideways... :'( At
some point I get a fused circle around the original circle..... that
doesn't bode well for a functioning part....

So even if I am able to test it up to 10 bearing balls, if anybody has a
hint  on where my error lies?

BTW i put the files as attachments, would there have been a better way to
pass them on?

ciao
Bruno

---==========
http://nohkumado.eu/, http://bboett.free.frhttp://aikido.nohkumado.eu/,
http://bboett.free.fr
http://aikido.zorn.free.fr


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

It is an arcane C form of "if/else". Arcane, but it still works in most compilers and apparently OpenSCAD. The "?" specifies the boolean test. The next statement is "if true", and the ":" separates the final statement which is "if false". So, it reads as "if (rk<wd) dx = wd else dx = rk;". On Fri, Dec 16, 2022 at 1:21 PM Douglas Miller <doug@milmac.com> wrote: > I think your problem is with this line in function halbrund(): > > dx = (rk<wd)? wd: rk, > > > It's not clear to me what the purpose of this line is, but I think you'll > see better results if you replace it with this: > > dx = rk, > > > > > On 12/16/2022 11:28 AM, Bruno Boettcher wrote: > > Hello! > > wanted to play around with printed ball bearings (or sort of) > The math looked simple enough (added the Kugellager svg to illustrate what > i tried) > with that formula, depending on n i can fill a ring with circles around > the original circle.... > since i am starting there are no concerns for clearings, that will come > later.... > > this works well up to n=10..... and afterwards it goes sideways... :'( At > some point I get a fused circle around the original circle..... that > doesn't bode well for a functioning part.... > > So even if I am able to test it up to 10 bearing balls, if anybody has a > hint on where my error lies? > > BTW i put the files as attachments, would there have been a better way to > pass them on? > -- > ciao > Bruno > > =========================================== > http://nohkumado.eu/, <http://bboett.free.fr>http://aikido.nohkumado.eu/, > <http://bboett.free.fr> > http://aikido.zorn.free.fr > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
DM
Douglas Miller
Sat, Dec 17, 2022 12:42 PM

I've been writing C code since the 1980s. I understand perfectly what
that line DOES. The question is WHY?

On 12/16/2022 2:42 PM, FF Systems wrote:

It is an arcane C form of "if/else".  Arcane, but it still works in
most compilers and apparently OpenSCAD.

The "?" specifies the boolean test.  The next statement is "if true",
and the ":" separates the final statement which is "if false".

So, it reads as "if (rk<wd) dx = wd else dx = rk;".

On Fri, Dec 16, 2022 at 1:21 PM Douglas Miller doug@milmac.com wrote:

 I think your problem is with this line in function halbrund():

     dx = (rk<wd)? wd: rk,


 It's not clear to me what the purpose of this line is, but I think
 you'll see better results if you replace it with this:

     dx = rk,
I've been writing C code since the 1980s. I understand perfectly what that line DOES. The question is WHY? On 12/16/2022 2:42 PM, FF Systems wrote: > It is an arcane C form of "if/else".  Arcane, but it still works in > most compilers and apparently OpenSCAD. > > The "?" specifies the boolean test.  The next statement is "if true", > and the ":" separates the final statement which is "if false". > > So, it reads as "if (rk<wd) dx = wd else dx = rk;". > > On Fri, Dec 16, 2022 at 1:21 PM Douglas Miller <doug@milmac.com> wrote: > > I think your problem is with this line in function halbrund(): > > dx = (rk<wd)? wd: rk, > > > It's not clear to me what the purpose of this line is, but I think > you'll see better results if you replace it with this: > > dx = rk, > >
BB
Bruno Boettcher
Sat, Dec 17, 2022 1:25 PM

i had the problem that when the numbers grow too small, i get warnings
about non-conform polyhedra, and i wanted to ensure that the distances
between surfaces always keep big enough not to trigger that error.....
And that error crept in, because on the first try i spared a variable by
using the same value for dx and dy, on splitting i forgot that shortcut and
protection and left it on the wrong axis....

Am Sa., 17. Dez. 2022 um 13:42 Uhr schrieb Douglas Miller doug@milmac.com:

I've been writing C code since the 1980s. I understand perfectly what that
line DOES. The question is WHY?

On 12/16/2022 2:42 PM, FF Systems wrote:

It is an arcane C form of "if/else".  Arcane, but it still works in most
compilers and apparently OpenSCAD.

The "?" specifies the boolean test.  The next statement is "if true", and
the ":" separates the final statement which is "if false".

So, it reads as "if (rk<wd) dx = wd else dx = rk;".

On Fri, Dec 16, 2022 at 1:21 PM Douglas Miller doug@milmac.com wrote:

I think your problem is with this line in function halbrund():

dx = (rk<wd)? wd: rk,

It's not clear to me what the purpose of this line is, but I think you'll
see better results if you replace it with this:

dx = rk,


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

i had the problem that when the numbers grow too small, i get warnings about non-conform polyhedra, and i wanted to ensure that the distances between surfaces always keep big enough not to trigger that error..... And that error crept in, because on the first try i spared a variable by using the same value for dx and dy, on splitting i forgot that shortcut and protection and left it on the wrong axis.... Am Sa., 17. Dez. 2022 um 13:42 Uhr schrieb Douglas Miller <doug@milmac.com>: > I've been writing C code since the 1980s. I understand perfectly what that > line DOES. The question is WHY? > > On 12/16/2022 2:42 PM, FF Systems wrote: > > It is an arcane C form of "if/else". Arcane, but it still works in most > compilers and apparently OpenSCAD. > > The "?" specifies the boolean test. The next statement is "if true", and > the ":" separates the final statement which is "if false". > > So, it reads as "if (rk<wd) dx = wd else dx = rk;". > > On Fri, Dec 16, 2022 at 1:21 PM Douglas Miller <doug@milmac.com> wrote: > >> I think your problem is with this line in function halbrund(): >> >> dx = (rk<wd)? wd: rk, >> >> >> It's not clear to me what the purpose of this line is, but I think you'll >> see better results if you replace it with this: >> >> dx = rk, >> >> >> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org > -- ciao Bruno =========================================== http://nohkumado.eu/, <http://bboett.free.fr>http://aikido.nohkumado.eu/, <http://bboett.free.fr> http://aikido.zorn.free.fr
FS
FF Systems
Sat, Dec 17, 2022 3:28 PM

"What the purpose of" is rather a different question than "Why is this
here".

Forgive my lack of ESP, but there were two possible paths for the
question.  I answered the only one I could.

"WHY" depends upon cogent comments from the coder.  Lacking those, we are
almost better served to debate how many angels can dance upon the head of a
pin.

Carry on.

On Sat, Dec 17, 2022 at 6:43 AM Douglas Miller doug@milmac.com wrote:

I've been writing C code since the 1980s. I understand perfectly what that
line DOES. The question is WHY?

On 12/16/2022 2:42 PM, FF Systems wrote:

It is an arcane C form of "if/else".  Arcane, but it still works in most
compilers and apparently OpenSCAD.

The "?" specifies the boolean test.  The next statement is "if true", and
the ":" separates the final statement which is "if false".

So, it reads as "if (rk<wd) dx = wd else dx = rk;".

On Fri, Dec 16, 2022 at 1:21 PM Douglas Miller doug@milmac.com wrote:

I think your problem is with this line in function halbrund():

dx = (rk<wd)? wd: rk,

It's not clear to me what the purpose of this line is, but I think you'll
see better results if you replace it with this:

dx = rk,


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

"What the purpose of" is rather a different question than "Why is this here". Forgive my lack of ESP, but there were two possible paths for the question. I answered the only one I could. "WHY" depends upon cogent comments from the coder. Lacking those, we are almost better served to debate how many angels can dance upon the head of a pin. Carry on. On Sat, Dec 17, 2022 at 6:43 AM Douglas Miller <doug@milmac.com> wrote: > I've been writing C code since the 1980s. I understand perfectly what that > line DOES. The question is WHY? > > On 12/16/2022 2:42 PM, FF Systems wrote: > > It is an arcane C form of "if/else". Arcane, but it still works in most > compilers and apparently OpenSCAD. > > The "?" specifies the boolean test. The next statement is "if true", and > the ":" separates the final statement which is "if false". > > So, it reads as "if (rk<wd) dx = wd else dx = rk;". > > On Fri, Dec 16, 2022 at 1:21 PM Douglas Miller <doug@milmac.com> wrote: > >> I think your problem is with this line in function halbrund(): >> >> dx = (rk<wd)? wd: rk, >> >> >> It's not clear to me what the purpose of this line is, but I think you'll >> see better results if you replace it with this: >> >> dx = rk, >> >> >> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
J
jay@jdnd.co.uk
Sun, Dec 18, 2022 2:55 PM

ubuntu 22.04.1 LTS my full root path to file is this

/home/jay/IDs/ID1032/R1/IEC-V1.scad

including this file as below, works fine

use</home/jay/IDs/ID1032/R1/IEC-V1.scad>

but this fails

use<~/IDs/ID1032/R1/IEC-V1.scad>

does anyone with any ubuntu knowledge know why openscad fails to account
for the ~ directive being the current users home directory

ubuntu 22.04.1 LTS my full root path to file is this /home/jay/IDs/ID1032/R1/IEC-V1.scad including this file as below, works fine use</home/jay/IDs/ID1032/R1/IEC-V1.scad> but this fails use<~/IDs/ID1032/R1/IEC-V1.scad> does anyone with any ubuntu knowledge know why openscad fails to account for the ~ directive being the current users home directory >
TP
Torsten Paul
Sun, Dec 18, 2022 3:27 PM

On 18.12.22 15:55, jay@jdnd.co.uk wrote:

does anyone with any ubuntu knowledge know why openscad fails
to account for the ~ directive being the current users home
directory

There's simply no support for handling "~" in any special way
currently.

ciao,
Torsten.

On 18.12.22 15:55, jay@jdnd.co.uk wrote: > does anyone with any ubuntu knowledge know why openscad fails > to account for the ~ directive being the current users home > directory There's simply no support for handling "~" in any special way currently. ciao, Torsten.
J
jay
Sun, Dec 18, 2022 3:33 PM

Ok, thanks, i may look into it. I thought ~ would have been core to ubuntu rather than an openscad issue since i have never seen another application that dosen't occount for it but i suppose i shouldent asume.Sent via the Samsung Galaxy S7, an AT&T 4G LTE smartphone
-------- Original message --------From: Torsten Paul Torsten.Paul@gmx.de Date: 12/18/22  3:27 PM  (GMT+00:00) To: discuss@lists.openscad.org Subject: [OpenSCAD] Re: use<> directive with full path to file, Ubuntu On 18.12.22 15:55, jay@jdnd.co.uk wrote:> does anyone with any ubuntu knowledge know why openscad fails> to account for the ~ directive being the current users home> directoryThere's simply no support for handling "~" in any special waycurrently.ciao,   Torsten._______________________________________________OpenSCAD mailing listTo unsubscribe send an email to discuss-leave@lists.openscad.org

Ok, thanks, i may look into it. I thought ~ would have been core to ubuntu rather than an openscad issue since i have never seen another application that dosen't occount for it but i suppose i shouldent asume.Sent via the Samsung Galaxy S7, an AT&T 4G LTE smartphone -------- Original message --------From: Torsten Paul <Torsten.Paul@gmx.de> Date: 12/18/22 3:27 PM (GMT+00:00) To: discuss@lists.openscad.org Subject: [OpenSCAD] Re: use<> directive with full path to file, Ubuntu On 18.12.22 15:55, jay@jdnd.co.uk wrote:> does anyone with any ubuntu knowledge know why openscad fails> to account for the ~ directive being the current users home> directoryThere's simply no support for handling "~" in any special waycurrently.ciao,   Torsten._______________________________________________OpenSCAD mailing listTo unsubscribe send an email to discuss-leave@lists.openscad.org