discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

multiplier question

NH
nop head
Thu, May 9, 2024 8:45 PM

For any number of sides  you just need to divide by cos(180/$fn) to convert
the distance between flats to a diameter.

On Thu, 9 May 2024 at 20:59, Raymond West via Discuss <
discuss@lists.openscad.org> wrote:

I made a typo in my first reply - and copied it 🙁.

cylinder(h= length_of_wedge,d1= 1.142s, d2=1.1422 - a_bit,$fn=4)

should be

cylinder(h= length_of_wedge,d1= 1.4142s, d2=1.41422 - a_bit,$fn=4)
On 09/05/2024 19:11, Revar Desmera via Discuss wrote:

The ratio should be about 1.414,


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

For any number of sides you just need to divide by cos(180/$fn) to convert the distance between flats to a diameter. On Thu, 9 May 2024 at 20:59, Raymond West via Discuss < discuss@lists.openscad.org> wrote: > I made a typo in my first reply - and copied it 🙁. > > > cylinder(h= length_of_wedge,d1= 1.142*s, d2=1.142*2 - a_bit,$fn=4) > > should be > > cylinder(h= length_of_wedge,d1= 1.4142*s, d2=1.4142*2 - a_bit,$fn=4) > On 09/05/2024 19:11, Revar Desmera via Discuss wrote: > > The ratio should be about 1.414, > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
JB
Jordan Brown
Thu, May 9, 2024 11:16 PM

On 5/9/2024 8:56 AM, gene heskett via Discuss wrote:

That looks useful but not as easily visualized as the $fn=4; solution.
How does that compare in render time?

With all flat faces (not curved), it pretty much won't matter how you
create a particular shape.  You can make a cube using cube(), or a
linear extrude of a square, or a cylinder with $fn=4, and they all
produce the same six faces and so the render behavior will be the same.

For execution time, theoretically I would expect the cube to be fastest,
then the cylinder, then the linear extrude of the square, but my bet is
that they are all so fast that you would have a very hard time measuring
a difference.

If you add in curves, again mostly it won't matter how you get the
shape.  What will control render time is the number of faces.

On 5/9/2024 8:56 AM, gene heskett via Discuss wrote: > That looks useful but not as easily visualized as the $fn=4; solution. > How does that compare in render time? With all flat faces (not curved), it pretty much won't matter how you create a particular shape.  You can make a cube using cube(), or a linear extrude of a square, or a cylinder with $fn=4, and they all produce the same six faces and so the render behavior will be the same. For execution time, theoretically I would expect the cube to be fastest, then the cylinder, then the linear extrude of the square, but my bet is that they are all so fast that you would have a very hard time measuring a difference. If you add in curves, again mostly it won't matter how you get the shape.  What will control render time is the number of faces.
GH
gene heskett
Fri, May 10, 2024 2:30 AM

On 5/9/24 14:11, Revar Desmera wrote:

The ratio should be about 1.414, which is roughly the square root of 2. As for how expensive it is to do extra math calculations, you should know that the cost of the linear extrude is two or three of orders of magnitude more expensive than the square root. Actually pretty much all geometry calls (union, difference, etc) are far, far more expensive than just doing math.

Thanks for the clarification. 1.414213562 it is.  Thank you.

-Revar

On May 9, 2024, at 8:43 AM, gene heskett via Discuss discuss@lists.openscad.org wrote:

On 5/9/24 07:20, Lenore Horner via Discuss wrote:

Shouldn't center of square to a corner be radius of circle?  If so, then calling s the side of the square and d the diameter of the circle the square is inscribed in so d = 2 sqrt(2)*(s/2).

Which looks like a hell of a lot of cpu cycles when it ought to be a fixed multiplier. I went and stuck my mitotuyo across the square to get a side and got 49.88mm then measured diagonally across it and got 69.84 which would be the diameter needed to get that 49.88mm square when $fn=4.

My TI-36X Pro says that is a ratio of 1.400160385, call it 1.4 and its close enough. There should not be a non-linear factor and that's only 1 multiply for d1 and one addition to get d2 from that.  Does that sound right? The starter stick isn't square, but within .1mm which is as close as I can reset my planer.

Thanks for the insight/help, I appreciate it.

