Living Hinges

classic Classic list List threaded Threaded
20 messages Options
Reply | Threaded
Open this post in threaded view
|

Living Hinges

drxenocide
These are living hinges:

http://www.deferredprocrastination.co.uk/blog/2011/laser-cut-lattice-living-hinges/

Is there an openscad library of these things? Anyone work with them before?

I'm thinking of some kind of module where you enter the width and height of the pattern you want, and the thickness of the material, and poof, it outputs a pattern of a living hinge.

Just trying to not reinvent the wheel.

Thanks,
Ari M Diacou

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Living Hinges

Michele
On 08-23-2016 2:17 PM, Ari Diacou wrote:
These are living hinges:

http://www.deferredprocrastination.co.uk/blog/2011/laser-cut-lattice-living-hinges/

Is there an openscad library of these things? Anyone work with them before?

I'm thinking of some kind of module where you enter the width and height of the pattern you want, and the thickness of the material, and poof, it outputs a pattern of a living hinge.

Just trying to not reinvent the wheel.
Living hinges are pretty cool and very easy to make.  I just difference a cube on edge to chisel into into a flat sheet and they come out very nice.  Eg.:

w = 38 ;
d = 26 ;
h = 2 ;
cut = 1 ;

difference ()
  {
   cube ([w, d, h]) ;

   translate ([-1, d / 2, cut])
   rotate ([45, 0, 0])
      cube ([w + 2, 2, h]) ;
  }



Polypropylene works very well for living hinges and is easy to work with.  I generally go for a 1 mm. hinge thickness.  Smaller will give you more flexible hinges, thicker makes them stronger but they still work.

            - Michele


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Living Hinges

Neon22
In reply to this post by drxenocide

great links to the maths for torsional and spring calculations. Sounds like a great idea to work on for openSCAD


On 8/24/2016 6:17 AM, Ari Diacou wrote:
These are living hinges:

http://www.deferredprocrastination.co.uk/blog/2011/laser-cut-lattice-living-hinges/

Is there an openscad library of these things? Anyone work with them before?

I'm thinking of some kind of module where you enter the width and height of the pattern you want, and the thickness of the material, and poof, it outputs a pattern of a living hinge.

Just trying to not reinvent the wheel.

Thanks,
Ari M Diacou


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


No virus found in this message.
Checked by AVG - www.avg.com
Version: 2016.0.7752 / Virus Database: 4647/12863 - Release Date: 08/23/16



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Living Hinges

drxenocide
So I created it. Could you nerds give me any feedback? Any features you'd want? Any settings that totally mess it up? I'll put it up on Thingiverse, I think under a GNU license, once you give it a quick vetting.

Thanks,
--Ari M Diacou
Metis Industries

//Living Hinge
//Ari M Diacou
//Metis Industries
//August 2016

///////////////////////////////// Main() //////////////////////////////////////
//Uncomment lines to see samples
hinge7();
//hinge7(d=6);
//hinge7(length=20, width=40,d=6,hinge_length=2.5,hinges_across_length=2,minimum_thinness=3);
//hinge7(length=30, width=20,d=2,hinge_length=2.5,hinges_across_length=2,minimum_thinness=3,center=true);
//hinge7(length=20, width=40,d=3,hinge_length=4,hinges_across_length=0,minimum_thinness=1);

/////////////////////////////// Functions /////////////////////////////////////
module hinge7(length=30,width=20,d=3,minimum_thinness=3,hinge_length=3,hinges_across_length=2,center=false){
    //moves difference(){ square(...) outside of if(m=0) statement, compared to hinge6()
    //length = the y dimension of the hinge, parallel to the laser cuts
    //width = the x dimension of the hinge, transverse to laser cuts
    //d=the distance between parallel laser cuts
    //What is the minimum distance that two parallel lines can be apart before the laser does something catastrophic? E.g. setting uncontrollable fire to the work piece. This is "minimum_thinness"
    //hinge_length=the distance between 2 colinear laser cuts
    //hinges_across_length=the number of hinges across the length of the hinge
    //center is a boolean value, if true, place the center of the rectangle at the origin, if false, put the bottom left corner at the origin (just like square() and cube())
    ep=.00101;//epsilon, a small number,=1.01 micron, a hack (for OpenSCAD 2015.03) used to make square()'s which look like lines (which OpenSCAD doesn't support). Hopefully, your laser has a function which says something like "ignore cuts less than THRESHOLD apart", set that to anything greater than ep.
    adjust=center?-[width,length]/2:[0,0];//a vector for adjusting the center position
    th=d/2<minimum_thinness?ep:d/2;//If the distance between lines is less than the minimum thickness, just make linear cuts, specifically, set the width=th=thickness of the squares to ep, which is just above 1 micron (for 1=1mm slicers)
    n=floor(width/d);
    m=floor(abs(hinges_across_length)); echo(str("Number of hinges (m)=",m)); //input cleaning, ensures m ϵ {non-negative integers}
    echo(str("The distance between parallel laser cuts (d) is: ",d," mm."));
    //the length of the short lines
    short=(length-m*hinge_length)/(m+1);
    //the length of the long lines
    long=(length-(m+1)*hinge_length)/(m);
    echo(str("There should be n=",n," links in the hinge."));
    translate(adjust) difference(){ 
        square([width,length],center=false);
        if(m==0) 
            //In the special case where |hinges_across_length|<1, the hinge should look like:
            // |  --------------------------------------|
            // |--------------------------------------  |
            // |  --------------------------------------|
            // |--------------------------------------  |
                for(i=[0:n])
                    translate([i*d,(pow(-1,i))*hinge_length]) // (-1)^i,{iϵZ} = {-1,+1,-1,+1,...}
                        square([th,length]);                
        else
            //A hinge with hinges_across_length=2 should look like:
            // |------------  ------------  ------------|
            // |  -----------------  -----------------  |
            // |------------  ------------  ------------|
            // |  -----------------  -----------------  |
            for(i=[0:n]){ //Iterating across x
                translate([i*d*1,0]){ //Do the x translation seperate from the y translations
                    if(i%2==1) //For odd columns
                        for(j=[0:m-1]){
                            translate([0,hinge_length+j*(long+hinge_length)]) 
                                square([th,long]);
                            }
                    if(i%2==0) //For even columns
                        for(j=[0:m]){
                            translate([0,j*(short+hinge_length)]) 
                                square([th,short]);
                        }
                    }
                }
            }
    }

On Tue, Aug 23, 2016 at 6:26 PM, Mark Schafer <[hidden email]> wrote:

great links to the maths for torsional and spring calculations. Sounds like a great idea to work on for openSCAD


On 8/24/2016 6:17 AM, Ari Diacou wrote:
These are living hinges:

http://www.deferredprocrastination.co.uk/blog/2011/laser-cut-lattice-living-hinges/

Is there an openscad library of these things? Anyone work with them before?

I'm thinking of some kind of module where you enter the width and height of the pattern you want, and the thickness of the material, and poof, it outputs a pattern of a living hinge.

Just trying to not reinvent the wheel.

Thanks,
Ari M Diacou


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


No virus found in this message.
Checked by AVG - www.avg.com
Version: 2016.0.7752 / Virus Database: 4647/12863 - Release Date: 08/23/16



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Living Hinges

Ronaldo
Nice work, Ari. I did not dig your code enough but I think could be beneficial to have a more general module that, instead of working with a fixed rectangular cutting shape, operates over user defined shapes. Something like:
     hinge7(params...) my_losangle();
     hinge7(params...) rounded_square();
I have no idea how you would control the minimum_thinness though.

2016-08-25 17:18 GMT-03:00 Ari Diacou <[hidden email]>:
So I created it. Could you nerds give me any feedback? Any features you'd want? Any settings that totally mess it up? I'll put it up on Thingiverse, I think under a GNU license, once you give it a quick vetting.

Thanks,
--Ari M Diacou
Metis Industries

//Living Hinge
//Ari M Diacou
//Metis Industries
//August 2016

///////////////////////////////// Main() //////////////////////////////////////
//Uncomment lines to see samples
hinge7();
//hinge7(d=6);
//hinge7(length=20, width=40,d=6,hinge_length=2.5,hinges_across_length=2,minimum_thinness=3);
//hinge7(length=30, width=20,d=2,hinge_length=2.5,hinges_across_length=2,minimum_thinness=3,center=true);
//hinge7(length=20, width=40,d=3,hinge_length=4,hinges_across_length=0,minimum_thinness=1);

