UNPKG

1.07 kBJavaScriptView Raw
1const _CSGDEBUG = false
2
3/** Number of polygons per 360 degree revolution for 2D objects.
4 * @default
5 */
6const defaultResolution2D = 32 // FIXME this seems excessive
7/** Number of polygons per 360 degree revolution for 3D objects.
8 * @default
9 */
10const defaultResolution3D = 12
11
12/** Epsilon used during determination of near zero distances.
13 * @default
14 */
15const EPS = 1e-5
16
17/** Epsilon used during determination of near zero areas.
18 * @default
19 */
20const 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 */
26const areaEPS = 0.50 * EPS * EPS * Math.sin(angleEPS)
27
28const all = 0
29const top = 1
30const bottom = 2
31const left = 3
32const right = 4
33const front = 5
34const back = 6
35// Tag factory: we can request a unique tag through CSG.getTag()
36let staticTag = 1
37const getTag = () => staticTag++
38
39module.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}