Skip to main content

Perforated faces

A perforated panel is the Voronoi pattern most people have held: a grille, a screen, a lamp shade, a speaker cover. bitbybit.occt.patterns.voronoi.perforate makes one from any planar face and a list of seeds. Each seed's cell is made smaller, its corners are rounded, and it goes back into the same face as a hole. The result is one face with its holes as inner wires, built without a boolean, so it stays a single clean face that extrudes into a plate, thickens, or starts a sheet metal part. The face may have curved edges and holes of its own.

Scale or inset​

shrink decides how a cell becomes a hole, and the choice changes the look more than any other setting:

  • scale, the default, scales each cell about its own centroid by scale (0.8 unless set). A hole's area is its cell's times the scale squared, and the bar left between two holes grows with the cells: wide between large cells, thin between small ones. A scaled hole always lies strictly inside its cell, whatever its shape.
  • inset moves every edge of the cell inward by inset. Two neighbouring holes then leave a bar exactly twice the inset wide, everywhere: an even lace whatever the cells' sizes, which is what a part cut from sheet or printed in thin bars usually wants. A cell narrower than twice the inset has nothing left and stays closed.
Holes made smaller by a scale and by an insetHoles made smaller by a scale and by an inset, front view
Bitbybit Platform

Holes made smaller by a scale and by an inset in Rete

Rete

Both plates are cut from the same seeds. On the left, scaled holes leave bars that are wide where the cells are large and narrow where they are small. On the right, every bar is 2.4 wide.

Rounded corners and the margin​

radius rounds every corner of every hole with an exact arc, so the holes extrude, mesh and export as true curves. A corner too sharp for the radius takes the largest radius that fits it, so a small hole is never refused for its corners.

margin is the least distance a hole keeps from the face's outline and from the face's own holes. A hole that would come closer is left out whole rather than shrunk to fit. Shrinking would make the holes along the edge smaller in a way that depends on where the edge happens to cut them, and an inset's even bars would no longer be even there; a left-out hole leaves solid sheet, which is what a panel's border is for. A hole along a straight edge of the face lies one inset from it, and a hole exactly the margin away is kept, so with inset holes a margin up to the inset keeps every one of them and leaves a rim one inset wide, as on the right above, where the margin is 1 and the inset 1.2. A margin above the inset leaves them all out, and the border becomes a wider, irregular band of solid sheet.

bitbybit.occt.patterns.voronoi.perforateWithReport says what became of every seed's hole: made, with its exact area, the scale or inset it was made with, how many of its corners took a smaller radius than asked (reducedCorners) and the smallest radius any took; consumed, when the shrink left nothing; tooClose, when it would have come nearer the edge than the margin; or noCell, when its seed has no cell.

The 0 to 1 rules​

A scale is a share of the cell, so it lives between 0 and 1, and the two ends behave differently for the one setting and for the values per cell:

  • The scale setting must lie from 0.001 to 0.999. A scale of 0 would make no holes and a scale of 1 holes that touch their neighbours, so both ends are refused: "patterns.voronoi.perforate: scale must be from 0.001 to 0.999".
  • The values per cell, the factors, one a seed, take the whole range from 0 to 1, so a field can close or open any cell without knowing the margins. From 0 to 0.001 the cell stays closed, its hole reported as consumed; from 0.999 to 1 it opens at 0.999, as far as a hole may; anything between scales the cell as given. A list of the wrong length is refused, "there must be one factor a seed, or none", and so is a value outside the range, "factor 1 is not a scale from 0 to 1".
  • With shrink set to inset, the setting and the values per cell are distances instead, each at least the face's tolerance. A value large enough to consume its cell closes it, so a field mapped onto insets closes cells too.

Holes graded cell by cell​

With factors, every hole takes its own scale. Read a field at the seeds and the holes follow it: open where the field is high, closed where it is low. Seeds and fields explains fields and affectors.

Holes graded by a fieldHoles graded by a field, front view
Bitbybit Platform

Holes graded by a field in Rete

Rete

A point affector at the centre, with a radius equal to the disc's, gives an influence of 1 in the middle falling smoothly to 0 at the rim, and bitbybit.occt.patterns.voronoi.field maps it onto factors from 0 at the rim to 0.85 in the middle. The holes open toward the centre like a sunflower's head and shrink to pinpricks toward the rim, and at the rim itself, where the factors reach 0, the cells stay closed and make the grille's solid border. The TypeScript tab prints how many holes were made, consumed and left out.

A perforated sheet metal vent panel​

A perforated face is a face like any other, so sheet metal can start a part from it. bitbybit.occt.fabrication.sheetMetal.plate takes it as the blank, holes and all, and bitbybit.occt.fabrication.sheetMetal.flanges bends a flange down off each of its four edges, mitred where they meet at the corners.

A perforated vent panel with bent flangesA perforated vent panel with bent flanges, below view
Bitbybit Platform

A perforated vent panel with bent flanges in Rete

Rete

The holes are inset 1.5 from their cells for even bars of 3, rounded to 2, and kept 7 from the blank's edges. That margin is not only for looks: a flange's bend takes up the outermost few millimetres of the blank, and a hole there would be cut through by the bend. Keeping the margin larger than the bend's reach keeps every hole in flat sheet, and bitbybit.occt.fabrication.sheetMetal.check, printed by the TypeScript tab, confirms the result is still a sheet of one thickness.