Skip to content

Commit

Permalink
EdgesGeometry: Remove rounding from hash computation. (mrdoob#22099)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mugen87 authored Jul 7, 2021
1 parent 9f71941 commit 34967bb
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/geometries/EdgesGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ class EdgesGeometry extends BufferGeometry {

}

const precisionPoints = 4;
const precision = Math.pow( 10, precisionPoints );
const thresholdDot = Math.cos( MathUtils.DEG2RAD * thresholdAngle );

const indexAttr = geometry.getIndex();
Expand Down Expand Up @@ -67,9 +65,9 @@ class EdgesGeometry extends BufferGeometry {
_triangle.getNormal( _normal );

// create hashes for the edge from the vertices
hashes[ 0 ] = `${ Math.round( a.x * precision ) },${ Math.round( a.y * precision ) },${ Math.round( a.z * precision ) }`;
hashes[ 1 ] = `${ Math.round( b.x * precision ) },${ Math.round( b.y * precision ) },${ Math.round( b.z * precision ) }`;
hashes[ 2 ] = `${ Math.round( c.x * precision ) },${ Math.round( c.y * precision ) },${ Math.round( c.z * precision ) }`;
hashes[ 0 ] = `${ a.x },${ a.y },${ a.z }`;
hashes[ 1 ] = `${ b.x },${ b.y },${ b.z }`;
hashes[ 2 ] = `${ c.x },${ c.y },${ c.z }`;

// skip degenerate triangles
if ( hashes[ 0 ] === hashes[ 1 ] || hashes[ 1 ] === hashes[ 2 ] || hashes[ 2 ] === hashes[ 0 ] ) {
Expand Down

0 comments on commit 34967bb

Please sign in to comment.