# How to flat the overlap area between a polygon and a 3D tiles to a specific height?

**URL:** <https://community.cesium.com/t/how-to-flat-the-overlap-area-between-a-polygon-and-a-3d-tiles-to-a-specific-height/9585>\
**Category:** CesiumJS\
**Created:** [May 9, 2020, 9:34am UTC](https://community.cesium.com/t/how-to-flat-the-overlap-area-between-a-polygon-and-a-3d-tiles-to-a-specific-height/9585 "2020-05-09T09:34:24Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![ercs](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/ercs/32/1987_2.png) [@ercs](https://community.cesium.com/u/ercs)\
**Post date:** [May 9, 2020, 9:34am UTC](https://community.cesium.com/t/how-to-flat-the-overlap-area-between-a-polygon-and-a-3d-tiles-to-a-specific-height/9585/1 "2020-05-09T09:34:24Z")

</div>

I was trying to implement a feature that is to flat the overlap area between a polygon and a 3D tiles to a given height but didn’t make it.

![Flat a 3D Tiles](https://global.discourse-cdn.com/cesium/original/2X/d/d1f4426dff1abc4b8b951cb0b3f2075324617ad2.gif)

Cesium provides the clipping plane feature to trim the 3D Tiles which is very much similar to what I want to implement. The difference is that the clipping discards all the vertex but in my case, I want all the vertexes to be set in the same z value.

Therefore, I tried to modify the z value of there discarded fragment in the clipping shader. However, many errors came up with any of the changes I made.

---

<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:** [May 18, 2020, 7:54pm UTC](https://community.cesium.com/t/how-to-flat-the-overlap-area-between-a-polygon-and-a-3d-tiles-to-a-specific-height/9585/2 "2020-05-18T19:54:25Z")

</div>

Welcome to the Cesium community @ercs!

Is that gif you posted running in Cesium? There’s nothing built-in to do this, but your approach sounds reasonable. What errors did you get? Are you able to post an example or a link to your CesiumJS fork with these changes?

---

<div class="post-metadata">

**Author:** ![ercs](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/ercs/32/1987_2.png) [@ercs](https://community.cesium.com/u/ercs)\
**Post date:** [May 28, 2020, 1:42am UTC](https://community.cesium.com/t/how-to-flat-the-overlap-area-between-a-polygon-and-a-3d-tiles-to-a-specific-height/9585/3 "2020-05-28T01:42:36Z")

</div>

Thanks! @omar  
What the GIF shows is that I am trying to implement. So far, I didn’t manage to achieve the feature. And I would love to share that example and source code if I make it.

---

<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:** [May 28, 2020, 3:38pm UTC](https://community.cesium.com/t/how-to-flat-the-overlap-area-between-a-polygon-and-a-3d-tiles-to-a-specific-height/9585/4 "2020-05-28T15:38:58Z")

</div>

> [@ercs](#):
>
> So far, I didn’t manage to achieve the feature

So is the GIF from a different software, not from a Cesium app? I am curious to know a bit more about your use-case, is your goal to replace the buildings by flattening certain areas and adding different models on top, or something else?

---

<div class="post-metadata">

**Author:** ![ercs](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/ercs/32/1987_2.png) [@ercs](https://community.cesium.com/u/ercs)\
**Post date:** [June 11, 2020, 8:19am UTC](https://community.cesium.com/t/how-to-flat-the-overlap-area-between-a-polygon-and-a-3d-tiles-to-a-specific-height/9585/5 "2020-06-11T08:19:52Z")

</div>

Yes. It is built on Cesium.js lib. The user-case is very much like what you mentioned. It is mostly used in city planning. User needs to flat an area to place a new build model. Then save the scene as a workspace for comparing with the previous scene, or cruise viewing like the sight of a drone.

---

<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:** [June 11, 2020, 11:59am UTC](https://community.cesium.com/t/how-to-flat-the-overlap-area-between-a-polygon-and-a-3d-tiles-to-a-specific-height/9585/6 "2020-06-11T11:59:00Z")

</div>

> [@ercs](#):
>
> Yes. It is built on Cesium.js lib.

Great! Are you able to share how this was created so others in the community who may be interested in the same use cases can use it?

---

<div class="post-metadata">

**Author:** ![ercs](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/ercs/32/1987_2.png) [@ercs](https://community.cesium.com/u/ercs)\
**Post date:** [July 24, 2020, 3:41am UTC](https://community.cesium.com/t/how-to-flat-the-overlap-area-between-a-polygon-and-a-3d-tiles-to-a-specific-height/9585/8 "2020-07-24T03:41:25Z")

</div>

Just read this message. I just know that feature is built on Cesium.js Lib, but currently I don’t get a chance to try it. I would love to share it once I make it.

---

<div class="post-metadata">

**Author:** ![ariel](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/ariel/32/3458_2.png) [@ariel](https://community.cesium.com/u/ariel)\
**Post date:** [February 13, 2021, 6:13am UTC](https://community.cesium.com/t/how-to-flat-the-overlap-area-between-a-polygon-and-a-3d-tiles-to-a-specific-height/9585/9 "2021-02-13T06:13:04Z")

</div>

Any update on this? Have used this feature regularly in other applications. As you said, it is quite important in urban planning. We have recently moved to Cesium but have not been able to recreate a similar function. Would love to see a working example. It kills me that I have to create new tilesets with flat areas over and over again…

---

<div class="post-metadata">

**Author:** ![Waylawww](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/waylawww/32/5653_2.png) [@Waylawww](https://community.cesium.com/u/Waylawww)\
**Post date:** [July 23, 2021, 10:40am UTC](https://community.cesium.com/t/how-to-flat-the-overlap-area-between-a-polygon-and-a-3d-tiles-to-a-specific-height/9585/10 "2021-07-23T10:40:58Z")

</div>

hello

---

<div class="post-metadata">

**Author:** ![W-Joker-cmd](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/w-joker-cmd/32/8389_2.png) [@W-Joker-cmd](https://community.cesium.com/u/W-Joker-cmd)\
**Post date:** [March 7, 2022, 7:45am UTC](https://community.cesium.com/t/how-to-flat-the-overlap-area-between-a-polygon-and-a-3d-tiles-to-a-specific-height/9585/11 "2022-03-07T07:45:58Z")

</div>

Hi, I wonder if you have any progress?

---

<div class="post-metadata">

**Author:** ![Moises\_Herrera](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/moises_herrera/32/2926_2.png) [@Moises\_Herrera](https://community.cesium.com/u/Moises_Herrera)\
**Post date:** [November 4, 2022, 12:38am UTC](https://community.cesium.com/t/how-to-flat-the-overlap-area-between-a-polygon-and-a-3d-tiles-to-a-specific-height/9585/12 "2022-11-04T00:38:09Z")

</div>

I saw similar functionality in one of the Mars3D examples.

> **[功能示例(原生JS版) | Mars3D三维可视化平台 | 合肥火星科技有限公司](http://mars3d.cn/editor-es5.html?id=thing%2Ftileset%2FtilesetClip)**
>
> 火星科技 合肥火星 合肥火星科技 合肥火星科技有限公司 leaflet leaflet框架 leaflet开发 cesium cesium开发 cesium框架 gis marsgis 地图离线 地图开发 地图框架 地图外包 框架 开发 外包 地图离线 二维地图 三维地图 全景漫游 地理信息系统 云GIS 三维GIS GIS平台 WebGIS

> **[功能示例(原生JS版) | Mars3D三维可视化平台 | 合肥火星科技有限公司](http://mars3d.cn/editor-es5.html?id=thing%2Ftileset%2FtilesetFlat)**
>
> 火星科技 合肥火星 合肥火星科技 合肥火星科技有限公司 leaflet leaflet框架 leaflet开发 cesium cesium开发 cesium框架 gis marsgis 地图离线 地图开发 地图框架 地图外包 框架 开发 外包 地图离线 二维地图 三维地图 全景漫游 地理信息系统 云GIS 三维GIS GIS平台 WebGIS

Maybe you can have an approach with the developers of this project.  
I hope it will help you.  
Best
