docs/csg.js
function(orthobasis) {
            var EPS = 1e-5;
            var cags = [];
            this.polygons.filter(function(p) {
                    // only return polys in plane, others may disturb result
                    return p.plane.normal.minus(orthobasis.plane.normal).lengthSquared() < EPS*EPS;
                })
                .map(function(polygon) {
                    var cag = polygon.projectToOrthoNormalBasis(orthobasis);
                    if (cag.sides.length > 0) {
                        cags.push(cag);
                    }
            });
            var result = new CAG().union(cags);
            return result;
        }
function(orthobasis) {
            var EPS = 1e-5;
            var cags = [];
            this.polygons.filter(function(p) {
                    // only return polys in plane, others may disturb result
                    return p.plane.normal.minus(orthobasis.plane.normal).lengthSquared() < EPS*EPS;
                })
                .map(function(polygon) {
                    var cag = polygon.projectToOrthoNormalBasis(orthobasis);
                    if (cag.sides.length > 0) {
                        cags.push(cag);
                    }
            });
            var result = new CAG().union(cags);
            return result;
        }
function ( orthobasis ) { var EPS = 1e-5 ; var cags = [ ] ; this . polygons . filter ( function ( p ) { // only return polys in plane, others may disturb result return p . plane . normal . minus ( orthobasis . plane . normal ) . lengthSquared ( ) < EPS * EPS ; } ) . map ( function ( polygon ) { var cag = polygon . projectToOrthoNormalBasis ( orthobasis ) ; if ( cag . sides . length > 0 ) { cags . push ( cag ) ; } } ) ; var result = new CAG ( ) . union ( cags ) ; return result ; }
project the 3D CSG onto a plane This returns a 2D CAG with the 'shadow' shape of the 3D solid when projected onto the plane represented by the orthonormal basis
project the 3D CSG onto a plane This returns a 2D CAG with the shadow shape of the 3D solid when projected onto the plane represented by the orthonormal basis