ThreeCSG icon indicating copy to clipboard operation
ThreeCSG copied to clipboard

Remove duplicate methods

Open Wilt opened this issue 9 years ago • 1 comments

There are two methods ThreeBSP.Node and ThreeBSP.Node.prototype.build that if I am not mistaken seem to do exactly the same.

Maybe one of them can be removed (duplicate code).

Wilt avatar Feb 03 '16 11:02 Wilt

They definitely do the same thing. The ThreeBSP.Node constructor should do

        this.polygons = [];
        this.front = this.back = undefined;

        if ( !(polygons instanceof Array) || polygons.length === 0 ) return;

and then call this.build(polygons); to use the method

chandlerprall avatar Feb 04 '16 05:02 chandlerprall