Dear all
This is the function of a logarithmic helix:
Funktion https://mathepedia.de/Reelle_Funktionen.html
�(�)=�⋅��⋅�r(φ)=a⋅ek⋅φ
How can I transform this "knowledge" to OpenScad, to receive a file in
which I can adjust the radients, the angles and the number of turns?
many thanks
Karl
P.S.
My aim is to create someting like that -->
https://www.kl-angelsport.de/images/thumbnail/produkte/medium/saenger_1907050.jpg
Unable to see the equation, but the creating the model as per picture
should not be difficult in pure openscad.
Maybe libraries available should be able to handle this.
On Mon, 2 Oct, 2023, 12:08 pm Karl Exler, karl.exler@meinklang.cc wrote:
Dear all
This is the function of a logarithmic helix:
Funktion https://mathepedia.de/Reelle_Funktionen.html �(�)=�⋅��⋅�r(φ)=a⋅
ek⋅φ
How can I transform this "knowledge" to OpenScad, to receive a file in
which I can adjust the radients, the angles and the number of turns?
many thanks
Karl
P.S.
My aim is to create someting like that -->
https://www.kl-angelsport.de/images/thumbnail/produkte/medium/saenger_1907050.jpg
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
code attached -
adjust the parameters to get it printable on your fdm printer.
On 10/1/2023 11:37 PM, Karl Exler wrote:
This is the function of a logarithmic helix:
Funktion https://mathepedia.de/Reelle_Funktionen.html
�(�)=�⋅��⋅�r(φ)=a⋅ek⋅φ
My math isn't all that strong, and the article is in German and my
German extends only slightly past "Ich spreche kien Deutsch", but I
think that's the function of an exponential spiral. It gives the radius
of the spiral for a particular angle phi around the spiral, with alpha
being a scaling factor on the radius and kappa being a scaling factor on
the angle.
How can I transform this "knowledge" to OpenScad, to receive a file in
which I can adjust the radients, the angles and the number of turns?
Here's something that turns that formula into OpenSCAD and draws some
lines. The next step (which I do not have time for at the moment) is to
sweep the points with a circle). But see the important caveat below.
maxPhi = 7200;
alpha = 10;
kappa = 0.0005;
stretch = 0.1;
function toRect2(p) = [
p[0] * cos(p[1]),
p[0] * sin(p[1])
];
function logSpiralR(phi, alpha, kappa) = alpha * exp(kappa * phi);
function logSpiral(phi, alpha, kappa) =
toRect2([logSpiralR(phi, alpha, kappa), phi]);
function logHelix(phi, alpha, kappa, stretch) = concat(
logSpiral(phi, alpha, kappa),
phi * stretch);
for (phi=[0:maxPhi]) {
translate(logSpiral(phi, alpha, kappa)) square(2, center=true);
translate(logHelix(phi, alpha, kappa, stretch)) cube(2, center=true);
}
My aim is to create someting like that -->
https://www.kl-angelsport.de/images/thumbnail/produkte/medium/saenger_1907050.jpg
But that function produces a shape that expands to infinity,
accelerating its expansion, as you move along it, and that's not what
this image shows. I suspect that you want a function where the key
piece is log() rather than exp(), but again I'm out of time right now.
My interpretation of the image is that it is the union of four spirals that
are all normal uniform spirals, neither logarithmic nor exponential or any
other fancy thing. The main body is two cones put together and at the ends
it's just tightly wrapped in a cylinder.
On Tue, Oct 3, 2023 at 11:40 AM Jordan Brown openscad@jordan.maileater.net
wrote:
On 10/1/2023 11:37 PM, Karl Exler wrote:
This is the function of a logarithmic helix:
Funktion https://mathepedia.de/Reelle_Funktionen.html �(�)=�⋅��⋅�r(φ)=a⋅
ek⋅φ
My math isn't all that strong, and the article is in German and my German
extends only slightly past "Ich spreche kien Deutsch", but I think that's
the function of an exponential spiral. It gives the radius of the spiral
for a particular angle phi around the spiral, with alpha being a scaling
factor on the radius and kappa being a scaling factor on the angle.
How can I transform this "knowledge" to OpenScad, to receive a file in
which I can adjust the radients, the angles and the number of turns?
Here's something that turns that formula into OpenSCAD and draws some
lines. The next step (which I do not have time for at the moment) is to
sweep the points with a circle). But see the important caveat below.
maxPhi = 7200;
alpha = 10;
kappa = 0.0005;
stretch = 0.1;
function toRect2(p) = [
p[0] * cos(p[1]),
p[0] * sin(p[1])
];
function logSpiralR(phi, alpha, kappa) = alpha * exp(kappa * phi);
function logSpiral(phi, alpha, kappa) =
toRect2([logSpiralR(phi, alpha, kappa), phi]);
function logHelix(phi, alpha, kappa, stretch) = concat(
logSpiral(phi, alpha, kappa),
phi * stretch);
for (phi=[0:maxPhi]) {
translate(logSpiral(phi, alpha, kappa)) square(2, center=true);
translate(logHelix(phi, alpha, kappa, stretch)) cube(2, center=true);
}
My aim is to create someting like that -->
https://www.kl-angelsport.de/images/thumbnail/produkte/medium/saenger_1907050.jpg
But that function produces a shape that expands to infinity, accelerating
its expansion, as you move along it, and that's not what this image shows.
I suspect that you want a function where the key piece is log() rather than
exp(), but again I'm out of time right now.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
Here's my approximation. Only the stroke()
command requires the BOSL2 library:
include <BOSL2/std.scad>
$fn = 45;
wire_d = 2;
spring_l = 100;
spring_d = 20;
rod_d = 10;
r_table = [
[0.00, 0],
[0.17, 0],
[0.50, 1],
[0.83, 0],
[1.00, 0],
];
l_table = [
[0.00, -0.50],
[0.17, -0.45],
[0.20, -0.42],
[0.80, +0.42],
[0.83, +0.45],
[1.00, +0.50],
];
loops = 17;
lsteps = 45;
tsteps = loops * lsteps;
path = [
for (i = [0:1:tsteps])
let(
u = i / tsteps,
a = u * 360 * loops,
r = lookup(u, r_table) * spring_d/2 + wire_d/2 + rod_d/2,
z = lookup(u, l_table) * spring_l,
pt = [r*cos(a), r*sin(a), z]
) pt
];
rotate([0,90,0]) {
color("lightblue") stroke(path, width=wire_d);
cylinder(d=rod_d, h=spring_l+10, center=true);
}