/////////////////////////////// Functions /////////////////////////////////////
module hinge7(length=30,width=20,d=3,minimum_thinness=3,hinge_length=3,hinges_across_length=2,center=false){
    //moves difference(){ square(...) outside of if(m=0) statement, compared to hinge6()
    //length = the y dimension of the hinge, parallel to the laser cuts
    //width = the x dimension of the hinge, transverse to laser cuts
    //d=the distance between parallel laser cuts
    //What is the minimum distance that two parallel lines can be apart before the laser does something catastrophic? E.g. setting uncontrollable fire to the work piece. This is "minimum_thinness"
    //hinge_length=the distance between 2 colinear laser cuts
    //hinges_across_length=the number of hinges across the length of the hinge
    //center is a boolean value, if true, place the center of the rectangle at the origin, if false, put the bottom left corner at the origin (just like square() and cube())
    ep=.00101;//epsilon, a small number,=1.01 micron, a hack (for OpenSCAD 2015.03) used to make square()'s which look like lines (which OpenSCAD doesn't support). Hopefully, your laser has a function which says something like "ignore cuts less than THRESHOLD apart", set that to anything greater than ep.
    adjust=center?-[width,length]/2:[0,0];//a vector for adjusting the center position
    th=d/2<minimum_thinness?ep:d/2;//If the distance between lines is less than the minimum thickness, just make linear cuts, specifically, set the width=th=thickness of the squares to ep, which is just above 1 micron (for 1=1mm slicers)
    n=floor(width/d);
    m=floor(abs(hinges_across_length)); echo(str("Number of hinges (m)=",m)); //input cleaning, ensures m ϵ {non-negative integers}
    echo(str("The distance between parallel laser cuts (d) is: ",d," mm."));
    //the length of the short lines
    short=(length-m*hinge_length)/(m+1);
    //the length of the long lines
    long=(length-(m+1)*hinge_length)/(m);
    echo(str("There should be n=",n," links in the hinge."));
    translate(adjust) difference(){ 
        square([width,length],center=false);
        if(m==0) 
            //In the special case where |hinges_across_length|<1, the hinge should look like:
            // |  --------------------------------------|
            // |--------------------------------------  |
            // |  --------------------------------------|
            // |--------------------------------------  |
                for(i=[0:n])
                    translate([i*d,(pow(-1,i))*hinge_length]) // (-1)^i,{iϵZ} = {-1,+1,-1,+1,...}
                        square([th,length]);                
        else
            //A hinge with hinges_across_length=2 should look like:
            // |------------  ------------  ------------|
            // |  -----------------  -----------------  |
            // |------------  ------------  ------------|
            // |  -----------------  -----------------  |
            for(i=[0:n]){ //Iterating across x
                translate([i*d*1,0]){ //Do the x translation seperate from the y translations
                    if(i%2==1) //For odd columns
                        for(j=[0:m-1]){
                            translate([0,hinge_length+j*(long+hinge_length)]) 
                                square([th,long]);
                            }
                    if(i%2==0) //For even columns
                        for(j=[0:m]){
                            translate([0,j*(short+hinge_length)]) 
                                square([th,short]);
                        }
                    }
                }
            }
    }

On Tue, Aug 23, 2016 at 6:26 PM, Mark Schafer <[hidden email]> wrote:

great links to the maths for torsional and spring calculations. Sounds like a great idea to work on for openSCAD


On 8/24/2016 6:17 AM, Ari Diacou wrote:
These are living hinges:

http://www.deferredprocrastination.co.uk/blog/2011/laser-cut-lattice-living-hinges/

Is there an openscad library of these things? Anyone work with them before?

I'm thinking of some kind of module where you enter the width and height of the pattern you want, and the thickness of the material, and poof, it outputs a pattern of a living hinge.

Just trying to not reinvent the wheel.

Thanks,
Ari M Diacou


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


No virus found in this message.
Checked by AVG - www.avg.com
Version: 2016.0.7752 / Virus Database: 4647/12863 - Release Date: 08/23/16



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Living Hinges

drxenocide
Thanks Ronaldo for the feedback. I can give that a think...

I see 2 problems:
1) If I am calling children to make my module modify another module, I dont (think I) have a way to get the dimensional information of the child module, so hinge8() would not know what to set "length" and "width" to use, which are called extensively in the code.

2) When you want a hinge, dont you almost always want it to be rectangular in profile? Under what conditions would you NOT want the profile of the hinge to be rectangular?

Are you thinking something like: ?

module add_hinge(length,width,...){
    union(){
        hinge7(length,width,center=true,...);
        difference(){
            children();
            square([length,width]);
            }
        }
    }


On Thu, Aug 25, 2016 at 5:11 PM, Ronaldo Persiano <[hidden email]> wrote:
Nice work, Ari. I did not dig your code enough but I think could be beneficial to have a more general module that, instead of working with a fixed rectangular cutting shape, operates over user defined shapes. Something like:
     hinge7(params...) my_losangle();
     hinge7(params...) rounded_square();
I have no idea how you would control the minimum_thinness though.

2016-08-25 17:18 GMT-03:00 Ari Diacou <[hidden email]>:
So I created it. Could you nerds give me any feedback? Any features you'd want? Any settings that totally mess it up? I'll put it up on Thingiverse, I think under a GNU license, once you give it a quick vetting.

Thanks,
--Ari M Diacou
Metis Industries

//Living Hinge
//Ari M Diacou
//Metis Industries
//August 2016

///////////////////////////////// Main() //////////////////////////////////////
//Uncomment lines to see samples
hinge7();
//hinge7(d=6);
//hinge7(length=20, width=40,d=6,hinge_length=2.5,hinges_across_length=2,minimum_thinness=3);
//hinge7(length=30, width=20,d=2,hinge_length=2.5,hinges_across_length=2,minimum_thinness=3,center=true);
//hinge7(length=20, width=40,d=3,hinge_length=4,hinges_across_length=0,minimum_thinness=1);

/////////////////////////////// Functions /////////////////////////////////////
module hinge7(length=30,width=20,d=3,minimum_thinness=3,hinge_length=3,hinges_across_length=2,center=false){
    //moves difference(){ square(...) outside of if(m=0) statement, compared to hinge6()
    //length = the y dimension of the hinge, parallel to the laser cuts
    //width = the x dimension of the hinge, transverse to laser cuts
    //d=the distance between parallel laser cuts
    //What is the minimum distance that two parallel lines can be apart before the laser does something catastrophic? E.g. setting uncontrollable fire to the work piece. This is "minimum_thinness"
    //hinge_length=the distance between 2 colinear laser cuts
    //hinges_across_length=the number of hinges across the length of the hinge
    //center is a boolean value, if true, place the center of the rectangle at the origin, if false, put the bottom left corner at the origin (just like square() and cube())
    ep=.00101;//epsilon, a small number,=1.01 micron, a hack (for OpenSCAD 2015.03) used to make square()'s which look like lines (which OpenSCAD doesn't support). Hopefully, your laser has a function which says something like "ignore cuts less than THRESHOLD apart", set that to anything greater than ep.
    adjust=center?-[width,length]/2:[0,0];//a vector for adjusting the center position
    th=d/2<minimum_thinness?ep:d/2;//If the distance between lines is less than the minimum thickness, just make linear cuts, specifically, set the width=th=thickness of the squares to ep, which is just above 1 micron (for 1=1mm slicers)
    n=floor(width/d);
    m=floor(abs(hinges_across_length)); echo(str("Number of hinges (m)=",m)); //input cleaning, ensures m ϵ {non-negative integers}
    echo(str("The distance between parallel laser cuts (d) is: ",d," mm."));
    //the length of the short lines
    short=(length-m*hinge_length)/(m+1);
    //the length of the long lines
    long=(length-(m+1)*hinge_length)/(m);
    echo(str("There should be n=",n," links in the hinge."));
    translate(adjust) difference(){ 
        square([width,length],center=false);
        if(m==0) 
            //In the special case where |hinges_across_length|<1, the hinge should look like:
            // |  --------------------------------------|
            // |--------------------------------------  |
            // |  --------------------------------------|
            // |--------------------------------------  |
                for(i=[0:n])
                    translate([i*d,(pow(-1,i))*hinge_length]) // (-1)^i,{iϵZ} = {-1,+1,-1,+1,...}
                        square([th,length]);                
        else
            //A hinge with hinges_across_length=2 should look like:
            // |------------  ------------  ------------|
            // |  -----------------  -----------------  |
            // |------------  ------------  ------------|
            // |  -----------------  -----------------  |
            for(i=[0:n]){ //Iterating across x
                translate([i*d*1,0]){ //Do the x translation seperate from the y translations
                    if(i%2==1) //For odd columns
                        for(j=[0:m-1]){
                            translate([0,hinge_length+j*(long+hinge_length)]) 
                                square([th,long]);
                            }
                    if(i%2==0) //For even columns
                        for(j=[0:m]){
                            translate([0,j*(short+hinge_length)]) 
                                square([th,short]);
                        }
                    }
                }
            }
    }

