Faster algorithm for rectilinear fill

This commit is contained in:
Alessandro Ranellucci 2011-10-06 15:24:21 +02:00
parent 33d7b8c7cf
commit 5daaf454b1
10 changed files with 242 additions and 159 deletions

View file

@ -22,14 +22,14 @@ sub output {
my $svg = svg($print);
foreach my $type (qw(polygons polylines)) {
foreach my $type (qw(polygons polylines white_polygons red_polylines)) {
if ($things{$type}) {
my $method = $type eq 'polygons' ? 'polygon' : 'polyline';
my $method = $type =~ /polygons/ ? 'polygon' : 'polyline';
my $g = $svg->group(
style => {
'stroke-width' => 2,
'stroke' => 'black',
'fill' => 'none',
'stroke' => $type =~ /red_/ ? 'red' : 'black',
'fill' => $type eq 'polygons' ? 'grey' : 'none',
},
);
foreach my $polygon (@{$things{$type}}) {