def taperedcylinder(self, start, end, startsize, endsize, mcmap, blockdata):
        '''Create a tapered cylinder in mcmap.

        start and end are the beginning and ending coordinates of form [x, y, z].
        startsize and endsize are the beginning and ending radius.
        The material of the cylinder is WOODMAT.
        '''

        # delta is the coordinate vector for the difference between
        # start and end.
        delta = [int(end[i] - start[i]) for i in range(3)]
        # primidx is the index (0, 1, or 2 for x, y, z) for the coordinate
        # which has the largest overall delta.
        maxdist = max(delta, key=abs)
        if maxdist == 0:
            return None
        primidx = delta.index(maxdist)
        # secidx1 and secidx2 are the remaining indicies out of [0, 1, 2].
        secidx1 = (primidx - 1) % 3
        secidx2 = (1 + primidx) % 3
        # primsign is the digit 1 or -1 depending on whether the limb is headed
        # along the positive or negative primidx axis.
        primsign = int(delta[primidx] / abs(delta[primidx]))
        # secdelta1 and ...2 are the amount the associated values change
        # for every step along the prime axis.
        secdelta1 = delta[secidx1]
        secfac1 = float(secdelta1) / delta[primidx]
        secdelta2 = delta[secidx2]
        secfac2 = float(secdelta2) / delta[primidx]
        # Initialize coord.  These values could be anything, since
        # they are overwritten.
        coord = [0, 0, 0]
        # Loop through each crossection along the primary axis,
        # from start to end.
        endoffset = delta[primidx] + primsign
        for primoffset in range(0, endoffset, primsign):
            primloc = start[primidx] + primoffset
            secloc1 = int(start[secidx1] + primoffset * secfac1)
            secloc2 = int(start[secidx2] + primoffset * secfac2)
            coord[primidx] = primloc
            coord[secidx1] = secloc1
            coord[secidx2] = secloc2
            primdist = abs(delta[primidx])
            radius = endsize + (startsize - endsize) * abs(delta[primidx]
                                                           - primoffset) / primdist
            self.crossection(coord, radius, primidx, blockdata, mcmap)
Create a tapered cylinder in mcmap.

        start and end are the beginning and ending coordinates of form [x, y, z].
        startsize and endsize are the beginning and ending radius.
        The material of the cylinder is WOODMAT.
        
stock-filters/Forester.py