summaryrefslogtreecommitdiff
path: root/DXF.pm
diff options
context:
space:
mode:
Diffstat (limited to 'DXF.pm')
-rw-r--r--DXF.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/DXF.pm b/DXF.pm
index 2e4bd1a..68ffc2a 100644
--- a/DXF.pm
+++ b/DXF.pm
@@ -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;
}