Closed gkjohnson closed 2 years ago
Though it looks like there's two overlapping triangles unexpectedly:
// split tri
new THREE.Triangle(
new THREE.Vector3( 0.1269903190542666, -0.15988833933004354, 0 ),
new THREE.Vector3( 0.5269903250147311, 0.5329319712626076, 0 ),
new THREE.Vector3( 0.32699033693566004, 0.5329319712626077, 0.20000000298023224 ),
)
// splitting tris
new THREE.Triangle(
new THREE.Vector3( 0.6000000238418579, 0, 0.20000000298023224 ),
new THREE.Vector3( 0.30000001192092896, 0.5196152329444885, 0.20000000298023224 ),
new THREE.Vector3( 0.20000000298023224, 0.3464101552963257, 2.4492935397342132e-17 ),
),
new THREE.Triangle(
new THREE.Vector3( 0.4000000059604645, 0, 2.4492935397342132e-17 ),
new THREE.Vector3( 0.6000000238418579, 0, 0.20000000298023224 ),
new THREE.Vector3( 0.20000000298023224, 0.3464101552963257, 2.4492935397342132e-17 ),
),
new THREE.Triangle(
new THREE.Vector3( 0.4000000059604645, 0, 2.4492935397342132e-17 ),
new THREE.Vector3( 0.20000000298023224, 0.3464101552963257, 2.4492935397342132e-17 ),
new THREE.Vector3( 0.30000001192092896, 0.5196152329444885, -0.20000000298023224 ),
),
new THREE.Triangle(
new THREE.Vector3( 0.800000011920929, 0, -4.8985870794684264e-17 ),
new THREE.Vector3( 0.6000000238418579, 0, -0.20000000298023224 ),
new THREE.Vector3( 0.4000000059604645, 0.6928203105926514, -4.8985870794684264e-17 ),
),
new THREE.Triangle(
new THREE.Vector3( 0.800000011920929, 0, 0 ),
new THREE.Vector3( 0.4000000059604645, 0.6928203105926514, 0 ),
new THREE.Vector3( 0.30000001192092896, 0.5196152329444885, 0.20000000298023224 ),
)
reduced problem triangle set
const tri = new THREE.Triangle(
new THREE.Vector3( 0.1269903190542666, -0.15988833933004354, 0 ),
new THREE.Vector3( 0.5269903250147311, 0.5329319712626076, 0 ),
new THREE.Vector3( 0.32699033693566004, 0.5329319712626077, 0.20000000298023224 ),
);
const tris = [
// lower tri
new THREE.Triangle(
new THREE.Vector3( 0.4000000059604645, 0, 2.4492935397342132e-17 ),
new THREE.Vector3( 0.6000000238418579, 0, 0.20000000298023224 ),
new THREE.Vector3( 0.20000000298023224, 0.3464101552963257, 2.4492935397342132e-17 ),
),
// upper tri
new THREE.Triangle(
new THREE.Vector3( 0.800000011920929, 0, 0 ),
new THREE.Vector3( 0.4000000059604645, 0.6928203105926514, 0 ),
new THREE.Vector3( 0.30000001192092896, 0.5196152329444885, 0.20000000298023224 ),
)
];
Follow on from #28
Looks like there's a triangle not getting split:
Next step: find the triangle that that's clipped from and the other triangles it's intersecting