Skip to content

Commit

Permalink
Add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
gkjohnson committed Jul 21, 2023
1 parent a6f1c7b commit 4a9fb7f
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions test/IntersectionUtils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,7 @@ describe( 'Triangle Intersection line', () => {

// this test fails due to a bug in the intersection function. It only intersects
// on one triangle intersection order.
// See issue #538
it( 'triangles should return a correct intersection', () => {
it( 'triangles should return a correct intersection (issue #538)', () => {

t1.a.set( - 5.781455993652344, - 7.291503906249993, - 30 );
t1.b.set( - 5.781455993652344, - 7.291503906250007, 30 );
Expand All @@ -375,6 +374,29 @@ describe( 'Triangle Intersection line', () => {

} );

it.skip( 'triangles should return a correct intersection (issue #543)', () => {

Check warning on line 377 in test/IntersectionUtils.test.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Skipped test

t1.a.set( - 15.430519104003906, 29.432968139648445, - 25 );
t1.b.set( - 15.430519104003906, 29.43296813964843, 25 );
t1.c.set( 0, 29.432968139648445, - 25 );
t1.needsUpdate = true;

t2.a.set( - 4.854911804199219, 36.03794860839844, 0.0777292251586914 );
t2.b.set( - 15.430519104003906, 29.432968139648438, - 1.905876636505127 );
t2.c.set( - 16.118995666503906, 26.962722778320312, - 2.8487582206726074 );
t2.needsUpdate = true;

expected.start.set( - 2.4950, - 7.2915, - 4.1065 );
expected.end.set( - 5.7815, - 7.2915, - 4.0989 );

expect( t1.intersectsTriangle( t2, target ) ).toBe( true );
expectLinesToBeClose( target, expected );

expect( t2.intersectsTriangle( t1, target ) ).toBe( true );
expectLinesToBeClose( target, expected );

} );

} );

describe( 'Sphere Intersections', () => {
Expand Down

0 comments on commit 4a9fb7f

Please sign in to comment.