Honeycomb Array

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
User avatar
quick61
Veteran
Posts: 3803
Joined: Sat Aug 24, 2013 2:49 am
Location: u.S.A.

Re: Honeycomb Array

Post by quick61 »

A further note, to make the array fully parametric, the Array intervals would need to update with the changes in the two dimensions in the screenshot.
Honeycomb1.png
Honeycomb1.png (10.04 KiB) Viewed 3045 times
I know very little about the spreadsheet module, but perhaps it could be used?

Mark
This post made with 0.0% Micro$oft products - GOT LINUX?
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Honeycomb Array

Post by triplus »

I know very little about the spreadsheet module, but perhaps it could be used?
Yes once the concept of Spreadsheet PropertyController will be re-introduced in FreeCAD we will be able to use it again for cases like this. Like in my example where it would calculate and control that 2 formulas automatically instead of users calculating and setting properties manually.
All these arrays need to be trim(m)able
All of the examples including OpenSCAD examples can be made as solids.
My HoneyComb matrix looks good but blows up during bool operation.

Anyone have a version that is trimable?
Can you share your .fcstd file and describe what you would like to achieve?
User avatar
quick61
Veteran
Posts: 3803
Joined: Sat Aug 24, 2013 2:49 am
Location: u.S.A.

Re: Honeycomb Array

Post by quick61 »

bill wrote:I need it for actual bees. :shock:
Are you wanting to make something like a mold or press for wax foundations?
triplus wrote:Yes once the concept of Spreadsheet PropertyController will be re-introduced in FreeCAD we will be able to use it again for cases like this. Like in my example where it would calculate and control that 2 formulas automatically instead of users calculating and setting properties manually.
Yea, that's one of the many things I don't know about spreadsheet. :oops: Thanks for the current info on it.

Mark
This post made with 0.0% Micro$oft products - GOT LINUX?
User avatar
bill
Posts: 376
Joined: Fri Jan 09, 2015 9:25 pm

Re: Honeycomb Array

Post by bill »

Fuse did the trick!
However, the array size I need seems to be unmanageable (400mm by 400mm). Too long calc time and too large a file.
Anyways thanks mark and others!

I will use a less detailed proxy-object instead.

mark, btw, yes it is for hive foundations!

thanks
User avatar
quick61
Veteran
Posts: 3803
Joined: Sat Aug 24, 2013 2:49 am
Location: u.S.A.

Re: Honeycomb Array

Post by quick61 »

bill wrote:Fuse did the trick!
However, the array size I need seems to be unmanageable (400mm by 400mm). Too long calc time and too large a file.
Anyways thanks mark and others!

I will use a less detailed proxy-object instead.

mark, btw, yes it is for hive foundations!

thanks
Hi bill, maybe you could post a small section with the size hexagon and finished shape your wanting. There may be a better way to create the model that would be less CPU intensive.

Mark
This post made with 0.0% Micro$oft products - GOT LINUX?
User avatar
bill
Posts: 376
Joined: Fri Jan 09, 2015 9:25 pm

Re: Honeycomb Array

Post by bill »

I liked ulrichs approach, so that is what i tried to emulate!

Thanks in advance!
mycomb.FCStd
(382.12 KiB) Downloaded 101 times
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Honeycomb Array

Post by triplus »

Yes things can get a bit heavy with arrays/patterns. What i would do i would probably set up everything in a way i would only need to wait at the final stage(s). Or if i would know exactly what it is you are after maybe other solution could be used.

Could you make what you are after in smaller form for us to see what is the final (bigger) outcome you are after?
User avatar
bill
Posts: 376
Joined: Fri Jan 09, 2015 9:25 pm

Re: Honeycomb Array

Post by bill »

triplus wrote:Yes things can get a bit heavy with arrays/patterns.
Yes, very true.

I need a panel (square) of honeycomb, 360mm by 360mm by 2mm thick.

