M
mikeonenine@web.de
Thu, Sep 19, 2024 10:37 PM
Something else with teeth that the world has been waiting for: a face spline coupling aka Hirth coupling. I created it some time ago as part of a design, but it had a glitch that turned out to be because the circumference of a small sector of a circle is slightly longer than the straight line across it. This left tiny but visible gaps between the splines.
I thought it would be difficult to parametrise but it was not.
But it still has some sharp edges that need rounding. Any volunteers?
$fn=100;
$vpr=[ 60, 0, 315 ];
$vpt=[ 0, 0, 0 ];
$vpd=80;
/*
*/
a=60; // Base angle
r=12; // Radius
n=24; // Number of splines
module facespline()
{
difference()
{
intersection()
{
for(i = [1 : n])
rotate(i * 360/n)
polyhedron(
points = [
// Point 0
[0, 0, PI*r/2/n*tan(a)],
// Point 1
[r, r*tan(360/2/n), 0],
// Point 2
[r, -r*tan(360/2/n), 0],
// Point 3
[r, 0, PI*r/n*tan(a)],
// Point 4
[0, 0, 0]
],
faces = [
[1,2,3],
//[0,2,1],
[3,2,0],
[3,0,1],
[0,2,4], //
[0,4,1], //
[1,4,2] //
]);
cylinder(r=r, h=PI*r/16*tan(a)+1);
}
// Hole
translate([0,0,-1])
cylinder(r=6, h=5);
}}
// Face spline coupling
rotate([0, 0, $t*360])
{
translate([0, 0, -3])
facespline();
translate([0, 0, 3])
rotate([0, 180, 360/2/n])
facespline();
}
Something else with teeth that the world has been waiting for: a face spline coupling aka Hirth coupling. I created it some time ago as part of a design, but it had a glitch that turned out to be because the circumference of a small sector of a circle is slightly longer than the straight line across it. This left tiny but visible gaps between the splines.
I thought it would be difficult to parametrise but it was not.
But it still has some sharp edges that need rounding. Any volunteers?
`$fn=100;`
`$vpr=[ 60, 0, 315 ];`
`$vpt=[ 0, 0, 0 ];`
`$vpd=80;`
`/*`
`*/`
`a=60; // Base angle`
`r=12; // Radius`
`n=24; // Number of splines`
`module facespline()`
`{`
`difference()`
`{`
`intersection()`
`{`
`for(i = [1 : n])`
`rotate(i * 360/n)`
`polyhedron( `
`points = [ `
`// Point 0`
`[0, 0, PI*r/2/n*tan(a)],`
`// Point 1`
`[r, r*tan(360/2/n), 0], `
`// Point 2`
`[r, -r*tan(360/2/n), 0], `
`// Point 3 `
`[r, 0, PI*r/n*tan(a)],`
`// Point 4`
`[0, 0, 0]`
`], `
`faces = [ `
`[1,2,3],`
`//[0,2,1], `
`[3,2,0],`
`[3,0,1],`
`[0,2,4], //`
`[0,4,1], //`
`[1,4,2] //`
`]);`
`cylinder(r=r, h=PI*r/16*tan(a)+1);`
`}`
`// Hole`
`translate([0,0,-1])`
`cylinder(r=6, h=5);`
`}}`
`// Face spline coupling`
`rotate([0, 0, $t*360])`
`{`
`translate([0, 0, -3])`
`facespline();`
`translate([0, 0, 3])`
`rotate([0, 180, 360/2/n])`
`facespline();`
`}`
BC
Bob Carlson
Thu, Sep 19, 2024 11:40 PM
I was curious what this looks like so I loaded it up and hit F6. I get No Geometry to Render.
-Bob
On Sep 19, 2024, at 15:37, Caddiy via Discuss discuss@lists.openscad.org wrote:
Something else with teeth that the world has been waiting for: a face spline coupling aka Hirth coupling. I created it some time ago as part of a design, but it had a glitch that turned out to be because the circumference of a small sector of a circle is slightly longer than the straight line across it. This left tiny but visible gaps between the splines.
I thought it would be difficult to parametrise but it was not.
But it still has some sharp edges that need rounding. Any volunteers?
$fn=100;
$vpr=[ 60, 0, 315 ];
$vpt=[ 0, 0, 0 ];
$vpd=80;
/*
*/
a=60; // Base angle
r=12; // Radius
n=24; // Number of splines
module facespline()
{
difference()
{
intersection()
{
for(i = [1 : n])
rotate(i * 360/n)
polyhedron(
points = [
// Point 0
[0, 0, PIr/2/ntan(a)],
// Point 1
[r, r*tan(360/2/n), 0],
// Point 2
[r, -r*tan(360/2/n), 0],
// Point 3
[r, 0, PIr/ntan(a)],
// Point 4
[0, 0, 0]
],
faces = [
[1,2,3],
//[0,2,1],
[3,2,0],
[3,0,1],
[0,2,4], //
[0,4,1], //
[1,4,2] //
]);
cylinder(r=r, h=PIr/16tan(a)+1);
}
// Hole
translate([0,0,-1])
cylinder(r=6, h=5);
}}
// Face spline coupling
rotate([0, 0, $t*360])
{
translate([0, 0, -3])
facespline();
translate([0, 0, 3])
rotate([0, 180, 360/2/n])
facespline();
}
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
I was curious what this looks like so I loaded it up and hit F6. I get No Geometry to Render.
-Bob
> On Sep 19, 2024, at 15:37, Caddiy via Discuss <discuss@lists.openscad.org> wrote:
>
> Something else with teeth that the world has been waiting for: a face spline coupling aka Hirth coupling. I created it some time ago as part of a design, but it had a glitch that turned out to be because the circumference of a small sector of a circle is slightly longer than the straight line across it. This left tiny but visible gaps between the splines.
>
> I thought it would be difficult to parametrise but it was not.
>
> But it still has some sharp edges that need rounding. Any volunteers?
>
> $fn=100;
>
> $vpr=[ 60, 0, 315 ];
>
> $vpt=[ 0, 0, 0 ];
>
> $vpd=80;
>
> /*
>
> */
>
> a=60; // Base angle
>
> r=12; // Radius
>
> n=24; // Number of splines
>
> module facespline()
>
> {
>
> difference()
>
> {
>
> intersection()
>
> {
>
> for(i = [1 : n])
>
> rotate(i * 360/n)
>
> polyhedron(
>
> points = [
>
> // Point 0
>
> [0, 0, PI*r/2/n*tan(a)],
>
> // Point 1
>
> [r, r*tan(360/2/n), 0],
>
> // Point 2
>
> [r, -r*tan(360/2/n), 0],
>
> // Point 3
>
> [r, 0, PI*r/n*tan(a)],
>
> // Point 4
>
> [0, 0, 0]
>
> ],
>
> faces = [
>
> [1,2,3],
>
> //[0,2,1],
>
> [3,2,0],
>
> [3,0,1],
>
> [0,2,4], //
>
> [0,4,1], //
>
> [1,4,2] //
>
> ]);
>
> cylinder(r=r, h=PI*r/16*tan(a)+1);
>
> }
>
> // Hole
>
> translate([0,0,-1])
>
> cylinder(r=6, h=5);
>
> }}
>
> // Face spline coupling
>
> rotate([0, 0, $t*360])
>
> {
>
> translate([0, 0, -3])
>
> facespline();
>
> translate([0, 0, 3])
>
> rotate([0, 180, 360/2/n])
>
> facespline();
>
> }
>
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
DP
Dan Perry
Thu, Sep 19, 2024 11:51 PM
I was curious what this looks like so I loaded it up and hit F6. I get No
Geometry to Render.
-Bob
On Sep 19, 2024, at 15:37, Caddiy via Discuss discuss@lists.openscad.org
wrote:
Something else with teeth that the world has been waiting for: a face
spline coupling aka Hirth coupling. I created it some time ago as part of a
design, but it had a glitch that turned out to be because the circumference
of a small sector of a circle is slightly longer than the straight line
across it. This left tiny but visible gaps between the splines.
I thought it would be difficult to parametrise but it was not.
But it still has some sharp edges that need rounding. Any volunteers?
$fn=100;
$vpr=[ 60, 0, 315 ];
$vpt=[ 0, 0, 0 ];
$vpd=80;
/*
*/
a=60; // Base angle
r=12; // Radius
n=24; // Number of splines
module facespline()
{
difference()
{
intersection()
{
for(i = [1 : n])
rotate(i * 360/n)
polyhedron(
points = [
// Point 0
[0, 0, PIr/2/ntan(a)],
// Point 1
[r, r*tan(360/2/n), 0],
// Point 2
[r, -r*tan(360/2/n), 0],
// Point 3
[r, 0, PIr/ntan(a)],
// Point 4
[0, 0, 0]
],
faces = [
[1,2,3],
//[0,2,1],
[3,2,0],
[3,0,1],
[0,2,4], //
[0,4,1], //
[1,4,2] //
]);
cylinder(r=r, h=PIr/16tan(a)+1);
}
// Hole
translate([0,0,-1])
cylinder(r=6, h=5);
}}
// Face spline coupling
rotate([0, 0, $t*360])
{
translate([0, 0, -3])
facespline();
translate([0, 0, 3])
rotate([0, 180, 360/2/n])
facespline();
}
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
Me too.
On Thu, Sep 19, 2024 at 4:40 PM Bob Carlson via Discuss <
discuss@lists.openscad.org> wrote:
> I was curious what this looks like so I loaded it up and hit F6. I get No
> Geometry to Render.
>
> -Bob
>
> On Sep 19, 2024, at 15:37, Caddiy via Discuss <discuss@lists.openscad.org>
> wrote:
>
> Something else with teeth that the world has been waiting for: a face
> spline coupling aka Hirth coupling. I created it some time ago as part of a
> design, but it had a glitch that turned out to be because the circumference
> of a small sector of a circle is slightly longer than the straight line
> across it. This left tiny but visible gaps between the splines.
>
> I thought it would be difficult to parametrise but it was not.
>
> But it still has some sharp edges that need rounding. Any volunteers?
>
> $fn=100;
>
> $vpr=[ 60, 0, 315 ];
>
> $vpt=[ 0, 0, 0 ];
>
> $vpd=80;
>
> /*
>
> */
>
> a=60; // Base angle
>
> r=12; // Radius
>
> n=24; // Number of splines
>
> module facespline()
>
> {
>
> difference()
>
> {
>
> intersection()
>
> {
>
> for(i = [1 : n])
>
> rotate(i * 360/n)
>
> polyhedron(
>
> points = [
>
> // Point 0
>
> [0, 0, PI*r/2/n*tan(a)],
>
> // Point 1
>
> [r, r*tan(360/2/n), 0],
>
> // Point 2
>
> [r, -r*tan(360/2/n), 0],
>
> // Point 3
>
> [r, 0, PI*r/n*tan(a)],
>
> // Point 4
>
> [0, 0, 0]
>
> ],
>
> faces = [
>
> [1,2,3],
>
> //[0,2,1],
>
> [3,2,0],
>
> [3,0,1],
>
> [0,2,4], //
>
> [0,4,1], //
>
> [1,4,2] //
>
> ]);
>
> cylinder(r=r, h=PI*r/16*tan(a)+1);
>
> }
>
> // Hole
>
> translate([0,0,-1])
>
> cylinder(r=6, h=5);
>
> }}
>
> // Face spline coupling
>
> rotate([0, 0, $t*360])
>
> {
>
> translate([0, 0, -3])
>
> facespline();
>
> translate([0, 0, 3])
>
> rotate([0, 180, 360/2/n])
>
> facespline();
>
> }
> _______________________________________________
> 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
>
M
mikeonenine@web.de
Thu, Sep 19, 2024 11:55 PM
Works perfectly here.
Previews immediately with the cube-and-chevron icon, took a little longer with F6.
Works perfectly here.
Previews immediately with the cube-and-chevron icon, took a little longer with F6.
BC
Bob Carlson
Fri, Sep 20, 2024 12:13 AM
I am on a relatively recent snapshot. Are you using the (ancient) “released” version? Or maybe a more recent snapshot?
I am on a relatively recent snapshot. Are you using the (ancient) “released” version? Or maybe a more recent snapshot?
> On Sep 19, 2024, at 16:55, Caddiy via Discuss <discuss@lists.openscad.org> wrote:
>
> Works perfectly here.
>
> Previews immediately with the cube-and-chevron icon, took a little longer with F6.
>
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
M
mikeonenine@web.de
Fri, Sep 20, 2024 12:15 AM
This is what you should see.
BTW I said sector above, but meant segment.
This is what you should see.
BTW I said sector above, but meant segment.
M
mikeonenine@web.de
Fri, Sep 20, 2024 12:20 AM
I am on a relatively recent snapshot. Are you using the (ancient) “released” version? Or maybe a more recent snapshot?
On Sep 19, 2024, at 16:55, Caddiy via Discuss discuss@lists.openscad.org wrote:
Works perfectly here.
Previews immediately with the cube-and-chevron icon, took a little longer with F6.
i Am using Version 2021.01, but that shouldn’t make any difference?
> I am on a relatively recent snapshot. Are you using the (ancient) “released” version? Or maybe a more recent snapshot?
>
> On Sep 19, 2024, at 16:55, Caddiy via Discuss [discuss@lists.openscad.org](mailto:discuss@lists.openscad.org) wrote:
>
> Works perfectly here.
>
> Previews immediately with the cube-and-chevron icon, took a little longer with F6.
>
> ---
>
> > OpenSCAD mailing list \
> > To unsubscribe send an email to [discuss-leave@lists.openscad.org](mailto:discuss-leave@lists.openscad.org)
i Am using Version 2021.01, but that shouldn’t make any difference?
M
mikeonenine@web.de
Fri, Sep 20, 2024 12:37 AM
Still no joy?
Try deleting all //, /* and */.
Still no joy?
Try deleting all //, /\* and \*/.
K
Ken
Fri, Sep 20, 2024 12:50 AM
I tried that, still no joy. I'm running 2024.08.30
F5 says Compile & preview finished, total rendering time 0.064 seconds- but there's nothing there.
F6 says there is no top-level geometry to render.
On 2024-09-20 10:37, Caddiy via Discuss wrote:
A baby can be defined as an ego with a noise at one end and a smell at the other.
Your job as parents is to teach them to control all three.
My job as a grandad is to tell you how you are doing it all wrong!
I tried that, still no joy. I'm running 2024.08.30
F5 says Compile & preview finished, total rendering time 0.064 seconds- but there's nothing there.
F6 says there is no top-level geometry to render.
On 2024-09-20 10:37, Caddiy via Discuss wrote:
>
> Still no joy?
>
> Try deleting all //, /* and */.
>
>
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email todiscuss-leave@lists.openscad.org
--
Cheers, Ken
bats059@gmail.com
https://vk7krj.com
https://vk7krj.com/running.html
----------------------------------------
A baby can be defined as an ego with a noise at one end and a smell at the other.
Your job as parents is to teach them to control all three.
My job as a grandad is to tell you how you are doing it all wrong!
M
mikeonenine@web.de
Fri, Sep 20, 2024 1:07 AM
Does this work for you?
$fn=100;
$vpr=[ 60, 0, 315 ];
$vpt=[ 0, 0, 0 ];
$vpd=80;
a=60; // Base angle
r=12; // Radius
n=16; // Number of splines
module facespline()
{
difference()
{
intersection()
{
for(i = [1 : n])
rotate(i * 360/n)
polyhedron(
points = [
[0, 0, PI*r/2/n*tan(a)],
[r, r*tan(360/2/n), 0],
[r, -r*tan(360/2/n), 0],
[r, 0, PI*r/n*tan(a)],
[0, 0, 0]
],
faces = [
[1,2,3],
[3,2,0],
[3,0,1],
[0,2,4],
[0,4,1],
[1,4,2]
]);
cylinder(r=r, h=PI*r/16*tan(a)+1);
}
// Hole
translate([0,0,-1])
cylinder(r=6, h=5);
}}
// Face spline coupling
{
translate([0, 0, -3])
facespline();
translate([0, 0, 3])
rotate([0, 180, 360/2/n])
facespline();
}
##### Does this work for you?
###### `$fn=100;`
`$vpr=[ 60, 0, 315 ];`
`$vpt=[ 0, 0, 0 ];`
`$vpd=80;`
`a=60; // Base angle`
`r=12; // Radius`
`n=16; // Number of splines`
`module facespline()`
`{`
`difference()`
`{`
`intersection()`
`{`
`for(i = [1 : n])`
`rotate(i * 360/n)`
`polyhedron(`
`points = [`
`[0, 0, PI*r/2/n*tan(a)],`
`[r, r*tan(360/2/n), 0],`
`[r, -r*tan(360/2/n), 0],`
`[r, 0, PI*r/n*tan(a)],`
`[0, 0, 0]`
`],`
`faces = [`
`[1,2,3],`
`[3,2,0],`
`[3,0,1],`
`[0,2,4], `
`[0,4,1], `
`[1,4,2] `
`]);`
`cylinder(r=r, h=PI*r/16*tan(a)+1);`
`}`
`// Hole`
`translate([0,0,-1])`
`cylinder(r=6, h=5);`
`}}`
`// Face spline coupling`
`{`
`translate([0, 0, -3])`
`facespline();`
`translate([0, 0, 3])`
`rotate([0, 180, 360/2/n])`
`facespline();`
`}`
L
larry
Fri, Sep 20, 2024 3:26 AM
Doesn't work for me.
On Fri, 2024-09-20 at 01:07 +0000, Caddiy via Discuss wrote:
Does this work for you?$fn=100;$vpr=[ 60, 0, 315 ];
$vpt=[ 0, 0, 0 ];
$vpd=80;
a=60; // Base angle
r=12; // Radius
n=16; // Number of splines
module facespline()
{
difference()
{
intersection()
{
for(i = [1 : n])
rotate(i * 360/n)
polyhedron(
points = [
[0, 0, PIr/2/ntan(a)],
[r, rtan(360/2/n), 0],
[r, -rtan(360/2/n), 0],
[r, 0, PIr/ntan(a)],
[0, 0, 0]
],
faces = [
[1,2,3],
[3,2,0],
[3,0,1],
[0,2,4],
[0,4,1],
[1,4,2]
]);
cylinder(r=r, h=PIr/16tan(a)+1);
}
// Hole
translate([0,0,-1])
cylinder(r=6, h=5);
}}
// Face spline coupling
{
translate([0, 0, -3])
facespline();
translate([0, 0, 3])
rotate([0, 180, 360/2/n])
facespline();
}
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
Doesn't work for me.
On Fri, 2024-09-20 at 01:07 +0000, Caddiy via Discuss wrote:
> Does this work for you?$fn=100;$vpr=[ 60, 0, 315 ];
> $vpt=[ 0, 0, 0 ];
> $vpd=80;
> a=60; // Base angle
> r=12; // Radius
> n=16; // Number of splines
> module facespline()
> {
> difference()
> {
> intersection()
> {
> for(i = [1 : n])
> rotate(i * 360/n)
> polyhedron(
> points = [
> [0, 0, PI*r/2/n*tan(a)],
> [r, r*tan(360/2/n), 0],
> [r, -r*tan(360/2/n), 0],
> [r, 0, PI*r/n*tan(a)],
> [0, 0, 0]
> ],
> faces = [
> [1,2,3],
> [3,2,0],
> [3,0,1],
> [0,2,4],
> [0,4,1],
> [1,4,2]
> ]);
> cylinder(r=r, h=PI*r/16*tan(a)+1);
> }
> // Hole
> translate([0,0,-1])
> cylinder(r=6, h=5);
> }}
> // Face spline coupling
> {
> translate([0, 0, -3])
> facespline();
> translate([0, 0, 3])
> rotate([0, 180, 360/2/n])
> facespline();
> }
>
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
K
Ken
Fri, Sep 20, 2024 3:36 AM
Sorry Mike, same result as before.
On 2024-09-20 11:07, Caddiy via Discuss wrote:
Does this work for you?
|$fn=100;|
|$vpr=[ 60, 0, 315 ];|
|$vpt=[ 0, 0, 0 ];|
|$vpd=80;|
|a=60; // Base angle|
|r=12; // Radius|
|n=16; // Number of splines|
|module facespline()|
|{|
|difference()|
|{|
|intersection()|
|{|
|for(i = [1 : n])|
|rotate(i * 360/n)|
|polyhedron(|
|points = [|
|[0, 0, PIr/2/ntan(a)],|
|[r, r*tan(360/2/n), 0],|
|[r, -r*tan(360/2/n), 0],|
|[r, 0, PIr/ntan(a)],|
|[0, 0, 0]|
|],|
|faces = [|
|[1,2,3],|
|[3,2,0],|
|[3,0,1],|
|[0,2,4], |
|[0,4,1], |
|[1,4,2] |
|]);|
|cylinder(r=r, h=PIr/16tan(a)+1);|
|}|
|// Hole|
|translate([0,0,-1])|
|cylinder(r=6, h=5);|
|}}|
|// Face spline coupling|
|{|
|translate([0, 0, -3])|
|facespline();|
|translate([0, 0, 3])|
|rotate([0, 180, 360/2/n])|
|facespline();|
|}|
OpenSCAD mailing list
To unsubscribe send an email todiscuss-leave@lists.openscad.org
A baby can be defined as an ego with a noise at one end and a smell at the other.
Your job as parents is to teach them to control all three.
My job as a grandad is to tell you how you are doing it all wrong!
Sorry Mike, same result as before.
On 2024-09-20 11:07, Caddiy via Discuss wrote:
>
>
> Does this work for you?
>
>
> |$fn=100;|
>
> |$vpr=[ 60, 0, 315 ];|
>
> |$vpt=[ 0, 0, 0 ];|
>
> |$vpd=80;|
>
> |a=60; // Base angle|
>
> |r=12; // Radius|
>
> |n=16; // Number of splines|
>
> |module facespline()|
>
> |{|
>
> |difference()|
>
> |{|
>
> |intersection()|
>
> |{|
>
> |for(i = [1 : n])|
>
> |rotate(i * 360/n)|
>
> |polyhedron(|
>
> |points = [|
>
> |[0, 0, PI*r/2/n*tan(a)],|
>
> |[r, r*tan(360/2/n), 0],|
>
> |[r, -r*tan(360/2/n), 0],|
>
> |[r, 0, PI*r/n*tan(a)],|
>
> |[0, 0, 0]|
>
> |],|
>
> |faces = [|
>
> |[1,2,3],|
>
> |[3,2,0],|
>
> |[3,0,1],|
>
> |[0,2,4], |
>
> |[0,4,1], |
>
> |[1,4,2] |
>
> |]);|
>
> |cylinder(r=r, h=PI*r/16*tan(a)+1);|
>
> |}|
>
> |// Hole|
>
> |translate([0,0,-1])|
>
> |cylinder(r=6, h=5);|
>
> |}}|
>
> |// Face spline coupling|
>
> |{|
>
> |translate([0, 0, -3])|
>
> |facespline();|
>
> |translate([0, 0, 3])|
>
> |rotate([0, 180, 360/2/n])|
>
> |facespline();|
>
> |}|
>
>
>
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email todiscuss-leave@lists.openscad.org
--
Cheers, Ken
bats059@gmail.com
https://vk7krj.com
https://vk7krj.com/running.html
----------------------------------------
A baby can be defined as an ego with a noise at one end and a smell at the other.
Your job as parents is to teach them to control all three.
My job as a grandad is to tell you how you are doing it all wrong!
MM
Michael Marx (spintel)
Fri, Sep 20, 2024 6:21 AM
I think you guys not seeing it may have Lazy Union enable.
Problem is the intersection() of the for(), as each arm of the for() doesn't overlap, so intersection() returns empty.
With Lazy union disabled (or not in 2021.01) the for() does a union().
To fix, stick union() in front of the for().
From: Ken via Discuss [mailto:discuss@lists.openscad.org]
Sent: Fri, 20 Sep 2024 13:36
To: discuss@lists.openscad.org
Cc: Ken
Subject: [OpenSCAD] Re: Face spline
Sorry Mike, same result as before.
On 2024-09-20 11:07, Caddiy via Discuss wrote:
Does this work for you?
$fn=100;
$vpr=[ 60, 0, 315 ];
$vpt=[ 0, 0, 0 ];
$vpd=80;
a=60; // Base angle
r=12; // Radius
n=16; // Number of splines
module facespline()
{
difference()
{
intersection()
{
for(i = [1 : n])
rotate(i * 360/n)
polyhedron(
points = [
[0, 0, PIr/2/ntan(a)],
[r, r*tan(360/2/n), 0],
[r, -r*tan(360/2/n), 0],
[r, 0, PIr/ntan(a)],
[0, 0, 0]
],
faces = [
[1,2,3],
[3,2,0],
[3,0,1],
[0,2,4],
[0,4,1],
[1,4,2]
]);
cylinder(r=r, h=PIr/16tan(a)+1);
}
// Hole
translate([0,0,-1])
cylinder(r=6, h=5);
}}
// Face spline coupling
{
translate([0, 0, -3])
facespline();
translate([0, 0, 3])
rotate([0, 180, 360/2/n])
facespline();
}
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
A baby can be defined as an ego with a noise at one end and a smell at the other.
Your job as parents is to teach them to control all three.
My job as a grandad is to tell you how you are doing it all wrong!
I think you guys not seeing it may have Lazy Union enable.
Problem is the intersection() of the for(), as each arm of the for() doesn't overlap, so intersection() returns empty.
With Lazy union disabled (or not in 2021.01) the for() does a union().
To fix, stick union() in front of the for().
_____
From: Ken via Discuss [mailto:discuss@lists.openscad.org]
Sent: Fri, 20 Sep 2024 13:36
To: discuss@lists.openscad.org
Cc: Ken
Subject: [OpenSCAD] Re: Face spline
Sorry Mike, same result as before.
On 2024-09-20 11:07, Caddiy via Discuss wrote:
Does this work for you?
$fn=100;
$vpr=[ 60, 0, 315 ];
$vpt=[ 0, 0, 0 ];
$vpd=80;
a=60; // Base angle
r=12; // Radius
n=16; // Number of splines
module facespline()
{
difference()
{
intersection()
{
for(i = [1 : n])
rotate(i * 360/n)
polyhedron(
points = [
[0, 0, PI*r/2/n*tan(a)],
[r, r*tan(360/2/n), 0],
[r, -r*tan(360/2/n), 0],
[r, 0, PI*r/n*tan(a)],
[0, 0, 0]
],
faces = [
[1,2,3],
[3,2,0],
[3,0,1],
[0,2,4],
[0,4,1],
[1,4,2]
]);
cylinder(r=r, h=PI*r/16*tan(a)+1);
}
// Hole
translate([0,0,-1])
cylinder(r=6, h=5);
}}
// Face spline coupling
{
translate([0, 0, -3])
facespline();
translate([0, 0, 3])
rotate([0, 180, 360/2/n])
facespline();
}
_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
--
Cheers, Ken
bats059@gmail.com
https://vk7krj.com
https://vk7krj.com/running.html
----------------------------------------
A baby can be defined as an ego with a noise at one end and a smell at the other.
Your job as parents is to teach them to control all three.
My job as a grandad is to tell you how you are doing it all wrong!
K
Ken
Fri, Sep 20, 2024 7:08 AM
Thanks Michael, that fixed it!
On 2024-09-20 16:21, Michael Marx (spintel) via Discuss wrote:
I think you guys not seeing it may have Lazy Union enable.
Problem is the intersection() of the for(), as each arm of the for() doesn't overlap, so intersection() returns empty.
With Lazy union disabled (or not in 2021.01) the for() does a union().
To fix, stick union() in front of the for().
*From:*Ken via Discuss [mailto:discuss@lists.openscad.org]
Sent: Fri, 20 Sep 2024 13:36
To: discuss@lists.openscad.org
Cc: Ken
Subject: [OpenSCAD] Re: Face spline
Sorry Mike, same result as before.
On 2024-09-20 11:07, Caddiy via Discuss wrote:
*Does this work for you?*
|*$fn=100;*|
|$vpr=[ 60, 0, 315 ];|
|$vpt=[ 0, 0, 0 ];|
|$vpd=80;|
|a=60; // Base angle|
|r=12; // Radius|
|n=16; // Number of splines|
|module facespline()|
|{|
|difference()|
|{|
|intersection()|
|{|
|for(i = [1 : n])|
|rotate(i * 360/n)|
|polyhedron(|
|points = [|
|[0, 0, PIr/2/ntan(a)],|
|[r, r*tan(360/2/n), 0],|
|[r, -r*tan(360/2/n), 0],|
|[r, 0, PIr/ntan(a)],|
|[0, 0, 0]|
|],|
|faces = [|
|[1,2,3],|
|[3,2,0],|
|[3,0,1],|
|[0,2,4], |
|[0,4,1], |
|[1,4,2] |
|]);|
|cylinder(r=r, h=PIr/16tan(a)+1);|
|}|
|// Hole|
|translate([0,0,-1])|
|cylinder(r=6, h=5);|
|}}|
|// Face spline coupling|
|{|
|translate([0, 0, -3])|
|facespline();|
|translate([0, 0, 3])|
|rotate([0, 180, 360/2/n])|
|facespline();|
|}|
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
A baby can be defined as an ego with a noise at one end and a smell at the other.
Your job as parents is to teach them to control all three.
My job as a grandad is to tell you how you are doing it all wrong!
OpenSCAD mailing list
To unsubscribe send an email todiscuss-leave@lists.openscad.org
A baby can be defined as an ego with a noise at one end and a smell at the other.
Your job as parents is to teach them to control all three.
My job as a grandad is to tell you how you are doing it all wrong!
Thanks Michael, that fixed it!
On 2024-09-20 16:21, Michael Marx (spintel) via Discuss wrote:
>
> I think you guys not seeing it may have Lazy Union enable.
>
> Problem is the intersection() of the for(), as each arm of the for() doesn't overlap, so intersection() returns empty.
>
> With Lazy union disabled (or not in 2021.01) the for() does a union().
>
> To fix, stick union() in front of the for().
>
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> *From:*Ken via Discuss [mailto:discuss@lists.openscad.org]
> *Sent:* Fri, 20 Sep 2024 13:36
> *To:* discuss@lists.openscad.org
> *Cc:* Ken
> *Subject:* [OpenSCAD] Re: Face spline
>
> Sorry Mike, same result as before.
>
> On 2024-09-20 11:07, Caddiy via Discuss wrote:
>
>>
>> *Does this work for you?*
>>
>>
>> |*$fn=100;*|
>>
>> |$vpr=[ 60, 0, 315 ];|
>>
>> |$vpt=[ 0, 0, 0 ];|
>>
>> |$vpd=80;|
>>
>> |a=60; // Base angle|
>>
>> |r=12; // Radius|
>>
>> |n=16; // Number of splines|
>>
>> |module facespline()|
>>
>> |{|
>>
>> |difference()|
>>
>> |{|
>>
>> |intersection()|
>>
>> |{|
>>
>> |for(i = [1 : n])|
>>
>> |rotate(i * 360/n)|
>>
>> |polyhedron(|
>>
>> |points = [|
>>
>> |[0, 0, PI*r/2/n*tan(a)],|
>>
>> |[r, r*tan(360/2/n), 0],|
>>
>> |[r, -r*tan(360/2/n), 0],|
>>
>> |[r, 0, PI*r/n*tan(a)],|
>>
>> |[0, 0, 0]|
>>
>> |],|
>>
>> |faces = [|
>>
>> |[1,2,3],|
>>
>> |[3,2,0],|
>>
>> |[3,0,1],|
>>
>> |[0,2,4], |
>>
>> |[0,4,1], |
>>
>> |[1,4,2] |
>>
>> |]);|
>>
>> |cylinder(r=r, h=PI*r/16*tan(a)+1);|
>>
>> |}|
>>
>> |// Hole|
>>
>> |translate([0,0,-1])|
>>
>> |cylinder(r=6, h=5);|
>>
>> |}}|
>>
>> |// Face spline coupling|
>>
>> |{|
>>
>> |translate([0, 0, -3])|
>>
>> |facespline();|
>>
>> |translate([0, 0, 3])|
>>
>> |rotate([0, 180, 360/2/n])|
>>
>> |facespline();|
>>
>> |}|
>>
>>
>>
>> _______________________________________________
>> OpenSCAD mailing list
>> To unsubscribe send an email to discuss-leave@lists.openscad.org
>
>
>
> --
> Cheers, Ken
> bats059@gmail.com
> https://vk7krj.com
> https://vk7krj.com/running.html
> ----------------------------------------
> A baby can be defined as an ego with a noise at one end and a smell at the other.
> Your job as parents is to teach them to control all three.
> My job as a grandad is to tell you how you are doing it all wrong!
>
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email todiscuss-leave@lists.openscad.org
--
Cheers, Ken
bats059@gmail.com
https://vk7krj.com
https://vk7krj.com/running.html
----------------------------------------
A baby can be defined as an ego with a noise at one end and a smell at the other.
Your job as parents is to teach them to control all three.
My job as a grandad is to tell you how you are doing it all wrong!
BC
Bob Carlson
Fri, Sep 20, 2024 4:38 PM
That worked for me too. It’s funny I had to make one of these for a project. My electric golf cart (carries my clubs, not me), has an accessories connector with one of these. Below is the part I made. It’s about 30 mm across. I had to count the blades by hand and measure everything to get it since I had no idea what kind of spline this was. I can’t post the code since I use my own library and BOSL2, but the way I constructed it was to create 1 “fanBlade” and then repeat it 60 times around a circle. Each fanBlade was made by positioning a thin inner shape and a thin out shape, then hull’ing. I’ll be taking a closer look at the posted code to compare the two methods.

