# Pavilion Mapping

**URL:** <https://forum.electromage.com/t/pavilion-mapping/711>\
**Category:** Show and Tell\
**Created:** [November 4, 2020, 2:21am UTC](https://forum.electromage.com/t/pavilion-mapping/711 "2020-11-04T02:21:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![spazzle](https://forum.electromage.com/user_avatar/forum.electromage.com/spazzle/32/2874_2.png) [@spazzle](https://forum.electromage.com/u/spazzle)\
**Post date:** [November 4, 2020, 2:21am UTC](https://forum.electromage.com/t/pavilion-mapping/711/1 "2020-11-04T02:21:43Z")

</div>

My wife has a medieval style pavilion. It is basically a small circus style tent that is held up with a central pole that has 16 spokes sticking out to hold up the structure. I’ve festooned it up with leds such that a string runs (1) out from the central axis along each even spoke to the tent wall, (2) then to the next odd spoke, (3) back to the central axis, (4) and then down to the floor. It looks like this

 ![image](https://forum.electromage.com/uploads/default/original/1X/8efcbff4820d62e9a2eec176a8abfc5552e822c1.png)  
I’m adapting the old fastled code which was split to each strip, such that each strip is independent using the pro driver and then adding patterns that use the XYZ mapping.

The map generating code looks like this.

> function (pixelCount) {  
> var map = ;  
> pixels\_per\_string=240  
> numstrings=8  
> initial\_offset=10  
> num\_first=50  
> //num\_arc=30  
> num\_second=initial\_offset+num\_first  
> num\_arc=num\_second_Math.PI \* 2/16  
> numpole=pixels\_per\_string-num\_first-num\_arc-num\_second-1  
> for (k=0;k\<numstrings;k++){  
> for (i = 0; i \< num\_first; i++) {  
> c = k / 8 \* Math.PI \* 2  
> map.push([Math.cos(c)_(i+initial\_offset), Math.sin(c)\*(i+initial\_offset),0])  
> }  
> for (i = 0; i \< num\_arc; i++) {  
> c = (k+i/num\_arc/2) / 8 \* Math.PI \* 2  
> map.push([Math.cos(c)_num\_second, Math.sin(c)num\_second,0])  
> }  
> for (i = 0; i \< num\_second; i++) {  
> c = (k+0.5) / 8 \* Math.PI \* 2  
> map.push([Math.cos(c)(num\_second-i), Math.sin(c)_(num\_second-i),0])  
> }  
> for (i = 0; i \< numpole; i++) {  
> c = (k) / 8 \* Math.PI \* 2  
> rad=5  
> map.push([Math.cos(c)\*rad, Math.sin(c)\*rad,-i])  
> } }  
> return map  
> }

---

<div class="post-metadata">

**Author:** ![zranger1](https://forum.electromage.com/user_avatar/forum.electromage.com/zranger1/32/301_2.png) [@zranger1](https://forum.electromage.com/u/zranger1)\
**Post date:** [November 4, 2020, 3:08am UTC](https://forum.electromage.com/t/pavilion-mapping/711/2 "2020-11-04T03:08:27Z")

</div>

That’s a great use of the mapping function. I’d love to see pictures or video of the pavillion in use!

---

<div class="post-metadata">

**Author:** ![spazzle](https://forum.electromage.com/user_avatar/forum.electromage.com/spazzle/32/2874_2.png) [@spazzle](https://forum.electromage.com/u/spazzle)\
**Post date:** [November 4, 2020, 4:26am UTC](https://forum.electromage.com/t/pavilion-mapping/711/3 "2020-11-04T04:26:10Z")

</div>

Me too :v . It’ll be a while before we have a chance to put it back up.
