# How to draw complex shapes in cesium like a radar search fence?

**URL:** <https://community.cesium.com/t/how-to-draw-complex-shapes-in-cesium-like-a-radar-search-fence/8099>\
**Category:** CesiumJS\
**Created:** [March 12, 2019, 8:48pm UTC](https://community.cesium.com/t/how-to-draw-complex-shapes-in-cesium-like-a-radar-search-fence/8099 "2019-03-12T20:48:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrew\_Hinson](https://avatars.discourse-cdn.com/v4/letter/a/5daacb/32.png) [@Andrew\_Hinson](https://community.cesium.com/u/Andrew_Hinson)\
**Post date:** [March 12, 2019, 8:48pm UTC](https://community.cesium.com/t/how-to-draw-complex-shapes-in-cesium-like-a-radar-search-fence/8099/1 "2019-03-12T20:48:09Z")

</div>

I am trying to draw a shape similar to the blue image in the attached picture. I feel like I have tried every shape possible in cesium. I have tried polylineVolumes, polygons,and many more. I am new to cesium and do not see how to draw complex shapes. Does anyone have any advice on what to try. Here is some code that got me the closest to what I wanted but still will not work.

var orangePolygon = viewer.entities.add({  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name: 'Orange polygon with per-position heights and outline',  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;polygon: {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hierarchy: Cesium.Cartesian3.fromDegreesArrayHeights(  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[155.5, 54.37139, 50000,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n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nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;outlineColor: Cesium.Color.BLACK  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});

 ![search_fence.jpg](https://global.discourse-cdn.com/cesium/original/1X/f7ae21a85951ba575d524c4059077e45b1a35f0f.jpeg)

---

<div class="post-metadata">

**Author:** ![omar](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/omar/32/1999_2.png) [@omar](https://community.cesium.com/u/omar)\
**Post date:** [March 14, 2019, 9:37am UTC](https://community.cesium.com/t/how-to-draw-complex-shapes-in-cesium-like-a-radar-search-fence/8099/2 "2019-03-14T09:37:45Z")

</div>

There is sensor viewshed package built on top of CesiumJS that does what you need that’s available for commercial use:

> **[Cesium Analytics](https://cesium.com/ion-sdk/)**
>
> Cesium is geospatial. Use Cesium ion's simple workflow to create 3D maps of your geospatial data for visualization, analysis, and sharing. For developers, use the open-source CesiumJS library to create custom 3D mapping apps.

It constructs custom geometry to visualize these new types of entities. This tutorial explains a bit about CesiumJS’s primitives and geometry:

> **[Documentation | cesium.com](https://cesium.com/docs/)**
>
> Cesium is geospatial. Use Cesium ion's simple workflow to create 3D maps of your geospatial data for visualization, analysis, and sharing. For developers, use the open-source CesiumJS library to create custom 3D mapping apps.

There aren’t any tutorials on creating custom geometry right now, but you might find some helpful threads, like this one:

[https://groups.google.com/d/msg/cesium-dev/X0jeqiCxX7M/YBgpeRFhBQAJ](https://groups.google.com/d/msg/cesium-dev/X0jeqiCxX7M/YBgpeRFhBQAJ)

---

<div class="post-metadata">

**Author:** ![Andrew\_Hinson](https://avatars.discourse-cdn.com/v4/letter/a/5daacb/32.png) [@Andrew\_Hinson](https://community.cesium.com/u/Andrew_Hinson)\
**Post date:** [March 14, 2019, 2:34pm UTC](https://community.cesium.com/t/how-to-draw-complex-shapes-in-cesium-like-a-radar-search-fence/8099/3 "2019-03-14T14:34:40Z")

</div>

Sweet thank you. Do you know if there is an offline version of the ion sdk or an offline or open source version of the viewshed

---

<div class="post-metadata">

**Author:** ![omar](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/omar/32/1999_2.png) [@omar](https://community.cesium.com/u/omar)\
**Post date:** [March 15, 2019, 9:51am UTC](https://community.cesium.com/t/how-to-draw-complex-shapes-in-cesium-like-a-radar-search-fence/8099/4 "2019-03-15T09:51:16Z")

</div>

The ion sdk for measurements/viewsheds etc. is a fork of CesiumJS with these additional features, so it works offline just fine. It’s not open source though.