Cheers, Gene Heskett, CET.

"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.

  • Louis D. Brandeis

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

.

Cheers, Gene Heskett, CET.

"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.

  • Louis D. Brandeis
On 5/9/24 14:11, Revar Desmera wrote: > The ratio should be about 1.414, which is roughly the square root of 2. As for how expensive it is to do extra math calculations, you should know that the cost of the linear extrude is two or three of orders of magnitude more expensive than the square root. Actually pretty much all geometry calls (union, difference, etc) are far, far more expensive than just doing math. Thanks for the clarification. 1.414213562 it is. Thank you. > > -Revar > > >> On May 9, 2024, at 8:43 AM, gene heskett via Discuss <discuss@lists.openscad.org> wrote: >> >> On 5/9/24 07:20, Lenore Horner via Discuss wrote: >>> Shouldn't center of square to a corner be radius of circle? If so, then calling s the side of the square and d the diameter of the circle the square is inscribed in so d = 2 sqrt(2)*(s/2). >> Which looks like a hell of a lot of cpu cycles when it ought to be a fixed multiplier. I went and stuck my mitotuyo across the square to get a side and got 49.88mm then measured diagonally across it and got 69.84 which would be the diameter needed to get that 49.88mm square when $fn=4. >> >> My TI-36X Pro says that is a ratio of 1.400160385, call it 1.4 and its close enough. There should not be a non-linear factor and that's only 1 multiply for d1 and one addition to get d2 from that. Does that sound right? The starter stick isn't square, but within .1mm which is as close as I can reset my planer. >> >> Thanks for the insight/help, I appreciate it. >> >> Cheers, Gene Heskett, CET. >> -- >> "There are four boxes to be used in defense of liberty: >> soap, ballot, jury, and ammo. Please use in that order." >> -Ed Howdershelt (Author, 1940) >> If we desire respect for the law, we must first make the law respectable. >> - Louis D. Brandeis >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org > . Cheers, Gene Heskett, CET. -- "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author, 1940) If we desire respect for the law, we must first make the law respectable. - Louis D. Brandeis
GH
gene heskett
Fri, May 10, 2024 2:35 AM

On 5/9/24 16:46, nop head via Discuss wrote:

For any number of sides  you just need to divide by cos(180/$fn) to
convert the distance between flats to a diameter.

And this would be much more universal, thank you.

On Thu, 9 May 2024 at 20:59, Raymond West via Discuss
<discuss@lists.openscad.org mailto:discuss@lists.openscad.org> wrote:

 __

 I made a typo in my first reply - and copied it 🙁.


 cylinder(h= length_of_wedge,d1= 1.142*s, d2=1.142*2 - a_bit,$fn=4)

 should be

 cylinder(h= length_of_wedge,d1= 1.4142*s, d2=1.4142*2 - a_bit,$fn=4)

 On 09/05/2024 19:11, Revar Desmera via Discuss wrote:
 The ratio should be about 1.414,
 _______________________________________________
 OpenSCAD mailing list
 To unsubscribe send an email to discuss-leave@lists.openscad.org
 <mailto:discuss-leave@lists.openscad.org>

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

Cheers, Gene Heskett, CET.

"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.

  • Louis D. Brandeis
On 5/9/24 16:46, nop head via Discuss wrote: > For any number of sides  you just need to divide by cos(180/$fn) to > convert the distance between flats to a diameter. > And this would be much more universal, thank you. > On Thu, 9 May 2024 at 20:59, Raymond West via Discuss > <discuss@lists.openscad.org <mailto:discuss@lists.openscad.org>> wrote: > > __ > > I made a typo in my first reply - and copied it 🙁. > > > cylinder(h= length_of_wedge,d1= 1.142*s, d2=1.142*2 - a_bit,$fn=4) > > should be > > cylinder(h= length_of_wedge,d1= 1.4142*s, d2=1.4142*2 - a_bit,$fn=4) > > On 09/05/2024 19:11, Revar Desmera via Discuss wrote: >> The ratio should be about 1.414, > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org > <mailto:discuss-leave@lists.openscad.org> > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org Cheers, Gene Heskett, CET. -- "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author, 1940) If we desire respect for the law, we must first make the law respectable. - Louis D. Brandeis