From ca3dd080a827f60bdfc39caf7b546d300047bf1e Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 14 Feb 2016 23:29:17 +0000 Subject: [PATCH] commitid: Use polygon simplification rather than overlap fudge factor Previously we adjusted each polygon's vertices by a fudge factor to make them overlap. This produces small wrinkles at the corners of the glyphs, which are undesriable and slow to render. This new version is about 30% faster on anarres. --- commitid.scad.pl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/commitid.scad.pl b/commitid.scad.pl index ca365a3..62ae510 100755 --- a/commitid.scad.pl +++ b/commitid.scad.pl @@ -571,8 +571,8 @@ sub parsefont () { } elsif (s{^\S}{}) { my $f = $cellmap{$&}; die unless $f; - $f =~ s/\b\d/ sprintf '%05d', $col*2000 + $&*1025 /ge; - $f =~ s/\d\b/ sprintf '%05d', $row*2000 + $&*1025 /ge; + $f =~ s/\b\d/ sprintf '%05d', $col*2000 + $&*1000 /ge; + $f =~ s/\d\b/ sprintf '%05d', $row*2000 + $&*1000 /ge; push @{ $chrpolys{$chr} }, { E => [ split / /, $f ] }; } else { die "$_ ?"; @@ -590,6 +590,8 @@ sub parsefont () { my $polys = $chrpolys{$chr}; $_->{Holes} = [] foreach @$polys; + simplify($chr,$polys); + my $mod = chrmodname $chr; p "module $mod () {\n"; foreach my $poly (@$polys) { -- 2.30.2