Bismuth

Web Page to Web Space · Project A · Generative 3D Structures · Stage 1
BISMUTH, grown and still bare: a tower of silver right-angled frames, stepped funnels and thin rods against a dark grey backdrop

BISMUTH grows a cluster of bismuth hopper crystals. Each crystal is a square spiral that is drawn bar by bar. New crystals start on the corners of older ones, so the cluster grows upward into a tower of right-angled frames. The metal is bare and silver while it grows. The colour comes later. It is calculated from the thickness of an oxide film, in nanometres, which is how real bismuth gets its colours, so there is no colour palette in the code.

BISMUTH 生长一簇铋的漏斗晶体。每个晶体是一条方形螺旋,一根杆接一根杆地画出来;新的晶体从旧晶体的角上长出,整簇因此向上长成一座直角框架的塔。生长的时候金属是裸露的银白色,颜色是之后才出现的:它由氧化膜的厚度(纳米)计算得出,真实的铋也是这样上色的,所以代码里没有调色板。

Continue with Stage 2: Applying Light and Shadow · 光影研究与制作记录

Live

Drag to orbit, scroll to zoom. Rest the pointer on the metal and it warms up. R melts it down and grows another, Space pauses, G opens the controls, H leaves only the sculpture. Click the frame first so the keys reach it. Best on a desktop with WebGL.

拖动环绕,滚轮缩放。把指针停在金属上,它会被加热。R 熔掉重长一件,空格 暂停,G 打开参数面板,H 只留雕塑。 先点一下画面让按键生效。建议在桌面浏览器观看。

One round takes about a minute and a half: grow, temper, hold, melt. After that a new seed is used and a different sculpture grows. The number at the bottom is the seed. Adding #7 to the address of the full-screen version grows No. 7 again, and it looks the same on every computer.

Overview

Project A asks us to choose a subject, study it, and imitate how it looks and behaves using objects made from a class. I chose bismuth. A bismuth crystal grows faster along its edges than on its faces, so the faces stay hollow and the crystal becomes a stepped square funnel, called a hopper crystal. The crystals grow into each other at right angles. The metal is silver when it solidifies. The gold, magenta and blue come from an oxide film a few hundred nanometres thick, which forms while the metal is still hot.

I turned these observations into three rules. A crystal only grows at its rim. A new crystal starts on a rim corner of an existing one and opens in one of the free directions. Every bar has a film thickness that increases with its age, and thin-film interference turns that thickness into a colour. The shapes are based on Sidney Gordin's welded steel sculptures: open rectangular frames, a few solid plates, bars that continue past their corners, and thin rods.

The piece runs in rounds. It grows as bare metal for about forty seconds. Then it tempers: over ten seconds the film gets thicker everywhere, and every bar goes through the colour sequence until it reaches its final colour. During the hold, heat pulses move up through the cluster and old crystals are replaced by new ones. At the end it melts from the top down, the colour goes back to silver, and the next round starts with a new seed.

One round of No. 7, to scale. The strip shows the colour of the film at the rim: 6 nanometres while it grows, up to 262 during tempering, and back to zero in the melt.
One full round of No. 7 and the first seconds of No. 8. The camera keeps moving. It looks up from below during tempering and again at the end of the melt, and looks down into the funnels in between. The pointer appears twice, once on the bare metal and once after tempering. Near the end of the hold I open the controls and change the sections from thin lines to solid steps and back.

The Spiral

Each crystal is built by a walker that moves along a square spiral. The sides are 1, 1, 2, 2, 3, 3 units long. It turns left after each side, and each full turn moves one step up along the axis of the funnel. Only the bar at the front of the spiral grows, and the next bar starts when it is finished. About a third of the crystals are sparse: they cover the same area with two to three times the spacing and fewer turns, which gives a few large frames next to the dense small ones. The spacing between turns is not constant. It gets larger towards the rim by a fixed ratio, and all crystals in a round use the same ratio.

112233 Ratio 1.00even spacing
Ratio 1.16the ratio of No. 7
The path of the walker, seen along the axis of the funnel, six turns. The dot is the start and the numbers are the lengths of the first sides. The ticks below show the grid lines. With a ratio of 1.16 the turns are closer together at the centre and further apart at the rim, and the spiral covers the same area.
BISMUTH, early in the growth: a silver stepped funnel with a few frames starting on its corners, seen close
Twenty seconds into No. 7. The first crystal opens upward. Its bars are thicker at the bottom of the funnel and thinner at the rim. The camera starts close and moves back as the cluster grows.
BISMUTH fully grown in bare metal: a tower of silver and tan frames with blue only deep inside the funnels
Fully grown and still bare. The film is only a few nanometres thick at the rims, which looks silver. It is thicker at the bottom of the funnels, where it is already blue.

