Hexagon Hive
Moving beyond simple perforated patterns, three-dimensional hive structures create authentic honeycomb architectures where each hexagonal cell has both outer walls and inner cavities with varying heights. This technique generates true hive geometries with hollow chambers, combining the structural efficiency of hexagonal tessellation with the material optimization of cellular construction, perfect for lightweight yet strong architectural elements.
- 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": "83915d932f56669d",
"output": "result",
"data": {}
}
]
},
"nrHexagonsInHeight": {
"connections": [
{
"node": "83915d932f56669d",
"output": "result",
"data": {}
}
]
},
"scalePatternWidth": {
"connections": [
{
"node": "4ed29b0c955238af",
"output": "result",
"data": {}
}
]
},
"scalePatternHeight": {
"connections": [
{
"node": "4ed29b0c955238af",
"output": "result",
"data": {}
}
]
},
"width": {
"connections": [
{
"node": "9b913af6633165cc",
"output": "result",
"data": {}
}
]
},
"nrHexagonsInWidth": {
"connections": [
{
"node": "9b913af6633165cc",
"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": "83915d932f56669d",
"output": "result",
"data": {}
}
]
},
"nrHexagonsInHeight": {
"connections": [
{
"node": "83915d932f56669d",
"output": "result",
"data": {}
}
]
},
"width": {
"connections": [
{
"node": "9b913af6633165cc",
"output": "result",
"data": {}
}
]
},
"nrHexagonsInWidth": {
"connections": [
{
"node": "9b913af6633165cc",
"output": "result",
"data": {}
}
]
}
},
"position": [
448.68412062979235,
218.09572799029144
]
},
"83915d932f56669d": {
"id": "83915d932f56669d",
"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
]
},
"34df4b5bbef5a9ee": {
"id": "34df4b5bbef5a9ee",
"name": "bitbybit.lists.createList",
"customName": "create list",
"data": {},
"inputs": {
"listElements": {
"connections": [
{
"node": "54b4d97b2b80a6b4",
"output": "result",
"data": {}
},
{
"node": "4b403038a4dbdfc1",
"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": "34df4b5bbef5a9ee",
"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": "17fc75ad9466bcca",
"output": "result",
"data": {}
}
]
}
},
"position": [
2913.368866435809,
563.4565890118139
]
},
"17fc75ad9466bcca": {
"id": "17fc75ad9466bcca",
"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": "645a54e4c193e74d",
"output": "result",
"data": {}
}
]
}
},
"position": [
978.931222406734,
1054.1771714524514
]
},
"645a54e4c193e74d": {
"id": "645a54e4c193e74d",
"name": "bitbybit.lists.flatten",
"customName": "flatten",
"data": {
"nrLevels": 1
},
"inputs": {
"list": {
"connections": [
{
"node": "9d7f2a374387e996",
"output": "result",
"data": {}
}
]
}
},
"position": [
900.8858625142839,
1341.1035867980377
]
},
"4b403038a4dbdfc1": {
"id": "4b403038a4dbdfc1",
"name": "bitbybit.lists.createList",
"customName": "create list",
"data": {},
"inputs": {
"listElements": {
"connections": [
{
"node": "b3655b9d6636e686",
"output": "result",
"data": {}
}
]
}
},
"position": [
1361.3695932860264,
1189.332414328107
]
},
"83e9cdc232b6162a": {
"id": "83e9cdc232b6162a",
"name": "bitbybit.occt.operations.extrude",
"customName": "extrude",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": true,
"flatten": 0,
"forceExecution": false
},
"direction": [
0,
1,
0
]
},
"inputs": {
"shape": {
"connections": [
{
"node": "d7a56661d006b9f3",
"output": "result",
"data": {}
}
]
},
"direction": {
"connections": [
{
"node": "007b9fe6982dfec3",
"output": "result",
"data": {}
}
]
}
},
"position": [
5172.068037519212,
567.18858262894
]
},
"41b6fb964df99c1b": {
"id": "41b6fb964df99c1b",
"name": "bitbybit.math.randomNumbers",
"customName": "random numbers",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"low": 1,
"high": 2,
"count": 10
},
"inputs": {
"count": {
"connections": [
{
"node": "e3b154579322c3df",
"output": "result",
"data": {}
}
]
}
},
"position": [
3492.8835781303237,
921.0140370288448
]
},
"e3b154579322c3df": {
"id": "e3b154579322c3df",
"name": "bitbybit.lists.listLength",
"customName": "list length",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"clone": true
},
"inputs": {
"list": {
"connections": [
{
"node": "ad3b8cc4c7ffaf5c",
"output": "result",
"data": {}
}
]
}
},
"position": [
2897.367428373892,
991.8037505420762
]
},
"007b9fe6982dfec3": {
"id": "007b9fe6982dfec3",
"name": "bitbybit.vector.vectorXYZ",
"customName": "vector xyz",
"async": false,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"x": 0,
"y": 0,
"z": 0
},
"inputs": {
"y": {
"connections": [
{
"node": "b99aa870626cd122",
"output": "result",
"data": {}
}
]
}
},
"position": [
4234.795040308072,
883.9331793713577
]
},
"b99aa870626cd122": {
"id": "b99aa870626cd122",
"name": "bitbybit.lists.flatten",
"customName": "flatten",
"data": {
"nrLevels": 1
},
"inputs": {
"list": {
"connections": [
{
"node": "41b6fb964df99c1b",
"output": "result",
"data": {}
}
]
}
},
"position": [
3857.297601685031,
958.5754091575557
]
},
"26b1994cbd1d2ca5": {
"id": "26b1994cbd1d2ca5",
"name": "bitbybit.occt.shapes.compound.makeCompound",
"customName": "make compound",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"shapes": {
"connections": [
{
"node": "5acf591cefeb5fa3",
"output": "list",
"data": {}
}
]
}
},
"position": [
5901.056867903156,
563.7255663540807
]
},
"5acf591cefeb5fa3": {
"id": "5acf591cefeb5fa3",
"name": "bitbybit.lists.createList",
"customName": "create list",
"data": {},
"inputs": {
"listElements": {
"connections": [
{
"node": "83e9cdc232b6162a",
"output": "result",
"data": {}
}
]
}
},
"position": [
5536.355760133505,
606.9168572958389
]
},
"9b913af6633165cc": {
"id": "9b913af6633165cc",
"name": "bitbybit.math.numberSlider",
"customName": "number slider",
"data": {
"number": 10
},
"inputs": {},
"position": [
-206.3776992839153,
435.6353284888108
]
}
}
}
<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">hexagons3D</variable><variable id="f/$E)[H-PLX@e%@yf{V?">i</variable><variable id="Nsd?_5DiQ^O2eD|:1`{I">compoundShapeForFastRendering</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.8</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.8</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">hexagons3D</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">hexagons3D</field></block></value><value name="TO"><block type="bitbybit.occt.operations.extrude" id="u+V]xJq#8w#d~UnMa$:2"><value name="Shape"><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><value name="Direction"><block type="bitbybit.vector.vectorXYZ" id="B$)Q:(d-*v*k7^DGB!8d"><value name="X"><block type="math_number" id="F,Wbk.T(];CO]^Z-$vQS"><field name="NUM">0</field></block></value><value name="Y"><block type="lists_getIndex" id="^}0mI;@XkLiPK%_s#;/6"><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="W.vKmz1b+9g-0!DC})0P"><field name="VAR" id="gp%SQ{HW_=TfWheCvN6B">randomHeights</field></block></value><value name="AT"><block type="variables_get" id="`u2CWr!5Wo/{j3HP(joQ"><field name="VAR" id="f/$E)[H-PLX@e%@yf{V?">i</field></block></value></block></value><value name="Z"><block type="math_number" id="9b_at7bnLs2QDtEF=.HE"><field name="NUM">0</field></block></value></block></value></block></value></block></statement><next><block type="variables_set" id="({S]_`jF/a1qSLN$?[HY"><field name="VAR" id="Nsd?_5DiQ^O2eD|:1`{I">compoundShapeForFastRendering</field><value name="VALUE"><block type="bitbybit.occt.shapes.compound.makeCompound" id="*HR;%nI9cm*%5$r#w=sF"><value name="Shapes"><block type="variables_get" id="Th,Gn@VLVkw}|`.ThqF^"><field name="VAR" id="@1r](rB/p`W*Ql7T)^4m">hexagons3D</field></block></value></block></value><next><block type="bitbybit.draw.drawAnyAsyncNoReturn" id="KwX^KPI(qMWh_j|AtPMT"><value name="Entity"><block type="variables_get" id="XfQixL}$~h(O*zP+kAh9"><field name="VAR" id="Nsd?_5DiQ^O2eD|:1`{I">compoundShapeForFastRendering</field></block></value></block></next></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, CompoundShapesDto, ShapeDto } = Bit.Inputs.OCCT;
// Import type definitions for type safety
type TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;
type TopoDSFacePointer = Bit.Inputs.OCCT.TopoDSFacePointer;
type TopoDSSolidPointer = Bit.Inputs.OCCT.TopoDSSolidPointer;
// Get access to OCCT modules and utilities
const { wire, face, compound } = bitbybit.occt.shapes;
const { operations } = bitbybit.occt;
const { math } = bitbybit;
// Define the main function to create a three-dimensional 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;
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.scalePatternWidth = [0.8];
hexGridSmallOptions.scalePatternHeight = [0.8];
const wiresHexSmall = await wire.hexagonsInGrid(hexGridSmallOptions);
// Generate random heights for each hexagon cell
const randomHeights = math.randomNumbers({
low: 1,
high: 2,
count: wiresHexLarge.length
});
// Process each hexagon to create 3D cells with holes
const hexagons3D: TopoDSSolidPointer[] = [];
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);
// Extrude the face with random height
const extrudeOptions = new ExtrudeDto<TopoDSFacePointer>();
extrudeOptions.shape = hexFaceWithHole;
extrudeOptions.direction = [0, randomHeights[i], 0];
const extrudedCell = await operations.extrude(extrudeOptions);
hexagons3D.push(extrudedCell);
}
// Combine all extruded cells into a compound shape for fast rendering
const compoundOptions = new CompoundShapesDto<TopoDSSolidPointer>();
compoundOptions.shapes = hexagons3D;
const compoundShapeForFastRendering = await compound.makeCompound(compoundOptions);
// Draw the resulting three-dimensional hive structure
bitbybit.draw.drawAnyAsync({
entity: compoundShapeForFastRendering
});
}
// Execute the function
start();
Understanding Three-Dimensional Hive Construction
The hexagon hive technique represents a sophisticated evolution of flat honeycomb patterns. Instead of creating simple perforations, this approach generates individual hexagonal cells that can be independently manipulated in three dimensions. Each cell becomes a discrete element with its own height, creating complex topographical landscapes that maintain the structural efficiency of hexagonal geometry.
This hollow hive method is particularly powerful for:
- Lightweight structural elements with maximum strength-to-weight ratios
- Architectural facades with natural ventilation and thermal regulation
- Acoustic panels with controlled sound absorption through hollow chambers
- Biomimetic designs that authentically replicate natural honeycomb structures
- Material-efficient construction reducing weight while maintaining structural integrity
- Artistic installations exploring the interplay of solid and void
Key Components of Hive Generation
Hexagonal Grid Foundation
The process begins with hexagonsInGrid, which creates a structured array of hexagonal wire elements:
- Grid Dimensions:
widthandheightdefine the overall area - Cell Density:
nrHexagonsInWidthandnrHexagonsInHeightcontrol subdivision - Orientation:
flatTopparameter affects the hexagon orientation and packing - Edge Behavior: Extension parameters control how the pattern handles boundaries
Individual Cell Processing
Unlike simple perforated patterns, authentic hive construction creates hollow chambers with walls:
- Dual Grid Generation: Large hexagons form outer walls, smaller scaled hexagons create inner cavities
- Face with Hole Creation: Each cell combines outer and reversed inner wires to form faces with holes
- Height Assignment: Random or controlled heights are assigned to each hollow cell
- Independent Extrusion: Each face with hole is extruded to create hollow chambers
- Compound Assembly: All hollow cells are combined into a unified hive structure
Controlled Randomization
The random height generation is a critical aspect that creates organic complexity:
// Note: These are pseudo code examples for illustration
// Controlled random variation
const subtleVariation = math.randomNumbers({ low: 0.8, high: 1.2, count: cellCount });
// Dramatic height differences
const dramaticVariation = math.randomNumbers({ low: 0.2, high: 4.0, count: cellCount });
// Biased toward specific ranges
const biasedHeights = math.randomNumbers({ low: 1.5, high: 2.5, count: cellCount });
Advanced Hive Design Strategies
Gradient-Based Height Control
Instead of pure randomization, you can create sophisticated gradient effects:
// Note: These are pseudo code examples for conceptual illustration
// Radial gradient from center
const createRadialGradient = (faces, minHeight, maxHeight) => {
const center = [gridWidth/2, 0, gridHeight/2];
return faces.map((face, index) => {
const distance = calculateDistanceFromCenter(face, center);
const normalizedDistance = distance / maxRadius;
return minHeight + (maxHeight - minHeight) * normalizedDistance;
});
};
// Wave-like patterns
const createWavePattern = (faces, amplitude, frequency) => {
return faces.map((face, index) => {
const position = getFacePosition(face);
const wave = Math.sin(position.x * frequency) * Math.cos(position.z * frequency);
return baseHeight + amplitude * wave;
});
};
Conclusion
The hexagon hive technique demonstrates how parametric design can create sophisticated three-dimensional structures that balance geometric order with organic variation. By generating hollow chambers with controlled random heights, this method produces authentic honeycomb architectures that are both structurally efficient and visually compelling.
The dual-grid approach—combining outer walls with inner cavities—enables the creation of lightweight yet strong elements suitable for architectural facades, acoustic panels, and biomimetic installations. The parametric nature of the system ensures adaptability across different scales and applications while maintaining the fundamental efficiency of hexagonal tessellation.
This technique bridges computational design with natural patterns, offering architects and designers a powerful tool for creating structures that are simultaneously systematic and organic, efficient and expressive.



