gkjohnson / three-bvh-csg

A flexible, memory compact, fast and dynamic CSG implementation on top of three-mesh-bvh
MIT License
623 stars 49 forks source link

Planar faces failure #185

Closed gkjohnson closed 10 months ago

gkjohnson commented 11 months ago

Related to #163

Using the coplanar hit side check every time provides a correct result. The triangles must not be being marked as coplanar?

image
const w = 0.45;
const h = 0.45;
const l = 0.45;
const e = ( w + h + l ) / 30;

const b1 = new Brush( new BoxGeometry() );
b1.scale.set( l - e, h - e, w + 1e-4 );
b1.updateMatrixWorld();

const b2 = new Brush( new BoxGeometry() );
b2.scale.set( l + 1e-4, h - e, w - e );
b2.updateMatrixWorld();

const evaluator = new Evaluator();
const result = evaluator.evaluate( b1, b2, ADDITION );
gkjohnson commented 10 months ago

It seems as though the coplanar triangles are not being detected as intersecting?