Skip to content

Commit

Permalink
Improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
gkjohnson committed Jan 6, 2024
1 parent 354ae1e commit d10f2b4
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions src/core/splitter/EdgeGraph.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Vector3, Line3, Triangle, Line } from 'three';
import { areEdgesParallel, lineIntersect } from './utils.js';
import { Vector3, Line3, Triangle } from 'three';
import { lineIntersect } from './utils.js';
import { ObjectPool } from './ObjectPool.js';

const _vec = new Vector3();
Expand Down Expand Up @@ -228,7 +228,14 @@ export class EdgeGraph {
const intersectingEdge = edges.findIndex( e => {

e.closestPointToPoint( point, true, _vec );
return _vec.distanceTo( point ) < EPSILON;
const found = _vec.distanceTo( point ) < EPSILON;
if ( found ) {

point.copy( _vec );

}

return found;

} );

Expand Down Expand Up @@ -555,12 +562,24 @@ export class EdgeGraph {

foundTriangleSet.add( edge.triangle );

if ( triangles.indexOf( edge.triangle ) === - 1 ) {

messages.push( 'Incorrect triangle assigned.' );

}

}

if ( edge.reverseTriangle ) {

foundTriangleSet.add( edge.reverseTriangle );

if ( triangles.indexOf( edge.reverseTriangle ) === - 1 ) {

messages.push( 'Incorrect triangle assigned.' );

}

}

} );
Expand Down

0 comments on commit d10f2b4

Please sign in to comment.