UNPKG

@jscad/modeling

Version:

Constructive Solid Geometry (CSG) Library for JSCAD

12 lines (9 loc) 291 B
const { EPS } = require('../maths/constants') const calculateEpsilonFromBounds = (bounds, dimensions) => { let total = 0 for (let i = 0; i < dimensions; i++) { total += bounds[1][i] - bounds[0][i] } return EPS * total / dimensions } module.exports = calculateEpsilonFromBounds