On Tue, Aug 23, 2016 at 6:26 PM, Mark Schafer <[hidden email]> wrote:

great links to the maths for torsional and spring calculations. Sounds like a great idea to work on for openSCAD


On 8/24/2016 6:17 AM, Ari Diacou wrote:
These are living hinges:

http://www.deferredprocrastination.co.uk/blog/2011/laser-cut-lattice-living-hinges/

Is there an openscad library of these things? Anyone work with them before?

I'm thinking of some kind of module where you enter the width and height of the pattern you want, and the thickness of the material, and poof, it outputs a pattern of a living hinge.

Just trying to not reinvent the wheel.

Thanks,
Ari M Diacou


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


No virus found in this message.
Checked by AVG - www.avg.com
Version: 2016.0.7752 / Virus Database: 4647/12863 - Release Date: 08/23/16



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Living Hinges

Ronaldo
The first problem: your code can assume or expect a centered standard footprint for the shape. Let's say 1x1 or 10x10. The hinge module will position and stretch the children shape to meet its parameters. Yes, you may inside the hinge module crop the shape to the 1x1 standard if you want to.

The second: you feed me with that ideas! The second reference of your first message shows several very beautiful non rectangular cutting paterns. ;)

2016-08-25 18:38 GMT-03:00 Ari Diacou <[hidden email]>:
Thanks Ronaldo for the feedback. I can give that a think...

I see 2 problems:
1) If I am calling children to make my module modify another module, I dont (think I) have a way to get the dimensional information of the child module, so hinge8() would not know what to set "length" and "width" to use, which are called extensively in the code.

2) When you want a hinge, dont you almost always want it to be rectangular in profile? Under what conditions would you NOT want the profile of the hinge to be rectangular?

Are you thinking something like: ?

module add_hinge(length,width,...){
    union(){
        hinge7(length,width,center=true,...);
        difference(){
            children();
            square([length,width]);
            }
        }
    }


On Thu, Aug 25, 2016 at 5:11 PM, Ronaldo Persiano <[hidden email]> wrote:
Nice work, Ari. I did not dig your code enough but I think could be beneficial to have a more general module that, instead of working with a fixed rectangular cutting shape, operates over user defined shapes. Something like:
     hinge7(params...) my_losangle();
     hinge7(params...) rounded_square();
I have no idea how you would control the minimum_thinness though.

2016-08-25 17:18 GMT-03:00 Ari Diacou <[hidden email]>:
So I created it. Could you nerds give me any feedback? Any features you'd want? Any settings that totally mess it up? I'll put it up on Thingiverse, I think under a GNU license, once you give it a quick vetting.

Thanks,
--Ari M Diacou
Metis Industries

//Living Hinge
//Ari M Diacou
//Metis Industries
//August 2016

///////////////////////////////// Main() //////////////////////////////////////
//Uncomment lines to see samples
hinge7();
//hinge7(d=6);
//hinge7(length=20, width=40,d=6,hinge_length=2.5,hinges_across_length=2,minimum_thinness=3);
//hinge7(length=30, width=20,d=2,hinge_length=2.5,hinges_across_length=2,minimum_thinness=3,center=true);
//hinge7(length=20, width=40,d=3,hinge_length=4,hinges_across_length=0,minimum_thinness=1);

/////////////////////////////// Functions /////////////////////////////////////
module hinge7(length=30,width=20,d=3,minimum_thinness=3,hinge_length=3,hinges_across_length=2,center=false){
    //moves difference(){ square(...) outside of if(m=0) statement, compared to hinge6()
    //length = the y dimension of the hinge, parallel to the laser cuts
    //width = the x dimension of the hinge, transverse to laser cuts
    //d=the distance between parallel laser cuts
    //What is the minimum distance that two parallel lines can be apart before the laser does something catastrophic? E.g. setting uncontrollable fire to the work piece. This is "minimum_thinness"
    //hinge_length=the distance between 2 colinear laser cuts
    //hinges_across_length=the number of hinges across the length of the hinge
    //center is a boolean value, if true, place the center of the rectangle at the origin, if false, put the bottom left corner at the origin (just like square() and cube())
    ep=.00101;//epsilon, a small number,=1.01 micron, a hack (for OpenSCAD 2015.03) used to make square()'s which look like lines (which OpenSCAD doesn't support). Hopefully, your laser has a function which says something like "ignore cuts less than THRESHOLD apart", set that to anything greater than ep.
    adjust=center?-[width,length]/2:[0,0];//a vector for adjusting the center position
    th=d/2<minimum_thinness?ep:d/2;//If the distance between lines is less than the minimum thickness, just make linear cuts, specifically, set the width=th=thickness of the squares to ep, which is just above 1 micron (for 1=1mm slicers)
    n=floor(width/d);
    m=floor(abs(hinges_across_length)); echo(str("Number of hinges (m)=",m)); //input cleaning, ensures m ϵ {non-negative integers}
    echo(str("The distance between parallel laser cuts (d) is: ",d," mm."));
    //the length of the short lines
    short=(length-m*hinge_length)/(m+1);
    //the length of the long lines
    long=(length-(m+1)*hinge_length)/(m);
    echo(str("There should be n=",n," links in the hinge."));
    translate(adjust) difference(){ 
        square([width,length],center=false);
        if(m==0) 
            //In the special case where |hinges_across_length|<1, the hinge should look like:
            // |  --------------------------------------|
            // |--------------------------------------  |
            // |  --------------------------------------|
            // |--------------------------------------  |
                for(i=[0:n])
                    translate([i*d,(pow(-1,i))*hinge_length]) // (-1)^i,{iϵZ} = {-1,+1,-1,+1,...}
                        square([th,length]);                
        else
            //A hinge with hinges_across_length=2 should look like:
            // |------------  ------------  ------------|
            // |  -----------------  -----------------  |
            // |------------  ------------  ------------|
            // |  -----------------  -----------------  |
            for(i=[0:n]){ //Iterating across x
                translate([i*d*1,0]){ //Do the x translation seperate from the y translations
                    if(i%2==1) //For odd columns
                        for(j=[0:m-1]){
                            translate([0,hinge_length+j*(long+hinge_length)]) 
                                square([th,long]);
                            }
                    if(i%2==0) //For even columns
                        for(j=[0:m]){
                            translate([0,j*(short+hinge_length)]) 
                                square([th,short]);
                        }
                    }
                }
            }
    }

On Tue, Aug 23, 2016 at 6:26 PM, Mark Schafer <[hidden email]> wrote:

great links to the maths for torsional and spring calculations. Sounds like a great idea to work on for openSCAD


On 8/24/2016 6:17 AM, Ari Diacou wrote:
These are living hinges:

http://www.deferredprocrastination.co.uk/blog/2011/laser-cut-lattice-living-hinges/

Is there an openscad library of these things? Anyone work with them before?

I'm thinking of some kind of module where you enter the width and height of the pattern you want, and the thickness of the material, and poof, it outputs a pattern of a living hinge.

Just trying to not reinvent the wheel.

Thanks,
Ari M Diacou


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


No virus found in this message.
Checked by AVG - www.avg.com
Version: 2016.0.7752 / Virus Database: 4647/12863 - Release Date: 08/23/16



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Living Hinges

drxenocide
Okay Ronaldo, you got your wish. I think "add_hinge() circle()" works the way you want it to: 

//Living Hinge
//Ari M Diacou
//Metis Industries
//August 2016

//Thanks to Ronaldo Persiano for the inspiration for add_hinge()

