threeJS / threeCSG - 使用 EdgesGeometry 时在 threeCSG 布尔函数之后共面的杂散边

threeJS / threeCSG - stray edges on coplanar faces after threeCSG boolean functions when using EdgesGeometry

我正在使用 EdgesGeometry 来显示网格的外边缘:EdgesGeometry( geometry, thresholdAngle )。

这通常按预期工作,但在使用 threeCSG 到 'subtract' 或 'union' 然后在生成的网格上生成 EdgesGeometry 后,我在共面面上出现各种杂散边,即使我增加 'thresholdAngle' 表示“180 度”,它们仍然存在。

事情是这样的——

这是我的代码: (a & b 是盒子几何体的网格)

a_ = new ThreeBSP( a );
b_ = new ThreeBSP( b );

c_ = a_.subtract(b_);
c = c_.toMesh(mat_cube);

scene.add( c );

edges = new THREE.EdgesGeometry( c.geometry, 5 )
line = new THREE.LineSegments( edges, mat_line )
scene.add( line )

有人有什么想法吗? 谢谢

更新

下面是 'WireframeGeometry' 的样子...

使用 EdgesGeometry 进行渲染时,您会看到意外的 "edges"。

原因是 threeCSG 的输出结果。

大三角形的长边与三个小三角形的边重合——重合,但不共享.

也就是说,长边根本不共享。三个短边也不是。

未共享的边由 EdgesGeometry 渲染。

three.js r.87