How to accurately change the terrain to achieve earthwork balance

Hello, I want to ask how to accurately modify the terrain in grasshopper, according to the following requirements to write a script:

  1. I have a large terrain, and there is a small terrain on the large terrain that needs to be modified, and the modified boundary of the new terrain should be connected with the surrounding land shape
  2. Compared with the original form, the new terrain basically achieves earthwork balance (the amount of fill and excavation is basically the same).
  3. Compared with the original form, the average slope of the new terrain has slowed downPreformatted text

Uploading: 期末作业地形文件.3dm…

Hi @wangmeiyun,

Bison has some tools for this.