56 lines
1.0 KiB
JavaScript
56 lines
1.0 KiB
JavaScript
const _CSGDEBUG = false
|
|
|
|
/** Number of polygons per 360 degree revolution for 2D objects.
|
|
* @default
|
|
*/
|
|
const defaultResolution2D = 32 // FIXME this seems excessive
|
|
/** Number of polygons per 360 degree revolution for 3D objects.
|
|
* @default
|
|
*/
|
|
const defaultResolution3D = 12
|
|
|
|
/** Epsilon used during determination of near zero distances.
|
|
* @default
|
|
*/
|
|
const EPS = 1e-5
|
|
|
|
/** Epsilon used during determination of near zero areas.
|
|
* @default
|
|
*/
|
|
const angleEPS = 0.10
|
|
|
|
/** Epsilon used during determination of near zero areas.
|
|
* This is the minimal area of a minimal polygon.
|
|
* @default
|
|
*/
|
|
const areaEPS = 0.50 * EPS * EPS * Math.sin(angleEPS)
|
|
|
|
const all = 0
|
|
const top = 1
|
|
const bottom = 2
|
|
const left = 3
|
|
const right = 4
|
|
const front = 5
|
|
const back = 6
|
|
// Tag factory: we can request a unique tag through CSG.getTag()
|
|
let staticTag = 1
|
|
const getTag = () => staticTag++
|
|
|
|
module.exports = {
|
|
_CSGDEBUG,
|
|
defaultResolution2D,
|
|
defaultResolution3D,
|
|
EPS,
|
|
angleEPS,
|
|
areaEPS,
|
|
all,
|
|
top,
|
|
bottom,
|
|
left,
|
|
right,
|
|
front,
|
|
back,
|
|
staticTag,
|
|
getTag
|
|
}
|