diff options
author | Thomas Kremer <-> | 2020-10-01 00:10:20 +0200 |
---|---|---|
committer | Thomas Kremer <-> | 2020-10-01 00:10:20 +0200 |
commit | d27ec23b8c4f61095828d6581c2e5b22afde5d18 (patch) | |
tree | eace2fcf79a35ec4cc2e6aabb893faf6c2074d25 /DXF.pm | |
parent | ae54e4ddcb16f0c63c03c6ae6aa8d1d02356e0c5 (diff) |
rewritten combine_polylines to make up for slight errors in input files and made sort_polylines round everything to 1mm.
Diffstat (limited to 'DXF.pm')
-rw-r--r-- | DXF.pm | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -845,7 +845,7 @@ my %replacers = ( my $fn = 20; while (@sx >= 4) { # TODO: subdivide by angle first. Estimate curvature. - for my $i (1..$fn) { + for my $i (1..$fn-1) { my $t = $i/$fn; my $x1 = $sx[0]*(1-$t)**3 + 3*$sx[1]*(1-$t)**2*$t + 3*$sx[2]*(1-$t)*$t**2 + $sx[3]*$t**3; @@ -856,6 +856,8 @@ my %replacers = ( #push @coords,$x1,$y1; #@p = ($x1,$y1); } + push @x, $sx[3]; # want to avoid any rounding errors + push @y, $sy[3]; splice @sx,0,3; splice @sy,0,3; } |