UNPKG

three-bvh-csg

Version:

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

29 lines (17 loc) 416 B
import { LineSegments } from 'three'; export class EdgesHelper extends LineSegments { get color() { return this.material.color; } constructor( edges = [] ) { super(); this.frustumCulled = false; this.setEdges( edges ); } setEdges( edges ) { const { geometry } = this; const points = edges.flatMap( e => [ e.start, e.end ] ); geometry.dispose(); geometry.setFromPoints( points ); } }