docs/csg.js
function(pathradius, resolution) {
            var sides = [];
            var numpoints = this.points.length;
            var startindex = 0;
            if (this.closed && (numpoints > 2)) startindex = -1;
            var prevvertex;
            for (var i = startindex; i < numpoints; i++) {
                var pointindex = i;
                if (pointindex < 0) pointindex = numpoints - 1;
                var point = this.points[pointindex];
                var vertex = new CAG.Vertex(point);
                if (i > startindex) {
                    var side = new CAG.Side(prevvertex, vertex);
                    sides.push(side);
                }
                prevvertex = vertex;
            }
            var shellcag = CAG.fromSides(sides);
            var expanded = shellcag.expandedShell(pathradius, resolution);
            return expanded;
        }
function(pathradius, resolution) {
            var sides = [];
            var numpoints = this.points.length;
            var startindex = 0;
            if (this.closed && (numpoints > 2)) startindex = -1;
            var prevvertex;
            for (var i = startindex; i < numpoints; i++) {
                var pointindex = i;
                if (pointindex < 0) pointindex = numpoints - 1;
                var point = this.points[pointindex];
                var vertex = new CAG.Vertex(point);
                if (i > startindex) {
                    var side = new CAG.Side(prevvertex, vertex);
                    sides.push(side);
                }
                prevvertex = vertex;
            }
            var shellcag = CAG.fromSides(sides);
            var expanded = shellcag.expandedShell(pathradius, resolution);
            return expanded;
        }
function ( pathradius , resolution ) { var sides = [ ] ; var numpoints = this . points . length ; var startindex = 0 ; if ( this . closed && ( numpoints > 2 ) ) startindex = - 1 ; var prevvertex ; for ( var i = startindex ; i < numpoints ; i ++ ) { var pointindex = i ; if ( pointindex < 0 ) pointindex = numpoints - 1 ; var point = this . points [ pointindex ] ; var vertex = new CAG . Vertex ( point ) ; if ( i > startindex ) { var side = new CAG . Side ( prevvertex , vertex ) ; sides . push ( side ) ; } prevvertex = vertex ; } var shellcag = CAG . fromSides ( sides ) ; var expanded = shellcag . expandedShell ( pathradius , resolution ) ; return expanded ; }
Expand the path to a CAG This traces the path with a circle with radius pathradius
Expand the path to a CAG This traces the path with a circle with radius pathradius