///////////////////////////// Parameters /////////////////////////////////////
// preview[view:north, tilt:top]
//The y dimension of the hinge, parallel to the laser cuts
length=30;
//The x dimension of the hinge, transverse to laser cuts
width=40;
//The distance between parallel laser cuts
d=6;
//The distance between 2 collinear laser cuts
hinge_length=3;
//The number of hinges across the length of the hinge
hinges_across_length=1;
//How thick do you want the hinge to be
height=5;
///////////////////////////////// Main() //////////////////////////////////////
//linear_extrude(height) hinge(length=length,width=width,d=d,minimum_thinness=.01,hinge_length=hinge_length,hinges_across_length=hinges_across_length);
////Uncomment lines to see samples (all flat for DXF exporting)
//hinge();
//hinge(d=6);
//hinge(length=20, width=39,d=6,hinge_length=2.5,hinges_across_length=2,minimum_thinness=3);
//hinge(length=30, width=20,d=2,hinge_length=2.5,hinges_across_length=2,minimum_thinness=3,center=true);
//hinge(length=20, width=40,d=3,hinge_length=4,hinges_across_length=0,minimum_thinness=1);
//linear_extrude(height=5) hinge(length=20, width=40,d=6,hinge_length=2.5,hinges_across_length=2,minimum_thinness=3);
//add_hinge(width=20,length=length,center=true) square([3*length,length-1],center=true);
//add_hinge(width=20,length=90) translate([5,0]) circle(d=90);
//add_hinge(width=30,length=90,hinges_across_length=3) circle(d=90);
//add_hinge(width=30,length=90,hinges_across_length=3,center=false) circle(d=90);
add_hinge(width=30,length=90,hinges_across_length=3,minimum_thinness=.1) circle(d=90);

/////////////////////////////// Functions /////////////////////////////////////
module hinge(length=30,width=20,d=3,minimum_thinness=3,hinge_length=3,hinges_across_length=2,center=false){
    //length = the y dimension of the hinge, parallel to the laser cuts
    //width = the x dimension of the hinge, transverse to laser cuts
    //d=the distance between parallel laser cuts
    //What is the minimum distance that two parallel lines can be apart before the laser does something catastrophic? E.g. setting uncontrollable fire to the work piece. This is "minimum_thinness"
    //hinge_length=the distance between 2 collinear laser cuts
    //hinges_across_length=the number of hinges across the length of the hinge
    //center is a boolean value, if true, place the center of the rectangle at the origin, if false, put the bottom left corner at the origin (just like square() and cube())
    ep=.00101;//epsilon, a small number,=1.01 micron, a hack (for OpenSCAD 2015.03) used to make square()'s which look like lines (which OpenSCAD doesn't support). Hopefully, your laser has a function which says something like "ignore cuts less than THRESHOLD apart", set that to anything greater than ep.
    adjust=center?-[width,length]/2:[0,0];//a vector for adjusting the center position
    th=d/2<minimum_thinness?ep:d/2;//If the distance between lines is less than the minimum thickness, just make linear cuts, specifically, set the width=th=thickness of the squares to ep, which is just above 1 micron (for 1=1mm slicers)
    n=floor(width/d);
    m=floor(abs(hinges_across_length)); echo(str("Number of hinges (m)=",m)); //input cleaning, ensures m ϵ {non-negative integers}
    echo(str("Suggested filename: Living Hinge-",length,"x",width,"mm-h=",m,"x",hinge_length,"-th=",th));
    echo(str("The distance between parallel laser cuts (d) is: ",d," mm."));
    //the length of the short lines
    short=(length-m*hinge_length)/(m+1);
    //the length of the long lines
    long=(length-(m+1)*hinge_length)/(m);
    echo(str("There should be n=",n," links in the hinge."));
    translate(adjust) difference(){ 
        square([width,length],center=false);
        if(m==0) 
            //In the special case where |hinges_across_length|<1, the hinge should look like:
            // |  --------------------------------------|
            // |--------------------------------------  |
            // |  --------------------------------------|
            // |--------------------------------------  |
                for(i=[0:n])
                    translate([i*d,(pow(-1,i))*hinge_length]) // (-1)^i,{iϵZ} = {-1,+1,-1,+1,...}
                        square([th,length]);                
        else
            //A hinge with hinges_across_length=2 should look like:
            // |------------  ------------  ------------|
            // |  -----------------  -----------------  |
            // |------------  ------------  ------------|
            // |  -----------------  -----------------  |
            for(i=[0:n]){ //Iterating across x
                translate([i*d*1,0]){ //Do the x translation separate from the y translations
                    if(i%2==1) //For odd columns
                        for(j=[0:m-1]){
                            translate([0,hinge_length+j*(long+hinge_length)]) 
                                square([th,long]);
                            }
                    if(i%2==0) //For even columns
                        for(j=[0:m]){
                            translate([0,j*(short+hinge_length)]) 
                                square([th,short]);
                        }
                    }
                }
            }
    }
    
module add_hinge(length=30,width=20,d=3,minimum_thinness=3,hinge_length=3,hinges_across_length=2,center=true){
    //add_hinge() modifies another 2D object, by adding a hinge which is centered on the origin (by default, this can be changed to false, so that the bottom left corner of the hinge is at the origin. It uses the same parameters as hinge(). 
    //First, difference() a rectangle the size of the hinge from the child object (makes a hole for the hinge
    //Second, union() a hinge with First (puts the hinge in the hole)
    //Third, intersection() the child object with Second (cuts off any extra hinge that sticks out past the child object)
    intersection(){
        children();
        union(){
            hinge(length=length,width=width,d=d,minimum_thinness=minimum_thinness,hinge_length=hinge_length,hinges_across_length=hinges_across_length,center=center);
            difference(){
                children();
                square([width,length],center=center);
                }
            }
        }
    }    
  


On Thu, Aug 25, 2016 at 6:21 PM, Ronaldo Persiano <[hidden email]> wrote:
The first problem: your code can assume or expect a centered standard footprint for the shape. Let's say 1x1 or 10x10. The hinge module will position and stretch the children shape to meet its parameters. Yes, you may inside the hinge module crop the shape to the 1x1 standard if you want to.

The second: you feed me with that ideas! The second reference of your first message shows several very beautiful non rectangular cutting paterns. ;)

2016-08-25 18:38 GMT-03:00 Ari Diacou <[hidden email]>:
Thanks Ronaldo for the feedback. I can give that a think...

I see 2 problems:
1) If I am calling children to make my module modify another module, I dont (think I) have a way to get the dimensional information of the child module, so hinge8() would not know what to set "length" and "width" to use, which are called extensively in the code.

2) When you want a hinge, dont you almost always want it to be rectangular in profile? Under what conditions would you NOT want the profile of the hinge to be rectangular?

Are you thinking something like: ?

module add_hinge(length,width,...){
    union(){
        hinge7(length,width,center=true,...);
        difference(){
            children();
            square([length,width]);
            }
        }
    }


On Thu, Aug 25, 2016 at 5:11 PM, Ronaldo Persiano <[hidden email]> wrote:
Nice work, Ari. I did not dig your code enough but I think could be beneficial to have a more general module that, instead of working with a fixed rectangular cutting shape, operates over user defined shapes. Something like:
     hinge7(params...) my_losangle();
     hinge7(params...) rounded_square();
I have no idea how you would control the minimum_thinness though.

2016-08-25 17:18 GMT-03:00 Ari Diacou <[hidden email]>:
So I created it. Could you nerds give me any feedback? Any features you'd want? Any settings that totally mess it up? I'll put it up on Thingiverse, I think under a GNU license, once you give it a quick vetting.

Thanks,
--Ari M Diacou
Metis Industries

//Living Hinge
//Ari M Diacou
//Metis Industries
//August 2016

///////////////////////////////// Main() //////////////////////////////////////
//Uncomment lines to see samples
hinge7();
//hinge7(d=6);
//hinge7(length=20, width=40,d=6,hinge_length=2.5,hinges_across_length=2,minimum_thinness=3);
//hinge7(length=30, width=20,d=2,hinge_length=2.5,hinges_across_length=2,minimum_thinness=3,center=true);
//hinge7(length=20, width=40,d=3,hinge_length=4,hinges_across_length=0,minimum_thinness=1);

