GH
gene heskett
Wed, Feb 5, 2025 11:54 PM
One of the things I'm doing with this vise screw is making asquare
pocket for the end of the wooden stick I'm useing for s screw.
But due to saw wander etc, the square end of the stick needs a pocket
made with a taper from $fn=4 and 2 slightly different d1 and d2's are
given for a square. So I need the divisor to scale the size to match
what I get for a cube. That is the chord I think I'm not a math wizard
so what would the mutlplier be if a 51mm square pocket was to be made by
a cylinder(h=depth, with d1 & d2 being he same physical size as the
cube? But with the equ of a 1 degree taper to the sidewalls'? Thank you
all.
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.
One of the things I'm doing with this vise screw is making asquare
pocket for the end of the wooden stick I'm useing for s screw.
But due to saw wander etc, the square end of the stick needs a pocket
made with a taper from $fn=4 and 2 slightly different d1 and d2's are
given for a square. So I need the divisor to scale the size to match
what I get for a cube. That is the chord I think I'm not a math wizard
so what would the mutlplier be if a 51mm square pocket was to be made by
a cylinder(h=depth, with d1 & d2 being he same physical size as the
cube? But with the equ of a 1 degree taper to the sidewalls'? Thank you
all.
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
RW
Raymond West
Thu, Feb 6, 2025 12:25 AM
probably easier to measure af at each end to get two squares separated
by the distances between your two measurements, say z. linear_extrude
the squares by say 0.01, then place them one above the other by z, and
hull.
But, if you want, here's how to get the circumscribed diameter s= side
for a square, n =4
function cd(s,n)=n % 2 == 0 ?
s / cos(180 / n):
s * (1/2 + 1 / (2 * cos(180 / n)));
On 05/02/2025 23:54, gene heskett via Discuss wrote:
One of the things I'm doing with this vise screw is making asquare
pocket for the end of the wooden stick I'm useing for s screw.
But due to saw wander etc, the square end of the stick needs a pocket
made with a taper from $fn=4 and 2 slightly different d1 and d2's are
given for a square. So I need the divisor to scale the size to match
what I get for a cube. That is the chord I think I'm not a math
wizard so what would the mutlplier be if a 51mm square pocket was to
be made by a cylinder(h=depth, with d1 & d2 being he same physical
size as the cube? But with the equ of a 1 degree taper to the
sidewalls'? Thank you all.
Cheers, Gene Heskett, CET.
probably easier to measure af at each end to get two squares separated
by the distances between your two measurements, say z. linear_extrude
the squares by say 0.01, then place them one above the other by z, and
hull.
But, if you want, here's how to get the circumscribed diameter s= side
for a square, n =4
function cd(s,n)=n % 2 == 0 ?
s / cos(180 / n):
s * (1/2 + 1 / (2 * cos(180 / n)));
On 05/02/2025 23:54, gene heskett via Discuss wrote:
> One of the things I'm doing with this vise screw is making asquare
> pocket for the end of the wooden stick I'm useing for s screw.
>
> But due to saw wander etc, the square end of the stick needs a pocket
> made with a taper from $fn=4 and 2 slightly different d1 and d2's are
> given for a square. So I need the divisor to scale the size to match
> what I get for a cube. That is the chord I think I'm not a math
> wizard so what would the mutlplier be if a 51mm square pocket was to
> be made by a cylinder(h=depth, with d1 & d2 being he same physical
> size as the cube? But with the equ of a 1 degree taper to the
> sidewalls'? Thank you all.
>
> Cheers, Gene Heskett, CET.
JB
Jordan Brown
Thu, Feb 6, 2025 7:58 AM
On 2/5/2025 3:54 PM, gene heskett via Discuss wrote:
But due to saw wander etc, the square end of the stick needs a pocket
made with a taper from $fn=4 and 2 slightly different d1 and d2's are
given for a square. So I need the divisor to scale the size to match
what I get for a cube. That is the chord I think I'm not a math
wizard so what would the mutlplier be if a 51mm square pocket was to
be made by a cylinder(h=depth, with d1 & d2 being he same physical
size as the cube? But with the equ of a 1 degree taper to the
sidewalls'? Thank you all.
I think you're saying two things:
1) Given a particular size square, what is the corresponding
circumscribed diameter that you would feed to cylinder() to get a
rectangular prism of that size. Note that the circumscribed diameter is
also the diagonal of the square, so Pythagoras tells us the answer: the
diagonal is the length of the side times the square root of 2. (For
non-squares, you need to use trigonometry and the ratio is 1/cos(180/n),
where n is the number of sides.)
2) What's the difference between two squares, that will produce a
one-degree taper across a particular height?
This latter is a little more complex. Here's a diagram, with the angle
exaggerated:
Quick trigonometry reference:
Talking always about a right triangle, and noting that the angle
between *a* and *b* is a right angle, and that *c* is the
hypotenuse, and that we're interested in the pointy angle between
*b* and *c*, at the top of the triangle...
sine is the side opposite the angle, divided by the hypotenuse -
here, *a/c*.
cosine is the side adjacent to the angle, divided by the hypotenuse
- here, *b/c*.
tangent is the side opposite the angle, divided by the side adjacent
to the angle - here, *a/b*.
You want the angle between line b and line c to be one degree.
You know the height b, and you want to know the difference a.
Again, the tangent of an angle is equal to the length of the opposite
side divided by the length of the adjacent side. In this case, this
means that you want a divided by b to be equal to the the tangent of
one degree.
*a/b = tan(1)*
Multiply both sides by b to get
*a = b * tan(1)*
(Sanity check: the tangent of a small angle is small. When we have a
small angle, a will get small compared to b. Good.)
And note that you've been thinking in terms of the lengths of the sides
of the top and bottom squares, you really want 2a*.
So the answer that you're looking for is that the difference between the
two, the difference between the sides of the two squares, is two times
tan(1) times the height.
Remember to apply the sqrt(2) correction from the first part to get the
values to feed into cylinder().
Sanity check time. One degree will be really hard to see, so let's try 45.
a = 45;
h = 100;
id2 = 400;
id1 = id2 - 2*tan(a)*h;
rotate(45) cylinder(h=h, d1=id1*sqrt(2), d2=id2*sqrt(2), $fn=4);
First, let's look from +Z:
Yep, looks like 400 on a side.
Looking from -Y, in orthogonal mode:
Yep, looks like 45 degree angles.
Now, let's try a couple of other angles. 30:
Looks plausible. Critically, it went in the correct direction compared
to the 45 example. How about 5°?
And just for completeness, because it's the number you were looking for,
one degree:
The taper there is barely visible, but it's there.
Hope that helps.
On 2/5/2025 3:54 PM, gene heskett via Discuss wrote:
> But due to saw wander etc, the square end of the stick needs a pocket
> made with a taper from $fn=4 and 2 slightly different d1 and d2's are
> given for a square. So I need the divisor to scale the size to match
> what I get for a cube. That is the chord I think I'm not a math
> wizard so what would the mutlplier be if a 51mm square pocket was to
> be made by a cylinder(h=depth, with d1 & d2 being he same physical
> size as the cube? But with the equ of a 1 degree taper to the
> sidewalls'? Thank you all.
I think you're saying two things:
1) Given a particular size square, what is the corresponding
circumscribed diameter that you would feed to cylinder() to get a
rectangular prism of that size. Note that the circumscribed diameter is
also the diagonal of the square, so Pythagoras tells us the answer: the
diagonal is the length of the side times the square root of 2. (For
non-squares, you need to use trigonometry and the ratio is 1/cos(180/n),
where n is the number of sides.)
2) What's the difference between two squares, that will produce a
one-degree taper across a particular height?
This latter is a little more complex. Here's a diagram, with the angle
exaggerated:
Quick trigonometry reference:
Talking always about a right triangle, and noting that the angle
between *a* and *b* is a right angle, and that *c* is the
hypotenuse, and that we're interested in the pointy angle between
*b* and *c*, at the top of the triangle...
sine is the side opposite the angle, divided by the hypotenuse -
here, *a/c*.
cosine is the side adjacent to the angle, divided by the hypotenuse
- here, *b/c*.
tangent is the side opposite the angle, divided by the side adjacent
to the angle - here, *a/b*.
You want the angle between line *b* and line *c* to be one degree.
You know the height *b*, and you want to know the difference *a*.
Again, the tangent of an angle is equal to the length of the opposite
side divided by the length of the adjacent side. In this case, this
means that you want *a* divided by *b* to be equal to the the tangent of
one degree.
*a/b = tan(1)*
Multiply both sides by *b* to get
*a = b * tan(1)*
(Sanity check: the tangent of a small angle is small. When we have a
small angle, *a* will get small compared to *b*. Good.)
And note that you've been thinking in terms of the lengths of the sides
of the top and bottom squares, you really want *2*a*.
So the answer that you're looking for is that the difference between the
two, the difference between the sides of the two squares, is *two times
tan(1) times the height*.
Remember to apply the sqrt(2) correction from the first part to get the
values to feed into cylinder().
Sanity check time. One degree will be really hard to see, so let's try 45.
a = 45;
h = 100;
id2 = 400;
id1 = id2 - 2*tan(a)*h;
rotate(45) cylinder(h=h, d1=id1*sqrt(2), d2=id2*sqrt(2), $fn=4);
First, let's look from +Z:
Yep, looks like 400 on a side.
Looking from -Y, in orthogonal mode:
Yep, looks like 45 degree angles.
Now, let's try a couple of other angles. 30:
Looks plausible. Critically, it went in the correct direction compared
to the 45 example. How about 5°?
And just for completeness, because it's the number you were looking for,
one degree:
The taper there is barely visible, but it's there.
Hope that helps.
JB
Jordan Brown
Thu, Feb 6, 2025 8:08 AM
On 2/5/2025 11:58 PM, Jordan Brown via Discuss wrote:
1) Given a particular size square, what is the corresponding
circumscribed diameter that you would feed to cylinder() to get a
rectangular prism of that size. Note that the circumscribed diameter
is also the diagonal of the square, so Pythagoras tells us the
answer: the diagonal is the length of the side times the square root
of 2. (For non-squares, you need to use trigonometry and the ratio is
1/cos(180/n), where n is the number of sides.)
I'm sorry, I added that parenthesized note at the last minute, and it's
not clear.
For a square, the length of the side is the same as the inscribed
diameter, the diameter of the largest circle that will fit in the
polygon. That's not true for any other number of sides.
What I'm talking about there is the ratio between the inscribed diameter
(or radius) and the circumscribed diameter (or radius).
If you want to derive the length of a side, or if you have the length of
a side and want to derive other stuff, it's different ratios that are
left as an exercise for the reader. (But hint: chop up your polygon
until you have a bunch of identical triangles with their points at the
center and the sides of the polygon as their bases, then divide them
each in half to make two mirror-image right triangles, and then look at
the trigonometry notes from the second part.)
On 2/5/2025 11:58 PM, Jordan Brown via Discuss wrote:
> 1) Given a particular size square, what is the corresponding
> circumscribed diameter that you would feed to cylinder() to get a
> rectangular prism of that size. Note that the circumscribed diameter
> is also the diagonal of the square, so Pythagoras tells us the
> answer: the diagonal is the length of the side times the square root
> of 2. (For non-squares, you need to use trigonometry and the ratio is
> 1/cos(180/n), where n is the number of sides.)
I'm sorry, I added that parenthesized note at the last minute, and it's
not clear.
For a square, the length of the side is the same as the inscribed
diameter, the diameter of the largest circle that will fit in the
polygon. That's not true for any other number of sides.
What I'm talking about there is the ratio between the inscribed diameter
(or radius) and the circumscribed diameter (or radius).
If you want to derive the length of a side, or if you have the length of
a side and want to derive other stuff, it's different ratios that are
left as an exercise for the reader. (But hint: chop up your polygon
until you have a bunch of identical triangles with their points at the
center and the sides of the polygon as their bases, then divide them
each in half to make two mirror-image right triangles, and then look at
the trigonometry notes from the second part.)
JB
Jon Bondy
Thu, Feb 6, 2025 11:01 AM
Excellent tutorial!
On 2/6/2025 2:58 AM, Jordan Brown via Discuss wrote:
On 2/5/2025 3:54 PM, gene heskett via Discuss wrote:
But due to saw wander etc, the square end of the stick needs a pocket
made with a taper from $fn=4 and 2 slightly different d1 and d2's are
given for a square. So I need the divisor to scale the size to match
what I get for a cube. That is the chord I think I'm not a math
wizard so what would the mutlplier be if a 51mm square pocket was to
be made by a cylinder(h=depth, with d1 & d2 being he same physical
size as the cube? But with the equ of a 1 degree taper to the
sidewalls'? Thank you all.
I think you're saying two things:
1) Given a particular size square, what is the corresponding
circumscribed diameter that you would feed to cylinder() to get a
rectangular prism of that size. Note that the circumscribed diameter
is also the diagonal of the square, so Pythagoras tells us the
answer: the diagonal is the length of the side times the square root
of 2. (For non-squares, you need to use trigonometry and the ratio is
1/cos(180/n), where n is the number of sides.)
2) What's the difference between two squares, that will produce a
one-degree taper across a particular height?
This latter is a little more complex. Here's a diagram, with the
angle exaggerated:
Quick trigonometry reference:
Talking always about a right triangle, and noting that the angle
between *a* and *b* is a right angle, and that *c* is the
hypotenuse, and that we're interested in the pointy angle between
*b* and *c*, at the top of the triangle...
sine is the side opposite the angle, divided by the hypotenuse -
here, *a/c*.
cosine is the side adjacent to the angle, divided by the
hypotenuse - here, *b/c*.
tangent is the side opposite the angle, divided by the side
adjacent to the angle - here, *a/b*.
You want the angle between line b and line c to be one degree.
You know the height b, and you want to know the difference a.
Again, the tangent of an angle is equal to the length of the opposite
side divided by the length of the adjacent side. In this case, this
means that you want a divided by b to be equal to the the tangent
of one degree.
*a/b = tan(1)*
Multiply both sides by b to get
*a = b * tan(1)*
(Sanity check: the tangent of a small angle is small. When we have a
small angle, a will get small compared to b. Good.)
And note that you've been thinking in terms of the lengths of the
sides of the top and bottom squares, you really want 2a*.
So the answer that you're looking for is that the difference between
the two, the difference between the sides of the two squares, is two
times tan(1) times the height.
Remember to apply the sqrt(2) correction from the first part to get
the values to feed into cylinder().
Sanity check time. One degree will be really hard to see, so let's
try 45.
a = 45;
h = 100;
id2 = 400;
id1 = id2 - 2*tan(a)*h;
rotate(45) cylinder(h=h, d1=id1*sqrt(2), d2=id2*sqrt(2), $fn=4);
First, let's look from +Z:
Yep, looks like 400 on a side.
Looking from -Y, in orthogonal mode:
Yep, looks like 45 degree angles.
Now, let's try a couple of other angles. 30:
Looks plausible. Critically, it went in the correct direction
compared to the 45 example. How about 5°?
And just for completeness, because it's the number you were looking
for, one degree:
The taper there is barely visible, but it's there.
Hope that helps.
OpenSCAD mailing list
To unsubscribe send an email todiscuss-leave@lists.openscad.org
--
This email has been checked for viruses by AVG antivirus software.
www.avg.com
Excellent tutorial!
On 2/6/2025 2:58 AM, Jordan Brown via Discuss wrote:
> On 2/5/2025 3:54 PM, gene heskett via Discuss wrote:
>> But due to saw wander etc, the square end of the stick needs a pocket
>> made with a taper from $fn=4 and 2 slightly different d1 and d2's are
>> given for a square. So I need the divisor to scale the size to match
>> what I get for a cube. That is the chord I think I'm not a math
>> wizard so what would the mutlplier be if a 51mm square pocket was to
>> be made by a cylinder(h=depth, with d1 & d2 being he same physical
>> size as the cube? But with the equ of a 1 degree taper to the
>> sidewalls'? Thank you all.
>
> I think you're saying two things:
>
> 1) Given a particular size square, what is the corresponding
> circumscribed diameter that you would feed to cylinder() to get a
> rectangular prism of that size. Note that the circumscribed diameter
> is also the diagonal of the square, so Pythagoras tells us the
> answer: the diagonal is the length of the side times the square root
> of 2. (For non-squares, you need to use trigonometry and the ratio is
> 1/cos(180/n), where n is the number of sides.)
>
> 2) What's the difference between two squares, that will produce a
> one-degree taper across a particular height?
>
> This latter is a little more complex. Here's a diagram, with the
> angle exaggerated:
>
>
>
>
> Quick trigonometry reference:
>
> Talking always about a right triangle, and noting that the angle
> between *a* and *b* is a right angle, and that *c* is the
> hypotenuse, and that we're interested in the pointy angle between
> *b* and *c*, at the top of the triangle...
>
> sine is the side opposite the angle, divided by the hypotenuse -
> here, *a/c*.
> cosine is the side adjacent to the angle, divided by the
> hypotenuse - here, *b/c*.
> tangent is the side opposite the angle, divided by the side
> adjacent to the angle - here, *a/b*.
>
>
> You want the angle between line *b* and line *c* to be one degree.
> You know the height *b*, and you want to know the difference *a*.
>
> Again, the tangent of an angle is equal to the length of the opposite
> side divided by the length of the adjacent side. In this case, this
> means that you want *a* divided by *b* to be equal to the the tangent
> of one degree.
>
> *a/b = tan(1)*
>
> Multiply both sides by *b* to get
>
> *a = b * tan(1)*
>
> (Sanity check: the tangent of a small angle is small. When we have a
> small angle, *a* will get small compared to *b*. Good.)
>
> And note that you've been thinking in terms of the lengths of the
> sides of the top and bottom squares, you really want *2*a*.
>
> So the answer that you're looking for is that the difference between
> the two, the difference between the sides of the two squares, is *two
> times tan(1) times the height*.
>
> Remember to apply the sqrt(2) correction from the first part to get
> the values to feed into cylinder().
>
> Sanity check time. One degree will be really hard to see, so let's
> try 45.
>
> a = 45;
> h = 100;
> id2 = 400;
> id1 = id2 - 2*tan(a)*h;
> rotate(45) cylinder(h=h, d1=id1*sqrt(2), d2=id2*sqrt(2), $fn=4);
>
> First, let's look from +Z:
>
> Yep, looks like 400 on a side.
>
> Looking from -Y, in orthogonal mode:
>
> Yep, looks like 45 degree angles.
>
> Now, let's try a couple of other angles. 30:
>
> Looks plausible. Critically, it went in the correct direction
> compared to the 45 example. How about 5°?
>
>
> And just for completeness, because it's the number you were looking
> for, one degree:
>
> The taper there is barely visible, but it's there.
>
>
> Hope that helps.
>
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email todiscuss-leave@lists.openscad.org
--
This email has been checked for viruses by AVG antivirus software.
www.avg.com
GH
gene heskett
Fri, Feb 7, 2025 3:44 AM
On 2/6/25 02:59, Jordan Brown via Discuss wrote:
On 2/5/2025 3:54 PM, gene heskett via Discuss wrote:
But due to saw wander etc, the square end of the stick needs a pocket
made with a taper from $fn=4 and 2 slightly different d1 and d2's are
given for a square. So I need the divisor to scale the size to match
what I get for a cube. That is the chord I think I'm not a math
wizard so what would the mutlplier be if a 51mm square pocket was to
be made by a cylinder(h=depth, with d1 & d2 being he same physical
size as the cube? But with the equ of a 1 degree taper to the
sidewalls'? Thank you all.
I think you're saying two things:
1) Given a particular size square, what is the corresponding
circumscribed diameter that you would feed to cylinder() to get a
rectangular prism of that size. Note that the circumscribed diameter is
also the diagonal of the square, so Pythagoras tells us the answer: the
diagonal is the length of the side times the square root of 2. (For
non-squares, you need to use trigonometry and the ratio is 1/cos(180/n),
where n is the number of sides.)
2) What's the difference between two squares, that will produce a
one-degree taper across a particular height?
This latter is a little more complex. Here's a diagram, with the angle
exaggerated:
Quick trigonometry reference:
Talking always about a right triangle, and noting that the angle
between *a* and *b* is a right angle, and that *c* is the
hypotenuse, and that we're interested in the pointy angle between
*b* and *c*, at the top of the triangle...
sine is the side opposite the angle, divided by the hypotenuse -
here, *a/c*.
cosine is the side adjacent to the angle, divided by the hypotenuse
- here, *b/c*.
tangent is the side opposite the angle, divided by the side adjacent
to the angle - here, *a/b*.
You want the angle between line b and line c to be one degree.
You know the height b, and you want to know the difference a.
Again, the tangent of an angle is equal to the length of the opposite
side divided by the length of the adjacent side. In this case, this
means that you want a divided by b to be equal to the the tangent of
one degree.
*a/b = tan(1)*
Multiply both sides by b to get
*a = b * tan(1)*
(Sanity check: the tangent of a small angle is small. When we have a
small angle, a will get small compared to b. Good.)
And note that you've been thinking in terms of the lengths of the sides
of the top and bottom squares, you really want 2a*.
So the answer that you're looking for is that the difference between the
two, the difference between the sides of the two squares, is two times
tan(1) times the height.
Remember to apply the sqrt(2) correction from the first part to get the
values to feed into cylinder().
Sanity check time. One degree will be really hard to see, so let's try 45.
a = 45;
h = 100;
id2 = 400;
id1 = id2 - 2*tan(a)*h;
rotate(45) cylinder(h=h, d1=id1*sqrt(2), d2=id2*sqrt(2), $fn=4);
First, let's look from +Z:
Yep, looks like 400 on a side.
Looking from -Y, in orthogonal mode:
Yep, looks like 45 degree angles.
Now, let's try a couple of other angles. 30:
Looks plausible. Critically, it went in the correct direction compared
to the 45 example. How about 5°?
And just for completeness, because it's the number you were looking for,
one degree:
The taper there is barely visible, but it's there.
Hope that helps.
I'm sure it does. Now the real trick is getting my 90 yo grey matter to
recall that a day later. Thank you very much,
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.
On 2/6/25 02:59, Jordan Brown via Discuss wrote:
> On 2/5/2025 3:54 PM, gene heskett via Discuss wrote:
>> But due to saw wander etc, the square end of the stick needs a pocket
>> made with a taper from $fn=4 and 2 slightly different d1 and d2's are
>> given for a square. So I need the divisor to scale the size to match
>> what I get for a cube. That is the chord I think I'm not a math
>> wizard so what would the mutlplier be if a 51mm square pocket was to
>> be made by a cylinder(h=depth, with d1 & d2 being he same physical
>> size as the cube? But with the equ of a 1 degree taper to the
>> sidewalls'? Thank you all.
> I think you're saying two things:
>
> 1) Given a particular size square, what is the corresponding
> circumscribed diameter that you would feed to cylinder() to get a
> rectangular prism of that size. Note that the circumscribed diameter is
> also the diagonal of the square, so Pythagoras tells us the answer: the
> diagonal is the length of the side times the square root of 2. (For
> non-squares, you need to use trigonometry and the ratio is 1/cos(180/n),
> where n is the number of sides.)
>
> 2) What's the difference between two squares, that will produce a
> one-degree taper across a particular height?
>
> This latter is a little more complex. Here's a diagram, with the angle
> exaggerated:
>
>
>
>
> Quick trigonometry reference:
>
> Talking always about a right triangle, and noting that the angle
> between *a* and *b* is a right angle, and that *c* is the
> hypotenuse, and that we're interested in the pointy angle between
> *b* and *c*, at the top of the triangle...
>
> sine is the side opposite the angle, divided by the hypotenuse -
> here, *a/c*.
> cosine is the side adjacent to the angle, divided by the hypotenuse
> - here, *b/c*.
> tangent is the side opposite the angle, divided by the side adjacent
> to the angle - here, *a/b*.
>
>
> You want the angle between line *b* and line *c* to be one degree.
> You know the height *b*, and you want to know the difference *a*.
>
> Again, the tangent of an angle is equal to the length of the opposite
> side divided by the length of the adjacent side. In this case, this
> means that you want *a* divided by *b* to be equal to the the tangent of
> one degree.
>
> *a/b = tan(1)*
>
> Multiply both sides by *b* to get
>
> *a = b * tan(1)*
>
> (Sanity check: the tangent of a small angle is small. When we have a
> small angle, *a* will get small compared to *b*. Good.)
>
> And note that you've been thinking in terms of the lengths of the sides
> of the top and bottom squares, you really want *2*a*.
>
> So the answer that you're looking for is that the difference between the
> two, the difference between the sides of the two squares, is *two times
> tan(1) times the height*.
>
> Remember to apply the sqrt(2) correction from the first part to get the
> values to feed into cylinder().
>
> Sanity check time. One degree will be really hard to see, so let's try 45.
>
> a = 45;
> h = 100;
> id2 = 400;
> id1 = id2 - 2*tan(a)*h;
> rotate(45) cylinder(h=h, d1=id1*sqrt(2), d2=id2*sqrt(2), $fn=4);
>
> First, let's look from +Z:
>
> Yep, looks like 400 on a side.
>
> Looking from -Y, in orthogonal mode:
>
> Yep, looks like 45 degree angles.
>
> Now, let's try a couple of other angles. 30:
>
> Looks plausible. Critically, it went in the correct direction compared
> to the 45 example. How about 5°?
>
>
> And just for completeness, because it's the number you were looking for,
> one degree:
>
> The taper there is barely visible, but it's there.
>
>
> Hope that helps.
I'm sure it does. Now the real trick is getting my 90 yo grey matter to
recall that a day later. Thank you very much,
>
> _______________________________________________
> 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, Feb 7, 2025 6:58 AM
On 2/6/25 06:01, Jon Bondy wrote:
Excellent tutorial!
On 2/6/2025 2:58 AM, Jordan Brown via Discuss wrote:
On 2/5/2025 3:54 PM, gene heskett via Discuss wrote:
But due to saw wander etc, the square end of the stick needs a
pocket made with a taper from $fn=4 and 2 slightly different d1 and
d2's are given for a square. So I need the divisor to scale the size
to match what I get for a cube. That is the chord I think I'm not a
math wizard so what would the mutlplier be if a 51mm square pocket
was to be made by a cylinder(h=depth, with d1 & d2 being he same
physical size as the cube? But with the equ of a 1 degree taper to
the sidewalls'? Thank you all.
I think you're saying two things:
1) Given a particular size square, what is the corresponding
circumscribed diameter that you would feed to cylinder() to get a
rectangular prism of that size. Note that the circumscribed diameter
is also the diagonal of the square, so Pythagoras tells us the
answer: the diagonal is the length of the side times the square root
of 2. (For non-squares, you need to use trigonometry and the ratio
is 1/cos(180/n), where n is the number of sides.)
2) What's the difference between two squares, that will produce a
one-degree taper across a particular height?
This latter is a little more complex. Here's a diagram, with the
angle exaggerated:
Quick trigonometry reference:
Talking always about a right triangle, and noting that the angle
between a and b is a right angle, and that c is the
hypotenuse, and that we're interested in the pointy angle between
b and c, at the top of the triangle...
sine is the side opposite the angle, divided by the hypotenuse -
here, a/c.
cosine is the side adjacent to the angle, divided by the
hypotenuse - here, b/c.
tangent is the side opposite the angle, divided by the side
adjacent to the angle - here, a/b.
You want the angle between line b and line c to be one degree.
You know the height b, and you want to know the difference a.
Again, the tangent of an angle is equal to the length of the opposite
side divided by the length of the adjacent side. In this case, this
means that you want a divided by b to be equal to the the tangent
of one degree.
a/b = tan(1)
Multiply both sides by b to get
a = b * tan(1)
(Sanity check: the tangent of a small angle is small. When we have
a small angle, a will get small compared to b. Good.)
And note that you've been thinking in terms of the lengths of the
sides of the top and bottom squares, you really want 2a*.
So the answer that you're looking for is that the difference between
the two, the difference between the sides of the two squares, is two
times tan(1) times the height.
Remember to apply the sqrt(2) correction from the first part to get
the values to feed into cylinder().
Sanity check time. One degree will be really hard to see, so let's
try 45.
a = 45;
h = 100;
id2 = 400;
id1 = id2 - 2tan(a)h;
rotate(45) cylinder(h=h, d1=id1sqrt(2), d2=id2sqrt(2), $fn=4);
First, let's look from +Z:
Yep, looks like 400 on a side.
Looking from -Y, in orthogonal mode:
Yep, looks like 45 degree angles.
Now, let's try a couple of other angles. 30:
Looks plausible. Critically, it went in the correct direction
compared to the 45 example. How about 5°?
And just for completeness, because it's the number you were looking
for, one degree:
The taper there is barely visible, but it's there.
And is exactly that tiny amount I am looking for. The idea being to get
a good squeeze on the stick so the 3/4" handle hole is re-enforced from
splitting forces as the handle is tightened on the board being machined.
What I've been doing is using a cube function, printing it in CF+PETG
then chamforing the entrance with an exacto knife whose cutting edge
goes away in one slice due to the abrasiveness of the cf in the PETG.
Printed with a taper would be a heck of a lot safer for my
fingerprints. And excellent tutorial, thanks Jordan Brown. Now I just
need to get all that stored in my aging grey matter.
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.
On 2/6/25 06:01, Jon Bondy wrote:
> Excellent tutorial!
>
>
> On 2/6/2025 2:58 AM, Jordan Brown via Discuss wrote:
>> On 2/5/2025 3:54 PM, gene heskett via Discuss wrote:
>>> But due to saw wander etc, the square end of the stick needs a
>>> pocket made with a taper from $fn=4 and 2 slightly different d1 and
>>> d2's are given for a square. So I need the divisor to scale the size
>>> to match what I get for a cube. That is the chord I think I'm not a
>>> math wizard so what would the mutlplier be if a 51mm square pocket
>>> was to be made by a cylinder(h=depth, with d1 & d2 being he same
>>> physical size as the cube? But with the equ of a 1 degree taper to
>>> the sidewalls'? Thank you all.
>>
>> I think you're saying two things:
>>
>> 1) Given a particular size square, what is the corresponding
>> circumscribed diameter that you would feed to cylinder() to get a
>> rectangular prism of that size. Note that the circumscribed diameter
>> is also the diagonal of the square, so Pythagoras tells us the
>> answer: the diagonal is the length of the side times the square root
>> of 2. (For non-squares, you need to use trigonometry and the ratio
>> is 1/cos(180/n), where n is the number of sides.)
>>
>> 2) What's the difference between two squares, that will produce a
>> one-degree taper across a particular height?
>>
>> This latter is a little more complex. Here's a diagram, with the
>> angle exaggerated:
>>
>>
>>
>>
>> Quick trigonometry reference:
>>
>> Talking always about a right triangle, and noting that the angle
>> between *a* and *b* is a right angle, and that *c* is the
>> hypotenuse, and that we're interested in the pointy angle between
>> *b* and *c*, at the top of the triangle...
>>
>> sine is the side opposite the angle, divided by the hypotenuse -
>> here, *a/c*.
>> cosine is the side adjacent to the angle, divided by the
>> hypotenuse - here, *b/c*.
>> tangent is the side opposite the angle, divided by the side
>> adjacent to the angle - here, *a/b*.
>>
>>
>> You want the angle between line *b* and line *c* to be one degree.
>> You know the height *b*, and you want to know the difference *a*.
>>
>> Again, the tangent of an angle is equal to the length of the opposite
>> side divided by the length of the adjacent side. In this case, this
>> means that you want *a* divided by *b* to be equal to the the tangent
>> of one degree.
>>
>> *a/b = tan(1)*
>>
>> Multiply both sides by *b* to get
>>
>> *a = b * tan(1)*
>>
>> (Sanity check: the tangent of a small angle is small. When we have
>> a small angle, *a* will get small compared to *b*. Good.)
>>
>> And note that you've been thinking in terms of the lengths of the
>> sides of the top and bottom squares, you really want *2*a*.
>>
>> So the answer that you're looking for is that the difference between
>> the two, the difference between the sides of the two squares, is *two
>> times tan(1) times the height*.
>>
>> Remember to apply the sqrt(2) correction from the first part to get
>> the values to feed into cylinder().
>>
>> Sanity check time. One degree will be really hard to see, so let's
>> try 45.
>>
>> a = 45;
>> h = 100;
>> id2 = 400;
>> id1 = id2 - 2*tan(a)*h;
>> rotate(45) cylinder(h=h, d1=id1*sqrt(2), d2=id2*sqrt(2), $fn=4);
>>
>> First, let's look from +Z:
>>
>> Yep, looks like 400 on a side.
>>
>> Looking from -Y, in orthogonal mode:
>>
>> Yep, looks like 45 degree angles.
>>
>> Now, let's try a couple of other angles. 30:
>>
>> Looks plausible. Critically, it went in the correct direction
>> compared to the 45 example. How about 5°?
>>
>>
>> And just for completeness, because it's the number you were looking
>> for, one degree:
>>
>> The taper there is barely visible, but it's there.
And is exactly that tiny amount I am looking for. The idea being to get
a good squeeze on the stick so the 3/4" handle hole is re-enforced from
splitting forces as the handle is tightened on the board being machined.
What I've been doing is using a cube function, printing it in CF+PETG
then chamforing the entrance with an exacto knife whose cutting edge
goes away in one slice due to the abrasiveness of the cf in the PETG.
Printed with a taper would be a heck of a lot safer for my
fingerprints. And excellent tutorial, thanks Jordan Brown. Now I just
need to get all that stored in my aging grey matter.
>> Hope that helps.
>>
>> _______________________________________________
>> OpenSCAD mailing list
>> To unsubscribe send an email todiscuss-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
RW
Raymond West
Fri, Feb 7, 2025 11:51 AM
The code below, does not give exact results for an odd number of faces.
I never noticed that in the parts that I generated. Thanks to Jordan for
pointing that out.
On 06/02/2025 00:25, Raymond West via Discuss wrote:
probably easier to measure af at each end to get two squares separated
by the distances between your two measurements, say z. linear_extrude
the squares by say 0.01, then place them one above the other by z, and
hull.
But, if you want, here's how to get the circumscribed diameter s= side
for a square, n =4
function cd(s,n)=n % 2 == 0 ?
s / cos(180 / n):
s * (1/2 + 1 / (2 * cos(180 / n)));
On 05/02/2025 23:54, gene heskett via Discuss wrote:
One of the things I'm doing with this vise screw is making asquare
pocket for the end of the wooden stick I'm useing for s screw.
But due to saw wander etc, the square end of the stick needs a pocket
made with a taper from $fn=4 and 2 slightly different d1 and d2's are
given for a square. So I need the divisor to scale the size to match
what I get for a cube. That is the chord I think I'm not a math
wizard so what would the mutlplier be if a 51mm square pocket was to
be made by a cylinder(h=depth, with d1 & d2 being he same physical
size as the cube? But with the equ of a 1 degree taper to the
sidewalls'? Thank you all.
Cheers, Gene Heskett, CET.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
The code below, does not give exact results for an odd number of faces.
I never noticed that in the parts that I generated. Thanks to Jordan for
pointing that out.
On 06/02/2025 00:25, Raymond West via Discuss wrote:
> probably easier to measure af at each end to get two squares separated
> by the distances between your two measurements, say z. linear_extrude
> the squares by say 0.01, then place them one above the other by z, and
> hull.
>
> But, if you want, here's how to get the circumscribed diameter s= side
> for a square, n =4
>
>
> function cd(s,n)=n % 2 == 0 ?
> s / cos(180 / n):
> s * (1/2 + 1 / (2 * cos(180 / n)));
>
>
>
> On 05/02/2025 23:54, gene heskett via Discuss wrote:
>> One of the things I'm doing with this vise screw is making asquare
>> pocket for the end of the wooden stick I'm useing for s screw.
>>
>> But due to saw wander etc, the square end of the stick needs a pocket
>> made with a taper from $fn=4 and 2 slightly different d1 and d2's are
>> given for a square. So I need the divisor to scale the size to match
>> what I get for a cube. That is the chord I think I'm not a math
>> wizard so what would the mutlplier be if a 51mm square pocket was to
>> be made by a cylinder(h=depth, with d1 & d2 being he same physical
>> size as the cube? But with the equ of a 1 degree taper to the
>> sidewalls'? Thank you all.
>>
>> Cheers, Gene Heskett, CET.
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
RW
Raymond West
Fri, Feb 7, 2025 1:36 PM
corrected code below
/*
calculate circumcircle for polygon given number of flats, n
and af, across flats for even n,
af=flat to opposite vertex for odd n
*/
function cd(af,n)= n% 2 == 0?
af/cos (180/n):
af/(1/2+ cos(180/n)/2);
$fn=200;
// test
n=9;
a=cd(50,n);
difference(){
circle(d=a);
circle(d=a,$fn=n);
}
On 07/02/2025 11:51, Raymond West via Discuss wrote:
The code below, does not give exact results for an odd number of
faces. I never noticed that in the parts that I generated. Thanks to
Jordan for pointing that out.
On 06/02/2025 00:25, Raymond West via Discuss wrote:
probably easier to measure af at each end to get two squares
separated by the distances between your two measurements, say z.
linear_extrude the squares by say 0.01, then place them one above the
other by z, and hull.
But, if you want, here's how to get the circumscribed diameter s=
side for a square, n =4
function cd(s,n)=n % 2 == 0 ?
s / cos(180 / n):
s * (1/2 + 1 / (2 * cos(180 / n)));
On 05/02/2025 23:54, gene heskett via Discuss wrote:
One of the things I'm doing with this vise screw is making asquare
pocket for the end of the wooden stick I'm useing for s screw.
But due to saw wander etc, the square end of the stick needs a
pocket made with a taper from $fn=4 and 2 slightly different d1 and
d2's are given for a square. So I need the divisor to scale the size
to match what I get for a cube. That is the chord I think I'm not a
math wizard so what would the mutlplier be if a 51mm square pocket
was to be made by a cylinder(h=depth, with d1 & d2 being he same
physical size as the cube? But with the equ of a 1 degree taper to
the sidewalls'? Thank you all.
Cheers, Gene Heskett, CET.
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
corrected code below
/*
calculate circumcircle for polygon given number of flats, n
and af, across flats for even n,
af=flat to opposite vertex for odd n
*/
function cd(af,n)= n% 2 == 0?
af/cos (180/n):
af/(1/2+ cos(180/n)/2);
$fn=200;
// test
n=9;
a=cd(50,n);
difference(){
circle(d=a);
circle(d=a,$fn=n);
}
On 07/02/2025 11:51, Raymond West via Discuss wrote:
> The code below, does not give exact results for an odd number of
> faces. I never noticed that in the parts that I generated. Thanks to
> Jordan for pointing that out.
>
>
> On 06/02/2025 00:25, Raymond West via Discuss wrote:
>> probably easier to measure af at each end to get two squares
>> separated by the distances between your two measurements, say z.
>> linear_extrude the squares by say 0.01, then place them one above the
>> other by z, and hull.
>>
>> But, if you want, here's how to get the circumscribed diameter s=
>> side for a square, n =4
>>
>>
>> function cd(s,n)=n % 2 == 0 ?
>> s / cos(180 / n):
>> s * (1/2 + 1 / (2 * cos(180 / n)));
>>
>>
>>
>> On 05/02/2025 23:54, gene heskett via Discuss wrote:
>>> One of the things I'm doing with this vise screw is making asquare
>>> pocket for the end of the wooden stick I'm useing for s screw.
>>>
>>> But due to saw wander etc, the square end of the stick needs a
>>> pocket made with a taper from $fn=4 and 2 slightly different d1 and
>>> d2's are given for a square. So I need the divisor to scale the size
>>> to match what I get for a cube. That is the chord I think I'm not a
>>> math wizard so what would the mutlplier be if a 51mm square pocket
>>> was to be made by a cylinder(h=depth, with d1 & d2 being he same
>>> physical size as the cube? But with the equ of a 1 degree taper to
>>> the sidewalls'? Thank you all.
>>>
>>> Cheers, Gene Heskett, CET.
>> _______________________________________________
>> 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
SP
Sanjeev Prabhakar
Fri, Feb 7, 2025 4:46 PM
another geometric way to solve such a problem is like this in pure openscad:
- find the mid points for any 2 sides of the polygon.
- draw a perpendicular bisector of the sides (from each midpoint).
3.find the intersection between these 2 perpendicular bisectors.
- This intersection point is the center of circle
- now find the distance between intersection point to any point on the
polygon. This is the radius of the circle.
so, now you have center point and also radius of the circumscribed circle
[image: Screenshot 2025-02-07 at 10.04.37 PM.png]
On Fri, 7 Feb 2025 at 19:06, Raymond West via Discuss <
discuss@lists.openscad.org> wrote:
corrected code below
/*
calculate circumcircle for polygon given number of flats, n
and af, across flats for even n,
af=flat to opposite vertex for odd n
*/
function cd(af,n)= n% 2 == 0?
af/cos (180/n):
af/(1/2+ cos(180/n)/2);
$fn=200;
// test
n=9;
a=cd(50,n);
difference(){
circle(d=a);
circle(d=a,$fn=n);
}
On 07/02/2025 11:51, Raymond West via Discuss wrote:
The code below, does not give exact results for an odd number of
faces. I never noticed that in the parts that I generated. Thanks to
Jordan for pointing that out.
On 06/02/2025 00:25, Raymond West via Discuss wrote:
probably easier to measure af at each end to get two squares
separated by the distances between your two measurements, say z.
linear_extrude the squares by say 0.01, then place them one above the
other by z, and hull.
But, if you want, here's how to get the circumscribed diameter s=
side for a square, n =4
function cd(s,n)=n % 2 == 0 ?
s / cos(180 / n):
s * (1/2 + 1 / (2 * cos(180 / n)));
On 05/02/2025 23:54, gene heskett via Discuss wrote:
One of the things I'm doing with this vise screw is making asquare
pocket for the end of the wooden stick I'm useing for s screw.
But due to saw wander etc, the square end of the stick needs a
pocket made with a taper from $fn=4 and 2 slightly different d1 and
d2's are given for a square. So I need the divisor to scale the size
to match what I get for a cube. That is the chord I think I'm not a
math wizard so what would the mutlplier be if a 51mm square pocket
was to be made by a cylinder(h=depth, with d1 & d2 being he same
physical size as the cube? But with the equ of a 1 degree taper to
the sidewalls'? Thank you all.
Cheers, Gene Heskett, CET.
another geometric way to solve such a problem is like this in pure openscad:
1. find the mid points for any 2 sides of the polygon.
2. draw a perpendicular bisector of the sides (from each midpoint).
3.find the intersection between these 2 perpendicular bisectors.
4. This intersection point is the center of circle
5. now find the distance between intersection point to any point on the
polygon. This is the radius of the circle.
so, now you have center point and also radius of the circumscribed circle
[image: Screenshot 2025-02-07 at 10.04.37 PM.png]
On Fri, 7 Feb 2025 at 19:06, Raymond West via Discuss <
discuss@lists.openscad.org> wrote:
> corrected code below
>
> /*
> calculate circumcircle for polygon given number of flats, n
> and af, across flats for even n,
> af=flat to opposite vertex for odd n
> */
>
> function cd(af,n)= n% 2 == 0?
> af/cos (180/n):
> af/(1/2+ cos(180/n)/2);
>
>
> $fn=200;
> // test
> n=9;
> a=cd(50,n);
> difference(){
> circle(d=a);
> circle(d=a,$fn=n);
> }
>
> On 07/02/2025 11:51, Raymond West via Discuss wrote:
> > The code below, does not give exact results for an odd number of
> > faces. I never noticed that in the parts that I generated. Thanks to
> > Jordan for pointing that out.
> >
> >
> > On 06/02/2025 00:25, Raymond West via Discuss wrote:
> >> probably easier to measure af at each end to get two squares
> >> separated by the distances between your two measurements, say z.
> >> linear_extrude the squares by say 0.01, then place them one above the
> >> other by z, and hull.
> >>
> >> But, if you want, here's how to get the circumscribed diameter s=
> >> side for a square, n =4
> >>
> >>
> >> function cd(s,n)=n % 2 == 0 ?
> >> s / cos(180 / n):
> >> s * (1/2 + 1 / (2 * cos(180 / n)));
> >>
> >>
> >>
> >> On 05/02/2025 23:54, gene heskett via Discuss wrote:
> >>> One of the things I'm doing with this vise screw is making asquare
> >>> pocket for the end of the wooden stick I'm useing for s screw.
> >>>
> >>> But due to saw wander etc, the square end of the stick needs a
> >>> pocket made with a taper from $fn=4 and 2 slightly different d1 and
> >>> d2's are given for a square. So I need the divisor to scale the size
> >>> to match what I get for a cube. That is the chord I think I'm not a
> >>> math wizard so what would the mutlplier be if a 51mm square pocket
> >>> was to be made by a cylinder(h=depth, with d1 & d2 being he same
> >>> physical size as the cube? But with the equ of a 1 degree taper to
> >>> the sidewalls'? Thank you all.
> >>>
> >>> Cheers, Gene Heskett, CET.
> >> _______________________________________________
> >> 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
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
>