Skip to main content

Made for 3D printing

The pages before this one take each operation of bitbybit.occt.patterns.voronoi on its own. This one puts them to work on four pieces that are meant to be printed, each built from start to finish in one script, in Rete, Blockly and TypeScript:

  • a dragonfly-wing pendant, a lace of cells graded along the wing's veins;
  • a lattice mount, struts that grow thicker toward where the load comes in and where it is bolted down;
  • an arm with a graded foam core, fine closed cells under its skin and coarse ones in its middle;
  • a tea-light lantern, six perforated panels whose holes open as they rise, thickened with its base and ring into one solid.

Each one draws on a different part of the family, and each grades its pattern with a field: a regular grid of holes or struts is the same everywhere, while Voronoi cells can be small where you want detail and large where you do not, changing smoothly between.

Every piece is exact geometry, so it exports as STEP for a CAD program or as STL for a slicer. The lattice comes as a compound of separate solids that overlap where they meet, as on every page of this section; export it as it is and print it, since slicers merge overlapping bodies. The pendant, the arm and the lantern are each one solid. The sizes are in millimetres.

A dragonfly-wing pendant​

A dragonfly's wing is a thin membrane stiffened by a network of veins. Long veins run from the root toward the tip, and the membrane between them is divided into hundreds of small cells, finest along the veins and the leading edge and larger in the open fields between. The pendant takes that idea and nothing more literal: a wing outline, cells graded by the veins, and the cells opened into a lace.

A dragonfly-wing pendantA dragonfly-wing pendant, front view
Bitbybit Platform

A dragonfly-wing pendant in Rete

Rete

The outline. bitbybit.occt.shapes.wire.interpolatePoints draws the wing through fifteen points as one smooth closed curve, from a rounded lobe at the root, along the nearly straight leading edge to the tip and back along the curved trailing edge. A circle in the lobe is the hole for a jump ring, and bitbybit.occt.shapes.face.createFaceFromWires makes the two wires one face: a face with a hole, which every Voronoi function takes as it is.

The veins. Four open curves fan out from the root, the way the main veins of a forewing do. They are never built into the pendant. They become one affector, a compound of the four curves with a radius of 2.6 and a smooth falloff, and the outline becomes a second, so the cells grow small along the veins and along the edge.

The seeds. seeds2d places Poisson seeds 3.6 apart in the open fields and down to 0.7 apart where the affectors reach in full, 381 in all, then relaxes them once. One round evens out the spacing without wiping out the grading, which more rounds would start to do.

The lace. perforate turns every cell into a hole by inset: every edge moves in by 0.2, so every bar is 0.4 wide, whether it lies between the tiny cells along a vein or the large ones between veins. That is what makes the veins show: where the cells are small, the bars crowd together and read as a denser, whiter line, though no vein is drawn. The holes' corners are rounded to 0.3, and the margin of 0.4 keeps them off the outline and the ring's hole, so the wing has a thin unbroken rim: 263 cells become holes, and the smallest ones along the edge stay solid.

The plate. bitbybit.occt.operations.extrude thickens the perforated face by 1.2 into one solid, ready to export and print. For wider bars, set a larger inset; for a larger pendant, scale the outline, the veins and the spacings together.

A lattice mount​

A mount sits between a load and what it is bolted to: here, a round pad on top and a plate underneath. The space between them is a lattice of struts, and with Voronoi cells the struts need not be the same everywhere: smaller cells and thicker struts near the pad and near the plate, larger cells and thinner struts in between.

A lattice mount, graded toward its loadA lattice mount, graded toward its load, back view
Bitbybit Platform

A lattice mount, graded toward its load in Rete

Rete

The volume. The lattice fills a box 62 by 46 by 44. Beams in space need a box or a convex solid of planar faces, and a box is the simplest.

Where the load is. Two affectors describe the part's job: a point at the middle of the top, where the pad takes the load, with a radius of 38, and the bottom face, where the base plate is bolted, with a radius of 12 and a strength of 0.75.

The seeds. seeds3d places Poisson seeds 11 apart, closing to 5.5 apart near the load point, and relaxes them twice. Poisson sampling keeps every seed at least its spacing from every other, so the cells are irregular but even, without the slivers random seeds leave.

The struts. field reads both affectors at every seed and maps the stronger of the two onto a radius from 0.5 to 1.4. beams3d takes those as sizes, so each strut's radius is the mean of the cells round it, and puts a sphere at every node, as wide as its widest strut. The struts thicken smoothly toward the pad and toward the base plate, and stay slender in the middle.

The plate and the pad. A plate 90 by 58 and 4 thick sits under the lattice, reaching 14 beyond it along its length and 6 across, and its four bolt holes, cut by one boolean, lie in that margin, 7 from the lattice and 7 from the plate's edge, so no strut covers them and each bolt head seats on flat plate. A round pad 4 thick sits on top. The lattice's outer struts overlap the plate and the pad, so all three print as one part. The lattice has 124 cells, 1,348 struts and 676 nodes. It is drawn with no edges, since that many round struts drawn with their seams look like noise.

An arm with a graded foam core​