Very elegant, Revar, not that I am surprised.
Jon
On 10/3/2023 9:08 PM, Revar Desmera wrote:
Here's my approximation. Only the stroke()
command requires the
BOSL2 library:
include <BOSL2/std.scad>
$fn = 45;
wire_d = 2;
spring_l = 100;
spring_d = 20;
rod_d = 10;
r_table = [
[0.00, 0],
[0.17, 0],
[0.50, 1],
[0.83, 0],
[1.00, 0],
];
l_table = [
[0.00, -0.50],
[0.17, -0.45],
[0.20, -0.42],
[0.80, +0.42],
[0.83, +0.45],
[1.00, +0.50],
];
loops = 17;
lsteps = 45;
tsteps = loops * lsteps;
path = [
for (i = [0:1:tsteps])
let(
u = i / tsteps,
a = u * 360 * loops,
r = lookup(u, r_table) * spring_d/2 + wire_d/2 + rod_d/2,
z = lookup(u, l_table) * spring_l,
pt = [rcos(a), rsin(a), z]
) pt
];
rotate([0,90,0]) {
color("lightblue") stroke(path, width=wire_d);
cylinder(d=rod_d, h=spring_l+10, center=true);
}
Screenshot 2023-10-03 at 6.05.28 PM.png
OpenSCAD mailing list
To unsubscribe send an email todiscuss-leave@lists.openscad.org
Revised code to ensure "perfect" end wrap spacing of the spring wire if you modify wire_d:
include <BOSL2/std.scad>
$fn = 45;
wire_d = 2;
spring_l = 100;
spring_d = 20;
rod_d = 10;
loops = 17;
tight_loops=3;
tpart = tight_loops/loops;
lpart = wire_d * tight_loops / 100;
r_table = [
[0.00, 0],
[0.17, 0],
[0.50, 1],
[0.83, 0],
[1.00, 0],
];
l_table = [
[0.00, -0.50],
[0+tpart, -0.5+lpart],
[1-tpart, +0.5-lpart],
[1.00, +0.50],
];
lsteps = 45;
tsteps = loops * lsteps;
path = [
for (i = [0:1:tsteps])
let(
u = i / tsteps,
a = u * 360 * loops,
r = lookup(u, r_table) * spring_d/2 + wire_d/2 + rod_d/2,
z = lookup(u, l_table) * spring_l,
pt = [r*cos(a), r*sin(a), z]
) pt
];
yrot(90) {
color("lightblue")
path_sweep(circle(d=wire_d), path);
cylinder(d=rod_d, h=spring_l+10, center=true);
}
maybe some other interesting shapes
On Wed, 4 Oct 2023, 12:25 Revar Desmera, revarbat@gmail.com wrote:
Revised code to ensure "perfect" end wrap spacing of the spring wire if
you modify wire_d:
include <BOSL2/std.scad>
$fn = 45;
wire_d = 2;
spring_l = 100;
spring_d = 20;
rod_d = 10;
loops = 17;
tight_loops=3;
tpart = tight_loops/loops;
lpart = wire_d * tight_loops / 100;
r_table = [
[0.00, 0],
[0.17, 0],
[0.50, 1],
[0.83, 0],
[1.00, 0],
];
l_table = [
[0.00, -0.50],
[0+tpart, -0.5+lpart],
[1-tpart, +0.5-lpart],
[1.00, +0.50],
];
lsteps = 45;
tsteps = loops * lsteps;
path = [
for (i = [0:1:tsteps])
let(
u = i / tsteps,
a = u * 360 * loops,
r = lookup(u, r_table) * spring_d/2 + wire_d/2 + rod_d/2,
z = lookup(u, l_table) * spring_l,
pt = [r*cos(a), r*sin(a), z]
) pt
];
yrot(90) {
color("lightblue")
path_sweep(circle(d=wire_d), path);
cylinder(d=rod_d, h=spring_l+10, center=true);
}
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
I honestly promise, that in my next life I will pay more attention to
mathematics in highschool ... I would give a lot to understand your code
but it is beautiful.. I now have your solution and that from Sanjeev.
So I am very happy
Many thanks
Karl
Am 04.10.23 um 08:54 schrieb Revar Desmera:
Revised code to ensure "perfect" end wrap spacing of the spring wire
if you modify wire_d:
include <BOSL2/std.scad>
$fn = 45;
wire_d = 2;
spring_l = 100;
spring_d = 20;
rod_d = 10;
loops = 17;
tight_loops=3;
tpart = tight_loops/loops;
lpart = wire_d * tight_loops / 100;
r_table = [
[0.00, 0],
[0.17, 0],
[0.50, 1],
[0.83, 0],
[1.00, 0],
];
l_table = [
[0.00, -0.50],
[0+tpart, -0.5+lpart],
[1-tpart, +0.5-lpart],
[1.00, +0.50],
];
lsteps = 45;
tsteps = loops * lsteps;
path = [
for (i = [0:1:tsteps])
let(
u = i / tsteps,
a = u * 360 * loops,
r = lookup(u, r_table) * spring_d/2 + wire_d/2 + rod_d/2,
z = lookup(u, l_table) * spring_l,
pt = [rcos(a), rsin(a), z]
) pt
];
yrot(90) {
color("lightblue")
path_sweep(circle(d=wire_d), path);
cylinder(d=rod_d, h=spring_l+10, center=true);
}
OpenSCAD mailing list
To unsubscribe send an email todiscuss-leave@lists.openscad.org