Weaving Data: Architecting a 3D Cybernetic Fabric with py5
2026/8/23
Visualizing raw data often conjures images of rigid grids, scrolling numbers, or hard-edged geometric structures. However, when we conceptualize data as a continuous, flowing stream of information, the visual representation can take on a more organic, fluid quality. This project explores the creation of a "cybernetic data fabric"—a 3D particle system that mimics the behavior of luminous silk undulating in a digital wind. By leveraging the py5 framework, we can procedurally generate and animate this complex topology, resulting in a mesmerizing representation of high-density information flow.The core of this simulation is a dense field of 10,000 individual particles, mapped not to a flat plane, but to a parametric cylinder in 3D space. As these particles orbit a central axis, their positions are continuously displaced by multi-dimensional OpenSimplex noise. This transforms the rigid cylinder into a highly textured, breathing surface.Python, and specifically the py5 library, provides the ideal environment for this kind of creative coding. The framework grants direct access to Processing's powerful 3D rendering engine (P3D) while maintaining Python's elegant syntax. This allows for rapid mathematical iteration—mapping UV coordinates, applying noise functions, and calculating matrix transformations—without sacrificing the frame rates necessary for smooth animation.
Visual & Aesthetic Approach
The aesthetic goal of this piece is to balance the cold precision of digital data with the soft, flowing dynamics of physical fabric. The canvas is initialized with absolute darkness (py5.background(0)), allowing the illuminated particles to define the spatial volume entirely on their own.A critical decision in the rendering process is the use of py5.blend_mode(py5.ADD). Instead of rendering opaque pixels, each particle acts as a tiny light source. When the undulating fabric folds over itself—driven by the noise displacements and the rotating camera angle—the overlapping particles compound in brightness. This additive blending creates intense, searing hotspots along the ridges of the fabric, while the valleys fade into a faint, ghostly luminescence.To further enhance the "data flow" concept, the simulation eschews standard background clearing. By drawing a highly transparent black rectangle (py5.fill(0, 5)) over the screen each frame, the particles leave faint, fading trails as they move. This subtle motion blur implies immense speed and continuity, transforming discrete points into continuous threads of glowing information.Code & Technical Breakdown
The architecture of the simulation relies on two main mathematical operations: the parametric mapping of particles to a cylindrical surface, and the subsequent application of noise-based displacement.Parametric Cylinder Mapping
Rather than calculating complex physical interactions, the position of each of the 10,000 particles is determined mathematically based on its index. This approach is highly efficient for generating structured, grid-like topologies.NUM_PARTICLES = 10000
# ...
py5.begin_shape(py5.POINTS)
for i in range(NUM_PARTICLES):
# Map index to UV coordinates (cylinder mapping)
u = (i % 100) / 100.0 * py5.TWO_PI
v = (i // 100) / 100.0 * 2000 - 1000
# Base radius with low-frequency noise for large folds
radius = 400 + py5.os_noise(u * 2, v * 0.005, t) * 200
# Convert polar to Cartesian coordinates
x = radius * py5.cos(u + t)
y = radius * py5.sin(u + t)
z = vThe modulo operator (i % 100) determines the particle's angular position (u) around the cylinder, while integer division (i // 100) determines its vertical position (v) along the Z-axis. By adding the time variable t to the angle u during the Cartesian conversion, the entire cylinder rotates continuously, creating the primary flow of the animation. The radius is also modulated by noise, causing the cylinder to bulge and contract organically.
Flow Offset and Color Mapping
To create the micro-texture that sells the illusion of fabric, a high-frequency noise offset is applied to the Cartesian coordinates. This creates the intricate wrinkles and ripples that catch the light. # High-frequency flow offset for micro-texture
offset = py5.os_noise(x * 0.002, y * 0.002, z * 0.002 + t * 5) * 100
x += offset * py5.cos(u)
y += offset * py5.sin(u)
# Dynamic color mapping
hue = (200 + offset * 2 + t * 50) % 360
py5.stroke(hue, 80, 100, 20)
py5.vertex(x, y, z)
py5.end_shape()The offset is calculated using the 3D position of the particle. Multiplying t by 5 in the noise function ensures that these micro-ripples travel much faster than the overall rotation of the cylinder, simulating the rapid transfer of data along the surface.The color is intimately tied to this structural displacement. The hue is driven primarily by a cool baseline of 200 (a cybernetic cyan), but it is shifted by the `offset` value. Consequently, the peaks of the ripples shift towards deep blues and purples, dynamically highlighting the topology of the fabric.
Camera Orchestration
Finally, a dynamic camera is employed to give the viewer a sense of scale and depth.py5.camera(
py5.width/2 + py5.cos(t) * 800, py5.height/2 + py5.sin(t*0.5) * 600, 800, # Eye position
py5.width/2, py5.height/2, 0, # Look-at point
0, 1, 0 # Up vector
)
py5.translate(py5.width/2, py5.height/2, 0)
py5.rotate_x(py5.PI/3)
py5.rotate_z(t)The camera's eye position orbits the scene on a slow, elliptical path, while the underlying geometry is tilted forward (py5.rotate_x(py5.PI/3)) and rotated continuously. This constantly changing perspective prevents the animation from feeling static, allowing the additive blending to reveal new luminous structures as the fabric folds across the line of sight.

Conclusion
The cybernetic_data_fabric_flow_3d sketch illustrates the aesthetic potential of mapping structured arrays into non-Euclidean spaces using procedural noise. By manipulating a simple cylindrical projection with layered, time-based displacements, we can simulate the complex behavior of fluid dynamics and cloth without the overhead of physical solvers. The py5 framework handles the heavy lifting of rendering 10,000 independent vertices with additive blending, allowing the developer to focus entirely on the mathematical choreography of the scene.GitHub: https://github.com/asamiile/py5-media-art/tree/main/sketch/cybernetic_data_fabric_flow_3d
Purchase assets: Adobe Stock