3D printing project need help with a pattern

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

3D printing project need help with a pattern

BaiErol



Hello, everyone
I have a problem with something. I need to make a honeybee foundation for 3D printing. I had already done the honeycomb part of my project to OpenSCAD but i face difficulties when i try to make the foundation.The foundation consists of a hexagon that has to bottom of it cut with a cube or something( still cant figure out the shape that needs to be cut from) that creates 3 faces at an angle pointing towards the center of the hexagon. I have uploaded an image on a plastic honeycomb foundation. What is the method i will have to use to create that foundation?
Here is the code for the honeycomb cells, someone might find it useful or you guys might give me pointers on how to optimize the code. I started using OpenSCAD last week for the first time so don't judge me too harsh.
Thanks in advance.

$fn= 6;
a = 2.658;
y = 6.3;
d = 7.3;
row = 16;
column = 38;

difference()
{
difference()                //outer frame
{
        minkowski()
        {
color( [ 255/255, 0/255, 0/255 ] )
translate( [ 135.5 , -96, 0.001 ] )
cube( [ 301, 216, 12 ], center = true ); //compensated dimentions for the R2 fillet on the next line
                cylinder( h = 0.0001, d = 4, $fn = 200, center = true);
        }
        minkowski()
        {
translate( [ 135.5 , -96, 6.6 ] )
cube( [ 277, 210, 11 ], center = true );//compensated dimentions for the R2 fillet on the next line
                cylinder( h = 0.0001, d = 4, $fn = 200, center = true );
        }
}


//holes on the left
//first hole from the top
translate( [ -12, 1, -1] )
rotate( [ 90, 0, 90 ] )
cylinder( h = 11, d = 3.6, $fn = 200, center = true );
//square instert
translate( [ -10, 1, -1.5 ] )
cube( [ 2.6, 6, 9 ], center = true);

//second hole from the top
translate( [ -12, -49, -1] )
rotate( [ 90, 0, 90 ] )
cylinder( h = 11, d = 3.6, $fn = 200, center = true );
//square instert
translate( [ -10, -49, -1.5 ] )
cube( [ 2.6, 6, 9 ], center = true);

//third hole form the top
translate( [ -12, -113, -1] )
rotate( [ 90, 0, 90 ] )
cylinder( h = 11, d = 3.6, $fn = 200, center = true );

//square instert
translate( [ -10, -113, -1.5 ] )
cube( [ 2.6, 6, 9 ], center = true);

//fourth hole form the top
translate( [ -12, -163, -1] )
rotate( [ 90, 0, 90 ] )
cylinder( h = 11, d = 3.6, $fn = 200, center = true );

//square instert
translate( [ -10, -163, -1.5 ] )
cube( [ 2.6, 6, 9 ], center = true);

//holes on the right
//first hole from the top
translate( [ 282.6, 1, -1] )
rotate( [ 90, 0, 90 ] )
cylinder( h = 11, d = 3.6, $fn = 200, center = true );

//square instert
translate( [ 282.6, 1, -1.5 ] )
cube( [ 2.6, 6, 9 ], center = true);

//second hole from the top
translate( [ 282.6, -49, -1] )
rotate( [ 90, 0, 90 ] )
cylinder( h = 11, d = 3.6, $fn = 200, center = true );

//square instert
translate( [ 282.6, -49, -1.5 ] )
cube( [ 2.6, 6, 9 ], center = true);

//third hole from the top
translate( [ 282.6, -113, -1] )
rotate( [ 90, 0, 90 ] )
cylinder( h = 11, d = 3.6, $fn = 200, center = true );

//square instert
translate( [ 282.6, -113, -1.5 ] )
cube( [ 2.6, 6, 9 ], center = true);

//fourth hole from the top
translate( [ 282.6, -163, -1] )
rotate( [ 90, 0, 90 ] )
cylinder( h = 11, d = 3.6, $fn = 200, center = true );

//square instert
translate( [ 282.6, -163, -1.5 ] )
cube( [ 2.6, 6, 9 ], center = true);

//shroud hole first from the top LEFT
translate( [ -11, -10.5, 0] )
rotate( [ 0, 0, 0 ] )
cylinder( h = 13, d = 3.6, $fn = 200, center = true );

//square insert
translate( [ -11, -10.5, -3] )
cube( [ 6, 6, 7] , center = true );

//shroud hole second from the top LEFT
translate( [ -11, -90.5, 0] )
rotate( [ 0, 0, 0 ] )
cylinder( h = 13, d = 3.6, $fn = 200, center = true );

//square insert
translate( [ -11, -90.5, -3] )
cube( [ 6, 6, 7] , center = true );

//shroud hole third from the top LEFT
translate( [ -11, -175.5, 0] )
rotate( [ 0, 0, 0 ] )
cylinder( h = 13, d = 3.6, $fn = 200, center = true );

//square insert
translate( [ -11, -175.5, -3] )
cube( [ 6, 6, 7] , center = true );

//+1 hole just in case
translate( [ -11, -198, 0] )
rotate( [ 0, 0, 0 ] )
cylinder( h = 13, d = 3.6, $fn = 200, center = true );

//square insert
translate( [ -11, -198, -3] )
cube( [ 6, 6, 7] , center = true );

//shroud hole first from the top RIGHT
translate( [ 282, -10.5, 0] )
rotate( [ 0, 0, 0 ] )
cylinder( h = 13, d = 3.6, $fn = 200, center = true );

//square insert
translate( [ 282, -10.5, -3] )
cube( [ 6, 6, 7] , center = true );

//shroud hole second from the top RIGHT
translate( [ 282, -90.5, 0] )
rotate( [ 0, 0, 0 ] )
cylinder( h = 13, d = 3.6, $fn = 200, center = true );

//square insert
translate( [ 282, -90.5, -3] )
cube( [ 6, 6, 7] , center = true );

//shroud hole third from the top RIGHT
translate( [ 282, -175.5, 0] )
rotate( [ 0, 0, 0 ] )
cylinder( h = 13, d = 3.6, $fn = 200, center = true );

//square insert
translate( [ 282, -175.5, -3] )
cube( [ 6, 6, 7] , center = true );

//+1 hole just in case
translate( [ 282, -198, 0] )
rotate( [ 0, 0, 0 ] )
cylinder( h = 13, d = 3.6, $fn = 200, center = true );

//square insert
translate( [ 282, -198, -3] )
cube( [ 6, 6, 7] , center = true );

//top hole
translate( [ -11, 10, 0 ] )
rotate( [ 90, 0 , 0 ] )
cylinder( h = 10, d = 3, $fn = 200, center = true );

translate( [ 282, 10, 0 ] )
rotate( [ 90, 0 , 0 ] )
cylinder( h = 10, d = 3, $fn = 200, center = true );

rectangular_array1( column, row, d,-12.644 )

hull()                  //first row of cells LOFT like function
{
translate( [ 0, 0, 0 ] )
translate( [ 0, 0, 2 ] )
rotate( [ 0, 0, 90 ] )
cylinder(  h = 0.001, d = 7.9, center = true );

translate( [ 0, 0, 0 ] )
translate( [ 0, -a, -7 ] )
rotate( [ 0, 0, 90 ] )
cylinder(  h = 0.001, d = 7.9, center = true );
}
;           // semi colon for the end of rectangular_array1 statemant


rectangular_array2( column -1 , row + 1, d, -12.644 )

hull()                  //second row of cells LOFT like function
{
translate( [ -d, 0, 2 ] )
translate( [ d + ( d / 2 ) , y, 0.001 ] )
rotate( [ 0, 0, 90 ] )
cylinder(  h = 0.001, d = 7.9, center = true ); //7.9 for ~6.9 from side to side cell

translate( [ -d, y, 0 ] )
translate( [ d +( d / 2 ), -a, -7 ] )
rotate( [ 0, 0, 90 ] )
cylinder(  h = 0.001, d = 7.9, center = true );    
}
;         // semi colon for the end of rectangular_array2 statemant
}