/////////////////////////////// Functions /////////////////////////////////////
module hinge7(length=30,width=20,d=3,minimum_thinness=3,hinge_length=3,hinges_across_length=2,center=false){
    //moves difference(){ square(...) outside of if(m=0) statement, compared to hinge6()
    //length = the y dimension of the hinge, parallel to the laser cuts
    //width = the x dimension of the hinge, transverse to laser cuts
    //d=the distance between parallel laser cuts
    //What is the minimum distance that two parallel lines can be apart before the laser does something catastrophic? E.g. setting uncontrollable fire to the work piece. This is "minimum_thinness"
    //hinge_length=the distance between 2 colinear laser cuts
    //hinges_across_length=the number of hinges across the length of the hinge
    //center is a boolean value, if true, place the center of the rectangle at the origin, if false, put the bottom left corner at the origin (just like square() and cube())
    ep=.00101;//epsilon, a small number,=1.01 micron, a hack (for OpenSCAD 2015.03) used to make square()'s which look like lines (which OpenSCAD doesn't support). Hopefully, your laser has a function which says something like "ignore cuts less than THRESHOLD apart", set that to anything greater than ep.
    adjust=center?-[width,length]/2:[0,0];//a vector for adjusting the center position
    th=d/2<minimum_thinness?ep:d/2;//If the distance between lines is less than the minimum thickness, just make linear cuts, specifically, set the width=th=thickness of the squares to ep, which is just above 1 micron (for 1=1mm slicers)
    n=floor(width/d);
    m=floor(abs(hinges_across_length)); echo(str("Number of hinges (m)=",m)); //input cleaning, ensures m ϵ {non-negative integers}
    echo(str("The distance between parallel laser cuts (d) is: ",d," mm."));
    //the length of the short lines
    short=(length-m*hinge_length)/(m+1);
    //the length of the long lines
    long=(length-(m+1)*hinge_length)/(m);
    echo(str("There should be n=",n," links in the hinge."));
    translate(adjust) difference(){ 
        square([width,length],center=false);
        if(m==0) 
            //In the special case where |hinges_across_length|<1, the hinge should look like:
            // |  --------------------------------------|
            // |--------------------------------------  |
            // |  --------------------------------------|
            // |--------------------------------------  |
                for(i=[0:n])
                    translate([i*d,(pow(-1,i))*hinge_length]) // (-1)^i,{iϵZ} = {-1,+1,-1,+1,...}
                        square([th,length]);                
        else
            //A hinge with hinges_across_length=2 should look like:
            // |------------  ------------  ------------|
            // |  -----------------  -----------------  |
            // |------------  ------------  ------------|
            // |  -----------------  -----------------  |
            for(i=[0:n]){ //Iterating across x
                translate([i*d*1,0]){ //Do the x translation seperate from the y translations
                    if(i%2==1) //For odd columns
                        for(j=[0:m-1]){
                            translate([0,hinge_length+j*(long+hinge_length)]) 
                                square([th,long]);
                            }
                    if(i%2==0) //For even columns
                        for(j=[0:m]){
                            translate([0,j*(short+hinge_length)]) 
                                square([th,short]);
                        }
                    }
                }
            }
    }

On Tue, Aug 23, 2016 at 6:26 PM, Mark Schafer <[hidden email]> wrote:

great links to the maths for torsional and spring calculations. Sounds like a great idea to work on for openSCAD


On 8/24/2016 6:17 AM, Ari Diacou wrote:
These are living hinges:

http://www.deferredprocrastination.co.uk/blog/2011/laser-cut-lattice-living-hinges/

Is there an openscad library of these things? Anyone work with them before?

I'm thinking of some kind of module where you enter the width and height of the pattern you want, and the thickness of the material, and poof, it outputs a pattern of a living hinge.

Just trying to not reinvent the wheel.

Thanks,
Ari M Diacou


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


No virus found in this message.
Checked by AVG - www.avg.com
Version: 2016.0.7752 / Virus Database: 4647/12863 - Release Date: 08/23/16



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Living Hinges

Ronaldo
I think I have not made myself clear. I had called shape the hinge repeated cutting shape. Your add_hinge has its own use but what I meant was:





​that I got with the following ad hoc code:

module shape1(b,a) {
    square([b/8,a], center=true);
    translate([-b+b/16,a-a/2]) square([b,a/4]);
    translate([-b/16,-a+a/4]) square([b,a/4]);
}

module shape2(s) {
    square([s,s/2],center=true);
    square([s/2,s],center=true);
}

module shape3(a,b) {
    scale([a,b]) rotate(45) square();
}

module hinge(s1,s2,offset=true){
    difference(){
        square([200,170]);
        translate([0,50])
        for(i=[0:10], j=[0:5]) {
            if ( (j%2) && offset ) {
                translate([s1*(i+0.5),s2*j])  children();
            } else {
                translate([s1*i,s2*j])  children();
            }
        }
    }
}
hinge(s1=26,s2=15,offset=false) shape1(20,6);

translate([220,0]) hinge(s1=21,s2=16) shape2(17);

translate([440,0]) hinge(s1=100,s2=12) shape3(60,12);

Note that I added one more parameter to allow patterns with no offset between rows. As I said before, I don't know how you could deal with the "minimum_thinness" in this case.


2016-08-26 11:23 GMT-03:00 Ari Diacou <[hidden email]>:
Okay Ronaldo, you got your wish. I think "add_hinge() circle()" works the way you want it to: 

//Living Hinge
//Ari M Diacou
//Metis Industries
//August 2016

//Thanks to Ronaldo Persiano for the inspiration for add_hinge()

///////////////////////////// Parameters /////////////////////////////////////
// preview[view:north, tilt:top]
//The y dimension of the hinge, parallel to the laser cuts
length=30;
//The x dimension of the hinge, transverse to laser cuts
width=40;
//The distance between parallel laser cuts
d=6;
//The distance between 2 collinear laser cuts
hinge_length=3;
//The number of hinges across the length of the hinge
hinges_across_length=1;
//How thick do you want the hinge to be
height=5;
///////////////////////////////// Main() //////////////////////////////////////
//linear_extrude(height) hinge(length=length,width=width,d=d,minimum_thinness=.01,hinge_length=hinge_length,hinges_across_length=hinges_across_length);
////Uncomment lines to see samples (all flat for DXF exporting)
//hinge();
//hinge(d=6);
//hinge(length=20, width=39,d=6,hinge_length=2.5,hinges_across_length=2,minimum_thinness=3);
//hinge(length=30, width=20,d=2,hinge_length=2.5,hinges_across_length=2,minimum_thinness=3,center=true);
//hinge(length=20, width=40,d=3,hinge_length=4,hinges_across_length=0,minimum_thinness=1);
//linear_extrude(height=5) hinge(length=20, width=40,d=6,hinge_length=2.5,hinges_across_length=2,minimum_thinness=3);
//add_hinge(width=20,length=length,center=true) square([3*length,length-1],center=true);
//add_hinge(width=20,length=90) translate([5,0]) circle(d=90);
//add_hinge(width=30,length=90,hinges_across_length=3) circle(d=90);
//add_hinge(width=30,length=90,hinges_across_length=3,center=false) circle(d=90);
add_hinge(width=30,length=90,hinges_across_length=3,minimum_thinness=.1) circle(d=90);

/////////////////////////////// Functions /////////////////////////////////////
module hinge(length=30,width=20,d=3,minimum_thinness=3,hinge_length=3,hinges_across_length=2,center=false){
    //length = the y dimension of the hinge, parallel to the laser cuts
    //width = the x dimension of the hinge, transverse to laser cuts
    //d=the distance between parallel laser cuts
    //What is the minimum distance that two parallel lines can be apart before the laser does something catastrophic? E.g. setting uncontrollable fire to the work piece. This is "minimum_thinness"
    //hinge_length=the distance between 2 collinear laser cuts
    //hinges_across_length=the number of hinges across the length of the hinge
    //center is a boolean value, if true, place the center of the rectangle at the origin, if false, put the bottom left corner at the origin (just like square() and cube())
    ep=.00101;//epsilon, a small number,=1.01 micron, a hack (for OpenSCAD 2015.03) used to make square()'s which look like lines (which OpenSCAD doesn't support). Hopefully, your laser has a function which says something like "ignore cuts less than THRESHOLD apart", set that to anything greater than ep.
    adjust=center?-[width,length]/2:[0,0];//a vector for adjusting the center position
    th=d/2<minimum_thinness?ep:d/2;//If the distance between lines is less than the minimum thickness, just make linear cuts, specifically, set the width=th=thickness of the squares to ep, which is just above 1 micron (for 1=1mm slicers)
    n=floor(width/d);
    m=floor(abs(hinges_across_length)); echo(str("Number of hinges (m)=",m)); //input cleaning, ensures m ϵ {non-negative integers}
    echo(str("Suggested filename: Living Hinge-",length,"x",width,"mm-h=",m,"x",hinge_length,"-th=",th));
    echo(str("The distance between parallel laser cuts (d) is: ",d," mm."));
    //the length of the short lines
    short=(length-m*hinge_length)/(m+1);
    //the length of the long lines
    long=(length-(m+1)*hinge_length)/(m);
    echo(str("There should be n=",n," links in the hinge."));
    translate(adjust) difference(){ 
        square([width,length],center=false);
        if(m==0) 
            //In the special case where |hinges_across_length|<1, the hinge should look like:
            // |  --------------------------------------|
            // |--------------------------------------  |
            // |  --------------------------------------|
            // |--------------------------------------  |
                for(i=[0:n])
                    translate([i*d,(pow(-1,i))*hinge_length]) // (-1)^i,{iϵZ} = {-1,+1,-1,+1,...}
                        square([th,length]);                
        else
            //A hinge with hinges_across_length=2 should look like:
            // |------------  ------------  ------------|
            // |  -----------------  -----------------  |
            // |------------  ------------  ------------|
            // |  -----------------  -----------------  |
            for(i=[0:n]){ //Iterating across x
                translate([i*d*1,0]){ //Do the x translation separate from the y translations
                    if(i%2==1) //For odd columns
                        for(j=[0:m-1]){
                            translate([0,hinge_length+j*(long+hinge_length)]) 
                                square([th,long]);
                            }
                    if(i%2==0) //For even columns
                        for(j=[0:m]){
                            translate([0,j*(short+hinge_length)]) 
                                square([th,short]);
                        }
                    }
                }
            }
    }
    
