Completely rewritten the slicing algorithm

It should work with any model now. There are still problems with some
bridges.
This commit is contained in:
Alessandro Ranellucci 2011-10-09 19:47:21 +02:00
parent ad27f25c71
commit 459577f9a2
8 changed files with 137 additions and 246 deletions

View file

@ -39,14 +39,15 @@ sub output {
my $svg = svg($print);
foreach my $type (qw(polygons polylines white_polygons red_polygons red_polylines)) {
foreach my $type (qw(polygons polylines white_polygons green_polygons red_polygons red_polylines)) {
if ($things{$type}) {
my $method = $type =~ /polygons/ ? 'polygon' : 'polyline';
my ($colour) = $type =~ /^(red|green)_/;
my $g = $svg->group(
style => {
'stroke-width' => 2,
'stroke' => $type =~ /red_/ ? 'red' : 'black',
'fill' => ($type !~ /polygons/ ? 'none' : ($type =~ /red_/ ? 'red' : 'grey')),
'stroke' => $colour || 'black',
'fill' => ($type !~ /polygons/ ? 'none' : ($colour || 'grey')),
},
);
foreach my $polygon (@{$things{$type}}) {
@ -57,7 +58,6 @@ sub output {
);
$g->$method(
%$path,
'marker-end' => "url(#endArrow)",
);
}
}