modifyMesh

The modifyMesh object enables creation of modify mesh objects. Modify mesh objects modify the elevation values in an area of the mesh based on a polygon. The surface of the mesh is raised or lowered according to the elevation values of the polygon's points and the options set. The following member and method are available:

§  items

§  create()

items

static items : Array<TerraExplorerObject>

Returns an array of TerraExplorerObject containing all modify mesh objects in the project.

 

create

create(description, polygon, altitude, options) → {promise}

Creates a modify mesh object.

Parameters

Name

Type

Description

description

String

The name of the modify mesh object as it appears in the Layers and Objects section of the Analysis tab on the sidebar.

polygon

Array of
 Cesium.Cartesian3

Array which represents the modify mesh polygon.

altitude

Number

The altitude by which to raise or lower the surface of the terrain in the area of the modify mesh polygon.

meshObject

TerraExplorerObject

The TerraExplorerObject representing the mesh object that the modification should apply to.

options

Object

Name

Type

Description

mtType

Number

Determines how the modified mesh elevation values affect the mesh's elevation. The following are the possible values: 

§  Replace = 0
Replaces the area defined by the modified mesh object with the passed altitude value. All points of the modified mesh are set at the same altitude, creating a horizontal flat surface (default).

§  Offset_Altitude = 1
Offsets the area defined by the modified mesh with the passed altitude value.

§  Crop_Above = 2
Replaces all elevation values that are higher than the passed altitude value with the passed altitude value.

§  Crop_Below = 3
Replaces all elevation values that are lower than the passed altitude value with the passed altitude value.

Returns

Promise - A promise that resolves to the newly created modify mesh TerraExplorerObject object.

 

Example

The following example creates a modifyMesh object:

var pos1 = Cesium.Cartesian3.fromDegrees(-81.38165, 28.54462);

var pos2 = Cesium.Cartesian3.fromDegrees(-81.37607, 28.54469);

var pos3 = Cesium.Cartesian3.fromDegrees(-81.37596, 28.54060);

var pos4 = Cesium.Cartesian3.fromDegrees(-81.38165, 28.54060);

var cart = [pos1, pos2, pos3, pos4];

 

Cesium.when(TerraExplorer.layers.mesh.create("Orlando ©Dat'Air", "https://www.skylineglobe.com/sg/streamer.ashx", "sg3dml_orlando", true),function(_3DMLObj){

Cesium.when(TerraExplorer.objects.modifyMesh.create("modifyMesh", cart, 150, _3DMLObj, {}),function(ModifyTerrainObject){

ModifyTerrainObject.flyTo();

});});