Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove duplicate methods #24

Open
Wilt opened this issue Feb 3, 2016 · 1 comment
Open

Remove duplicate methods #24

Wilt opened this issue Feb 3, 2016 · 1 comment

Comments

@Wilt
Copy link
Contributor

Wilt commented Feb 3, 2016

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).

@chandlerprall
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants