Skip to content

Instantly share code, notes, and snippets.

@davorg
Created March 17, 2019 15:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davorg/3d1b58aab00feaaba38098ec838fa6f5 to your computer and use it in GitHub Desktop.
Save davorg/3d1b58aab00feaaba38098ec838fa6f5 to your computer and use it in GitHub Desktop.
Wall stuff for T
#!/usr/bin/perl
use strict;
use warnings;
use SVG;
my $PICWIDTH = 22;
my $svg = SVG->new(width => 184, height => 200);
$svg->rectangle(
width => 184,
height => 200,
x => 0,
y => 0,
style => {
stroke => 'rgb(0,0,0)',
fill => 'rgb(255,255,255)',
stroke_width => 1,
},
);
sub picture {
my ($svg, $x, $y) = @_;
$svg->rectangle(
width => $PICWIDTH,
height => $PICWIDTH,
x => ($x - $PICWIDTH/2),
y => $y,
style => {
stroke => 'rgb(0,0,0)',
fill => 'rgb(255,255,255)',
stroke_width => 4,
},
);
}
my $gr = $PICWIDTH * .618;
my $incr = $PICWIDTH + $gr;
my $first = (184 - (4*$PICWIDTH) - (3*$gr)) / 2;
$first += $PICWIDTH / 2;
my $x = $first;
for (1 .. 4) {
warn "$x\n";
picture($svg, $x, 50);
$x += $incr;
}
print $svg->xmlify;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment