Welcome! Log In Create A New Profile

Advanced

Why are equilateral triangles so difficult?

Posted by o_lampe 
Why are equilateral triangles so difficult?
June 11, 2015 04:09AM
I have tested the triangle libraries comming with OpenSCAD and found it terribly difficult to build a equilateral triangle with the center = true.

From what I know, a triangle is THE basic structure in 3D-CAD, but openSCAD doesn´t even have a function for it?!

I can use $fn=3 and circle/cylinder function, but sometimes that doesn´t work for me.
Same is polygon/polyhedron function. Way to complicate to calculate everything beforehand.

Hey, it is 30 years ago, when I had trigonometry in school ! winking smiley
-Olaf

Edited 1 time(s). Last edit at 06/11/2015 04:11AM by o_lampe.
Re: Why are equilateral triangles so difficult?
June 11, 2015 04:17AM
What do you need to do with an equilateral triangle that can NOT be accomplished by using $fn=3 and circle/cylinder function?
What are you trying to do?


Bob Morrison
Wörth am Rhein, Germany
"Luke, use the source!"
BLOG - PHOTOS - Thingiverse
Re: Why are equilateral triangles so difficult?
June 11, 2015 04:30AM
I want to build a triangle part with a center cylindric hole in it. The min. wall thickness and the hole diameter are the only parameters I have as starting point.
-Olaf
Attachments:
open | download - triangle.JPG (59.1 KB)
Re: Why are equilateral triangles so difficult?
June 11, 2015 05:51AM
If you take a look at the following pages:

Solver Calculate side length of equilateral triangle inscribed in the circle
SOLUTION: If a circle is inscribed in an equilateral triangle of side 2v3 units, then radius of the circle is
Inscribed kissing circles in an equilateral triangle

If you work out the math for your special case it turns out that







the radius of a circle r that touches the walls of a triangle
inscribed in a circle with a radius of R is simply

    r = R/2

where;

    r = the radius of the hole
    R = the radius of the circle that contains the points of the triangle
d = 20;     //Diameter of circle in which Triangle is inscribed
tH = 20;    //Height of the Triangle
wT = 2;     //Wall Thickness

difference()
{
	cylinder(r=d/2, h=tH, center=true, $fn=3);
	cylinder(r=d/4-wT, h=tH+1, center=true, $fn=100);
}



Q.E.D.

Edited 8 time(s). Last edit at 06/11/2015 11:38AM by rhmorrison.


Bob Morrison
Wörth am Rhein, Germany
"Luke, use the source!"
BLOG - PHOTOS - Thingiverse
Re: Why are equilateral triangles so difficult?
June 11, 2015 06:02AM
Oops... You did write that all you had was the HOLE DIAMETER and the WALL THICKNESS so:

hD = 10; // Diameter of Hole
tH = 20; // Height of the Triangle
wT = 2;  // Wall Thickness

difference()
{
	cylinder(r=hD+2*wT, h=tH, center=true, $fn=3);
	cylinder(r=hD/2, h=tH+1, center=true, $fn=100);
}



Now - Q.E.D.!


Bob Morrison
Wörth am Rhein, Germany
"Luke, use the source!"
BLOG - PHOTOS - Thingiverse
Re: Why are equilateral triangles so difficult?
June 11, 2015 11:21AM
WOW awesome,
I owe you a beer at least. smileys with beer
So much investigation and (re)writing for such a simple shape.
I hope, I don´t stumble across more serious things....

Danke
-Olaf
Re: Why are equilateral triangles so difficult?
June 11, 2015 11:31AM
Two at least - one per post! smileys with beer


Bob Morrison
Wörth am Rhein, Germany
"Luke, use the source!"
BLOG - PHOTOS - Thingiverse
Re: Why are equilateral triangles so difficult?
June 11, 2015 11:57AM
The beauty with OpenScad is that you can write modules to perform any function you want. For that reason OpenScad does not need to have all that many native shapes in the way that other CAD applications often have. You can find lots of libraries on the web containing modules that do all sorts of clever things, meaning that you do not have to spend hours working out all the formulae yourself.

Dave
Re: Why are equilateral triangles so difficult?
June 11, 2015 01:35PM
I wish, there would be a global openSCAD repository and a sticky-post in this subforum with the link.

Two beer granted, when you are near Kassel next time grinning smiley
-Olaf
Re: Why are equilateral triangles so difficult?
June 12, 2015 09:58AM
Quote
o_lampe
I wish, there would be a global openSCAD repository and a sticky-post in this subforum with the link.

