Frost Flower
❄️ Create a delicate 3D printable snowflake using interpolated curves and 12-fold rotational symmetry! This tutorial demonstrates how smooth B-spline curves and offset operations can create organic, nature-inspired shapes.
The algorithm:
- Define branch points - a simple zigzag pattern for one branch
- Interpolate a smooth curve - creates flowing organic lines
- Rotate 180° the branch to create bilateral symmetry
- Combine wires into a single branch pair
- Create outer and inner offsets - hollow structure for the branch
- Cut the inner face out of the outer one - a face from each offset, the inner one subtracted, leaves a hollow face
- Rotate copies at 30° intervals (0°, 30°, 60°, 90°, 120°, 150°) for 12-fold symmetry
- Boolean union to merge all faces into one shape
- Extrude the unified face to create a 3D solid

- Rete
- Blockly
- TypeScript
{
"id": "rete-v2-json",
"nodes": {
"branchPoints": {
"id": "branchPoints",
"name": "bitbybit.lists.createList",
"customName": "create list",
"async": false,
"drawable": false,
"data": {},
"inputs": {
"listElements": {
"connections": [
{
"node": "p1Center",
"output": "result",
"data": {}
},
{
"node": "p2",
"output": "result",
"data": {}
},
{
"node": "p3",
"output": "result",
"data": {}
},
{
"node": "p4",
"output": "result",
"data": {}
},
{
"node": "p5Tip",
"output": "result",
"data": {}
}
]
}
},
"position": [
-19,
-112
]
},
"p1Center": {
"id": "p1Center",
"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": {},
"position": [
-500,
-829
]
},
"p2": {
"id": "p2",
"name": "bitbybit.vector.vectorXYZ",
"customName": "vector xyz",
"async": false,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"x": 0.3,
"y": 1.5,
"z": 0
},
"inputs": {
"y": {
"connections": [
{
"node": "scaleP2",
"output": "result",
"data": {}
}
]
}
},
"position": [
-503,
-432
]
},
"p3": {
"id": "p3",
"name": "bitbybit.vector.vectorXYZ",
"customName": "vector xyz",
"async": false,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"x": -0.2,
"y": 2.5,
"z": 0
},
"inputs": {
"y": {
"connections": [
{
"node": "scaleP3",
"output": "result",
"data": {}
}
]
}
},
"position": [
-500,
-95
]
},
"p4": {
"id": "p4",
"name": "bitbybit.vector.vectorXYZ",
"customName": "vector xyz",
"async": false,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"x": 0.4,
"y": 3.5,
"z": 0
},
"inputs": {
"y": {
"connections": [
{
"node": "scaleP4",
"output": "result",
"data": {}
}
]
}
},
"position": [
-499,
241
]
},
"p5Tip": {
"id": "p5Tip",
"name": "bitbybit.vector.vectorXYZ",
"customName": "vector xyz",
"async": false,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"x": 0,
"y": 4,
"z": 0
},
"inputs": {
"y": {
"connections": [
{
"node": "scaleP5",
"output": "result",
"data": {}
}
]
}
},
"position": [
-501,
583
]
},
"scaleP2": {
"id": "scaleP2",
"name": "bitbybit.math.twoNrOperation",
"customName": "two nr operation",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"first": 1.5,
"second": 1,
"operation": "multiply"
},
"inputs": {
"second": {
"connections": [
{
"node": "size",
"output": "result",
"data": {}
}
]
}
},
"position": [
-901,
-394
]
},
"scaleP3": {
"id": "scaleP3",
"name": "bitbybit.math.twoNrOperation",
"customName": "two nr operation",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"first": 2.5,
"second": 1,
"operation": "multiply"
},
"inputs": {
"second": {
"connections": [
{
"node": "size",
"output": "result",
"data": {}
}
]
}
},
"position": [
-902,
-58
]
},
"scaleP4": {
"id": "scaleP4",
"name": "bitbybit.math.twoNrOperation",
"customName": "two nr operation",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"first": 3.5,
"second": 1,
"operation": "multiply"
},
"inputs": {
"second": {
"connections": [
{
"node": "size",
"output": "result",
"data": {}
}
]
}
},
"position": [
-902,
280
]
},
"scaleP5": {
"id": "scaleP5",
"name": "bitbybit.math.twoNrOperation",
"customName": "two nr operation",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"first": 4,
"second": 1,
"operation": "multiply"
},
"inputs": {
"second": {
"connections": [
{
"node": "size",
"output": "result",
"data": {}
}
]
}
},
"position": [
-904,
623
]
},
"size": {
"id": "size",
"name": "bitbybit.math.numberSlider",
"customName": "number slider",
"async": false,
"drawable": false,
"data": {
"options": {
"min": 0.5,
"max": 2,
"step": 0.1,
"width": 350,
"updateOnDrag": false
},
"number": 0.8
},
"inputs": {},
"position": [
-1606,
8
]
},
"branchWire": {
"id": "branchWire",
"name": "bitbybit.occt.shapes.wire.interpolatePoints",
"customName": "interpolate points",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"periodic": false,
"tolerance": 0.00001,
"parametrization": "chordLength"
},
"inputs": {
"points": {
"connections": [
{
"node": "branchPoints",
"output": "list",
"data": {}
}
]
}
},
"position": [
350,
-150
]
},
"branchPair": {
"id": "branchPair",
"name": "bitbybit.lists.createList",
"customName": "create list",
"async": false,
"drawable": false,
"data": {},
"inputs": {
"listElements": {
"connections": [
{
"node": "branchWire",
"output": "result",
"data": {}
},
{
"node": "rotate",
"output": "result",
"data": {}
}
]
}
},
"position": [
1291,
-283
]
},
"combinePair": {
"id": "combinePair",
"name": "bitbybit.occt.shapes.wire.combineEdgesAndWiresIntoAWire",
"customName": "combine edges and wires into a wire",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"shapes": {
"connections": [
{
"node": "branchPair",
"output": "list",
"data": {}
}
]
}
},
"position": [
1668,
-318
]
},
"iceMaterial": {
"id": "iceMaterial",
"name": "bitbybit.babylon.material.pbrMetallicRoughness.create",
"customName": "pbr metallic roughness",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"name": "Ice Material",
"baseColor": "#aed6f1",
"emissiveColor": "#5dade2",
"metallic": 0.1,
"roughness": 0.3,
"alpha": 1,
"backFaceCulling": false,
"zOffset": 2
},
"inputs": {},
"position": [
6178,
658
]
},
"rotate": {
"id": "rotate",
"name": "bitbybit.occt.transforms.rotate",
"customName": "rotate",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"axis": [
0,
0,
1
],
"angle": 180
},
"inputs": {
"shape": {
"connections": [
{
"node": "branchWire",
"output": "result",
"data": {}
}
]
},
"axis": {
"connections": [
{
"node": "vectorXyz",
"output": "result",
"data": {}
}
]
}
},
"position": [
815,
14
]
},
"vectorXyz": {
"id": "vectorXyz",
"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": 1
},
"inputs": {},
"position": [
354,
247
]
},
"span": {
"id": "span",
"name": "bitbybit.vector.span",
"customName": "span",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"step": 30,
"min": 0,
"max": 150
},
"inputs": {},
"position": [
3995,
542
]
},
"rotate2": {
"id": "rotate2",
"name": "bitbybit.occt.transforms.rotate",
"customName": "rotate",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"axis": [
0,
0,
1
],
"angle": 0
},
"inputs": {
"axis": {
"connections": [
{
"node": "vectorXyz2",
"output": "result",
"data": {}
}
]
},
"angle": {
"connections": [
{
"node": "flatten",
"output": "result",
"data": {}
}
]
},
"shape": {
"connections": [
{
"node": "hollowFace",
"output": "result",
"data": {}
}
]
}
},
"position": [
4835,
78
]
},
"vectorXyz2": {
"id": "vectorXyz2",
"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": 1
},
"inputs": {},
"position": [
3992,
204
]
},
"flatten": {
"id": "flatten",
"name": "bitbybit.lists.flatten",
"customName": "flatten",
"async": false,
"drawable": false,
"data": {
"nrLevels": 1
},
"inputs": {
"list": {
"connections": [
{
"node": "span",
"output": "result",
"data": {}
}
]
}
},
"position": [
4380,
578
]
},
"createList": {
"id": "createList",
"name": "bitbybit.lists.createList",
"customName": "create list",
"async": false,
"drawable": false,
"data": {},
"inputs": {
"listElements": {
"connections": [
{
"node": "rotate2",
"output": "result",
"data": {}
}
]
}
},
"position": [
5267,
118
]
},
"offset": {
"id": "offset",
"name": "bitbybit.occt.operations.offset",
"customName": "offset",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"distance": 0.2,
"tolerance": 0.1
},
"inputs": {
"shape": {
"connections": [
{
"node": "combinePair",
"output": "result",
"data": {}
}
]
}
},
"position": [
2234,
-106
]
},
"union": {
"id": "union",
"name": "bitbybit.occt.booleans.union",
"customName": "union",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"keepEdges": false,
"strategy": "oneAfterAnother"
},
"inputs": {
"shapes": {
"connections": [
{
"node": "createList",
"output": "list",
"data": {}
}
]
}
},
"position": [
5643,
79
]
},
"offset2": {
"id": "offset2",
"name": "bitbybit.occt.operations.offset",
"customName": "offset",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"distance": 0.4,
"tolerance": 0.1
},
"inputs": {
"shape": {
"connections": [
{
"node": "combinePair",
"output": "result",
"data": {}
}
]
}
},
"position": [
2234,
-562
]
},
"outerFace": {
"id": "outerFace",
"name": "bitbybit.occt.shapes.face.createFaceFromWire",
"customName": "face from wire",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"planar": true
},
"inputs": {
"shape": {
"connections": [
{
"node": "offset2",
"output": "result",
"data": {}
}
]
}
},
"position": [
2780,
-562
]
},
"innerFace": {
"id": "innerFace",
"name": "bitbybit.occt.shapes.face.createFaceFromWire",
"customName": "face from wire",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"planar": true
},
"inputs": {
"shape": {
"connections": [
{
"node": "offset",
"output": "result",
"data": {}
}
]
}
},
"position": [
2780,
-111
]
},
"innerFaces": {
"id": "innerFaces",
"name": "bitbybit.lists.createList",
"customName": "create list",
"async": false,
"drawable": false,
"data": {},
"inputs": {
"listElements": {
"connections": [
{
"node": "innerFace",
"output": "result",
"data": {}
}
]
}
},
"position": [
3415,
-199
]
},
"hollowFace": {
"id": "hollowFace",
"name": "bitbybit.occt.booleans.difference",
"customName": "difference",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"keepEdges": false,
"strategy": "oneAfterAnother"
},
"inputs": {
"shape": {
"connections": [
{
"node": "outerFace",
"output": "result",
"data": {}
}
]
},
"shapes": {
"connections": [
{
"node": "innerFaces",
"output": "list",
"data": {}
}
]
}
},
"position": [
3995,
-227
]
},
"extrude": {
"id": "extrude",
"name": "bitbybit.occt.operations.extrude",
"customName": "extrude",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"direction": [
0,
1,
0
]
},
"inputs": {
"shape": {
"connections": [
{
"node": "union",
"output": "result",
"data": {}
}
]
},
"direction": {
"connections": [
{
"node": "vectorXyz3",
"output": "result",
"data": {}
}
]
}
},
"position": [
6562,
311
]
},
"vectorXyz3": {
"id": "vectorXyz3",
"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.2
},
"inputs": {},
"position": [
5642,
399
]
},
"drawAnyAsync": {
"id": "drawAnyAsync",
"name": "bitbybit.draw.drawAnyAsync",
"customName": "draw any async",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"entity": {
"connections": [
{
"node": "extrude",
"output": "result",
"data": {}
}
]
},
"options": {
"connections": [
{
"node": "optionsOcctShapeMaterial",
"output": "result",
"data": {}
}
]
}
},
"position": [
7019,
450
]
},
"optionsOcctShapeMaterial": {
"id": "optionsOcctShapeMaterial",
"name": "bitbybit.draw.optionsOcctShapeMaterial",
"customName": "options occt shape material",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"precision": 0.01,
"drawEdges": false,
"edgeColour": "#ffffff",
"edgeWidth": 2
},
"inputs": {
"faceMaterial": {
"connections": [
{
"node": "iceMaterial",
"output": "result",
"data": {}
}
]
}
},
"position": [
6565,
624
]
},
"createList3": {
"id": "createList3",
"name": "bitbybit.lists.createList",
"customName": "create list",
"async": false,
"drawable": false,
"data": {},
"inputs": {
"listElements": {
"connections": [
{
"node": "drawAnyAsync",
"output": "result",
"data": {}
}
]
}
},
"position": [
7436,
486
]
},
"zoomOn": {
"id": "zoomOn",
"name": "bitbybit.advanced.navigation.zoomOn",
"customName": "zoom on",
"async": true,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"meshes": [],
"includeChildren": true,
"animationSpeed": 0.8,
"offset": 0,
"doNotUpdateMaxZ": true,
"ease": "easeInOutCubic"
},
"inputs": {
"meshes": {
"connections": [
{
"node": "createList3",
"output": "list",
"data": {}
}
]
}
},
"position": [
7820,
445
]
}
},
"modules": {}
}
<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="size">size</variable><variable id="branchWire">branchWire</variable><variable id="combinedWire">combinedWire</variable><variable id="outerWire">outerWire</variable><variable id="innerWire">innerWire</variable><variable id="hollowFace">hollowFace</variable><variable id="snowflake">snowflake</variable></variables><block type="variables_set" x="-600" y="-200"><field name="VAR" id="size">size</field><value name="VALUE"><block type="math_number"><field name="NUM">0.8</field></block></value><next><block type="variables_set"><field name="VAR" id="branchWire">branchWire</field><value name="VALUE"><block type="bitbybit.occt.shapes.wire.interpolatePoints"><value name="Points"><block type="lists_create_with"><mutation items="5"></mutation><value name="ADD0"><block type="bitbybit.vector.vectorXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">0</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value><value name="ADD1"><block type="bitbybit.vector.vectorXYZ"><value name="X"><block type="math_number"><field name="NUM">0.3</field></block></value><value name="Y"><block type="math_arithmetic"><field name="OP">MULTIPLY</field><value name="A"><block type="math_number"><field name="NUM">1.5</field></block></value><value name="B"><block type="variables_get"><field name="VAR" id="size">size</field></block></value></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value><value name="ADD2"><block type="bitbybit.vector.vectorXYZ"><value name="X"><block type="math_number"><field name="NUM">-0.2</field></block></value><value name="Y"><block type="math_arithmetic"><field name="OP">MULTIPLY</field><value name="A"><block type="math_number"><field name="NUM">2.5</field></block></value><value name="B"><block type="variables_get"><field name="VAR" id="size">size</field></block></value></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value><value name="ADD3"><block type="bitbybit.vector.vectorXYZ"><value name="X"><block type="math_number"><field name="NUM">0.4</field></block></value><value name="Y"><block type="math_arithmetic"><field name="OP">MULTIPLY</field><value name="A"><block type="math_number"><field name="NUM">3.5</field></block></value><value name="B"><block type="variables_get"><field name="VAR" id="size">size</field></block></value></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value><value name="ADD4"><block type="bitbybit.vector.vectorXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_arithmetic"><field name="OP">MULTIPLY</field><value name="A"><block type="math_number"><field name="NUM">4</field></block></value><value name="B"><block type="variables_get"><field name="VAR" id="size">size</field></block></value></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value></block></value><value name="Periodic"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="Tolerance"><block type="math_number"><field name="NUM">0.00001</field></block></value></block></value><next><block type="variables_set"><field name="VAR" id="combinedWire">combinedWire</field><value name="VALUE"><block type="bitbybit.occt.shapes.wire.combineEdgesAndWiresIntoAWire"><value name="Shapes"><block type="lists_create_with"><mutation items="2"></mutation><value name="ADD0"><block type="variables_get"><field name="VAR" id="branchWire">branchWire</field></block></value><value name="ADD1"><block type="bitbybit.occt.transforms.rotate"><value name="Shape"><block type="variables_get"><field name="VAR" id="branchWire">branchWire</field></block></value><value name="Axis"><block type="bitbybit.vector.vectorXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">0</field></block></value><value name="Z"><block type="math_number"><field name="NUM">1</field></block></value></block></value><value name="Angle"><block type="math_number"><field name="NUM">180</field></block></value></block></value></block></value></block></value><next><block type="variables_set"><field name="VAR" id="outerWire">outerWire</field><value name="VALUE"><block type="bitbybit.occt.operations.offset"><value name="Shape"><block type="variables_get"><field name="VAR" id="combinedWire">combinedWire</field></block></value><value name="Distance"><block type="math_number"><field name="NUM">0.4</field></block></value><value name="Tolerance"><block type="math_number"><field name="NUM">0.1</field></block></value></block></value><next><block type="variables_set"><field name="VAR" id="innerWire">innerWire</field><value name="VALUE"><block type="bitbybit.occt.operations.offset"><value name="Shape"><block type="variables_get"><field name="VAR" id="combinedWire">combinedWire</field></block></value><value name="Distance"><block type="math_number"><field name="NUM">0.2</field></block></value><value name="Tolerance"><block type="math_number"><field name="NUM">0.1</field></block></value></block></value><next><block type="variables_set"><field name="VAR" id="hollowFace">hollowFace</field><value name="VALUE"><block type="bitbybit.occt.booleans.difference"><value name="Shape"><block type="bitbybit.occt.shapes.face.createFaceFromWire"><value name="Shape"><block type="variables_get"><field name="VAR" id="outerWire">outerWire</field></block></value><value name="Planar"><block type="logic_boolean"><field name="BOOL">TRUE</field></block></value></block></value><value name="Shapes"><block type="lists_create_with"><mutation items="1"></mutation><value name="ADD0"><block type="bitbybit.occt.shapes.face.createFaceFromWire"><value name="Shape"><block type="variables_get"><field name="VAR" id="innerWire">innerWire</field></block></value><value name="Planar"><block type="logic_boolean"><field name="BOOL">TRUE</field></block></value></block></value></block></value><value name="KeepEdges"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value></block></value><next><block type="variables_set"><field name="VAR" id="snowflake">snowflake</field><value name="VALUE"><block type="bitbybit.occt.booleans.union"><value name="Shapes"><block type="lists_create_with"><mutation items="6"></mutation><value name="ADD0"><block type="variables_get"><field name="VAR" id="hollowFace">hollowFace</field></block></value><value name="ADD1"><block type="bitbybit.occt.transforms.rotate"><value name="Shape"><block type="variables_get"><field name="VAR" id="hollowFace">hollowFace</field></block></value><value name="Axis"><block type="bitbybit.vector.vectorXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">0</field></block></value><value name="Z"><block type="math_number"><field name="NUM">1</field></block></value></block></value><value name="Angle"><block type="math_number"><field name="NUM">30</field></block></value></block></value><value name="ADD2"><block type="bitbybit.occt.transforms.rotate"><value name="Shape"><block type="variables_get"><field name="VAR" id="hollowFace">hollowFace</field></block></value><value name="Axis"><block type="bitbybit.vector.vectorXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">0</field></block></value><value name="Z"><block type="math_number"><field name="NUM">1</field></block></value></block></value><value name="Angle"><block type="math_number"><field name="NUM">60</field></block></value></block></value><value name="ADD3"><block type="bitbybit.occt.transforms.rotate"><value name="Shape"><block type="variables_get"><field name="VAR" id="hollowFace">hollowFace</field></block></value><value name="Axis"><block type="bitbybit.vector.vectorXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">0</field></block></value><value name="Z"><block type="math_number"><field name="NUM">1</field></block></value></block></value><value name="Angle"><block type="math_number"><field name="NUM">90</field></block></value></block></value><value name="ADD4"><block type="bitbybit.occt.transforms.rotate"><value name="Shape"><block type="variables_get"><field name="VAR" id="hollowFace">hollowFace</field></block></value><value name="Axis"><block type="bitbybit.vector.vectorXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">0</field></block></value><value name="Z"><block type="math_number"><field name="NUM">1</field></block></value></block></value><value name="Angle"><block type="math_number"><field name="NUM">120</field></block></value></block></value><value name="ADD5"><block type="bitbybit.occt.transforms.rotate"><value name="Shape"><block type="variables_get"><field name="VAR" id="hollowFace">hollowFace</field></block></value><value name="Axis"><block type="bitbybit.vector.vectorXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">0</field></block></value><value name="Z"><block type="math_number"><field name="NUM">1</field></block></value></block></value><value name="Angle"><block type="math_number"><field name="NUM">150</field></block></value></block></value></block></value><value name="KeepEdges"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value></block></value><next><block type="bitbybit.draw.drawAnyAsyncNoReturn"><value name="Entity"><block type="bitbybit.occt.operations.extrude"><value name="Shape"><block type="variables_get"><field name="VAR" id="snowflake">snowflake</field></block></value><value name="Direction"><block type="bitbybit.vector.vectorXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">0</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0.2</field></block></value></block></value></block></value><value name="Options"><block type="bitbybit.draw.optionsOcctShapeMaterial"><value name="Precision"><block type="math_number"><field name="NUM">0.01</field></block></value><value name="FaceMaterial"><block type="bitbybit.babylon.material.pbrMetallicRoughness.create"><value name="Name"><block type="text"><field name="TEXT">Ice Material</field></block></value><value name="BaseColor"><block type="colour_picker"><field name="COLOUR">#aed6f1</field></block></value><value name="EmissiveColor"><block type="colour_picker"><field name="COLOUR">#5dade2</field></block></value><value name="Metallic"><block type="math_number"><field name="NUM">0.1</field></block></value><value name="Roughness"><block type="math_number"><field name="NUM">0.3</field></block></value><value name="Alpha"><block type="math_number"><field name="NUM">1</field></block></value><value name="BackFaceCulling"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="ZOffset"><block type="math_number"><field name="NUM">2</field></block></value></block></value><value name="DrawEdges"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="EdgeColour"><block type="colour_picker"><field name="COLOUR">#ffffff</field></block></value><value name="EdgeWidth"><block type="math_number"><field name="NUM">2</field></block></value></block></value></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></xml>
const { InterpolationDto, RotateDto, ShapesDto, OffsetDto, FaceFromWireDto, DifferenceDto, ExtrudeDto, UnionDto } = Bit.Inputs.OCCT;
const { PBRMetallicRoughnessDto } = Bit.Inputs.BabylonMaterial;
const { DrawOcctShapeOptions } = Bit.Inputs.Draw;
const { ZoomOnDto } = Bit.Advanced.Navigation;
type Point3 = Bit.Inputs.Base.Point3;
type TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;
type TopoDSFacePointer = Bit.Inputs.OCCT.TopoDSFacePointer;
type TopoDSShapePointer = Bit.Inputs.OCCT.TopoDSShapePointer;
const { wire, face } = bitbybit.occt.shapes;
const { operations, transforms, booleans } = bitbybit.occt;
const size = 0.8;
const branchPoints: Point3[] = [
[0, 0, 0],
[0.3, 1.5 * size, 0],
[-0.2, 2.5 * size, 0],
[0.4, 3.5 * size, 0],
[0, 4 * size, 0],
];
const interpolation = new InterpolationDto();
interpolation.points = branchPoints;
interpolation.periodic = false;
interpolation.tolerance = 0.00001;
const branchWire = await wire.interpolatePoints(interpolation);
const rotate180 = new RotateDto<TopoDSWirePointer>();
rotate180.shape = branchWire;
rotate180.axis = [0, 0, 1];
rotate180.angle = 180;
const branchWireRotated = await transforms.rotate(rotate180);
const combine = new ShapesDto<TopoDSWirePointer>();
combine.shapes = [branchWire, branchWireRotated];
const combinedWire = await wire.combineEdgesAndWiresIntoAWire(combine);
const offsetOuter = new OffsetDto<TopoDSShapePointer, TopoDSFacePointer>();
offsetOuter.shape = combinedWire;
offsetOuter.distance = 0.4;
offsetOuter.tolerance = 0.1;
const outerWire = (await operations.offset(offsetOuter)) as unknown as TopoDSWirePointer;
const offsetInner = new OffsetDto<TopoDSShapePointer, TopoDSFacePointer>();
offsetInner.shape = combinedWire;
offsetInner.distance = 0.2;
offsetInner.tolerance = 0.1;
const innerWire = (await operations.offset(offsetInner)) as unknown as TopoDSWirePointer;
const outerFaceOptions = new FaceFromWireDto<TopoDSWirePointer>();
outerFaceOptions.shape = outerWire;
outerFaceOptions.planar = true;
const outerFace = await face.createFaceFromWire(outerFaceOptions);
const innerFaceOptions = new FaceFromWireDto<TopoDSWirePointer>();
innerFaceOptions.shape = innerWire;
innerFaceOptions.planar = true;
const innerFace = await face.createFaceFromWire(innerFaceOptions);
const cutOut = new DifferenceDto<TopoDSShapePointer>();
cutOut.shape = outerFace;
cutOut.shapes = [innerFace];
const hollowFace = await booleans.difference(cutOut);
const angles = [0, 30, 60, 90, 120, 150];
const rotatedFaces: TopoDSShapePointer[] = [];
for (const angle of angles) {
if (angle === 0) {
rotatedFaces.push(hollowFace);
continue;
}
const rotate = new RotateDto<TopoDSShapePointer>();
rotate.shape = hollowFace;
rotate.axis = [0, 0, 1];
rotate.angle = angle;
rotatedFaces.push(await transforms.rotate(rotate));
}
const union = new UnionDto<TopoDSShapePointer>();
union.shapes = rotatedFaces;
union.keepEdges = false;
const snowflakeFace = await booleans.union(union);
const extrude = new ExtrudeDto<TopoDSShapePointer>();
extrude.shape = snowflakeFace;
extrude.direction = [0, 0, 0.2];
const snowflakeSolid = await operations.extrude(extrude);
const materialOptions = new PBRMetallicRoughnessDto();
materialOptions.name = 'Ice Material';
materialOptions.baseColor = '#aed6f1';
materialOptions.emissiveColor = '#5dade2';
materialOptions.metallic = 0.1;
materialOptions.roughness = 0.3;
materialOptions.alpha = 1;
materialOptions.backFaceCulling = false;
materialOptions.zOffset = 2;
const material = bitbybit.babylon.material.pbrMetallicRoughness.create(materialOptions);
const drawOptions = new DrawOcctShapeOptions();
drawOptions.precision = 0.01;
drawOptions.drawEdges = false;
drawOptions.edgeColour = '#ffffff';
drawOptions.edgeWidth = 2;
drawOptions.faceMaterial = material;
const starMesh = await bitbybit.draw.drawAnyAsync({
entity: snowflakeSolid,
options: drawOptions,
});
const options = new ZoomOnDto();
options.meshes = [starMesh];
bitbybit.advanced.navigation.zoomOn(options);
How It Works
Branch Design
Each branch is defined by 5 points creating a gentle zigzag pattern:
- Center point at origin (0, 0, 0)
- Alternating left/right offsets as Y increases (0.3, -0.2, 0.4...)
- Tip point centered for a clean finish (0, 4*size, 0)
The interpolatePoints operation creates a smooth B-spline curve through these points.
Bilateral Symmetry
The branch wire is rotated 180° around the Z-axis, creating a mirrored copy. Both wires are then combined into a single wire, forming the classic "double-branched" snowflake arm look.
Creating Hollow Structure
Instead of solid geometry, this creates a delicate hollow branch:
- Outer offset: The combined wire is offset outward by 0.4 units
- Inner offset: The combined wire is offset outward by 0.2 units
- Faces and a cut: A flat face is made from each offset, and the inner face is subtracted from the outer one with a boolean difference, leaving a face with a hollow center - like a ribbon
12-Fold Symmetry
The hollow face is rotated at 30° intervals (0°, 30°, 60°, 90°, 120°, 150°), creating 6 rotated copies plus the original. This creates a complex 12-branch pattern when the bilateral branches overlap, giving the appearance of intricate snowflake geometry.
Final 3D Solid
- Boolean Union: All rotated faces are merged into a single flat 2D shape
- Extrude: The unified shape is extruded 0.2 units along the Z-axis to create the final 3D printable solid
Customization ❄️
- Size slider: Scale the entire snowflake (controls the Y coordinates of branch points)
- Offset distances: Adjust the 0.4 and 0.2 values to change the branch thickness
- Edit point positions: Modify the zigzag pattern for different branch styles
- Rotation angles: Change the 30° step to create different symmetries (try 60° for 6-fold, or 45° for 8-fold)
3D Printing Tips
- The offset technique creates thin, elegant branches - great for decorative ornaments
- The boolean union merges the overlapping arms into one flat outline before it is extruded, so no two parts overlap
- 0.1-0.15mm layer height for fine detail
- 10-15% infill (it's mostly thin walls anyway)
- White or translucent filament for icy look
- Consider adding a small cylinder at the center for a hanging hole
Happy holidays! ❄️