A foam core keeps a part's outside solid and its inside mostly empty: a skin over a core of sealed cells. Plant stems grade theirs, fine just under the surface and coarse in the middle. The arm below is a tapered link between two pin joints, made into closed-cell foam graded the same way, joined to its bosses into one part, and cut open to show it.

An arm with a graded foam core, cut openAn arm with a graded foam core, cut open, side view
Bitbybit Platform

An arm with a graded foam core, cut open in Rete

Rete

The arm. bitbybit.occt.operations.loft joins an eight-sided outline 44 across its corners at the root to one 28 across at the tip, 140 away. Two parallel, similar outlines loft into a solid of flat faces, a convex solid, which is the domain foam builds in exactly: every cell gets its void, cut back by the skin where it meets the outside. A round boss stands across each end for a pin.

Fine under the skin. The arm itself is the affector, measured as a surface: its influence is strongest at its own faces and fades over 9 into the material. seeds3d turns that into Poisson seeds 4.5 apart under the skin and 15 apart in the core, reading the field through a grid of 16 points along the arm's length, which is plenty for spacing and keeps the sampling quick.

Solid at the joints. The bosses must take pins, so no void may open where a boss meets the arm or a pin hole will be drilled. Each boss becomes a second kind of affector, a region with a radius of 4: full influence inside the boss and a little beyond. field maps it onto each cell's scale, from 0.75 away from the bosses down to 0 inside them, and foam takes those as sizes. A scale of 0 keeps a cell solid, so the cells at both ends are left whole.

The foam. foamWithReport makes the arm one solid with a sealed void in each cell but those at the joints, each void its cell scaled about its centroid, never touching another, and a skin of 1.5 all round. The TypeScript tab prints how many cells there are and how many voids were made.

One part. bitbybit.occt.booleans.union joins the foam and both bosses into one solid. The foam grows in the arm before the bosses join it because the arm is convex: in a solid that is not, such as the arm already joined to its bosses, only cells wholly inside get a void, and in an arm this slender most cells reach its outside. Since the cells where the arm meets a boss are kept solid, the union meets solid material there, and each boss comes out solid all round its pin hole.

The cut. One more boolean drills the two pin holes through the part and cuts away its near half to show the core. The cut is only for the picture; the part to print is the joined part with its holes drilled.

A tea-light lantern​

A lantern's walls decide what its light looks like. This one tapers upward on six sides, and its pattern changes as it rises: small cells with wide bars at the bottom, beside the flame, growing into large cells with thin bars at the top, where the light spills out. All six walls are one perforated panel turned about the axis, and the panels, a base and a ring are thickened together into one solid whose corners meet in exact mitres.

A tea-light lantern of six perforated panelsA tea-light lantern of six perforated panels, side view
Bitbybit Platform

A tea-light lantern of six perforated panels in Rete

Rete

One panel. bitbybit.occt.shapes.face.createPolygonFace makes the panel as a flat trapezoid from four corners, leaning inward as the lantern tapers from a radius of 50 at the bottom to 38 at the top. Its corners are the lantern's own, given to eight decimals (25 and 19 times the square root of 3 for the two apothems), so the turned copies meet their neighbours, the base and the ring at the same points.

Small cells low down. The panel's bottom edge is an affector with a radius of 150, the panel's whole height, and a linear falloff. seeds2d places Poisson seeds 5 apart along the bottom, spreading to 9 apart at the top.

Openings that grow upward. The top edge is a second affector, also reaching the whole height, with a smooth falloff. field reads it at every seed and maps it onto an inset from 1.8 at the bottom to 0.7 at the top, and perforate, set to inset, takes those as factors: each hole's edges move in by its own inset, so the bars are 3.6 wide low down and thin to 1.4 at the top, and every hole's corners are rounded to 1.5. A margin of 3 keeps every hole at least 3 from the panel's outline, clear of the mitres where the panel will meet the others: at a thickness of 2.4 a mitre reaches about 2.6 into the panel at the base, 2.2 at the ring and 1.4 at a neighbouring panel. A hole that came closer would be refused, since its tunnel would cut the mitre, and the solid border it leaves along every edge frames each panel.

The base and the ring. bitbybit.occt.transforms.rotate turns the perforated panel five more times about the lantern's axis, 60 degrees apart. A hexagonal base on the panels' bottom edges and a ring on their top edges, with a round opening of radius 22, close the shell, and bitbybit.occt.shapes.compound.makeCompound holds all eight faces.

One solid. bitbybit.occt.operations.thickenPlanarShell thickens the eight faces inward by 2.4 in one call. Every edge two faces share becomes a mitre, so the panels meet each other, the base and the ring in exact corners, with no posts and nothing overlapping, and each of the panels' holes and the ring's opening becomes a tunnel through its face. The lantern is one solid of planes and cylinders, made in a fraction of a second, with a floor for the tea light inside it.

Going further​

Each script is a starting point. Change the seed number for another arrangement of the same pattern, move or reshape an affector to grade the pattern somewhere else, or swap one piece's structure for another's: the lantern given a thicker base through thicknesses, the pendant thickened as frames, the mount's lattice turned into foam. Seeds and fields covers every way to place and grade seeds, and the introduction lists every function.