Perl really is good for everything! I'm building a sofa, which is a story in itself and unrelated to Perl. Suffice to say that I started with a table saw and now I'm finishing with a tiny needle and thread.

Covering a complex curved surface with a flat piece of fabric is not trivial. A more specific example, I was trying to make a seat cushin with a "bullnose" design, which entails taking a long rectangle and bending it into a "U" shape to form the top, bottom, and front; then add sides that are flat U's.

Given shapes carefully drawn on slightly larger pieces of cloth, the effort is to match the edges of the two U's. I'm sure someone with experience would simply chalk that up to "skill", knowing just how to match the edges, how it feels when it's stretched just right, etc.

But what about me, a humble programmer who has trouble even holding a needle?

If I mark the edge of the long piece with dots every 5mm (for example), then do the same along the side "U", then I can simply make sure each stitch hits the corresponding dot on each layer being joined. It's like the difference between impressionistic painting and drafting, and I'm back on "technical" turf.

Making accurate dots on a curve (not a straight line) is not easy, if it's to be accurate enough to be any good.

But a program, though, would find it simple. I can do sin's and cos's, measure off pi/2 inches, or whatever, without being bothered by the physical limitations of a tape measure.

In short, I want to write a Perl script to generate a pattern that I can print out.

It reminds me of when I was much younger, playing around with BASIC on simple computers, amusing myself (as well as learning a lot) by writing programs that drew "black hole" plots, perspective drawings, spirograph-type curves, etc.

Well, Perl doesn't have a PLOT statement, or LINETO, or anything like that built-in (sigh).

What should I use? I suppose a package designed for web graphics plots could work with a large (e.g. 180 dpi) bitmap. Any suggestions on one to use on a Windows system? But, it might be better to use a vector-based system. I heard something about a PDF writer. Is that something I can use to encapsulate vector art? Any vector-drawing things out there than I can then print out?

—John


In reply to Perl and sewing by John M. Dlugosz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.