Lips, Keys and Crowns

Every part is still the same unit box, but I wanted the crystals to look less like plain bars. Real bismuth has a raised edge on every step, square meander patterns along its sides, and corners that grow faster than the faces. Each crystal randomly gets some of these three details. A lip is a thin strip along the outer edge of a bar, slightly taller than the bar. Its film is a little thinner, so it shows as a line in a different colour. A key is a square meander: the spiral path moves sideways, continues for one or two steps, and moves back. It is grown bar by bar like the rest of the spiral. A crown is a set of short posts on the corners of the outer three rings. Crystals with thick sections do not get keys.

A close view into BISMUTH: stepped funnels whose bars carry thin raised lips, a side with a square meander in it, short posts on the corners
Detail. Every part is the same unit box, only scaled and positioned, never rotated. Visible here: lips on the outer edges, a key in a long side, and posts on rim corners.

Overall Form

The crystals have very different sizes, like in a real bismuth cluster. Large crystals get satellites, which are crystals about a fifth of their size placed on any of their corners, including corners inside the funnel. Sometimes a child crystal is as large as its parent. Such a large crystal can also become a hopper cube, the shape bismuth is best known for: a cube where every face is a funnel. I built it from the same parts. Five normal spirals start around one centre point, open outward, and use the same proportions, so their rims meet at the edges of a cube. The sixth face would point back into the crystal the cube sits on, so it is left out. A round has at most one cube, and it grows somewhere up the tower. In an earlier version the cube was the starting point, but then the piece no longer felt like it was growing upward.

Each round also has one to three invisible boxes where nothing is allowed to grow, so the cluster has to grow around them and leaves some empty space. There are only a few thin rods. They grow on rims, more often higher up, and most are short with a few very long ones. They point along the axis of their crystal, so crystals that open sideways get horizontal rods.

BISMUTH seen from below: the stepped underside of the first funnel, large frames around it and the tower above
The same sculpture seen from below: the underside of the first funnel with the tower above it. Faces that point down are the darkest, like under a light from above.

Colour from Film Thickness

Light reflects from the surface of the oxide film and from the metal below it, and the two reflections interfere. Which wavelengths remain depends on how thick the film is. I calculate this for three wavelengths, one each for red, green and blue, and use the result as the colour of the bar. From 0 to 360 nanometres the colours go through silver, pale gold, a dark band, blue, cyan, yellow, orange and crimson, followed by the second-order colours that bismuth is known for: blue, green, gold and magenta.

262 nm · Gold Move the pointer over the scale to read a thickness.

The thickness of a bar is the value at the rim, plus an amount for every ring below the rim, because the bottom of a funnel stays hot longest. A noise field adds a difference between crystals, so crystals that are close together have similar colours. The light path through the film is shorter when seen at an angle, so the colours shift slightly when the camera moves. Tempering only changes the rim value, from 6 to 262 nanometres, and the colours change as a result.

BISMUTH half way through tempering: the whole tower in deep blue and violet with green and orange in the funnels
Halfway through the ten seconds of tempering. Every bar is somewhere on the colour scale above, and the deeper rings are further along than the rims.
BISMUTH tempered: gold and orange frames facing up, magenta and violet frames facing the camera, a few green crystals
After tempering. Funnels that open upward are seen at an angle and appear gold. Frames that face the camera appear magenta. About one crystal in eight has an extra 62 nanometres, which makes it green.

Heating with the Pointer

Since heat is what colours the metal, I made the pointer a heat source. While the pointer rests on the sculpture, the bars inside its square frame glow, and they cool down in about a second after it leaves. The film under the pointer gets thicker and stays that way, so the spot keeps a different colour until the round melts. On bare metal the colours go from pale gold to brown, violet and blue, like the temper colours around a weld. The outline of the frame fills up to show how much film was added, and the number below shows the same amount in nanometres.

The square pointer frame resting on bare silver metal, the bars inside it glowing warm, a reading of plus 91 nanometres under it
The pointer on bare metal. The frame has the same size as the heated area, which is square like everything else in the scene. The number is the film added at the hottest bar.
The same place after the pointer has left: a patch of gold, brown and blue bars in the silver structure
Shortly after the pointer has left. The glow has faded and the colour remains.

Hold and Melt

