• Creates a 3D mesh, with the given parameters.

     //Create a simple triangle in the X-Y plane
    var mesh = MeshFactory.create3DMesh([0,0,0, 1,0,0, 0,1,0], [0,1,2], {});
    //In your FeaturePainter
    featurePainter.paintBody = function(geocanvas, feature, shape, layer, map, paintState) {
    //An instance of Icon3DStyle
    var icon3dstyle = {mesh: mesh, legacyAxis: false};
    geocanvas.drawIcon3D(shape, icon3dstyle);
    };

    Parameters

    • positions: number[]

      An array of positions containing (X,Y,Z) positions defined in a local cartesian reference. The unit of measure is assumed to be meters. You can control how the local mesh is placed in the world with Icon3DStyle. Its documentation also provides a more in depth explanation of how to place the (local) positions in the world. In short; the Y-axis points north, the X-axis points east and the Z-axis points up.

      The positions in local cartesian reference
      Local positions placed in world
      The positions in local cartesian reference Local positions placed in world

    • indices: number[]

      An array of indices connecting the various positions together as a set of triangles. Each triple of indices points to the 3 vertices of a triangle. The indices of the triangle must match the indices of the positions in the positions array.

    • Optional options: MeshCreateOptions

      An object literal containing various options to create this 3D mesh.

    Returns Mesh

    A 3D mesh that can be painted by a FeaturePainter.