How can I make terrain motelation like the terrain gun in Astroneer?

I want to make a tool that I can use in-game to shape terrain similar to the terrain tool in Astroneer.