The cluster keeps changing during the hold. Every eight seconds a band of heat moves from the bottom to the top. Bars inside the band get taller and their film gets thicker for a moment. Every few seconds the oldest crystal that has no children melts, and a new crystal grows in the free space. At the end of the round the whole cluster melts from the top down. A melting bar shrinks, drops a little, and its colour goes back through the sequence to silver. Then its mesh is removed from the scene.

BISMUTH during the hold with a horizontal band of swollen, violet and teal bars half way up
A heat pulse halfway up the tower.
BISMUTH melting: only the lower half is left, long bars and plates over a stepped funnel
Six seconds into the melt. The top is already gone and the camera moves down with it.

Seeds and Rounds

The seed controls more than the positions of the crystals. It also sets the parameters of the round: the spacing of the spirals, how steep the funnels are, how many crystals are sparse, how strongly the cluster grows upward, how many plates and rods there are, and which of four film thicknesses it tempers to. As a result some rounds are tall and open and others are low and dense. The simulation runs in fixed steps of one sixtieth of a second, independent of the display's frame rate. The random numbers are therefore always used in the same order, and a seed gives the same sculpture on every computer.

BISMUTH No. 5 tempered to blue and cyan with a few orange crystals
No. 5 tempers to Sea: 185 nanometres at the rim. Blue, with teal deeper in the funnels and a few orange crystals.
BISMUTH No. 3 tempered to violet and blue with vivid green in the funnels
No. 3 tempers to Aurora: 292 nanometres. Violet and blue, with green deeper in the funnels.
BISMUTH No. 4 tempered to amber and orange with blue deep inside
No. 4 tempers to Ember: 138 nanometres. Amber and red, with blue at the bottom of the funnels.

Sections and the Controls

Every crystal has its own bar section: thin lines, tall fins, flat ribbons or solid steps. Two sliders scale all sections together, so the same sculpture can change between an open structure of lines and solid stepped funnels that look more like the mineral. The other folders in the panel control the growth, the oxide film in nanometres, and the form of new crystals. The accent colour of the interface also comes from the film. The progress line, the outline of the pointer frame and the active buttons use three colours taken from the rim, the middle and the bottom of a funnel, so the interface changes colour together with the sculpture.

BISMUTH with the control panel open and the sections thickened into solid stepped funnels
The same No. 7 with wall at 0.85 and wall height at 1.30, which gives solid steps in place of lines.

How It Is Built

The scene has a single BoxGeometry that is shared by about 2,200 meshes. The code follows the class we wrote in the course: each object has a position, a scale, a colour and a lifespan, updates them itself, and its mesh is removed from the scene when it is done.

Crystalwalks the square spiral and adds the parts
Barone box that grows along one axis, ages, sets its colour and meltspos · scale · color · lifespan
Plateflat part of a stepupdateScale()
Spirethin rodupdateScale()
Lipraised outer edge of a barupdate()
updatePosition()
updateScale()
Postraised cornerupdatePosition()
updateScale()
The six classes. The four classes under Bar only replace the methods listed in them.

Six classes

Crystal is the spiral walker. Bar is one box that grows from a start point along one axis, ages, sets its own colour and melts. Plate (the flat part of a step), Spire (a thin rod), Lip (the raised edge) and Post (a raised corner) extend Bar and only override how they are positioned and scaled.

Never rotated

All bars are axis-aligned, so I only use position and scale, and every face always points in the same world direction. Stage 1 has no lights. I store a fixed brightness per face in the vertex colours of the shared geometry, which works as a simple replacement for a light until Stage 2.

Growing upward

Only corners on the two outer rings of a crystal can hold a new crystal, and the highest free corner is chosen, with some noise. I first scored corners by their distance to the centre axis, which packed all crystals into the bottom of the first funnel. Scoring by height produced the tower.

Automatic framing

The camera target and distance follow the bounding box of everything that has not melted, while avoiding the title, the bottom panel and the open controls. The camera starts close to the first crystal, moves back as the cluster grows, and moves down during the melt.

Technical Notes

There are two main parts: the rule that converts a thickness into a colour, and the factors that determine the thickness. The physics is simplified, and one value is exaggerated on purpose. I point out both below.

From thickness to colour

For a film of thickness d and refractive index n = 2.5, the optical path difference between the two reflections, seen at an angle γ from the axis of the crystal, is

\Delta = 2\,n\,d\,\sqrt{1 - \kappa \sin^2 \gamma}

and each colour channel is the two-beam interference term at its own wavelength:

I_\lambda = \tfrac{1}{2} + \tfrac{1}{2}\cos\frac{2\pi\Delta}{\lambda}, \qquad \lambda \in \{610,\ 540,\ 465\}\ \mathrm{nm}

