forked from mrdoob/three.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConvexHull.d.ts
103 lines (83 loc) · 2.35 KB
/
ConvexHull.d.ts
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
import {
Object3D,
Ray,
Vector3
} from '../../../src/Three';
declare class Face {
constructor();
normal: Vector3;
midpoint: Vector3;
area: number;
constant: number;
outside: VertexNode;
mark: number;
edge: HalfEdge;
static create( a: VertexNode, b: VertexNode, c: VertexNode ): Face;
compute(): this;
getEdge( i: number ): HalfEdge;
}
declare class HalfEdge {
constructor( vertex: VertexNode, face: Face );
vertex: VertexNode;
prev: HalfEdge;
next: HalfEdge;
twin: HalfEdge;
face: Face;
head(): VertexNode;
length(): number;
lengthSquared(): number;
setTwin( edge: HalfEdge ): this;
tail(): VertexNode;
}
declare class VertexNode {
constructor( point: Vector3 );
point: Vector3;
prev: VertexNode;
next: VertexNode;
face: Face;
}
declare class VertexList {
constructor();
head: VertexNode;
tail: VertexNode;
append( vertex: VertexNode ): this;
appendChain( vertex: VertexNode ): this;
clear(): this;
first(): VertexNode;
insertAfter( target: VertexNode, vertex: VertexNode ): this;
insertBefore( target: VertexNode, vertex: VertexNode ): this;
isEmpty(): boolean;
last(): VertexNode;
remove( vertex: VertexNode ): this;
removeSubList( a: VertexNode, b: VertexNode ): this;
}
export class ConvexHull {
constructor();
tolerance: number;
faces: Face[];
newFaces: Face[];
assigned: VertexList;
unassigned: VertexList;
vertices: VertexNode[];
addAdjoiningFace( eyeVertex: VertexNode, horizonEdge: HalfEdge ): HalfEdge;
addNewFaces( eyeVertex: VertexNode, horizon: HalfEdge[] ): this;
addVertexToFace( vertex: VertexNode, face: Face ): this;
addVertexToHull( eyeVertex: VertexNode ): this;
cleanup(): this;
compute(): this;
computeExtremes(): object;
computeHorizon( eyePoint: Vector3, crossEdge: HalfEdge, face: Face, horizon: HalfEdge[] ): this;
computeInitialHull(): this;
containsPoint( point: Vector3 ): boolean;
deleteFaceVertices( face: Face, absorbingFace: Face ): this;
intersectRay( ray: Ray, target: Vector3 ): Vector3 | null;
intersectsRay( ray: Ray ): boolean;
makeEmpty(): this;
nextVertexToAdd(): VertexNode | undefined;
reindexFaces(): this;
removeAllVerticesFromFace( face: Face ): VertexNode | undefined;
removeVertexFromFace( vertex: VertexNode, face: Face ): this;
resolveUnassignedPoints( newFaces: Face[] ): this;
setFromPoints( points: Vector3[] ): this;
setFromObject( object: Object3D ): this;
}