On Sep 19, 2024, at 23:21, Michael Marx (spintel) via Discuss discuss@lists.openscad.org wrote:
I think you guys not seeing it may have Lazy Union enable.
Problem is the intersection() of the for(), as each arm of the for() doesn't overlap, so intersection() returns empty.
With Lazy union disabled (or not in 2021.01) the for() does a union().
To fix, stick union() in front of the for().
From: Ken via Discuss [mailto:discuss@lists.openscad.org]
Sent: Fri, 20 Sep 2024 13:36
To: discuss@lists.openscad.org
Cc: Ken
Subject: [OpenSCAD] Re: Face spline
Sorry Mike, same result as before.
On 2024-09-20 11:07, Caddiy via Discuss wrote:
Does this work for you?
$fn=100;
$vpr=[ 60, 0, 315 ];
$vpt=[ 0, 0, 0 ];
$vpd=80;
a=60; // Base angle
r=12; // Radius
n=16; // Number of splines
module facespline()
{
difference()
{
intersection()
{
for(i = [1 : n])
rotate(i * 360/n)
polyhedron(
points = [
[0, 0, PIr/2/ntan(a)],
[r, r*tan(360/2/n), 0],
[r, -r*tan(360/2/n), 0],
[r, 0, PIr/ntan(a)],
[0, 0, 0]
],
faces = [
[1,2,3],
[3,2,0],
[3,0,1],
[0,2,4],
[0,4,1],
[1,4,2]
]);
cylinder(r=r, h=PIr/16tan(a)+1);
}
// Hole
translate([0,0,-1])
cylinder(r=6, h=5);
}}
// Face spline coupling
{
translate([0, 0, -3])
facespline();
translate([0, 0, 3])
rotate([0, 180, 360/2/n])
facespline();
}
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org mailto:discuss-leave@lists.openscad.org
A baby can be defined as an ego with a noise at one end and a smell at the other.
Your job as parents is to teach them to control all three.
My job as a grandad is to tell you how you are doing it all wrong!
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
That worked for me too. It’s funny I had to make one of these for a project. My electric golf cart (carries my clubs, not me), has an accessories connector with one of these. Below is the part I made. It’s about 30 mm across. I had to count the blades by hand and measure everything to get it since I had no idea what kind of spline this was. I can’t post the code since I use my own library and BOSL2, but the way I constructed it was to create 1 “fanBlade” and then repeat it 60 times around a circle. Each fanBlade was made by positioning a thin inner shape and a thin out shape, then hull’ing. I’ll be taking a closer look at the posted code to compare the two methods.

