API

Function ExtrudePolygon

  • Creates an extruded polygon mesh, with depth in the Y direction.

    • You can set different colors and different images to the top, bottom and extruded side by using the parameters faceColors (an array of 3 Color3 elements) and faceUV (an array of 3 Vector4 elements)
    • The smoothingThreshold option defines the dot product threshold for smoothing the normals of adjacent side faces. The default value of 2 disables smoothing

    Parameters

    • name: string

      defines the name of the mesh

    • options: {
          backUVs?: Vector4;
          depth?: number;
          faceColors?: Color4[];
          faceUV?: Vector4[];
          frontUVs?: Vector4;
          holes?: Vector3[][];
          shape: Vector3[];
          sideOrientation?: number;
          smoothingThreshold?: number;
          updatable?: boolean;
          wrap?: boolean;
      }

      defines the options used to create the mesh

    • scene: Nullable<Scene> = null

      defines the hosting scene

    • earcutInjection: any = earcut

      can be used to inject your own earcut reference

    Returns Mesh

    the polygon mesh