javascript - 什么是“未捕获 RangeError:超出最大调用堆栈大小”
问题描述
我正在尝试实现一个threecsg库,但是当尝试使用实现的函数时,我收到一条错误消息:“Uncaught RangeError: Maximum call stack size exceeded at Plane.splitPolygon (code.html:229)”
代码是:
/******Code ommitted above******/
// Split `polygon` by this plane if needed, then put the polygon or polygon
// fragments in the appropriate lists. Coplanar polygons go into either
// `coplanarFront` or `coplanarBack` depending on their orientation with
// respect to this plane. Polygons in front or in back of this plane go into
// either `front` or `back`.
splitPolygon(polygon, coplanarFront, coplanarBack, front, back) { //this is the line with issues
var COPLANAR = 0;
var FRONT = 1;
var BACK = 2;
var SPANNING = 3;
// Classify each point as well as the entire polygon into one of the above
// four classes.
var polygonType = 0;
var types = [];
for (var i = 0; i < polygon.vertices.length; i++) {
var t = this.normal.dot(polygon.vertices[i].pos) - this.w;
var type = (t < -Plane.EPSILON) ? BACK : (t > Plane.EPSILON) ? FRONT : COPLANAR;
polygonType |= type;
types.push(type);
}
/******code omitted below******/
解决方案
推荐阅读
- python - Ubuntu EC2 - 重启时运行 Python 脚本
- javascript - 调试这个并帮助找到解决这个问题
- python - 如何读取这个特定的 pbf 文件
- c++ - 在一定长度后从数组打印出时缺少整数
- tensorflow - 如何在 tensorboard 中可视化 K 折交叉验证
- javascript - 在 React 钩子中调用函数是可能的
- javascript - 从 e.target.parentNode 获取特定 div 后,我们如何访问它的某些属性/属性
- .net - 使用 dot Net MS Graph SDK 获取自己的用户信息时出现错误代码 406?
- python - 在 Python 中使用 get 和 requests 时如何防止下载空的 pdf 文件?
- python - 从循环创建数据集