module add_hinge(length=30,width=20,d=3,minimum_thinness=3,hinge_length=3,hinges_across_length=2,center=true){
    //add_hinge() modifies another 2D object, by adding a hinge which is centered on the origin (by default, this can be changed to false, so that the bottom left corner of the hinge is at the origin. It uses the same parameters as hinge(). 
    //First, difference() a rectangle the size of the hinge from the child object (makes a hole for the hinge
    //Second, union() a hinge with First (puts the hinge in the hole)
    //Third, intersection() the child object with Second (cuts off any extra hinge that sticks out past the child object)
    intersection(){
        children();
        union(){
            hinge(length=length,width=width,d=d,minimum_thinness=minimum_thinness,hinge_length=hinge_length,hinges_across_length=hinges_across_length,center=center);
            difference(){
                children();
                square([width,length],center=center);
                }
            }
        }
    }    
  


On Thu, Aug 25, 2016 at 6:21 PM, Ronaldo Persiano <[hidden email]> wrote:
The first problem: your code can assume or expect a centered standard footprint for the shape. Let's say 1x1 or 10x10. The hinge module will position and stretch the children shape to meet its parameters. Yes, you may inside the hinge module crop the shape to the 1x1 standard if you want to.

The second: you feed me with that ideas! The second reference of your first message shows several very beautiful non rectangular cutting paterns. ;)

2016-08-25 18:38 GMT-03:00 Ari Diacou <[hidden email]>:
Thanks Ronaldo for the feedback. I can give that a think...

I see 2 problems:
1) If I am calling children to make my module modify another module, I dont (think I) have a way to get the dimensional information of the child module, so hinge8() would not know what to set "length" and "width" to use, which are called extensively in the code.

2) When you want a hinge, dont you almost always want it to be rectangular in profile? Under what conditions would you NOT want the profile of the hinge to be rectangular?

Are you thinking something like: ?

module add_hinge(length,width,...){
    union(){
        hinge7(length,width,center=true,...);
        difference(){
            children();
            square([length,width]);
            }
        }
    }


On Thu, Aug 25, 2016 at 5:11 PM, Ronaldo Persiano <[hidden email]> wrote:
Nice work, Ari. I did not dig your code enough but I think could be beneficial to have a more general module that, instead of working with a fixed rectangular cutting shape, operates over user defined shapes. Something like:
     hinge7(params...) my_losangle();
     hinge7(params...) rounded_square();
I have no idea how you would control the minimum_thinness though.

2016-08-25 17:18 GMT-03:00 Ari Diacou <[hidden email]>:
So I created it. Could you nerds give me any feedback? Any features you'd want? Any settings that totally mess it up? I'll put it up on Thingiverse, I think under a GNU license, once you give it a quick vetting.

Thanks,
--Ari M Diacou
Metis Industries

//Living Hinge
//Ari M Diacou
//Metis Industries
//August 2016

///////////////////////////////// Main() //////////////////////////////////////
//Uncomment lines to see samples
hinge7();
//hinge7(d=6);
//hinge7(length=20, width=40,d=6,hinge_length=2.5,hinges_across_length=2,minimum_thinness=3);
//hinge7(length=30, width=20,d=2,hinge_length=2.5,hinges_across_length=2,minimum_thinness=3,center=true);
//hinge7(length=20, width=40,d=3,hinge_length=4,hinges_across_length=0,minimum_thinness=1);

/////////////////////////////// Functions /////////////////////////////////////
module hinge7(length=30,width=20,d=3,minimum_thinness=3,hinge_length=3,hinges_across_length=2,center=false){
    //moves difference(){ square(...) outside of if(m=0) statement, compared to hinge6()
    //length = the y dimension of the hinge, parallel to the laser cuts
    //width = the x dimension of the hinge, transverse to laser cuts
    //d=the distance between parallel laser cuts
    //What is the minimum distance that two parallel lines can be apart before the laser does something catastrophic? E.g. setting uncontrollable fire to the work piece. This is "minimum_thinness"
    //hinge_length=the distance between 2 colinear laser cuts
    //hinges_across_length=the number of hinges across the length of the hinge
    //center is a boolean value, if true, place the center of the rectangle at the origin, if false, put the bottom left corner at the origin (just like square() and cube())
    ep=.00101;//epsilon, a small number,=1.01 micron, a hack (for OpenSCAD 2015.03) used to make square()'s which look like lines (which OpenSCAD doesn't support). Hopefully, your laser has a function which says something like "ignore cuts less than THRESHOLD apart", set that to anything greater than ep.
    adjust=center?-[width,length]/2:[0,0];//a vector for adjusting the center position
    th=d/2<minimum_thinness?ep:d/2;//If the distance between lines is less than the minimum thickness, just make linear cuts, specifically, set the width=th=thickness of the squares to ep, which is just above 1 micron (for 1=1mm slicers)
    n=floor(width/d);
    m=floor(abs(hinges_across_length)); echo(str("Number of hinges (m)=",m)); //input cleaning, ensures m ϵ {non-negative integers}
    echo(str("The distance between parallel laser cuts (d) is: ",d," mm."));
    //the length of the short lines
    short=(length-m*hinge_length)/(m+1);
    //the length of the long lines
    long=(length-(m+1)*hinge_length)/(m);
    echo(str("There should be n=",n," links in the hinge."));
    translate(adjust) difference(){ 
        square([width,length],center=false);
        if(m==0) 
            //In the special case where |hinges_across_length|<1, the hinge should look like:
            // |  --------------------------------------|
            // |--------------------------------------  |
            // |  --------------------------------------|
            // |--------------------------------------  |
                for(i=[0:n])
                    translate([i*d,(pow(-1,i))*hinge_length]) // (-1)^i,{iϵZ} = {-1,+1,-1,+1,...}
                        square([th,length]);                
        else
            //A hinge with hinges_across_length=2 should look like:
            // |------------  ------------  ------------|
            // |  -----------------  -----------------  |
            // |------------  ------------  ------------|
            // |  -----------------  -----------------  |
            for(i=[0:n]){ //Iterating across x
                translate([i*d*1,0]){ //Do the x translation seperate from the y translations
                    if(i%2==1) //For odd columns
                        for(j=[0:m-1]){
                            translate([0,hinge_length+j*(long+hinge_length)]) 
                                square([th,long]);
                            }
                    if(i%2==0) //For even columns
                        for(j=[0:m]){
                            translate([0,j*(short+hinge_length)]) 
                                square([th,short]);
                        }
                    }
                }
            }
    }

On Tue, Aug 23, 2016 at 6:26 PM, Mark Schafer <[hidden email]> wrote:

great links to the maths for torsional and spring calculations. Sounds like a great idea to work on for openSCAD


On 8/24/2016 6:17 AM, Ari Diacou wrote:
These are living hinges:

http://www.deferredprocrastination.co.uk/blog/2011/laser-cut-lattice-living-hinges/

Is there an openscad library of these things? Anyone work with them before?

I'm thinking of some kind of module where you enter the width and height of the pattern you want, and the thickness of the material, and poof, it outputs a pattern of a living hinge.

Just trying to not reinvent the wheel.

Thanks,
Ari M Diacou


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


No virus found in this message.
Checked by AVG - www.avg.com
Version: 2016.0.7752 / Virus Database: 4647/12863 - Release Date: 08/23/16



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Living Hinges

Ronaldo
One more comment: I don't think it is a good idea to crop the shape to constrain it to a rectangle [length, width]. The bounding boxes of shape1 of my code overlaps each other along a row.



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Living Hinges