module rectangular_array1( rows, colum, distance1, distance2 )  
                //pattern rown 1
{
        for( k = [ 0: 1: rows - 1 ] )
        {
          for( j = [ 0: 1: colum - 1 ]) // start value,step value, end value
                {
                 translate( [ distance1 * k, distance2 * j ] )
                        children();
                }
        }
       
}  

module rectangular_array2( rows, colum, distance1, distance2 )
                //pattern row 2
{
        for( k = [ 0: 1: rows - 1 ] )
        {
          for( j = [ 0: 1: colum - 1 ]) // start value,step value, end value
                {
                 translate( [ distance1 * k, distance2 * j ] )
                        children();
                }
        }
       
module mirror_copy ( mirrorVector )
{
       children();
       mirror( mirrorVector ) children();
}
       
}  
 
Reply | Threaded
Open this post in threaded view
|

Re: 3D printing project need help with a pattern

David Eccles (gringer)
The top-down view makes it difficult to work out the structure underneath the honeycomb. Do you have an isometric-ish view, diagonally from the side, that makes it easier to see?

Here's my guess at a structure, based on images I've looked at online. This cuts a hexagonal cone out of the base plate:

cw=10; // cell width
cww=1; // cell wall width
bt=2; // base thickness
bbwt=1; // base bottom wall thickness
hct=2; // honeycomb thickness
hcw=120; // honeycomb width
hch=80; // honeycomb height
xw=0.4; // extrude width

