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

Bug in splitting algorithm #11

Open
NMO13 opened this issue Mar 27, 2013 · 0 comments
Open

Bug in splitting algorithm #11

NMO13 opened this issue Mar 27, 2013 · 0 comments

Comments

@NMO13
Copy link

NMO13 commented Mar 27, 2013

The following code will result in an endless recursion. I think this is a problem due to rounding errors. The first poly is a triangle, the second poly is a quad.

var l = [], polys = [];

        l.push(new CSG.Vertex(new CSG.Vector(1.23079, 0.35525, -0.39928), new CSG.Vector(0, 0, 0)));
        l.push(new CSG.Vertex(new CSG.Vector(1.26563, 0.28906, -0.40625), new CSG.Vector(0, 0, 0)));
        l.push(new CSG.Vertex(new CSG.Vector(1.24346, 0.44424, -0.41733), new CSG.Vector(0, 0, 0)));
        polys.push(new CSG.Polygon(l));

        var l2 = [];
        l2.push(new CSG.Vertex(new CSG.Vector(1.26216, 0.46369, -0.43822), new CSG.Vector(0, 0, 0)));
        l2.push(new CSG.Vertex(new CSG.Vector(1.36719, 0.29688, -0.50000), new CSG.Vector(0, 0, 0)));
        l2.push(new CSG.Vertex(new CSG.Vector(1.35204, 0.32133, -0.34461), new CSG.Vector(0, 0, 0)));
        l2.push(new CSG.Vertex(new CSG.Vector(1.25679, 0.47373, -0.34461), new CSG.Vector(0, 0, 0)));
        polys.push(new CSG.Polygon(l2));
        var res = CSG.fromPolygons(polys);

        var a = new CSG.Node(res.toPolygons());
        var result = a.AllPolygons();
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

1 participant