前言:我正在使用Three-CSG来尝试合并 Three.js 中的几何图形。
Uncaught ThreeBSP: Given geometry is unsupported
将 THREE.Mesh 的实例传递到库的ThreeBSP
方法中时出现错误。
任何想法为什么我会收到此错误?我在下面提供了我的代码片段,我传递给库方法的对象评估true
为instanceof
THREE.Mesh
来自我的 js 文件中的一个,所以我对代码抛出错误的原因一无所知。任何帮助将不胜感激!
import THREE from 'three';
import CSG from 'three-csg';
[...]
export const meshFactory = () => {
const cone = {};
cone.geometry = new THREE.CylinderGeometry(5, 100, 100, 32);
cone.mesh = new THREE.Mesh(cone.geometry);
console.log(cone.mesh instanceof THREE.Mesh); // prints true
const coneBSP = new CSG(cone.mesh); // error thrown here as it doesn't appear to be an instance of THREE.Mesh or other valid cases
[...]
};
谢谢,詹姆斯。