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
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! ❄️
