Hexagon Hive Flat
Flat hexagon hive construction creates optimized honeycomb panels by treating the entire pattern as a unified surface rather than individual cells. This approach generates continuous surfaces with integrated holes, making it ideal for manufacturing processes like laser cutting, CNC machining, or large-scale 3D printing where single-piece construction is preferred over assembled components.
- Rete
- Blockly
- TypeScript
{
"id": "rete-v2-json",
"nodes": {
"9d7f2a374387e996": {
"id": "9d7f2a374387e996",
"name": "bitbybit.occt.shapes.wire.hexagonsInGrid",
"customName": "hexagons in grid",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"width": 10,
"height": 10,
"nrHexagonsInWidth": 10,
"nrHexagonsInHeight": 10,
"flatTop": false,
"extendTop": false,
"extendBottom": false,
"extendLeft": false,
"extendRight": false
},
"inputs": {
"height": {
"connections": [
{
"node": "ccede5d93d4fda6c",
"output": "result",
"data": {}
}
]
},
"nrHexagonsInHeight": {
"connections": [
{
"node": "ccede5d93d4fda6c",
"output": "result",
"data": {}
}
]
},
"scalePatternWidth": {
"connections": [
{
"node": "4ed29b0c955238af",
"output": "result",
"data": {}
}
]
},
"scalePatternHeight": {
"connections": [
{
"node": "4ed29b0c955238af",
"output": "result",
"data": {}
}
]
},
"width": {
"connections": [
{
"node": "2e5dba84fe5ba9b1",
"output": "result",
"data": {}
}
]
},
"nrHexagonsInWidth": {
"connections": [
{
"node": "2e5dba84fe5ba9b1",
"output": "result",
"data": {}
}
]
}
},
"position": [
458.816051804341,
982.9791386898194
]
},
"54b4d97b2b80a6b4": {
"id": "54b4d97b2b80a6b4",
"name": "bitbybit.occt.shapes.wire.hexagonsInGrid",
"customName": "hexagons in grid",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"width": 10,
"height": 10,
"nrHexagonsInWidth": 10,
"nrHexagonsInHeight": 10,
"flatTop": false,
"extendTop": false,
"extendBottom": false,
"extendLeft": false,
"extendRight": false
},
"inputs": {
"height": {
"connections": [
{
"node": "ccede5d93d4fda6c",
"output": "result",
"data": {}
}
]
},
"nrHexagonsInHeight": {
"connections": [
{
"node": "ccede5d93d4fda6c",
"output": "result",
"data": {}
}
]
},
"width": {
"connections": [
{
"node": "2e5dba84fe5ba9b1",
"output": "result",
"data": {}
}
]
},
"nrHexagonsInWidth": {
"connections": [
{
"node": "2e5dba84fe5ba9b1",
"output": "result",
"data": {}
}
]
}
},
"position": [
448.68412062979235,
218.09572799029144
]
},
"ccede5d93d4fda6c": {
"id": "ccede5d93d4fda6c",
"name": "bitbybit.math.numberSlider",
"customName": "number slider",
"data": {
"options": {
"min": 10,
"max": 20,
"step": 1,
"width": 350,
"updateOnDrag": false
},
"number": 20
},
"inputs": {},
"position": [
-209.6659222820727,
614.5935332494847
]
},
"4ed29b0c955238af": {
"id": "4ed29b0c955238af",
"name": "bitbybit.json.parse",
"customName": "parse",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"text": "[0.7]"
},
"inputs": {},
"position": [
68.21418665133817,
1360.5313330836511
]
},
"4be0b46dac54c760": {
"id": "4be0b46dac54c760",
"name": "bitbybit.lists.createList",
"customName": "create list",
"data": {},
"inputs": {
"listElements": {
"connections": [
{
"node": "54b4d97b2b80a6b4",
"output": "result",
"data": {}
},
{
"node": "e1a0d376c0b7fbe3",
"output": "list",
"data": {}
}
]
}
},
"position": [
1783.7274173750163,
604.187955094538
]
},
"ad3b8cc4c7ffaf5c": {
"id": "ad3b8cc4c7ffaf5c",
"name": "bitbybit.lists.flipLists",
"customName": "flip lists",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"clone": true
},
"inputs": {
"list": {
"connections": [
{
"node": "4be0b46dac54c760",
"output": "list",
"data": {}
}
]
}
},
"position": [
2173.1037052193133,
567.4874119121739
]
},
"d7a56661d006b9f3": {
"id": "d7a56661d006b9f3",
"name": "bitbybit.occt.shapes.face.createFaceFromWires",
"customName": "face from wires",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"planar": true
},
"inputs": {
"shapes": {
"connections": [
{
"node": "fb34fc4ceb2ec38c",
"output": "result",
"data": {}
}
]
}
},
"position": [
2913.368866435809,
563.4565890118139
]
},
"fb34fc4ceb2ec38c": {
"id": "fb34fc4ceb2ec38c",
"name": "bitbybit.lists.flatten",
"customName": "flatten",
"data": {
"nrLevels": 1
},
"inputs": {
"list": {
"connections": [
{
"node": "ad3b8cc4c7ffaf5c",
"output": "result",
"data": {}
}
]
}
},
"position": [
2548.035531544265,
604.1710127203966
]
},
"b3655b9d6636e686": {
"id": "b3655b9d6636e686",
"name": "bitbybit.occt.shapes.wire.reversedWire",
"customName": "reversed wire",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"shape": {
"connections": [
{
"node": "ab9f85d67feff27d",
"output": "result",
"data": {}
}
]
}
},
"position": [
978.931222406734,
1054.1771714524514
]
},
"ab9f85d67feff27d": {
"id": "ab9f85d67feff27d",
"name": "bitbybit.lists.flatten",
"customName": "flatten",
"data": {
"nrLevels": 1
},
"inputs": {
"list": {
"connections": [
{
"node": "9d7f2a374387e996",
"output": "result",
"data": {}
}
]
}
},
"position": [
900.8858625142839,
1341.1035867980377
]
},
"e1a0d376c0b7fbe3": {
"id": "e1a0d376c0b7fbe3",
"name": "bitbybit.lists.createList",
"customName": "create list",
"data": {},
"inputs": {
"listElements": {
"connections": [
{
"node": "b3655b9d6636e686",
"output": "result",
"data": {}
}
]
}
},
"position": [
1361.3695932860264,
1189.332414328107
]
},
"2e5dba84fe5ba9b1": {
"id": "2e5dba84fe5ba9b1",
"name": "bitbybit.math.numberSlider",
"customName": "number slider",
"data": {
"number": 10
},
"inputs": {},
"position": [
-206.3776992839153,
435.6353284888108
]
},
"fb5b17a682edda6f": {
"id": "fb5b17a682edda6f",
"name": "bitbybit.occt.shapes.shell.sewFaces",
"customName": "sew faces",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"tolerance": 1e-7
},
"inputs": {
"shapes": {
"connections": [
{
"node": "3767b2373c379628",
"output": "list",
"data": {}
}
]
}
},
"position": [
3648.8567044264146,
562.075547503597
]
},
"3767b2373c379628": {
"id": "3767b2373c379628",
"name": "bitbybit.lists.createList",
"customName": "create list",
"data": {},
"inputs": {
"listElements": {
"connections": [
{
"node": "d7a56661d006b9f3",
"output": "result",
"data": {}
}
]
}
},
"position": [
3279.4985473123206,
602.0254590303489
]
},
"5d828f69929a7f6b": {
"id": "5d828f69929a7f6b",
"name": "bitbybit.occt.operations.extrude",
"customName": "extrude",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"direction": [
0,
1,
0
]
},
"inputs": {
"shape": {
"connections": [
{
"node": "f0c6ae1e036c3586",
"output": "result",
"data": {}
}
]
}
},
"position": [
4403.343377860639,
559.1776924343567
]
},
"f0c6ae1e036c3586": {
"id": "f0c6ae1e036c3586",
"name": "bitbybit.occt.shapes.shape.unifySameDomain",
"customName": "unify same domain",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"unifyEdges": true,
"unifyFaces": true,
"concatBSplines": true
},
"inputs": {
"shape": {
"connections": [
{
"node": "fb5b17a682edda6f",
"output": "result",
"data": {}
}
]
}
},
"position": [
4026.418995605226,
561.3925803650337
]
}
}
}
<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="2lmH)6s_lH:6ak^}:2n=">width</variable><variable id="+_^TTwC`M56pew!CZ~-k">height</variable><variable id=",|%.U$vOBI@X1(xN7/$P">nrHexWidth</variable><variable id="E6]et0PLz}hhjuKn=a3?">nrHexHeight</variable><variable id="vrB7DK_jX]~{UEC!?~5~">wiresHexLarge</variable><variable id="2M-(Os/W|k[5+SA:)lU/">wiresHexSmall</variable><variable id="gp%SQ{HW_=TfWheCvN6B">randomHeights</variable><variable id="@1r](rB/p`W*Ql7T)^4m">hexagonFaces</variable><variable id="f/$E)[H-PLX@e%@yf{V?">i</variable></variables><block type="variables_set" id=",|{6+69mk(Xn|Dpo{8O|" x="-464" y="-540"><field name="VAR" id="2lmH)6s_lH:6ak^}:2n=">width</field><value name="VALUE"><block type="math_number" id="07,[vHmlN){2Uh%8up4s"><field name="NUM">10</field></block></value><next><block type="variables_set" id="#~0]LX-r{lU#fLs?:bMR"><field name="VAR" id="+_^TTwC`M56pew!CZ~-k">height</field><value name="VALUE"><block type="math_number" id="rPC[gY1(74TroZ9h:=#+"><field name="NUM">20</field></block></value><next><block type="variables_set" id=";Gh_2kTw;+N,Ec..{~m{"><field name="VAR" id=",|%.U$vOBI@X1(xN7/$P">nrHexWidth</field><value name="VALUE"><block type="math_number" id="t.H,^-}a]_;`FSam(zal"><field name="NUM">10</field></block></value><next><block type="variables_set" id="Bg9#8o`9zl?eCQ?pIg9Z"><field name="VAR" id="E6]et0PLz}hhjuKn=a3?">nrHexHeight</field><value name="VALUE"><block type="math_number" id="QUYj7C8MPiuNznD0]p1V"><field name="NUM">20</field></block></value><next><block type="variables_set" id="tBOmIj.:c0ta$=LlR)fZ"><field name="VAR" id="vrB7DK_jX]~{UEC!?~5~">wiresHexLarge</field><value name="VALUE"><block type="base_time_await_return" id="o]p^nYHY933s#/U`?8So"><value name="Promise"><block type="bitbybit.occt.shapes.wire.hexagonsInGrid" id="3,zw,p(p18M6/gBd)}fz"><value name="Width"><block type="variables_get" id="{ntM~()ik-9Dz2[Ta)|C"><field name="VAR" id="2lmH)6s_lH:6ak^}:2n=">width</field></block></value><value name="Height"><block type="variables_get" id="Ni9O8MkJ?(Nf*)AM*08P"><field name="VAR" id="+_^TTwC`M56pew!CZ~-k">height</field></block></value><value name="NrHexagonsInWidth"><block type="variables_get" id="^},eIa2fchs3(-In4t6,"><field name="VAR" id=",|%.U$vOBI@X1(xN7/$P">nrHexWidth</field></block></value><value name="NrHexagonsInHeight"><block type="variables_get" id="ixY;!hvYq:t%@-%y/]$0"><field name="VAR" id="E6]et0PLz}hhjuKn=a3?">nrHexHeight</field></block></value><value name="FlatTop"><block type="logic_boolean" id="|RIYQ;FwnHks:HzoRMAA"><field name="BOOL">FALSE</field></block></value><value name="ExtendTop"><block type="logic_boolean" id="ts;(#B(%!fsX,XZqO=0z"><field name="BOOL">FALSE</field></block></value><value name="ExtendBottom"><block type="logic_boolean" id="d99#a12TwEA1r.A.[IUO"><field name="BOOL">FALSE</field></block></value><value name="ExtendLeft"><block type="logic_boolean" id="YT}hgG4w-TWu^7SP(o77"><field name="BOOL">FALSE</field></block></value><value name="ExtendRight"><block type="logic_boolean" id="e-.S:6*?,xTICl2F0W-t"><field name="BOOL">FALSE</field></block></value></block></value></block></value><next><block type="variables_set" id="]Z7P/7Ay2Ac^f^j;4BpH"><field name="VAR" id="2M-(Os/W|k[5+SA:)lU/">wiresHexSmall</field><value name="VALUE"><block type="base_time_await_return" id="p/w7TUe/:IjZu*?,7!sc"><value name="Promise"><block type="bitbybit.occt.shapes.wire.hexagonsInGrid" id="W${V{10[F3-`*F5^9KNw"><value name="Width"><block type="variables_get" id="Oou}{kLA))Sus/d8rsoW"><field name="VAR" id="2lmH)6s_lH:6ak^}:2n=">width</field></block></value><value name="Height"><block type="variables_get" id="+}Q^ktzG*ZcyXsTo,^X,"><field name="VAR" id="+_^TTwC`M56pew!CZ~-k">height</field></block></value><value name="NrHexagonsInWidth"><block type="variables_get" id="%d|.9l=}~{#AEaMf$-@b"><field name="VAR" id=",|%.U$vOBI@X1(xN7/$P">nrHexWidth</field></block></value><value name="NrHexagonsInHeight"><block type="variables_get" id="ev!Id/a2j:BY14LH1DwJ"><field name="VAR" id="E6]et0PLz}hhjuKn=a3?">nrHexHeight</field></block></value><value name="FlatTop"><block type="logic_boolean" id="6eUjXs)7oFL]UOnyCF~k"><field name="BOOL">FALSE</field></block></value><value name="ExtendTop"><block type="logic_boolean" id="9nhxVCLHZJx3kR#fm~e-"><field name="BOOL">FALSE</field></block></value><value name="ExtendBottom"><block type="logic_boolean" id="T0R*LID8ih]L1jN%N/w{"><field name="BOOL">FALSE</field></block></value><value name="ExtendLeft"><block type="logic_boolean" id="CJzT[iypLp1UICY.B8Y]"><field name="BOOL">FALSE</field></block></value><value name="ExtendRight"><block type="logic_boolean" id="}-KZAFY}m!691s8L{;h5"><field name="BOOL">FALSE</field></block></value><value name="ScalePatternWidth"><block type="lists_create_with" id="cmGU`@lo=%I`#x9L{8qe"><mutation items="1"></mutation><value name="ADD0"><block type="math_number" id="Um@r/4D9#?MKXv!=K.;R"><field name="NUM">0.7</field></block></value></block></value><value name="ScalePatternHeight"><block type="lists_create_with" id="ODA_NGn9aLo[b9UGfM|n"><mutation items="1"></mutation><value name="ADD0"><block type="math_number" id="}vknrQg/YE}u-@a$21A4"><field name="NUM">0.7</field></block></value></block></value></block></value></block></value><next><block type="variables_set" id="ajW!:)7ILclqQ4X{Zl;e"><field name="VAR" id="gp%SQ{HW_=TfWheCvN6B">randomHeights</field><value name="VALUE"><block type="bitbybit.math.randomNumbers" id="2;e-K8!uM]SvW?R@a2R#"><value name="Low"><block type="math_number" id="cFUA9/Yj$f*8`oCA(5HT"><field name="NUM">1</field></block></value><value name="High"><block type="math_number" id="yeT*J:E4GI6QmLLaZu+c"><field name="NUM">2</field></block></value><value name="Count"><block type="lists_length" id="jG,0X2Cs)Fwxq=xots2}"><value name="VALUE"><block type="variables_get" id="hD#?$#@GL(Fo5$KWt4lz"><field name="VAR" id="vrB7DK_jX]~{UEC!?~5~">wiresHexLarge</field></block></value></block></value></block></value><next><block type="variables_set" id=":a[$}dwODhG-i9kvY=Fc"><field name="VAR" id="@1r](rB/p`W*Ql7T)^4m">hexagonFaces</field><value name="VALUE"><block type="lists_create_with" id="=S(PamVb5@CiN#iW=0^4"><mutation items="0"></mutation></block></value><next><block type="controls_for" id="it6|Bu1MdT#}u*5%DR}n"><field name="VAR" id="f/$E)[H-PLX@e%@yf{V?">i</field><value name="FROM"><block type="math_number" id="]4=JtgV|Q]9ozf(8^@%|"><field name="NUM">1</field></block></value><value name="TO"><block type="lists_length" id="Xk0TDDAX,uf)]-v,518N"><value name="VALUE"><block type="variables_get" id="7p-2`Lg:v-}Gr8UZ}8:("><field name="VAR" id="vrB7DK_jX]~{UEC!?~5~">wiresHexLarge</field></block></value></block></value><value name="BY"><block type="math_number" id=":c$W()D-zzS%AN3Ndz,U"><field name="NUM">1</field></block></value><statement name="DO"><block type="lists_setIndex" id="6rQ$E.BKj9NyQA@P1X5s"><mutation at="false"></mutation><field name="MODE">INSERT</field><field name="WHERE">LAST</field><value name="LIST"><block type="variables_get" id="vsJE2uf9ZP[AKe_@Lw9c"><field name="VAR" id="@1r](rB/p`W*Ql7T)^4m">hexagonFaces</field></block></value><value name="TO"><block type="bitbybit.occt.shapes.face.createFaceFromWires" id="17}Pwsk#^!(w+ypbwZJx"><value name="Shapes"><block type="lists_create_with" id="{a!g2alH5Ksgl$,R!t1/"><mutation items="2"></mutation><value name="ADD0"><block type="lists_getIndex" id="nnOpWB]yHrvjgcPbMYlu"><mutation statement="false" at="true"></mutation><field name="MODE">GET</field><field name="WHERE">FROM_START</field><value name="VALUE"><block type="variables_get" id="*lBH[-l!{uE{PZ*2HFi-"><field name="VAR" id="vrB7DK_jX]~{UEC!?~5~">wiresHexLarge</field></block></value><value name="AT"><block type="variables_get" id="sqUA*D%/$7RZ=kGTxYlx"><field name="VAR" id="f/$E)[H-PLX@e%@yf{V?">i</field></block></value></block></value><value name="ADD1"><block type="bitbybit.occt.shapes.wire.reversedWire" id=",Y[[oy4B-blbSBC4/N$d"><value name="Shape"><block type="lists_getIndex" id="|$4O$IX_u59e+U_LzUF]"><mutation statement="false" at="true"></mutation><field name="MODE">GET</field><field name="WHERE">FROM_START</field><value name="VALUE"><block type="variables_get" id="%X2sd~52VkN|VZV)0Xc^"><field name="VAR" id="2M-(Os/W|k[5+SA:)lU/">wiresHexSmall</field></block></value><value name="AT"><block type="variables_get" id="POq/.yh41$?_#Nv|Xns|"><field name="VAR" id="f/$E)[H-PLX@e%@yf{V?">i</field></block></value></block></value></block></value></block></value><value name="Planar"><block type="logic_boolean" id="it!fv3m6yZf{CqyGsVqS"><field name="BOOL">TRUE</field></block></value></block></value></block></statement><next><block type="bitbybit.draw.drawAnyAsyncNoReturn" id="KwX^KPI(qMWh_j|AtPMT"><value name="Entity"><block type="bitbybit.occt.operations.extrude" id="[9+/cXe5DYq}-pSI,$uk"><value name="Shape"><block type="bitbybit.occt.shapes.shape.unifySameDomain" id="YoB5[Dz}cuvFJrjsl|/3"><value name="Shape"><block type="bitbybit.occt.shapes.shell.sewFaces" id="T6Hka8-!meu5G3,xlD/g"><value name="Shapes"><block type="variables_get" id=";sc7cwqifdGF}wM1}HnP"><field name="VAR" id="@1r](rB/p`W*Ql7T)^4m">hexagonFaces</field></block></value><value name="Tolerance"><block type="math_number" id="Zy-NQ6(q@A0`RFJ-Y^P-"><field name="NUM">1e-7</field></block></value></block></value><value name="UnifyEdges"><block type="logic_boolean" id="l;hN}(1~yX$Kaf#Pq]Z:"><field name="BOOL">TRUE</field></block></value><value name="UnifyFaces"><block type="logic_boolean" id="kpjo.le9$Jjr$l(u=r`8"><field name="BOOL">TRUE</field></block></value><value name="ConcatBSplines"><block type="logic_boolean" id="`u+W2lwdoeRlhAT}@Y,5"><field name="BOOL">TRUE</field></block></value></block></value><value name="Direction"><block type="bitbybit.vector.vectorXYZ" id="R`Go3U_vr|y*_)mczigA"><value name="X"><block type="math_number" id="Z9h50#WgO7vEL4g;G|P@"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number" id="|1v+N.oC2@{o!ul{j7+V"><field name="NUM">1</field></block></value><value name="Z"><block type="math_number" id="%V}9Bpd*9)i%WsP2;]JJ"><field name="NUM">0</field></block></value></block></value></block></value></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></xml>
// Import required DTOs for hexagon grid creation and operations
const { HexagonsInGridDto, FaceFromWiresDto, ExtrudeDto, ShapesDto, SewDto, UnifySameDomainDto, ShapeDto } = Bit.Inputs.OCCT;
// Import type definitions for type safety
type TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;
type TopoDSFacePointer = Bit.Inputs.OCCT.TopoDSFacePointer;
type TopoDSShellPointer = Bit.Inputs.OCCT.TopoDSShellPointer;
type TopoDSSolidPointer = Bit.Inputs.OCCT.TopoDSSolidPointer;
// Get access to OCCT modules and utilities
const { wire, face, shell, shape } = bitbybit.occt.shapes;
const { operations } = bitbybit.occt;
const { math } = bitbybit;
// Define the main function to create a flat hexagon hive
const start = async () => {
// Create hexagonal grid parameters
const gridWidth = 10;
const gridHeight = 20;
const hexagonsInWidth = 10;
const hexagonsInHeight = 20;
// Generate large hexagonal wire grid (outer walls)
const hexGridLargeOptions = new HexagonsInGridDto();
hexGridLargeOptions.width = gridWidth;
hexGridLargeOptions.height = gridHeight;
hexGridLargeOptions.nrHexagonsInWidth = hexagonsInWidth;
hexGridLargeOptions.nrHexagonsInHeight = hexagonsInHeight;
hexGridLargeOptions.flatTop = false;
hexGridLargeOptions.extendTop = false;
hexGridLargeOptions.extendBottom = false;
hexGridLargeOptions.extendLeft = false;
hexGridLargeOptions.extendRight = false;
const wiresHexLarge = await wire.hexagonsInGrid(hexGridLargeOptions);
// Generate small hexagonal wire grid (inner holes)
const hexGridSmallOptions = new HexagonsInGridDto();
hexGridSmallOptions.width = gridWidth;
hexGridSmallOptions.height = gridHeight;
hexGridSmallOptions.nrHexagonsInWidth = hexagonsInWidth;
hexGridSmallOptions.nrHexagonsInHeight = hexagonsInHeight;
hexGridSmallOptions.flatTop = false;
hexGridSmallOptions.extendTop = false;
hexGridSmallOptions.extendBottom = false;
hexGridSmallOptions.extendLeft = false;
hexGridSmallOptions.extendRight = false;
hexGridSmallOptions.scalePatternWidth = [0.7];
hexGridSmallOptions.scalePatternHeight = [0.7];
const wiresHexSmall = await wire.hexagonsInGrid(hexGridSmallOptions);
// Generate random heights for creating individual faces
const randomHeights = math.randomNumbers({
low: 1,
high: 2,
count: wiresHexLarge.length
});
// Create faces with holes for each hexagon cell
const hexagonFaces: TopoDSFacePointer[] = [];
for (let i = 0; i < wiresHexLarge.length; i++) {
// Get the outer and inner wires for this cell
const outerWire = wiresHexLarge[i];
const innerWire = wiresHexSmall[i];
// Reverse the inner wire to create a hole
const reverseOptions = new ShapeDto<TopoDSWirePointer>();
reverseOptions.shape = innerWire;
const reversedInnerWire = await wire.reversedWire(reverseOptions);
// Create face with hole
const faceOptions = new FaceFromWiresDto<TopoDSWirePointer>();
faceOptions.shapes = [outerWire, reversedInnerWire];
faceOptions.planar = true;
const hexFaceWithHole = await face.createFaceFromWires(faceOptions);
hexagonFaces.push(hexFaceWithHole);
}
// Sew faces together
const sewOptions = new SewDto<TopoDSFacePointer>(hexagonFaces);
sewOptions.tolerance = 1e-7;
const sewedFaces = await shell.sewFaces(sewOptions);
// Unify same domain for cleaner geometry
const unifyOptions = new UnifySameDomainDto<TopoDSShellPointer>();
unifyOptions.shape = sewedFaces;
unifyOptions.unifyEdges = true;
unifyOptions.unifyFaces = true;
unifyOptions.concatBSplines = true;
const unifiedShape = await shape.unifySameDomain(unifyOptions);
// Extrude the unified shape
const extrudeOptions = new ExtrudeDto<TopoDSShellPointer>();
extrudeOptions.shape = unifiedShape;
extrudeOptions.direction = [0, 1, 0];
const extrudedHive = await operations.extrude(extrudeOptions);
// Draw the resulting flat hive structure
bitbybit.draw.drawAnyAsync({
entity: extrudedHive
});
}
// Execute the function
start();
Flat Hive Construction
Unlike individual cell approaches, flat hive construction treats the entire honeycomb pattern as a single, continuous surface. This method combines all hexagonal wires at once, sews the resulting faces together, and extrudes the unified structure as one piece.
Key Advantages
- Manufacturing Efficiency: Single continuous surface ideal for CNC machining and laser cutting
- Structural Integrity: No joints between cells, creating stronger unified panels
- Processing Speed: Reduces computational overhead by avoiding individual cell operations
- Clean Geometry: Face sewing and domain unification eliminate edge artifacts
Process Overview
- Dual Wire Generation: Create outer boundary and inner hole wire patterns
- Wire Reversal: Reverse inner wires to ensure proper hole orientation
- Unified Face Creation: Combine all wires into faces simultaneously
- Face Sewing: Join faces into a continuous shell structure
- Domain Unification: Clean up geometry by merging adjacent surfaces
- Single Extrusion: Extrude the entire unified surface at once
Conclusion
Flat hexagon hive construction optimizes honeycomb creation for manufacturing and structural applications. By treating the pattern as a unified surface rather than assembled components, this approach produces cleaner geometry, stronger structures, and more efficient manufacturing workflows. The method is particularly valuable for architectural panels, industrial components, and any application where single-piece construction is preferred over multi-part assembly.