Two beer granted, when you are near Kassel next time grinning smiley
-Olaf

Careful, I might take you up on that offer!

A central documented repository would be great, but meanwhile you usually get good results by Googling "Openscad" followed by the type of function you are looking for. e.g. google "openscad triangle" brings up several links to several libraries that implement all sorts of triangle functions.

Dave
Re: Why are equilateral triangles so difficult?
June 12, 2015 07:52PM
Quote
o_lampe
I hope, I don´t stumble across more serious things....

Danke
-Olaf

Hee hee - you should take a look at my "trig challenge" post further down this forum if you want a triangles-based head scratcher! grinning smiley
Re: Why are equilateral triangles so difficult?
June 15, 2015 05:47AM
That´s what happens, when I get the right tips from the right People winking smiley

A parametric freewheel assembly that needs only 4 parameters to render.
1. shaft diameter
2. wall thickness
3. height
4. number of notches in the outer rim

It´s not finally tweaked. Some values cause nonfunctional results, but I´m working on it.

Thanks again
-Olaf

Edited 1 time(s). Last edit at 06/15/2015 05:50AM by o_lampe.
Attachments:
open | download - freewheel_real.jpg (292 KB)
Re: Why are equilateral triangles so difficult?
June 15, 2015 10:31AM
Quote
o_lampe
That´s what happens, when I get the right tips from the right People winking smiley

A parametric freewheel assembly that needs only 4 parameters to render.
1. shaft diameter
2. wall thickness
3. height
4. number of notches in the outer rim

It´s not finally tweaked. Some values cause nonfunctional results, but I´m working on it.

Thanks again
-Olaf

Have you considered designing a sprag clutch to fulfil the function you need? [www.renold.com]

It's quieter and has less wear than a ratchet design. It's what is used on helicopters so that the motor can drive the rotor, but the rotor can freewheel in the event of an engine failure (won't try to drive the motor)

Dave
Re: Why are equilateral triangles so difficult?
June 15, 2015 12:23PM
For me, the freewheel is just a stepstone in a much greater project.
Ofcourse, I could buy a freewheel. But for demonstration only, I think, I can use a selfmade ratchet. ( The noise even helps people understand what´s going on in my project)
-Olaf
Re: Why are equilateral triangles so difficult?
June 16, 2015 07:47AM
Quote
o_lampe
For me, the freewheel is just a stepstone in a much greater project.
Ofcourse, I could buy a freewheel. But for demonstration only, I think, I can use a selfmade ratchet. ( The noise even helps people understand what´s going on in my project)
-Olaf

I was not thinking of buying a freewheel, but in designing and printing a sprag clutch instead of a ratchet clutch. Sprags in PLA or ABS may work OK, or print them in NinjaFlex.

Dave
Re: Why are equilateral triangles so difficult?
June 16, 2015 11:58AM
To use an empty lm8uu housing and an 8mm shaft, the sprags would be ~3mm high. A real challenge to print.
They shouldn´t be compressible, so PLA would be the best choice.
I wonder, how a cage for the sprags could be made?
-Olaf
Re: Why are equilateral triangles so difficult?
August 21, 2015 09:40PM
Nice work Olaf.
Re: Why are equilateral triangles so difficult?
August 24, 2015 05:54AM
Hi,

I made simple polygon generator that has equal sides. Equilateral triangle is a isogonal whose number of sides is three. I have been using it often.


/*
isogonal.scad

        +
       /|\
      /o| \
   r /  |y \
    /   |   \
   +----+----+
   |  x      |
   |<-- l -->|
*/

module isogonal(length, number)
{
    angle = 360 / number;
    theta = angle / 2;
    x = length / 2;
    r = x / sin(theta);
    y = r * cos(theta);

    // hull() is better than for() and scale() method.
    hull()
    {
        for (i = [0 : number-1])
        {
                rotate([0, 0, angle*i]) translate([0, -y, 0])
                square([length, 1], center=true);
        }
    }
}

module demo()
{
    linear_extrude(height = 40, twist = -180, scale = 1/2, center = true, slices = 200)
            isogonal(20, 3);

    translate([0, 30, 0])
    linear_extrude(height = 40, twist = -180, scale = 2/3, center = true, slices = 200)
                isogonal(20, 4);

    translate([30, 30, 0])
    linear_extrude(height = 40, twist = 270, scale = 1/2, center = true, slices = 200)
                hollow_hexagon();
}

module hollow_hexagon()
{
    difference()
    {
        isogonal(20, 3);
        isogonal(17, 3);
    }
}
Sorry, only registered users may post in this forum.

Click here to login