问题描述
我有一个 BufferGeometry 从中提取边缘并显示线条:
const geometry = new THREE.BufferGeometry();
geometry.setAttribute('position',new THREE.BufferAttribute(vertices,3));
const edges = new THREE.EdgesGeometry(geometry);
const line = new THREE.Linesegments(edges,new THREE.LineBasicMaterial({ color: 0xc4eaff }));
scene.add(line);
现在我有一个相当复杂的形状。从这个形状中提取出不存在的边缘(见下图)。我的第一个想法是,我的形状可能有一些小孔,但是当我显示整个网格时,我看不到任何孔。
有没有人知道为什么会这样?
线段:
网格:
const geometry = new THREE.BufferGeometry();
geometry.setAttribute('position',3));
const mesh = new THREE.Mesh(geometry,new THREE.MeshBasicMaterial({color: 0x77a6f2,side: THREE.DoubleSide}));
scene.add(mesh);
带有 Linesegments 叠加层的网格(由于可见性,只有一部分):
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)