File size: 1,834 Bytes
6cd9596
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
import { Vector3 } from './../math/Vector3';
import { Color } from './../math/Color';

export interface Event {
  type: string;
  target?: any;
  [attachment: string]: any;
}

/**
 * Triangle face.
 *
 * # Example
 *     var normal = new THREE.Vector3( 0, 1, 0 );
 *     var color = new THREE.Color( 0xffaa00 );
 *     var face = new THREE.Face3( 0, 1, 2, normal, color, 0 );
 *
 * @source https://github.com/mrdoob/three.js/blob/master/src/core/Face3.js
 */
export class Face3 {
  /**
   * @param a Vertex A index.
   * @param b Vertex B index.
   * @param c Vertex C index.
   * @param normal Face normal or array of vertex normals.
   * @param color Face color or array of vertex colors.
   * @param materialIndex Material index.
   */
  constructor(
    a: number,
    b: number,
    c: number,
    normal?: Vector3,
    color?: Color,
    materialIndex?: number
  );
  constructor(
    a: number,
    b: number,
    c: number,
    normal?: Vector3,
    vertexColors?: Color[],
    materialIndex?: number
  );
  constructor(
    a: number,
    b: number,
    c: number,
    vertexNormals?: Vector3[],
    color?: Color,
    materialIndex?: number
  );
  constructor(
    a: number,
    b: number,
    c: number,
    vertexNormals?: Vector3[],
    vertexColors?: Color[],
    materialIndex?: number
  );

  /**
   * Vertex A index.
   */
  a: number;

  /**
   * Vertex B index.
   */
  b: number;

  /**
   * Vertex C index.
   */
  c: number;

  /**
   * Face normal.
   */
  normal: Vector3;

  /**
   * Array of 4 vertex normals.
   */
  vertexNormals: Vector3[];

  /**
   * Face color.
   */
  color: Color;

  /**
   * Array of 4 vertex normals.
   */
  vertexColors: Color[];

  /**
   * Material index (points to {@link Geometry.materials}).
   */
  materialIndex: number;

  clone(): this;
  copy(source: Face3): this;
}