# PolylineVolume circle changing width

**URL:** <https://community.cesium.com/t/polylinevolume-circle-changing-width/14500>\
**Category:** CesiumJS\
**Created:** [July 20, 2021, 2:17pm UTC](https://community.cesium.com/t/polylinevolume-circle-changing-width/14500 "2021-07-20T14:17:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![DuncanScu](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/duncanscu/32/3458_2.png) [@DuncanScu](https://community.cesium.com/u/DuncanScu)\
**Post date:** [July 20, 2021, 2:17pm UTC](https://community.cesium.com/t/polylinevolume-circle-changing-width/14500/1 "2021-07-20T14:17:27Z")

</div>

Hi,  
I have a PolylineVolume where I have set the shape as a circle, similar to the sandcastle demo for polyline volumes. I need the PolylineVolume to have a set width at the start and end of the line so that the width increase/decreases smoothly from start to finish. Any help will be greatly appreciated 🙂

---

<div class="post-metadata">

**Author:** ![sam.rothstein](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/sam.rothstein/32/6584_2.png) [@sam.rothstein](https://community.cesium.com/u/sam.rothstein)\
**Post date:** [July 20, 2021, 2:31pm UTC](https://community.cesium.com/t/polylinevolume-circle-changing-width/14500/2 "2021-07-20T14:31:15Z")

</div>

@DuncanScu

I recommend using [linear interpolation](https://en.wikipedia.org/wiki/Linear_interpolation) to determine the radius of the circle at each point. The simplest way to implement this in sandcastle may be to “stack” multiple smaller circles with decreasing radii.

Once implemented, I would love to see a demo! I think adding this to the [Polyline Volume](https://sandcastle.cesium.com/?src=Polyline%20Volume.html) sandcastle would help other community members in the future.

-Sam

---

<div class="post-metadata">

**Author:** ![DuncanScu](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/duncanscu/32/3458_2.png) [@DuncanScu](https://community.cesium.com/u/DuncanScu)\
**Post date:** [July 20, 2021, 2:53pm UTC](https://community.cesium.com/t/polylinevolume-circle-changing-width/14500/3 "2021-07-20T14:53:33Z")

</div>

Sounds Good. Ill give it a go and let you know how it turns out 👍  
-Duncan

---

<div class="post-metadata">

**Author:** ![DuncanScu](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/duncanscu/32/3458_2.png) [@DuncanScu](https://community.cesium.com/u/DuncanScu)\
**Post date:** [July 20, 2021, 4:50pm UTC](https://community.cesium.com/t/polylinevolume-circle-changing-width/14500/4 "2021-07-20T16:50:26Z")

</div>

@sam.rothstein  
I managed to get it working! It can be a little slow and i’m sure there are ways to improve it, but i’m happy with it. The “smoothness” of the change gradient can be altered by increasing or decreasing the resolution variable. Check it out below 👍

> **[Cesium Sandcastle](https://sandcastle.cesium.com/#c=jVXfT9swEP5XTn1yRnADCDTRUk3rGC9Mm8bghfLgJm5qzbEj2ykqqP/7LnWaOKVovDT23Xe/vrtzV8zASvBnbuAKFH+GKbeiKujDVkZmg3R7n2rlmFDczAbRaKZmalGp1AmtINVFWTk+FSaVnBiWicpG8DpTACv0XWorapxF949Po1q80AZIrRMoS0b4GcPZRX04OmosvW3tjG0tm6R+MLekTv/2ciKikQe3QWhZ2SXxQgjLmTLj8MTUaasF8MnCJ9j6TbUlTcQofg9khWpBO0xz8Mls6h/DXWVUlxZqNj3SbjhSyZC1JVO5UPkvLdcS6X3Qsio4YTHMY/Ri8VrjY1gIxWRddxTwU2qhXECsl6ZYqs4NK5civXN46fibBiq6MLpoaSEsesfFtco+5GAeOsi5zlCc9mfqWkpRWi2ym0ZN3uQa78f201b7PTA2VwFH/fHpD1+YNhrvsqNIHzelltiJe+xs/t2wbX+CGREwDIK0LR/tTr4Hfu4OkeR0R9GhdKLOlVgAETCBJKjC12GbNvpgj01MyVXulnAMp0+jPp5ve/YO+mQfXTbDh10puDNrNPUvAuXKYcLcUpZlJMgJWhs/sJfQUwYLeQmP1vcVc3qK+yi7ZCXa9l8Q0o56j/kIN1BEew4KbJwRTF6286mlNvTr7f11D7kJbpuO8I0/NJ92aWu6drs8UyH/hx6Us+0efOO54dyS48/nNInh7JQmdZyuGR83vehMu/LRw0mSJCj/z9PRsd1/QM7ROvHL1DT3RevijyZ7ra4hg3gwtm4t+WTH1BdRlBopqIwklA4dL8p6aexwXqV/uaOptTtax8PQdJyJFYjs6sD/CKSSWYuaRSXlnXjhs8FkPET8G1OpcRpU/nPFjWTrGrY8mdx6IaV0PMTrYUuntZwzs+f5Hw)**
>
> The Cesium Sandcastle provides an interactive environment for testing Cesium code.

Please let me know if you do decide to use it in the sandcastle demo 🙂  
-Duncan

---

<div class="post-metadata">

**Author:** ![sam.rothstein](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/sam.rothstein/32/6584_2.png) [@sam.rothstein](https://community.cesium.com/u/sam.rothstein)\
**Post date:** [July 20, 2021, 5:03pm UTC](https://community.cesium.com/t/polylinevolume-circle-changing-width/14500/5 "2021-07-20T17:03:39Z")

</div>

@DuncanScu

That looks great! Thank you for sharing - I will keep you posted.

-Sam
