• Return two typed array for the faces and the vertices making a sphere given by a subdivision. Note that all triangles are decoupled.

    {
    position: Float32Array,
    indices : Int16Array
    }

    Example

    import { generateSphere, Surface } from '@youwol/geometry

    const {positions, indices} = generateSphere(10)
    console.log('nb vertices :', positions.count)
    console.log('nb triangles:', indices.count)

    const surface = Surface.create(positions, indices)

    // const archSrface = new arch.Surface(positions.array, indices.array)

    Parameters

    • subdivision: number

      The number of subdivision (>0)

    • __namedParameters: {
          shared?: boolean;
          typed?: boolean;
      } = {}
      • Optional shared?: boolean
      • Optional typed?: boolean

    Returns {
        indices: IArray;
        positions: IArray;
    } | {
        indices: number[];
        positions: number[];
    }