> On Sep 19, 2024, at 23:21, Michael Marx (spintel) via Discuss <discuss@lists.openscad.org> wrote:
>
> I think you guys not seeing it may have Lazy Union enable.
> Problem is the intersection() of the for(), as each arm of the for() doesn't overlap, so intersection() returns empty.
> With Lazy union disabled (or not in 2021.01) the for() does a union().
>
> To fix, stick union() in front of the for().
>
>
> From: Ken via Discuss [mailto:discuss@lists.openscad.org]
> Sent: Fri, 20 Sep 2024 13:36
> To: discuss@lists.openscad.org
> Cc: Ken
> Subject: [OpenSCAD] Re: Face spline
>
> Sorry Mike, same result as before.
>
>
> On 2024-09-20 11:07, Caddiy via Discuss wrote:
>> Does this work for you?
>>
>> $fn=100;
>>
>> $vpr=[ 60, 0, 315 ];
>>
>> $vpt=[ 0, 0, 0 ];
>>
>> $vpd=80;
>>
>> a=60; // Base angle
>>
>> r=12; // Radius
>>
>> n=16; // Number of splines
>>
>> module facespline()
>>
>> {
>>
>> difference()
>>
>> {
>>
>> intersection()
>>
>> {
>>
>> for(i = [1 : n])
>>
>> rotate(i * 360/n)
>>
>> polyhedron(
>>
>> points = [
>>
>> [0, 0, PI*r/2/n*tan(a)],
>>
>> [r, r*tan(360/2/n), 0],
>>
>> [r, -r*tan(360/2/n), 0],
>>
>> [r, 0, PI*r/n*tan(a)],
>>
>> [0, 0, 0]
>>
>> ],
>>
>> faces = [
>>
>> [1,2,3],
>>
>> [3,2,0],
>>
>> [3,0,1],
>>
>> [0,2,4],
>>
>> [0,4,1],
>>
>> [1,4,2]
>>
>> ]);
>>
>> cylinder(r=r, h=PI*r/16*tan(a)+1);
>>
>> }
>>
>> // Hole
>>
>> translate([0,0,-1])
>>
>> cylinder(r=6, h=5);
>>
>> }}
>>
>> // Face spline coupling
>>
>> {
>>
>> translate([0, 0, -3])
>>
>> facespline();
>>
>> translate([0, 0, 3])
>>
>> rotate([0, 180, 360/2/n])
>>
>> facespline();
>>
>> }
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> OpenSCAD mailing list
>> To unsubscribe send an email to discuss-leave@lists.openscad.org <mailto:discuss-leave@lists.openscad.org>
>
> --
> Cheers, Ken
> bats059@gmail.com <mailto:bats059@gmail.com>
> https://vk7krj.com <https://vk7krj.com/>
> https://vk7krj.com/running.html
> ----------------------------------------
> A baby can be defined as an ego with a noise at one end and a smell at the other.
> Your job as parents is to teach them to control all three.
> My job as a grandad is to tell you how you are doing it all wrong!
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
M
mikeonenine@web.de
Sat, Sep 21, 2024 1:48 AM
Bob Carlson
Fri, Sep 20, 2024 12:38 PM
That worked for me too. It’s funny I had to make one of these for a project. My electric golf cart (carries my clubs, not me), has an accessories connector with one of these. Below is the part I made. It’s about 30 mm across. I had to count the blades by hand and measure everything to get it since I had no idea what kind of spline this was. I can’t post the code since I use my own library and BOSL2, but the way I constructed it was to create 1 “fanBlade” and then repeat it 60 times around a circle. Each fanBlade was made by positioning a thin inner shape and a thin out shape, then hull’ing. I’ll be taking a closer look at the posted code to compare the two methods.