drxenocide
Aha! Yes, your function seems much more useful. I would call yours a "tesselation_hinge" since it tessellates the child object. I can think more about how to make yours a little more general.
 
One more comment: I don't think it is a good idea to crop the shape to constrain it to a rectangle [length, width]. The bounding boxes of shape1 of my code overlaps each other along a row.

If you ar talking about the cropping of my hinge to the outline of the circle: While I obviously misunderstood what you were asking for, that is one reason I thought (what I thought was) your proposal was a little odd. However, I found that while the hinges at the edges do get cut off, causing edge effects, this can be fixed by increasing the "hinges_across_length". If for some reason this makes the hinge too rigid, then "d" can be decreased.



On Fri, Aug 26, 2016 at 11:22 AM, Ronaldo Persiano <[hidden email]> wrote:
One more comment: I don't think it is a good idea to crop the shape to constrain it to a rectangle [length, width]. The bounding boxes of shape1 of my code overlaps each other along a row.



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Living Hinges

Ronaldo
I meant it is not a good idea to crop the children inside the hinge module. It would be users responsibility to define cutting shapes that produce sensible results.

2016-08-26 12:35 GMT-03:00 Ari Diacou <[hidden email]>:

If you ar talking about the cropping of my hinge to the outline of the circle: While I obviously misunderstood what you were asking for, that is one reason I thought (what I thought was) your proposal was a little odd. However, I found that while the hinges at the edges do get cut off, causing edge effects, this can be fixed by increasing the "hinges_across_length". If for some reason this makes the hinge too rigid, then "d" can be decreased.



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Living Hinges

louijp
You guys might want to look at a technology called “Industrial Origami”

Just my $0.02,

Jean-Paul
N1JPL


> On Aug 26, 2016, at 12:51 PM, Ronaldo Persiano <[hidden email]> wrote:
>
> I meant it is not a good idea to crop the children inside the hinge module. It would be users responsibility to define cutting shapes that produce sensible results.
>
> 2016-08-26 12:35 GMT-03:00 Ari Diacou <[hidden email]>:
>
> If you ar talking about the cropping of my hinge to the outline of the circle: While I obviously misunderstood what you were asking for, that is one reason I thought (what I thought was) your proposal was a little odd. However, I found that while the hinges at the edges do get cut off, causing edge effects, this can be fixed by increasing the "hinges_across_length". If for some reason this makes the hinge too rigid, then "d" can be decreased.
>
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org




_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Living Hinges

drxenocide
In reply to this post by Ronaldo
Okay, last one ( I think). I have implemented Ronaldo's suggestion to have a tessellation module that acts on a child object. It can be found at http://www.thingiverse.com/thing:1745322 or below:

//Living Hinge
//Ari M Diacou
//Metis Industries
//August 2016

//Thanks to Ronaldo Persiano for the inspiration for add_hinge() and tesselation_hinge()

////Uncomment lines to see Examples (all flat for DXF exporting)
///////////////////////////// Hinge() ///////////////////////////////////////
//hinge();
//hinge(d=6);
//hinge(length=20, size[0]=39,d=6,hinge_length=2.5,hinges_across_length=2,minimum_thinness=3);
//hinge(length=30, size[0]=20,d=2,hinge_length=2.5,hinges_across_length=2,minimum_thinness=3,center=true);
//hinge(length=20, size[0]=40,d=3,hinge_length=4,hinges_across_length=0,minimum_thinness=1);
//linear_extrude(height=5) hinge(length=20, size[0]=40,d=6,hinge_length=2.5,hinges_across_length=2,minimum_thinness=3);
//////////////////////////// Add_Hinge() ////////////////////////////////////
//add_hinge(size[0]=20,length=size[1],center=true) square([3*size[1],size[1]-1],center=true);
//add_hinge(size[0]=20,length=90) translate([5,0]) circle(d=90);
//add_hinge(size[0]=30,length=90,hinges_across_length=3) circle(d=90);
//add_hinge(size[0]=30,length=90,hinges_across_length=3,center=false) circle(d=90);
//add_hinge(size[0]=30,length=90,hinges_across_length=3,minimum_thinness=.1) circle(d=90);
//////////////////////////// Tesselate() ////////////////////////////////////
//tesselate(num=[3,6], size=[3,2],padding=[.1,.1],type="hex") rotate(30) circle($fn=6);
//tesselate(num=[3,6], size=[2,1],padding=[.4,.1],type="tri") translate([-.1,-.1]) text("T",valign="center",halign="center");
//tesselate(num=[6,6], size=[2,.7071],padding=[0.01,.01],type="tri") translate([0,.25]) rotate(30)  circle($fn=3);
//tesselate(num=[8,6], size=[2,1],padding=[.6,.1],type="tri") translate([-.1,-.1]) rotate(25) text("y",valign="center",halign="center");
//tesselate(num=[6,8], size=[1.5,1],padding=[.6,.1],type="hex") translate([-.1,-.1])  text("+",valign="center",halign="center");
//////////////////////// Tesselation_Hinge() ////////////////////////////////
tesselation_hinge(num=[6,8], size=[9,6],padding=[.6,.1],type="hex") translate([-.1,-.1])  text("+",valign="center",halign="center");
//tesselation_hinge(size=[4,5],num=[3,6],padding=[.1,.4],type="hex") translate([-.8,-.5])square(); //running bond bricks
//tesselation_hinge(size=[4,5],num=[4,5],padding=[.1,.1],type="tri") translate([0,.28])rotate(30) circle($fn=3);
//tesselation_hinge(size=[4,5],num=[4,5],padding=[.7,.1],type="tri") translate([-.1,-.1]) rotate(5) text("t",valign="center",halign="center");
//tesselation_hinge(num=[3,6], size=[3,6],padding=[.4,.1],type="tri") translate([-.1,-.1]) text("T",valign="center",halign="center");
//tesselation_hinge(size=[6,6],num=[6,6],padding=[.2,.2],type="hex") rotate(30) circle($fn=6);

/////////////////////////////// Functions /////////////////////////////////////
module hinge(size=[20,30],d=3,minimum_thinness=3,hinge_length=3,hinges_across_length=2,center=false){
    //size[1] = the y dimension of the hinge, parallel to the laser cuts
    //size[0] = the x dimension of the hinge, transverse to laser cuts
    //d=the distance between parallel laser cuts
    //What is the minimum distance that two parallel lines can be apart before the laser does something catastrophic? E.g. setting uncontrollable fire to the work piece. This is "minimum_thinness"
    //hinge_length=the distance between 2 colinear laser cuts
    //hinges_across_length=the number of hinges across the size[1] of the hinge
    //center is a boolean value, if true, place the center of the rectangle at the origin, if false, put the bottom left corner at the origin (just like square() and cube())
    ep=.00101;//epsilon, a small number,=1.01 micron, a hack (for OpenSCAD 2015.03) used to make square()'s which look like lines (which OpenSCAD doesn't support). Hopefully, your laser has a function which says something like "ignore cuts less than THRESHOLD apart", set that to anything greater than ep.
    adjust=center?-[size[0],size[1]]/2:[0,0];//a vector for adjusting the center position
    th=d/2<minimum_thinness?ep:d/2;//If the distance between lines is less than the minimum thickness, just make linear cuts, specifically, set the size[0]=th=thickness of the squares to ep, which is just above 1 micron (for 1=1mm slicers)
    n=floor(size[0]/d);
    m=floor(abs(hinges_across_length)); echo(str("Number of hinges (m)=",m)); //input cleaning, ensures m ϵ {non-negative integers}
    echo(str("Suggested filename: Living Hinge-",size[1],"x",size[0],"mm-h=",m,"x",hinge_length,"-th=",th));
    echo(str("The distance between parallel laser cuts (d) is: ",d," mm."));
    //the size[1] of the short lines
    short=(size[1]-m*hinge_length)/(m+1);
    //the size[1] of the long lines
    long=(size[1]-(m+1)*hinge_length)/(m);
    echo(str("There should be n=",n," links in the hinge."));
    translate(adjust) difference(){
        square([size[0],size[1]],center=false);
        if(m==0)
            //In the special case where |hinges_across_length|<1, the hinge should look like:
            // |  --------------------------------------|
            // |--------------------------------------  |
            // |  --------------------------------------|
            // |--------------------------------------  |
                for(i=[0:n])
                    translate([i*d,(pow(-1,i))*hinge_length]) // (-1)^i,{iϵZ} = {-1,+1,-1,+1,...}
                        square([th,size[1]]);               
        else
            //A hinge with hinges_across_length=2 should look like:
            // |------------  ------------  ------------|
            // |  -----------------  -----------------  |
            // |------------  ------------  ------------|
            // |  -----------------  -----------------  |
            for(i=[0:n]){ //Iterating across x
                translate([i*d*1,0]){ //Do the x translation seperate from the y translations
                    if(i%2==1) //For odd columns
                        for(j=[0:m-1]){
                            translate([0,hinge_length+j*(long+hinge_length)])
                                square([th,long]);
                            }
                    if(i%2==0) //For even columns
                        for(j=[0:m]){
                            translate([0,j*(short+hinge_length)])
                                square([th,short]);
                        }
                    }
                }
            }
    }
   
