# HG changeset patch # User Trammell Hudson # Date 1329676853 18000 # Node ID d4f777af91d96b86616de0eae971efb3295a6eee # Parent 6c9518119035f9df0daa695f9db3321814dc2673 Side generation tabs look better diff --git a/boxer b/boxer --- a/boxer +++ b/boxer @@ -10,16 +10,17 @@ my \$units = "mm"; # mm = 1, inches = 1000 / 25.4 my \$thickness = 3; -my \$sides = 9; +my \$sides = 4; my \$edge = 30; my \$height = 20; +my \$tab_width = 5; my \$deg2rad = # Compute the height of the interior triangle my \$interior_angle = 360.0 / \$sides; -my \$hx = \$edge / 2; -my \$hy = \$hx / tan(deg2rad(\$interior_angle/2)); +my \$interior_len = \$edge - \$thickness/2; +my \$interior_radius = (\$interior_len/2) / tan(deg2rad(\$interior_angle/2)); print <<""; @@ -37,17 +38,27 @@ for my \$side (0..\$sides-1) { my \$angle = (360 / \$sides) * \$side; + my \$hx = \$interior_len / 2; + + # Put one tab in the middle + my \$tab_x1 = \$hx - \$tab_width/2; + my \$tab_x2 = \$hx + \$tab_width/2; print <<""; \$side @@ -57,6 +68,98 @@ print <<""; +# +# Draw the edge pieces +# +print <<""; + + +for my \$side (0..\$sides-1) +{ + my \$origin_x = \$side * (\$edge + \$thickness + 2); + + # Put one tab in the middle of the top and bottom edges + my \$tab_x1 = \$edge/2 - \$tab_width/2; + my \$tab_x2 = \$edge/2 + \$tab_width/2; + + # Put one tab in the middle of the left and right edges + my \$side_tab_x1 = \$height/2 - \$tab_width/2; + my \$side_tab_x2 = \$height/2 + \$tab_width/2; + + print <<""; + + + print <<""; + + + + print <<""; + + + + print <<""; + + + + print <<""; + + + + print <<""; + + +} + +print <<""; + print <<"";