On Sat, Nov 19, 2022 at 11:11:20PM -0800, Jordan Brown wrote:
Getting it truly right is, I believe, a bit of an adventure.
The offset would need to be perpendicular to the curve.
For a parabola, you can find this line by taking the average
between a line to the focal point and the vertical.
Roger.
--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 **
** Delftechpark 11 2628 XJ Delft, The Netherlands. KVK: 27239233 **
f equals m times a. When your f is steady, and your m is going down
your a is going up. -- Chris Hadfield about flying up the space shuttle.
On Sun, Nov 20, 2022 at 04:20:14AM -0500, Bob Roos wrote:
Hi Bob,
Looks good in OPenSCAD but you can't see cross section until you slice it. It was tough to get one layer at the top when printed upside down.
Oh, I always do "difference" with a big cube when trying to look at
the insides of something in openscad. With an object (like here)
centered on the origin you get a cutout on one quadrant and you get
to keep 3/4ths to look at the outside....
Roger.
--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 **
** Delftechpark 11 2628 XJ Delft, The Netherlands. KVK: 27239233 **
f equals m times a. When your f is steady, and your m is going down
your a is going up. -- Chris Hadfield about flying up the space shuttle.
A full offset() solution is very difficult indeed, as I can report from
personal experience. You can use it here:
https://github.com/revarbat/BOSL2/wiki/regions.scad#function-offset
But if you don't want to do that, you can get a decent result in this case,
because you know the functional form so you can compute the normal, and the
point spacing is large. Just offset using the normal vector, which is very
easy to calculate from a parabola since the derivative is easy to compute.
So if your parabola is ax^2+bx+c the normal will be [2ax+b,-1]. Here's
code that does it:
a=1/144; b=0; c=0;
thickness = 5;
step=7.5;
pts = [for(x=[0:step:120]) [x,ax^2+bx+c]];
pts2 = [for(x=[120:-step:0]) let(n=[2ax+b,-1]) [x,ax^2+bx+c] -
thickness*n/norm(n)];
polygon(concat(pts,pts2));
[image: image.png]
On Sun, Nov 20, 2022 at 2:11 AM Jordan Brown openscad@jordan.maileater.net
wrote:
Also note that offsetting in X alone doesn't really do what you want,
because at the start of the curve it's close to Y=0 and the result is thin;
it's only when the curve goes vertical that you get a thickness of 2.
Better might be to offset it by [2,-2]:
but that isn't exactly right either:
Getting it truly right is, I believe, a bit of an adventure.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
try code in the attached file
On Sun, 20 Nov 2022 at 11:49, Bob Roos roosbob@wybatap.com wrote:
Hello OpenSCAD,
I have some points from a parabola that I want to turn into a reflector.
The points are generated from an external program. Maybe I should be using
something in OpenScad to generate them? I have not explored that yet.
Anyway, I want to generate a 2nd set of points where the X coordinate is a
thickness away from the first list so I can have a polygon that I can
extrude.
I am aware that what I wrote doesn't work and I understand why it doesn't
work, but I have no idea how to make something that will give a list of
points.
Thank you for your help.
Bob Roos
// parabolic reflector
// Bob Roos
// November 19, 2022
L1 = [[ 0.00, 0.00],[ 7.50, 0.39],[ 15.00, 1.56],[ 22.50,
3.52],[ 30.00, 6.25],[ 37.50, 9.77],[ 45.00, 14.06],[ 52.50,
19.14],[ 60.00, 25.00],[ 67.50, 31.64]];
L3 = [[ 75.00, 39.06],[ 82.50, 47.27],[ 90.00, 56.25],[ 97.50,
66.02],[ 105.00, 76.56],[ 112.50, 87.89],[ 120.00,100.00]];
Thick = 2;
List = concat(L1,L3);
List2 = [];
//rotate_extrude(angle = 360) polygon(List);
for (a =[len(List)-1:-1:0]){
b = List[a][0]+Thick;
List2 = concat(List2,[b,List[a][1]]);
echo(List2);
}
--
Best regards,
Bob mailto:roosbob@wybatap.com
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
On 11/20/2022 12:27 AM, gene heskett wrote:
I am math challenged, only an 8th grade education, but this sort of a
problem would seem to be right up the "polar math" alley. The path
interpreter as used in LinuxCNC can take not only a trio of points
(actually 9 points) as the goto command, but can also work with
distance from an anchoring point and an angle from that point and can
then draw arbitrary curves from a list of distances and angles.
The question is what kinds of curves it can do. I assume that it can do
parts of a circle but that might be all. What Bob was asking for was a
parabola.
I don't see that polar math ability in OpenSCAD unless its hiding
under a different name.
It depends on what you're looking for. You can create some kinds of
curves with circle() and with rotate_extrude(). Much more than that
requires doing your own math.
You can use polar coordinates with some trigonometry.
BOSL2 has polar to rectangular conversion functions
https://github.com/revarbat/BOSL2/wiki/coords.scad and various curved
shapes (2D https://github.com/revarbat/BOSL2/wiki/shapes2d.scad and 3D
https://github.com/revarbat/BOSL2/wiki/shapes3d.scad), notably Bézier
curves https://github.com/revarbat/BOSL2/wiki/beziers.scad.
Unless it's really necessary that the reflector be a parabola on both
sides, I wouldn't (and haven't, when I've done this) do it that way. I'd do
this:
L1 = [[0, -1],[ 0.00, 0.00],[ 7.50, 0.39],[ 15.00, 1.56],[ 22.50,
3.52],[ 30.00, 6.25],[ 37.50, 9.77],[ 45.00, 14.06],[ 52.50,
19.14],[ 60.00, 25.00],[ 67.50, 31.64], [67.5, -1]];
l1_moved = [for (b = L1) [b.x, b.y + 1]];
rotate_extrude() polygon(l1_moved);
and then print with minimal infill. Since you're going to need supports to
print it anyway, it's not as much of a waste as it appears.
I might also note that you might not get the results you want because
you're not going to get a smooth curve, even with a finer points list.
You're going to get stair-steps. This might work for reflecting sound, but
it won't work well for light.
On Sun, Nov 20, 2022 at 10:51 AM Jordan Brown openscad@jordan.maileater.net
wrote:
On 11/20/2022 12:27 AM, gene heskett wrote:
I am math challenged, only an 8th grade education, but this sort of a
problem would seem to be right up the "polar math" alley. The path
interpreter as used in LinuxCNC can take not only a trio of points
(actually 9 points) as the goto command, but can also work with distance
from an anchoring point and an angle from that point and can then draw
arbitrary curves from a list of distances and angles.
The question is what kinds of curves it can do. I assume that it can do
parts of a circle but that might be all. What Bob was asking for was a
parabola.
I don't see that polar math ability in OpenSCAD unless its hiding under a
different name.
It depends on what you're looking for. You can create some kinds of
curves with circle() and with rotate_extrude(). Much more than that
requires doing your own math.
You can use polar coordinates with some trigonometry.
BOSL2 has polar to rectangular conversion functions
https://github.com/revarbat/BOSL2/wiki/coords.scad and various curved
shapes (2D https://github.com/revarbat/BOSL2/wiki/shapes2d.scad and 3D
https://github.com/revarbat/BOSL2/wiki/shapes3d.scad), notably Bézier
curves https://github.com/revarbat/BOSL2/wiki/beziers.scad.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
In BOSL2, just use stroke()
. It’ll take care of the offset for you:
thick=5;
up(thick/2)
rotate_extrude()
stroke([for (x=[0:7.5:220]) [x,x*x/144]], width=thick);
-Revar
On Nov 20, 2022, at 5:58 AM, Adrian Mariano <avm4@cornell.edu> wrote:
A full offset() solution is very difficult indeed, as I can report from personal experience. You can use it here:
https://github.com/revarbat/BOSL2/wiki/regions.scad#function-offset
But if you don't want to do that, you can get a decent result in this case, because you know the functional form so you can compute the normal, and the point spacing is large. Just offset using the normal vector, which is very easy to calculate from a parabola since the derivative is easy to compute. So if your parabola is ax^2+bx+c the normal will be [2ax+b,-1]. Here's code that does it:
a=1/144; b=0; c=0;
thickness = 5;
step=7.5;
pts = [for(x=[0:step:120]) [x,ax^2+bx+c]];
pts2 = [for(x=[120:-step:0]) let(n=[2ax+b,-1]) [x,ax^2+bx+c] - thickness*n/norm(n)];
polygon(concat(pts,pts2));<image.png>
On Sun, Nov 20, 2022 at 2:11 AM Jordan Brown <openscad@jordan.maileater.net> wrote:
Also note that offsetting in X alone doesn't really do what you want, because at the start of the curve it's close to Y=0 and the result is thin; it's only when the curve goes vertical that you get a thickness of 2.
<8by0b6ENZA81gvzT.png>
Better might be to offset it by [2,-2]:
<ZMAuUyvslozDulY8.png>but that isn't exactly right either:
<KpgA2FSz800FPvQ3.png>
Getting it truly right is, I believe, a bit of an adventure.
_______________________________________________
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
That 220 should be 120. That’s what I get for writing code on a phone.
-Revar
On Nov 20, 2022, at 10:39 AM, Revar Desmera <revarbat@gmail.com> wrote:
In BOSL2, just use
stroke()
. It’ll take care of the offset for you:thick=5;
up(thick/2)
rotate_extrude()
stroke([for (x=[0:7.5:220]) [x,x*x/144]], width=thick);
-Revar
On Nov 20, 2022, at 5:58 AM, Adrian Mariano <avm4@cornell.edu> wrote:
A full offset() solution is very difficult indeed, as I can report from personal experience. You can use it here:
https://github.com/revarbat/BOSL2/wiki/regions.scad#function-offset
But if you don't want to do that, you can get a decent result in this case, because you know the functional form so you can compute the normal, and the point spacing is large. Just offset using the normal vector, which is very easy to calculate from a parabola since the derivative is easy to compute. So if your parabola is ax^2+bx+c the normal will be [2ax+b,-1]. Here's code that does it:
a=1/144; b=0; c=0;
thickness = 5;
step=7.5;
pts = [for(x=[0:step:120]) [x,ax^2+bx+c]];
pts2 = [for(x=[120:-step:0]) let(n=[2ax+b,-1]) [x,ax^2+bx+c] - thickness*n/norm(n)];
polygon(concat(pts,pts2));<image.png>
On Sun, Nov 20, 2022 at 2:11 AM Jordan Brown <openscad@jordan.maileater.net> wrote:
Also note that offsetting in X alone doesn't really do what you want, because at the start of the curve it's close to Y=0 and the result is thin; it's only when the curve goes vertical that you get a thickness of 2.
<8by0b6ENZA81gvzT.png>
Better might be to offset it by [2,-2]:
<ZMAuUyvslozDulY8.png>but that isn't exactly right either:
<KpgA2FSz800FPvQ3.png>
Getting it truly right is, I believe, a bit of an adventure.
_______________________________________________
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
On 11/20/22 11:50, Jordan Brown wrote:
On 11/20/2022 12:27 AM, gene heskett wrote:
I am math challenged, only an 8th grade education, but this sort of a
problem would seem to be right up the "polar math" alley. The path
interpreter as used in LinuxCNC can take not only a trio of points
(actually 9 points) as the goto command, but can also work with
distance from an anchoring point and an angle from that point and can
then draw arbitrary curves from a list of distances and angles.
The question is what kinds of curves it can do. I assume that it can do
parts of a circle but that might be all. What Bob was asking for was a
parabola.
We are way off topic, thanks to me, but:
The G5 bezier function could take his limited accuracy parabola and by
following the average of its point path, convert it to a much higher
accuracy curve, with the right tweaks to its operation code of course.
G2/G3 for arcs has no revolution limits vis-a-vis turns or fractions of
them. You can direct it to spiral outward, or to spiral downward. I have
a 60 degree tooth cutter .750" in diameter that can cut a thread that
only exists in your mind. A 50 tpi thread in a 6" hole if that is what
you need. Metric or imperial, your choice, its all math, no actual gears
involved.
Generally, your imagination is the more important limit to what it can do.
Not mentioned in the docs for G76, the threading macro, is the ability
to cut tappered threads in case you need a compression fitting.
Not mentioned in the O.P. is the size of the parabola in terms of the
audio wavelength, but a sloppily made 10 foot parabola will have
noticeable effects on the frequency response at the higher frequencies,
such as bird song. Caused by the errors being big enough that certain
frequencies would be canceled instead of added.
I don't see that polar math ability in OpenSCAD unless its hiding
under a different name.
It depends on what you're looking for. You can create some kinds of
curves with circle() and with rotate_extrude(). Much more than that
requires doing your own math.
You can use polar coordinates with some trigonometry.
BOSL2 has polar to rectangular conversion functions
https://github.com/revarbat/BOSL2/wiki/coords.scad and various curved
shapes (2D https://github.com/revarbat/BOSL2/wiki/shapes2d.scad and 3D
https://github.com/revarbat/BOSL2/wiki/shapes3d.scad), notably Bézier
curves https://github.com/revarbat/BOSL2/wiki/beziers.scad.
I did not know that, BOSL2 seemed to be pretty intimidating, so I've not
studied it in depth. Thank you.
"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.