module add_hinge(size=[20,30],d=3,minimum_thinness=3,hinge_length=3,hinges_across_length=2,center=true){
    //add_hinge() modifies another 2D object, by adding a hinge which is centered on the origin (by default, this can be changed to false, so that the bottom left corner of the hinge is at the origin. It uses the same parameters as hinge().
    //First, difference() a rectangle the size of the hinge from the child object (makes a hole for the hinge
    //Second, union() a hinge with First (puts the hinge in the hole)
    //Third, intersection() the child object with Second (cuts off any extra hinge that sticks out past the child object)
    intersection(){
        children();
        union(){
            hinge(size=size,d=d,minimum_thinness=minimum_thinness,hinge_length=hinge_length,hinges_across_length=hinges_across_length,center=center);
            difference(){
                children();
                square([size[0],size[1]],center=center);
                }
            }
        }
    }   

module tesselate(num=[1,1],size=[1,1],padding=[0,0],type="square"){
    //Tesselate acts on a child object, and tesselates it, in a sqaure, triagular or hexagonal array.
    //num is [the number of objects in x, the number of objects in y]
    //size is [the size of each "cell" in x, the size of each "cell" in y]
    //padding is how much should be subtracted from the "cell" size to get the object size. This is absolute, not proportional, i.e. padding of .1 means each object is 0.1mm smaller than the cell, not 10% or 90% the size of the cell.
    //type is the type of array. There are exactly 3 types of regular polyhedron tesselations, square (normal graph paper), hexagonal (hex tiles, e.g. Civilization 5, or bricks in "running bond"), and triangular (this particular code uses a 180 degree rotation in z instead of a reflection in the xz-plane
    index = (type=="h"||type=="hex"||type=="hexagon"||type=="hexagonal")     ? 1 :
            (type=="t"||type=="tri"||type=="triangle"||type=="triangular")   ? 2 : 0;//index converts the text of type into a numbered index. I didn't want to slow down computation time by having if statements or conditionals, so I calculate transforamtions for all 3, make an array of them, and then use index to pick the appropriate one.
    sq=[[1,0],[0,1]]; hex=[[1,0],[.5,.75]]; tri=[[.5,0],[0,1]]; //These are the unit vectors for each of the array types.
    Map=[sq,hex,tri][index];
    for(j=[0:num[1]-1]) //Iterate in y
        for(i=[0:num[0]-1]){ //Iterate in x
            translation=[(i+.5)*Map[0]*size[0]+(j+.5)*Map[1]*size[1],[(i+.5)*(size[0]*Map[0][0])+Map[1][0]*size[0]*(j%2),(j+.5)*(size[1]*Map[1][1])],(i+.5)*Map[0]*size[0]+(j+.5)*Map[1]*size[1]][index]; //What is the vector that describes the position of each object in the array?
            rot=[0,0,180*((i+j)%2)][index]; //Only triangular arrays need a rotation
            translate(translation)
                rotate(rot)
                    resize(size-padding) 
                        children();
            }
    }

module tesselation_hinge(num=[1,1],size=[1,1],padding=[0,0],type="square"){
    //Tesselation hinge takes the difference of a square(size) and a tesselate().
    //size as used in this function is the size of the hinge, not the size of each object (like in tesselate()) the size of the objects are dynamically adjusted based on num and padding, and of course, the size of the hinge.
    //num, padding and type have all the same meanings as they do in tesselate().
    index = (type=="h"||type=="hex"||type=="hexagon"||type=="hexagonal")     ? 1 :
            (type=="t"||type=="tri"||type=="triangle"||type=="triangular")   ? 2 : 0;
    sq=[[1,0],[0,1]]; hex=[[1,0],[.5,.75]]; tri=[[.5,0],[0,1]];
    Map=[sq,hex,tri][index];
    //These parameters need to be re-declared because when calling tesselate(), the size of each object needs to be recalculated based on the size of each cell. These parameters must be the same in both functions.
    difference(){
        square(size);
        tesselate(num=num,size=[size[0]/num[0]/Map[0][0],size[1]/num[1]/Map[1][1]],padding=padding,type=type)
            children();
        }
    }
   



On Fri, Aug 26, 2016 at 12:51 PM, Ronaldo Persiano <[hidden email]> wrote:
I meant it is not a good idea to crop the children inside the hinge module. It would be users responsibility to define cutting shapes that produce sensible results.

2016-08-26 12:35 GMT-03:00 Ari Diacou <[hidden email]>:

If you ar talking about the cropping of my hinge to the outline of the circle: While I obviously misunderstood what you were asking for, that is one reason I thought (what I thought was) your proposal was a little odd. However, I found that while the hinges at the edges do get cut off, causing edge effects, this can be fixed by increasing the "hinges_across_length". If for some reason this makes the hinge too rigid, then "d" can be decreased.



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Living Hinges

Ronaldo
Nice work, Ari! And very well documented.

I have been caught by your hinge question. So, I could not wait your solution and have written mine own. Comparing it with yours I realized that we have used different tiling (or tesselation) approaches.



That is my code where I included the above patterns, four of them I found at ponoko site and two I designed myself. Hope you like it:
living_hinges2.scad
As you can see, I don't make any change to the patterns (children()) except translation to the tilling position and flipping. The tile dimensions, arguments of hinge module, may be different from the pattern dimensions so they are able to overlap like in the "diamonds" above.

I think that the standard hinge pattern (the one you use in your hinge module) is probably the more adequate to the function. Other patterns may have some value, like diamonds and bowling pins. The others have more decorative appeal but they seem to be either fragile or less flexible for a living hinge. I don't have a laser cutting service nearby to try them.

Any way, it was fun to play with them.
Reply | Threaded
Open this post in threaded view
|

Re: Living Hinges

MichaelAtOz
Administrator
Has this been tried with printed plastic?
Admin - email* me if you need anything,
or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work.
Obviously inclusion of works of previous authors is not included in the above.


The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!
Reply | Threaded
Open this post in threaded view
|

Re: Living Hinges

Michele
On 09-01-2016 11:29 PM, MichaelAtOz wrote:
> Has this been tried with printed plastic?
>
>    
What, living hinges?  Yes, I print them in polypropylene.  They work
just as well as commercial ones.

             - Michele



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Living Hinges

Neon22
nice work. I found one hinge design that flexes in both directions. Only example I found.
its here:
http://lab.kofaktor.hr/en/portfolio/super-flexible-laser-cut-plywood/
Reply | Threaded
Open this post in threaded view
|

Re: Living Hinges

Ronaldo
Great design, Neon22! I was looking for something like that. Thank you.

At a first look of that design, I saw lots of interlocked swastikas. After that it reminded me the Hilbert curve.

I coded the pattern for the design and found the hinge() parameters to reproduce it:


module koFACTORlab_flex(a=20,b,kerf=0.5) {
    c = b==undef ? a : b/2;
    p = [[-1,2],[-1,4],[1,4],[1,0],[-3,0],
         [-3,-4],[1,-4],[1,-2],[-1,-2]
    ]*[[a,0],[0,c]]/5;
    q = [[0,3],[0,1],[-2,1],[-2,5],[2,5],
         [2,9],[-2,9],[-2,7],[0,7]
    ]*[[a,0],[0,c]]/5;
    for(i=[1:len(p)-1]) line(p[i-1],p[i],kerf);
    for(i=[1:len(q)-1]) line(q[i-1],q[i],kerf);
}
size = 20; // each square size
kerf = 0.5;
hinge(horRepeat=5, vertRepeat=3, patWidth=size, patHeight=2*size, border=20, align=size)
    translate([size/8,0]) koFACTORlab_flex(a=size,kerf=kerf);
Reply | Threaded
Open this post in threaded view
|

Re: Living Hinges

Neon22
This looking very good. Consider this pattern also if you like
http://www.thingiverse.com/thing:304177