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.I know very little about the spreadsheet module, but perhaps it could be used?
All of the examples including OpenSCAD examples can be made as solids.All these arrays need to be trim(m)able
Can you share your .fcstd file and describe what you would like to achieve?My HoneyComb matrix looks good but blows up during bool operation.
Anyone have a version that is trimable?
Are you wanting to make something like a mold or press for wax foundations?bill wrote:I need it for actual bees.
Yea, that's one of the many things I don't know about spreadsheet. Thanks for the current info on it.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.
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.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!
Yes, very true.triplus wrote:Yes things can get a bit heavy with arrays/patterns.
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, corner).toShape(), # left Part.Line(corner, corner).toShape(), # top Part.Line(corner, corner).toShape(), # right Part.Line(corner, corner).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)