# Mapping a helix

**URL:** <https://forum.electromage.com/t/mapping-a-helix/71>\
**Category:** Ideas and Tips\
**Created:** [September 11, 2019, 3:57pm UTC](https://forum.electromage.com/t/mapping-a-helix/71 "2019-09-11T15:57:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![eike](https://forum.electromage.com/user_avatar/forum.electromage.com/eike/32/38_2.png) [@eike](https://forum.electromage.com/u/eike)\
**Post date:** [September 11, 2019, 3:57pm UTC](https://forum.electromage.com/t/mapping-a-helix/71/1 "2019-09-11T15:57:23Z")

</div>

Ive got a PVC cylinder with a long strip wrapped around it. What is the best way to configure the mapping so that the patterns are ‘aware’ of this physical configuration?

---

<div class="post-metadata">

**Author:** ![wizard](https://forum.electromage.com/user_avatar/forum.electromage.com/wizard/32/4_2.png) [@wizard](https://forum.electromage.com/u/wizard)\
**Post date:** [September 11, 2019, 6:18pm UTC](https://forum.electromage.com/t/mapping-a-helix/71/2 "2019-09-11T18:18:52Z")

</div>

Hi @eike,  
For a single helix, the Ring example is a good starting point.

First, add a Z component. Since the for loop’s `i` variable linearly increases for every pixel, it makes a good Z coordinate as-is. Remember the mapper will autoscale this to “world units” between 0 and 1 for you automatically.

Next, you’ll probably want more than 1 loop, so multiply the angle by some factor. This will cause it to wrap around a few times as it goes through the pixels.

e.g.

```auto
function (pixelCount) {
  var loops = 5
  var map = []
  for (i = 0; i < pixelCount; i++) {
    c = i / pixelCount * Math.PI * 2 * loops
    map.push([Math.cos(c), Math.sin(c), i])
  }
  return map
}

```

 ![48%20AM](https://forum.electromage.com/uploads/default/original/1X/babd79106658d83557eeb5669ac3a32605524b6a.png)

---

<div class="post-metadata">

**Author:** ![wizard](https://forum.electromage.com/user_avatar/forum.electromage.com/wizard/32/4_2.png) [@wizard](https://forum.electromage.com/u/wizard)\
**Post date:** [September 11, 2019, 6:21pm UTC](https://forum.electromage.com/t/mapping-a-helix/71/3 "2019-09-11T18:21:06Z")

</div>

You might also be interested in this blog post, covering the helix mapper for a really cool project. The rest of the series is pretty neat!

> **[Pixelblaze Pixel Map For LED Helix](https://newscrewdriver.com/2019/07/04/pixelblaze-pixel-map-for-led-helix/)**
>
> Completing first draft of a LED helix mechanical chassis means everything is in place to dig into Pixelblaze and start playing with the software end of things. There are a selection of built-in pat…

---

<div class="post-metadata">

**Author:** ![eike](https://forum.electromage.com/user_avatar/forum.electromage.com/eike/32/38_2.png) [@eike](https://forum.electromage.com/u/eike)\
**Post date:** [September 11, 2019, 6:34pm UTC](https://forum.electromage.com/t/mapping-a-helix/71/4 "2019-09-11T18:34:20Z")

</div>

this is great, thanks!!

---

<div class="post-metadata">

**Author:** ![eike](https://forum.electromage.com/user_avatar/forum.electromage.com/eike/32/38_2.png) [@eike](https://forum.electromage.com/u/eike)\
**Post date:** [September 11, 2019, 6:35pm UTC](https://forum.electromage.com/t/mapping-a-helix/71/5 "2019-09-11T18:35:11Z")

</div>

this project looks great but it wasnt quite sinking in as well as this code you just posted.
