
use sculptie;
use strict;

my $zLow = 128;
my $zHigh = 255;

my $xyHigh = 255;
my $xyFoldDepth = 36;

my $layers = 12;

startPix(4, $layers + 1);

for(my $z = 0; $z <= $layers; $z++)
{
    my $x1 = 0;
    my $x2 = $xyHigh;
    my $y1 = 0;
    my $y2 = $xyHigh;
    # alternate accordion indents
    if($z % 2)
    {
        $x1 += $xyFoldDepth;
        $x2 -= $xyFoldDepth;
    }
    else
    {
        $y1 += $xyFoldDepth;
        $y2 -= $xyFoldDepth;
    }

    my $zz = mapRangeInt($z,0,$layers + 1, $zLow,$zHigh);
    addPt($x1,$y1,$zz);
    addPt($x2,$y1,$zz);
    addPt($x2,$y2,$zz);
    addPt($x1,$y2,$zz);
}


render("accordionSculptie",64,64,1);