Using three wavelengths in place of a full spectrum is the simplification. It makes the higher-order colours more saturated than in reality. κ is the exaggerated value. With the real refractive index, the path length changes by less than ten percent at grazing angles, which is almost invisible, so I made κ a slider and set it to 0.12. At 0.25 the gold of the tempered state turned yellow-green, which is how I found this value. Finally the channels are scaled to the range 0.2 to 0.88 and tinted slightly pink, which is the colour of bare bismuth.

What sets the thickness

d = \Big[\big(d_0 + g\,k + v\,\tau + a + p\big)\big(1 - e^{-\sigma t}\big) + h\Big]\,\ell

d0 is the film thickness at the rim, g the increase per ring, and k the number of rings below the rim. v is the variation between crystals and τ the tint of the bar, which comes from its crystal and from a noise field. a is the offset of the accent crystals, and p is the contribution of the heat pulse and the slow drift. t is the age of the bar in frames and σ the oxidation rate, so a new bar starts silver and goes through the colour sequence in its first seconds. h is the amount added by the pointer. ℓ is the lifespan, which goes from one to zero during the melt and brings the colour back to silver. Tempering only changes d0, g, v and a from one preset to another.

Spacing of the turns

The walker moves on a grid of whole turns. Grid line j is at the distance

G(j) = c (rho^j - 1) / (rho - 1)

from the centre of the spiral, in units. ρ is the ratio between the spacing of one turn and the next. It is between 0.96 and 1.18 and is the same for all crystals in a round. c rescales the grid so that a crystal with N turns covers the same area as it would with even spacing. The height uses the same function, so the slope of the funnel stays constant.

The pointer

I do not use a raycaster. Every frame, the position of each bar is projected to screen space and compared with the position of the pointer frame:

h \leftarrow \min\!\Big(h + r\,s\,e^{-\left(\max(|\Delta x|,\,|\Delta y|)/R\right)^2},\ 170\Big)

with r = 0.9 nm per frame, R = 48 pixels, and s the value of the touch slider. The distance is the larger of the horizontal and vertical offsets, so the heated area is a square. The glow uses the same falloff and fades by 3.5 percent per frame.

Depth

Where two bars meet, the end of one bar sits slightly inside the side of the other. The template camera has its near plane at 0.1. At a viewing distance of about a thousand units the depth buffer could not separate these faces, and the joints flickered. Setting the near plane to 20 fixed it. For the same view, moving the camera by a hundredth of a unit changed the colour of 2050 pixels before the fix and 19 pixels after it.

Process

  1. I considered three subjects: scaffolding around a building that does not exist, a figure that forms out of drifting blocks, and bismuth. I chose bismuth because its growth rule is simple and its colour has a physical explanation.
  2. The first version worked but did not look right. All hues appeared at once, the walls were solid, and the cluster was flat. I narrowed the range of the film thickness, changed the walls to open frames, and gave each face a fixed brightness so the form is readable without lights.
  3. The cluster did not grow upward. It did once I allowed new crystals only on rim corners and always picked the highest free corner.
  4. I gave the colour a time structure: grow bare, temper, hold, melt. In the same round of changes I added the large sparse crystals, the gradient background and the slow drift of the film thickness.
  5. It became monotonous when I watched it for a long time, so every crystal got its own proportions, depth and section, and every round got its own parameters and its own final palette.
  6. The same seed did not always give the same sculpture, because the simulation depended on the frame rate. It now runs in fixed steps. I also scramble the seed first, because p5's random generator returns similar numbers for seeds that are close together.
  7. I made the pointer a heat source. At first its effect was hard to see while the whole piece was changing colour, so I added a separate glow, and the thicker film is what remains afterwards.
  8. Then I worked on the interface: a square pointer with a gauge, buttons that show the current state, and an accent colour taken from the film.
  9. The crystals still looked like plain boxes. Lips, keys and crowns added detail to each crystal. Satellites, giants, empty boxes and a shared spacing ratio improved the overall form.
  10. In one version every round started from a cube. It was easy to recognise as bismuth, but the piece no longer felt like it was growing upward. The first crystal is a single funnel again, and the cube now appears higher up.

Reflections

As with APERTURE, starting from a physical rule helped me most with the design. After I decided that colour depends only on film thickness, the questions about palette, timing and interaction all came down to what changes the thickness. Growth, tempering, heat pulses, the pointer and melting all work through that one value.

Stage 2 is about light and shadow. I expect the open frames to cast more detailed shadows than the solid version. The fixed brightness per face will be replaced by real lights.