How to create spiral Stairs

please how to created spiral stairs like in this picture below : spiral stairs
I used this code:

const spiralstairs = new THREE.BoxGeometry(5,20,1, 1, 20, 1);
    const spiralmaterials = new THREE.MeshLambertMaterial({ color: 'green', wireframe:true,side: THREE.DoubleSide });
    const spiralMesh = new THREE.Mesh(spiralstairs,spiralmaterials);
    for(let i=0;i<42;i+=2){
      for(let i=1;i<42;i+=2){

I got This result :

To create spiral staircase, all you’d really need is to create a single prefab of a step, with a column segment on one side, and a slight angle on the other side - then just duplicate that step, translate upwards, rotate, rinse-and-repeat. Generating tons of vertices in a loop seems not only tedious but also is likely going to be quite a bit slower.

1 Like

Generating the geometry in code is tedious, (but not neccessarily slower than loading it)…
On the other hand… to texture it, you’d have to synthesize/generate UVs as well… so as you said @mjurczyk for that it probably would be easiest to import a single stair step model and instance it.

I took a stab at it @mohamad_chouacha :

(I didn’t bother with instancing… just clone() ing a loaded stair step mesh…)

Hi @mohamad_chouacha …

I could not resist…

Hope You like the idea. :wink:


@jrlazz :smiley: nice! these geometry style questions are like catnip!
I like your sample setup… minimal and clever!