On Sep 19, 2024, at 23:21, Michael Marx (spintel) via Discuss discuss@lists.openscad.org wrote:
I think you guys not seeing it may have Lazy Union enable.
Linear extrude works well too. The peaks and valleys can be rounded, which doesn’t seem to be possible with polyhedrons. The flat side isn’t, and needs to be filled in with a cone to make it flat.
> Bob Carlson
>
> Fri, Sep 20, 2024 12:38 PM
>
> That worked for me too. It’s funny I had to make one of these for a project. My electric golf cart (carries my clubs, not me), has an accessories connector with one of these. Below is the part I made. It’s about 30 mm across. I had to count the blades by hand and measure everything to get it since I had no idea what kind of spline this was. I can’t post the code since I use my own library and BOSL2, but the way I constructed it was to create 1 “fanBlade” and then repeat it 60 times around a circle. Each fanBlade was made by positioning a thin inner shape and a thin out shape, then hull’ing. I’ll be taking a closer look at the posted code to compare the two methods.
>
> 
>
> On Sep 19, 2024, at 23:21, Michael Marx (spintel) via Discuss [discuss@lists.openscad.org](mailto:discuss@lists.openscad.org) wrote:
>
> > I think you guys not seeing it may have Lazy Union enable.
Linear extrude works well too. The peaks and valleys can be rounded, which doesn’t seem to be possible with polyhedrons. The flat side isn’t, and needs to be filled in with a cone to make it flat.
BC
Bob Carlson
Wed, Sep 25, 2024 1:08 AM
I got interested in the Hirth joint problem since I now know the name and understand what’s going on. Also, the part I needed to make had a conical Hirth joint. I was curious how that could be parameterized. It turned out to be fairly simple. Here is the current state of my test program. It uses BOSL2, but not my own library. It’s set up with the customizer so it’s easy to play around with. I’m running it on OpenSCAD.24.09.20 and BOSL2 from maybe a couple of months ago. It’s not entirely debugged, but works. Using hull and cheating a little, the math is minimal. It’s all in calculating toothBaseWidth and toothHeight. The “cheat” is that I hull the tooth profile with a tiny cube at the origin. For a conical joint, the origin just moves up. Most of the code is actually there to provide the base above or below the teeth. That’s where I think bugs still lurk.
include <BOSL2/std.scad>
showTooth = false;
showLower = false;
showUpper = false;
showFit = false;
showProfile = false;
// Number of Teeth
N = 36; // Number Of Teeth
// Inner Radius
innerR = 30;
// Outer Radius
outerR = 50;
// Is the coupling conical?
conical = 10;
// Tooth Profile Angle
profileAngle = 60; // [60, 90]
// Must be >= 0, Default used when left at 0
chamfer = 0; // .1
// Explosion distance in mm
ex = 0;
module Customizer_Limit () {} // This actually works
$fn = 180;
tiny = 1 / 1024;
assembly();
module assembly() {
if (showTooth) {
tooth(conical);
}
if (showLower) {
teeth();
}
if (showUpper) {
up(ex == 0 ? .1 : ex)
upperTeeth();
}
if (showFit) {
teeth();
up(ex == 0 ? .1 : ex)
upperTeeth();
}
if (showProfile) {
toothProfile();
}
}
a0 = assert(conical >= 0, "Conical must be >= 0");
outerR0 = outerR + 0;
rotationAngle = 360/N;
toothBaseWidth = 2 * (sin(rotationAngle/2) * outerR0);
toothHeight = (toothBaseWidth/2) / tan(profileAngle/2) ;
toothChamfer = chamfer == 0.0 ? min(3, toothHeight * .1) : chamfer;
e0 = echo(str("Tooth Width ", toothBaseWidth));
e1 = echo(str("Tooth Height ", toothHeight));
e2 = echo(str("Tooth Chamfer ", toothChamfer));
e3 = echo(str("Tooth Profile ", profileAngle));
module upperTeeth() {
zrot(rotationAngle/2)
xrot(180)
intersection() {
difference() {
union() {
teeth0(-conical);
down(toothHeight/2 - toothChamfer/2) {
if (conical > 0) {
difference() {
zcyl(l = conical - toothHeight/2, r = outerR, anchor = TOP);
zcyl(l = conical - toothHeight/2, r2 = outerR, r1 = 0, anchor = TOP);
}
} else {
zcyl(l = toothHeight/2 + conical, r1 = outerR, r2 = 0, anchor = BOTTOM)
attach(BOTTOM, TOP)
zcyl(l = 1, r = outerR);
}
//attach(BOTTOM, TOP)
//zcyl(l = 1, r = outerR);
}
}
zcyl(h = 20, r = innerR, anchor = CENTER);
}
zcyl(h = 20, r = outerR, anchor = CENTER, $fn = 180);
}
}
module teeth() {
intersection() {
difference() {
union() {
teeth0(conical);
down(toothHeight/2 - toothChamfer/2) {
zcyl(l = toothHeight/2 + conical, r1 = outerR, r2 = 0, anchor = BOTTOM)
attach(BOTTOM, TOP)
zcyl(l = 1, r = outerR);
}
}
zcyl(h = 20, r = innerR, anchor = CENTER);
}
zcyl(h = 20, r = outerR, anchor = CENTER, $fn = 180);
}
}
module teeth0(h) {
for (i = [0 : 360/N : 359]) {
zrot(i)
tooth(h);
}
}
module tooth(h) {
hull() {
up(h)
cube(tiny, anchor = CENTER);
right(outerR0)
toothProfile();
}
}
module toothProfile() {
path = [[0, 0],
[0, toothBaseWidth],
[toothHeight, toothBaseWidth/2]];
//e0 = echo(path);
difference() {
yrot(-90)
left(toothHeight/2)
fwd(toothBaseWidth/2)
linear_extrude(tiny)
polygon(path);
up(toothHeight/2 - toothChamfer)
cube(toothChamfer*2, anchor = BOTTOM);
}
}
I got interested in the Hirth joint problem since I now know the name and understand what’s going on. Also, the part I needed to make had a conical Hirth joint. I was curious how that could be parameterized. It turned out to be fairly simple. Here is the current state of my test program. It uses BOSL2, but not my own library. It’s set up with the customizer so it’s easy to play around with. I’m running it on OpenSCAD.24.09.20 and BOSL2 from maybe a couple of months ago. It’s not entirely debugged, but works. Using hull and cheating a little, the math is minimal. It’s all in calculating toothBaseWidth and toothHeight. The “cheat” is that I hull the tooth profile with a tiny cube at the origin. For a conical joint, the origin just moves up. Most of the code is actually there to provide the base above or below the teeth. That’s where I think bugs still lurk.
include <BOSL2/std.scad>
showTooth = false;
showLower = false;
showUpper = false;
showFit = false;
showProfile = false;
// Number of Teeth
N = 36; // Number Of Teeth
// Inner Radius
innerR = 30;
// Outer Radius
outerR = 50;
// Is the coupling conical?
conical = 10;
// Tooth Profile Angle
profileAngle = 60; // [60, 90]
// Must be >= 0, Default used when left at 0
chamfer = 0; // .1
// Explosion distance in mm
ex = 0;
module __Customizer_Limit__ () {} // This actually works
$fn = 180;
tiny = 1 / 1024;
assembly();
module assembly() {
if (showTooth) {
tooth(conical);
}
if (showLower) {
teeth();
}
if (showUpper) {
up(ex == 0 ? .1 : ex)
upperTeeth();
}
if (showFit) {
teeth();
up(ex == 0 ? .1 : ex)
upperTeeth();
}
if (showProfile) {
toothProfile();
}
}
a0 = assert(conical >= 0, "Conical must be >= 0");
outerR0 = outerR + 0;
rotationAngle = 360/N;
toothBaseWidth = 2 * (sin(rotationAngle/2) * outerR0);
toothHeight = (toothBaseWidth/2) / tan(profileAngle/2) ;
toothChamfer = chamfer == 0.0 ? min(3, toothHeight * .1) : chamfer;
e0 = echo(str("Tooth Width ", toothBaseWidth));
e1 = echo(str("Tooth Height ", toothHeight));
e2 = echo(str("Tooth Chamfer ", toothChamfer));
e3 = echo(str("Tooth Profile ", profileAngle));
module upperTeeth() {
zrot(rotationAngle/2)
xrot(180)
intersection() {
difference() {
union() {
teeth0(-conical);
down(toothHeight/2 - toothChamfer/2) {
if (conical > 0) {
difference() {
zcyl(l = conical - toothHeight/2, r = outerR, anchor = TOP);
zcyl(l = conical - toothHeight/2, r2 = outerR, r1 = 0, anchor = TOP);
}
} else {
zcyl(l = toothHeight/2 + conical, r1 = outerR, r2 = 0, anchor = BOTTOM)
attach(BOTTOM, TOP)
zcyl(l = 1, r = outerR);
}
//attach(BOTTOM, TOP)
//zcyl(l = 1, r = outerR);
}
}
zcyl(h = 20, r = innerR, anchor = CENTER);
}
zcyl(h = 20, r = outerR, anchor = CENTER, $fn = 180);
}
}
module teeth() {
intersection() {
difference() {
union() {
teeth0(conical);
down(toothHeight/2 - toothChamfer/2) {
zcyl(l = toothHeight/2 + conical, r1 = outerR, r2 = 0, anchor = BOTTOM)
attach(BOTTOM, TOP)
zcyl(l = 1, r = outerR);
}
}
zcyl(h = 20, r = innerR, anchor = CENTER);
}
zcyl(h = 20, r = outerR, anchor = CENTER, $fn = 180);
}
}
module teeth0(h) {
for (i = [0 : 360/N : 359]) {
zrot(i)
tooth(h);
}
}
module tooth(h) {
hull() {
up(h)
cube(tiny, anchor = CENTER);
right(outerR0)
toothProfile();
}
}
module toothProfile() {
path = [[0, 0],
[0, toothBaseWidth],
[toothHeight, toothBaseWidth/2]];
//e0 = echo(path);
difference() {
yrot(-90)
left(toothHeight/2)
fwd(toothBaseWidth/2)
linear_extrude(tiny)
polygon(path);
up(toothHeight/2 - toothChamfer)
cube(toothChamfer*2, anchor = BOTTOM);
}
}