chiark / gitweb /
poster-tube-lid-parametric: bugfixes
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 20 Oct 2017 18:41:40 +0000 (19:41 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 20 Oct 2017 18:41:40 +0000 (19:41 +0100)
poster-tube-lid-parametric.pl

index 940d4818e67279c4bfaf3deecc1da94bbad02edd..64a6003a51efe2c9e565d3cb79861542a0b4c84c 100755 (executable)
@@ -38,7 +38,7 @@ my @j_sections = qw(lin0    2
                    -
                    curve1 10
                    -
-                   curveE 5
+                   curveE 20
                    -
                    curve2 10
                    -
@@ -106,15 +106,15 @@ sub point ($$$$) {
 
     if ($jp =~ m/^curveE$/) {
        my $angle = ($jt + 1) * TAU/2 - $slope_angle;
-       $j_x = $j_p_x + $i_thick * cos($angle);
-       $j_y = $j_p_y + $i_thick * sin($angle);
+       $j_x = $j_p_x + $i_thick/2 * cos($angle);
+       $j_y = $j_p_y + $i_thick/2 * sin($angle);
     } elsif ($jp =~ m/^curve[12]$/) {
        my $angle = $slope_angle * ($jp =~ m/1/ ? $jt : (1-$jt));
        my $outwards = $jp =~ m/1/ ? -1 : +1;
-       $j_x = $j_qrc_x + cos($angle) * ($jcurverad + $outwards * $i_thick);
-       $j_y = $j_qrc_y + sin($angle) * ($jcurverad + $outwards * $i_thick);
+       $j_x = $j_qrc_x + cos($angle) * ($jcurverad + $outwards * $i_thick/2);
+       $j_y = $j_qrc_y - sin($angle) * ($jcurverad + $outwards * $i_thick/2);
     } elsif ($jp =~ m/^lin0$/) {
-       $j_x = $j_rs_x + $i_thick * (-0.5 + 0.5 * $jt);
+       $j_x = $j_rs_x + $i_thick * (+0.5 - $jt);
        $j_y = $j_s_y;
     } else {
        die "$jp ?";