From: Ian Jackson Date: Fri, 20 Oct 2017 18:41:40 +0000 (+0100) Subject: poster-tube-lid-parametric: bugfixes X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=reprap-play.git;a=commitdiff_plain;h=e3a2741203f4bf9851863aeb0127a7f5ad355792 poster-tube-lid-parametric: bugfixes --- diff --git a/poster-tube-lid-parametric.pl b/poster-tube-lid-parametric.pl index 940d481..64a6003 100755 --- a/poster-tube-lid-parametric.pl +++ b/poster-tube-lid-parametric.pl @@ -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 ?";