My machine will generate it eventually; takes a long time (seems to be a load on CPU) ; on the order of +5 minutes for each array. And the file size is over 5Mbytes. I be interested to see how long it takes to generate this size matrix on some else's machine?

I was hoping I was doing something wrong and there was a better approach; since this was the first time I had used ARRAYS in FreeCAD.

Thanks for your help!

bill
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Honeycomb Array

Post by triplus »

Will you make 2D DXF file for your machine? If the answer is yes i would do it in 2D (as faces). Focus only on "pocket faces" and array "pocket faces". After do a boolean cut between "array of pocket faces" and "rectangle face". That should in general work faster and should provide you what you need to get to 2D DXF file.

But if you need to create solid to perform additional modelling operation on it that just can't be done in 2D (can't it be done?) then you will have to produce a solid from that 2D face and that will take time.
ian.rees
Posts: 696
Joined: Sun Jun 15, 2014 3:28 am
Contact:

Re: Honeycomb Array

Post by ian.rees »

Here's another option Bill - I just banged this macro out for another project, before searching around with the right keywords apparently :). There are a couple parameters at the top that should be fairly self explanatory, it makes a 2D "Face" first, a 72x72 cell one took my computer (nothing special) probably 10-15 seconds to do.

Out of curiosity, have you read about "natural cells" at the Bush Farms site?

Seeing your handle reminded me about that placement thing from a couple months ago, will have a think about that and get it done soon hopefully. -Ian-

Code: Select all

import Part, FreeCAD
from FreeCAD import Base
from math import cos, sin, pi

rows = 10
cols = 10
cellWD = 4.9 # Calling this "wrench diameter" - inside distance between opposite flats
wallThickness = 0.5

# x and y are centre, counter-clockwise winding
def hexGenerator(x, y, radius):
    lastPt = Base.Vector( x + radius * cos(pi / -3.0),
                          y + radius * sin(pi / -3.0) )

    for p in xrange(6):
        nextPt = Base.Vector( x + radius * cos(p * pi / 3.0),
                              y + radius * sin(p * pi / 3.0) )
        yield Part.Line(lastPt, nextPt).toShape()
        lastPt = nextPt

xOff = (wallThickness + cellWD / 2.0) / cos(pi / 6.0)
yOff = cellWD / 2.0 + wallThickness

xDelta = (cellWD + wallThickness) * sin(pi / 3.0)
yDelta = cellWD + wallThickness

# Make a box to draw the whole thing in - I bet there's a utility for this...
# clockwise winding
boxHalfWidth = xOff + max(0, cols - 1) * xDelta / 2.0
boxHalfHeight = yOff + max(0, rows - 1) * yDelta / 2.0

corner = [ Base.Vector(-boxHalfWidth, boxHalfHeight), # top left
           Base.Vector(boxHalfWidth, boxHalfHeight), # top right
           Base.Vector(boxHalfWidth, -boxHalfHeight), # bottom right
           Base.Vector(-boxHalfWidth, -boxHalfHeight) ] # bottom left

box = Part.Wire([ Part.Line(corner[0], corner[3]).toShape(), # left
                  Part.Line(corner[1], corner[0]).toShape(), # top
                  Part.Line(corner[2], corner[1]).toShape(), # right
                  Part.Line(corner[3], corner[2]).toShape() ]) # bottom

# Centre on the origin
xOff -= boxHalfWidth
yOff -= boxHalfHeight

cellRad = (cellWD / 2.0) / cos(pi / 6.0)

faces = [box]
for col in xrange(cols):
    x = xOff + xDelta * col
    for row in xrange(rows - (col % 2)): # one less row on odd columns
        y = ( yOff + (col % 2) * (cellWD + wallThickness) / 2.0 + #offset
              yDelta * row ) #increment

        cell = Part.Wire([s for s in hexGenerator(x, y, cellRad)])
        faces.append(cell)


myObject = App.ActiveDocument.addObject("Part::Feature", "Honeycomb")

myObject.Shape = Part.Face(faces)

Post Reply