1 | const _CSGDEBUG = false
|
2 |
|
3 | /** Number of polygons per 360 degree revolution for 2D objects.
|
4 | * @default
|
5 | */
|
6 | const defaultResolution2D = 32 // FIXME this seems excessive
|
7 | /** Number of polygons per 360 degree revolution for 3D objects.
|
8 | * @default
|
9 | */
|
10 | const defaultResolution3D = 12
|
11 |
|
12 | /** Epsilon used during determination of near zero distances.
|
13 | * @default
|
14 | */
|
15 | const EPS = 1e-5
|
16 |
|
17 | /** Epsilon used during determination of near zero areas.
|
18 | * @default
|
19 | */
|
20 | const angleEPS = 0.10
|
21 |
|
22 | /** Epsilon used during determination of near zero areas.
|
23 | * This is the minimal area of a minimal polygon.
|
24 | * @default
|
25 | */
|
26 | const areaEPS = 0.50 * EPS * EPS * Math.sin(angleEPS)
|
27 |
|
28 | const all = 0
|
29 | const top = 1
|
30 | const bottom = 2
|
31 | const left = 3
|
32 | const right = 4
|
33 | const front = 5
|
34 | const back = 6
|
35 | // Tag factory: we can request a unique tag through CSG.getTag()
|
36 | let staticTag = 1
|
37 | const getTag = () => staticTag++
|
38 |
|
39 | module.exports = {
|
40 | _CSGDEBUG,
|
41 | defaultResolution2D,
|
42 | defaultResolution3D,
|
43 | EPS,
|
44 | angleEPS,
|
45 | areaEPS,
|
46 | all,
|
47 | top,
|
48 | bottom,
|
49 | left,
|
50 | right,
|
51 | front,
|
52 | back,
|
53 | staticTag,
|
54 | getTag
|
55 | }
|