three-ts-types icon indicating copy to clipboard operation
three-ts-types copied to clipboard

Incorrect typing for Earcut.triangulate return value

Open molnarm opened this issue 2 years ago • 0 comments

  • three version: 0.143
  • node version: 16.14.2
  • npm (or yarn) version: 8.5.0

Problem description:

According to its documentation and source, the Earcut.triangulate method returns "an array of triangles. A triangle is defined by three consecutive integers representing vertex indices"; but the typings use Triangle[] which is something else.

Suggested solution:

Should be fixed here, probably as: function triangulate(data: number[], holeIndices: number[], dim: number): number[];

molnarm avatar Sep 30 '22 07:09 molnarm