Method Overview
Name | Return Type | Summary | Object |
---|---|---|---|
Promise<ElevationSampler> | Creates an elevation sampler from a mesh. more details | meshUtils | |
Promise<Mesh> | Creates a mesh geometry by sampling elevation data from an elevation service on a regular grid. more details | meshUtils | |
VertexAttributes | Georeferences vertices specified in a Cartesian coordinate system. more details | meshUtils | |
Mesh | Merges multiple meshes into a single mesh. more details | meshUtils | |
VertexAttributes | Projects georeferenced vertices to a Cartesian coordinate system. more details | meshUtils |
Method Details
-
createElevationSampler(mesh, options){Promise<ElevationSampler>}Since: ArcGIS Maps SDK for JavaScript 4.12
-
Creates an elevation sampler from a mesh. The sampler can be used to query elevation values on the surface of the mesh. The elevation sampler uses a snapshot of the Mesh geometry and will not update if the mesh changes after the sampler has been created.
Parametersmesh MeshThe mesh geometry used to create the elevation sampler.
options ObjectoptionalAdditional options.
SpecificationnoDataValue NumberoptionalDefault Value: 0The value to use when there is no data available.
ReturnsType Description Promise<ElevationSampler> An elevation sampler.
-
Creates a mesh geometry by sampling elevation data from an elevation service on a regular grid.
Parameterssource ElevationLayer|Ground|ElevationSamplerThe source from which to query the elevation data.
extent ExtentThe extent from which to create the mesh.
options ObjectoptionalAdditional options.
params.material MeshMaterialoptionalThe material to be used for the mesh.
optional Default Value: autoControls 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.options.signal AbortSignaloptionalSignal object that can be used to abort the asynchronous task.
ReturnsType Description 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, options){VertexAttributes}
-
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 unit of the source data defaults to the unit of thelocation
's spatial reference. If the coordinate system is WGS84, metric units are used as the default. The unit of the source data may be specified in the additionaloptions
in which case a linear unit scale will automatically be applied to bring the source data in the unit of the spatial reference.ParametersSpecificationvertexAttributes VertexAttributesThe position and normal buffers to georeference.
location PointThe location at which to georeference the position and normal buffers.
options ObjectoptionalAdditional options.
Specificationgeographic BooleanoptionalIndicates whether to georeference relative to the globe or the projected coordinate system.
unit StringoptionalIndicates the unit of the source data. A linear scale will be applied to the position attributes to convert the source data to the unit of the spatial reference at which the mesh is being georeferenced. By default the unit of the source data is assumed to be the same as the target spatial reference.
Possible Values:"millimeters"|"centimeters"|"decimeters"|"meters"|"kilometers"|"inches"|"feet"|"yards"|"miles"|"nautical-miles"|"us-feet"
ReturnsType Description VertexAttributes The georeferenced position and normal buffers. Examplelet geoVertexAttributes = meshUtils.georeference(vertexAttributes, location); let 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.
ParameterOne or more meshes.
ReturnsType Description Mesh The merged mesh geometry. Examplelet mergedMesh = meshUtils.merge([mesh1, mesh2]);
-
ungeoreference(vertexAttributes, location, options){VertexAttributes}
-
Projects georeferenced vertices to a Cartesian coordinate system. This is useful for converting existing scene geometry so that it can be used as source material for generating new 3D meshes. This method operates on mesh vertex attributes and will convert positions and normals (if specified) from georeferenced coordinates at the specified
location
to a local (0, 0, 0) Cartesian system. The unit of the resulting data defaults to the unit of thelocation
's spatial reference. If the coordinate system is WGS84, metric units are used as the default. The unit of the resulting data may be specified in the additionaloptions
in which case a linear unit scale will automatically be applied.ParametersSpecificationvertexAttributes VertexAttributesThe georeferenced position and normal buffers.
location PointThe location to which the position and normal buffers are georeferenced.
options ObjectoptionalAdditional options.
Specificationgeographic BooleanoptionalIndicates whether the coordinates are georeferenced relative to the globe or the projected coordinate system.
unit StringoptionalIndicates the unit of the resulting data. A linear scale will be applied to the position attributes to convert the source data to the specified unit. By default the unit of the resulting data will be the same as the source spatial reference.
Possible Values:"millimeters"|"centimeters"|"decimeters"|"meters"|"kilometers"|"inches"|"feet"|"yards"|"miles"|"nautical-miles"|"us-feet"
ReturnsType Description VertexAttributes The position and normal buffers in a local Cartesian coordinate system. Examplelet vertexAttributes = meshUtils.ungeoreference(geoVertexAttributes, location);
Type Definitions
-
VertexAttributes Object
-
Represents the position and normal vertex attribute buffers of a mesh.
- Properties
-
position Float64Array
The position buffer.
normal Float32ArrayThe normal buffer.
tangent Float32ArrayThe tangent buffer.