ThreeCSG expand gives faulty mesh

154 Views Asked by At

I'm trying to create a rounded cube using the ThreeCSG expand function on a csg model, but the resulting mesh looks wrong. I can't figure out what the problem is though. Does anyone have experience with ThreeCSG and see what's up ? thanks. the code:

var a = CSG.cube();
var b = a.expand( 0.4, 6 ); 
this.m_scene.add( new THREE.Mesh( THREE.CSG.fromCSG( b ), new THREE.MeshNormalMaterial() ) );

the resulting mesh is here:

mesh
(source: jvanderspek.com)

thanks,

Jonathan

1

There are 1 best solutions below

0
On

Your vertexNormals somehow fail. Seems they got "lost in translation".

Check my answer on another question here. It might be the same problem.