From 3245c642975dfdd0ebb33e6dcb1af693e4701565 Mon Sep 17 00:00:00 2001 From: FishOrBear Date: Wed, 31 Oct 2018 09:32:52 +0800 Subject: [PATCH] fix threejs `ShapeUtils` ref: https://github.com/mrdoob/three.js/blob/dev/src/extras/ShapeUtils.js --- types/three/three-core.d.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/types/three/three-core.d.ts b/types/three/three-core.d.ts index 66276bb1f4..1e0ed32989 100755 --- a/types/three/three-core.d.ts +++ b/types/three/three-core.d.ts @@ -6688,11 +6688,17 @@ export namespace SceneUtils { export function attach(child: Object3D, scene: Scene, parent: Object3D): void; } +interface Vec2 +{ + x: number; + y: number; +} + export namespace ShapeUtils { - export function area(contour: number[]): number; - export function triangulate(contour: number[], indices: boolean): number[]; - export function triangulateShape(contour: number[], holes: any[]): number[]; - export function isClockWise(pts: number[]): boolean; + export function area(contour: Vec2[]): number; + export function triangulate(contour: Vec2[], indices: boolean): number[]; + export function triangulateShape(contour: Vec2[], holes: Vec2[]): number[][]; + export function isClockWise(pts: Vec2[]): boolean; } // Extras / Audio /////////////////////////////////////////////////////////////////////