require(["esri/geometry/support/meshUtils"], function(meshUtils) { /* code goes here */ });
Object: esri/geometry/support/meshUtils
Since: ArcGIS API for JavaScript 4.7

Various utilities and convenience functions for working with Mesh objects.

Method Overview

NameReturn TypeSummaryObject
Promise<Mesh>

Creates a mesh geometry by sampling elevation data from an elevation service on a regular grid.

more details
more detailsmeshUtils
meshUtils

Georeferences vertices specified in a Cartesian coordinate system.

more details
more detailsmeshUtils
Mesh

Merges multiple meshes into a single mesh.

more details
more detailsmeshUtils

Method Details

createFromElevation(source, extent, params){Promise<Mesh>}

Creates a mesh geometry by sampling elevation data from an elevation service on a regular grid.

Parameters:

The source from which to query the elevation data.

extent Extent

The extent from which to create the mesh.

params Object
optional

Optional parameters.

Specification:
material Object
optional

The material.

Specification:
optional

The material color.

demResolution Number|String
optional
Default Value: auto

Controls the horizontal resolution (cell size) in meters from which elevation data is sampled (defaults to auto). See ElevationLayer.queryElevation for more details on the different settings.

Returns:
TypeDescription
Promise<Mesh>A promise that resolves to a mesh geometry representing the elevation data at the specified extent.
Example:
// Create a mesh by sampling the ground
meshUtils.createFromElevation(map.ground, extent)
    .then(function(mesh) {
      // Do something with the mesh
    });

// Create a mesh by sampling the ground surface currently in view
meshUtils.createFromElevation(view.groundView.elevationSampler, view.extent)
    .then(function(mesh) {
      // Do something with the mesh
    });
georeference(vertexAttributes, location, params){meshUtils}

Georeferences vertices specified in a Cartesian coordinate system. This is useful when converting general 3D model meshes not typically georeferenced. This method operates on mesh vertex attributes and will convert positions and normals (if specified) from a local (0, 0, 0) Cartesian system to the properly georeferenced coordinates at the specified location. The location's coordinate system determines the units of the converted positions. If the coordinate system is WGS84, metric units are used.

Parameters:
vertexAttributes meshUtils

The position and normal buffers to georeference.

location Point

The location at which to georeference the position and normal buffers.

params Object
optional

Optional parameters.

Specification:
geographic Boolean
optional

Indicates whether to georeference relative to the globe or the projected coordinate system.

Returns:
TypeDescription
meshUtilsThe georeferenced position and normal buffers.
Example:
var geoVertexAttributes = meshUtils.georeference(vertexAttributes, location);
var mesh = new Mesh({
  vertexAttributes: geoVertexAttributes,
  spatialReference: location.spatialReference
});
merge(geometries){Mesh}

Merges multiple meshes into a single mesh. All mesh geometries must be in the same spatial reference.

Parameter:
geometries Mesh[]

One or more meshes.

Returns:
TypeDescription
MeshThe merged mesh geometry.
Example:
var mergedMesh = meshUtils.merge([mesh1, mesh2]);

Type Definitions

VertexAttributesObject

Represents the position and normal vertex attribute buffers of a mesh.

Properties:
position Float64Array

The position buffer.

optional

The normal buffer.

API Reference search results

NameTypeModule
Loading...