Triangle Mesh
Represents a 3D triangle mesh.
Altitudes within the mesh's positions are interpreted according to the mesh's altitude mode, which can be one of the following:
If the latter, the mesh positions' altitudes are ignored. (If the mesh should be draped onto the terrain, you might want to use surface Polygon instead.)
Meshes have separate attributes for normal display and highlighted display. They use the interior and outline attributes of ShapeAttributes. If those attributes identify an image, that image is applied to the mesh. Texture coordinates for the image may be specified, but if not specified the full image is stretched over the full mesh. If texture coordinates are specified, there must be one texture coordinate for each vertex in the mesh.
Parameters
An array containing the mesh vertices. There must be no more than 65536 positions. Use split to subdivide large meshes into smaller ones that fit this limit.
An array of integers identifying the positions of each mesh triangle. Each sequence of three indices defines one triangle in the mesh. The indices identify the index of the position in the associated positions array. The indices for each triangle should be in counter-clockwise order to identify the triangles as front-facing.
The attributes to associate with this mesh. May be null, in which case default attributes are associated.
Throws
If the specified positions array is null, empty or undefined, the number of indices is less than 3 or too many positions are specified (limit is 65536).
Constructors
Properties
AltitudeMode used by movable object
Scales the altitudes of this mesh.
Indicates the shape's normal (non-highlight) attributes.
Base altitude level of shape sides. Is dependent on altitudeMode. Ground level by default.
Indicates the shape's highlight attributes.
Draw sides of the shape which extend from the defined position and altitude to baseAltitude level.
Determines whether this shape's geometry follows the terrain surface or is fixed at a constant altitude.
Indicates whether the shape is highlighted.
true when this shape's referencePosition coincides with where the user actually sees the shape (Placemark, Label, sightlines — the reference is the rendered location). false for shapes whose reference is computed from extended geometry and may sit far from where the user grabbed (Polygon centroid, Path centroid, Mesh).
Optional lambda to control current shape visibility based on its attributes and frame render context
Maximum number of intermediate edge intervals across a half-equator (PI radians) of arc. Per-edge subdivision count is scaled by edge length: steps = round(maximumNumEdgeIntervals * distanceRadians / PI), then further adjusted by polarThrottle near the poles for surface shapes. 3D shapes use the unthrottled count. A value of 0 disables intermediate vertex generation.
The mesh outline indices, an array of integers identifying the positions in the outline. Each index in this array identifies the index of the corresponding position in the positions array of this mesh. May be null, in which case no outline is drawn.
Indicates whether this mesh is pickable when the pick point intersects transparent pixels of the image applied to this mesh. If no image is applied to this mesh, this property is ignored. If this property is true and an image with fully transparent pixels is applied to the mesh, the mesh is pickable at those transparent pixels, otherwise this mesh is not pickable at those transparent pixels.
Pole-throttle factor: higher values shrink the subdivision step near ±90° latitude so the straight 2D lon/lat segments between samples more closely follow the true great-circle path. A value of 0 disables throttling (uniform step).
Indicates this shape's geographic position. The position's altitude is relative to this shape's altitude mode.
This mesh's texture coordinates if this mesh is textured. A texture coordinate must be provided for each mesh position. If no texture coordinates are specified then texture is not applied to this mesh.
Functions
Apply simplestyle stroke / fill / stroke-width to a Path or Polygon's attributes. Writes outline / interior color only when there's an explicit value to apply — either the feature's stroke / fill property OR a non-null defaultLineColor / defaultFillColor. With both null (the default), an absent property leaves the renderable's existing color alone — important when the layer's shapeAttributes supplied an intentional template colour at construction time (e.g. Shapefile's translucent blue) that would otherwise be clobbered by auto-style.
Determines all intersections between the given ray and this mesh.