Skip to main content

Creating a Spiral of Points

Point category icon

Points are the fundamental building blocks for defining locations in 3D space. The Point class in Bitbybit provides various methods to create and manipulate points. This tutorial demonstrates how to use the point.spiral() method to generate a series of points arranged in a spiral pattern.

We'll explore this using Rete (visual nodes), Blockly (visual blocks), and TypeScript (code). All examples will generate a spiral of points and draw them in the 3D scene.

For detailed information on each point function, please refer to the Point API Documentation.

The Core Idea: Generating a Spiral

The point.spiral() method algorithmically calculates the X, Y, and Z coordinates for a sequence of points that form a spiral. You can control various parameters of this spiral, such as:

  • numberPoints: The total number of points to generate for the spiral.
  • radius: The overall radius or extent of the spiral.
  • widening: A factor that controls how quickly the spiral widens or tightens.
  • phi: A constant related to the golden angle, often used in phyllotaxis patterns (like sunflower seeds) to create natural-looking spirals.
  • factor: Another scaling factor for the spiral's generation.

Once the list of points is generated, we use Draw.drawAnyAsync() to render them in the 3D scene.

Live Examples

Click through the tabs below to see the implementation. Each example will generate and display 300 points arranged in a spiral.

Bitbybit Platform

Point Spiral Example

rete logoRete
Script Source (rete)
{
"id": "rete-v2-json",
"nodes": {
"15579b09dc5adca9": {
"id": "15579b09dc5adca9",
"name": "bitbybit.point.spiral",
"customName": "spiral",
"async": false,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"phi": 0.9,
"numberPoints": 300,
"widening": 3,
"radius": 6,
"factor": 1
},
"inputs": {},
"position": [
141.90082846282178,
326.4099338563376
]
}
}
}

Conclusion

The point.spiral() method is a simple way to generate interesting and organic-looking point patterns. By adjusting its parameters, you can create a wide variety of spiral forms. These points can then be used as a basis for other geometric constructions, particle systems, or purely visual arrangements.

Explore the Point Documentation for other methods of creating and manipulating points in Bitbybit!