// top honeycomb
translate([0,0,-xw]) linear_extrude(height=hct+xw) difference(){
  square([hcw, hch], center=true);
  for(x = [-(0.5*hcw/cw+1):(0.5*hcw/cw+1)]){
      for(y = [-(0.5*hch/cw+1):(0.5*hch/cw+1)]){
        translate([(y)%2*(cw/2) + x*cw,y*cw*cos(30)])
          rotate(30) circle(d=cw/cos(30)-cww, $fn=6);
      }
  }
}

// cutouts
difference(){
    translate([0,0,-bt/2]) cube([hcw,hch, bt], center=true); // base plate
    for(x = [-(0.5*hcw/cw+1):(0.5*hcw/cw+1)]){
        for(y = [-(0.5*hch/cw+1):(0.5*hch/cw+1)]){
            translate([(y)%2*(cw/2) + x*cw,y*cw*cos(30)]) hull(){
                rotate(30) translate([0,0,-bt+bbwt])
                    cylinder(h=bt-bbwt+xw/10, d1=0, d2=cw/cos(30)-cww/2-xw, $fn=6);
            }
        }
    }
}

Reply | Threaded
Open this post in threaded view
|

Re: 3D printing project need help with a pattern

BaiErol
This post was updated on .
Hello, David
Thank you for the rapid response. It's almost what i need but this is not the exact shape of the bottom of the cell. I usually would do this with a chamfer in Fusion360 for example but the program crashes that's why i started using OpenSCAD. Here is a picture of a plastic bee hive frame. I need only the sloped sides of the bottom of the cell not the extruded cells in my project they are separate components.

 


Just for the sake of optimization would you change anything about the previous code i have posted?
Thanks in advance.
Reply | Threaded
Open this post in threaded view
|

Re: 3D printing project need help with a pattern

David Eccles (gringer)
Thanks, that image is very helpful. Just a small clarification, are those rhombus-like faces flat?

> Just for the sake of optimization would you change anything about the previous code i have posted?
Thanks in advance.

Yeah, I'd try to find some way to do it without the minkowski sums. Minkowski is very slow, especially with objects that have lots of points in them. Also, try to do things in 2D where possible, as those are much quicker operations.

You might find the offset function useful, which allows you to inset/outset 2D shapes with a radius at the points.
Reply | Threaded
Open this post in threaded view
|

Re: 3D printing project need help with a pattern

MichaelAtOz
Administrator
Please read the first pinned post, posts here will not generally get seen so people won't see them.
You may want to post the above message as an email to the Mailing-list.
OpenSCAD Admin - email* me if you need anything, or if I've done something stupid...
* on the Forum, 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.