UNPKG

three-bvh-csg

Version:

A fast, flexible, dynamic CSG implementation on top of three-mesh-bvh

25 lines (14 loc) 319 B
export class IntersectionMap { constructor() { this.intersectionSet = {}; this.ids = []; } add( id, intersectionId ) { const { intersectionSet, ids } = this; if ( ! intersectionSet[ id ] ) { intersectionSet[ id ] = []; ids.push( id ); } intersectionSet[ id ].push( intersectionId ); } }