Ultimately this will be used in a web page (for shapes representing towns in different counties)

Interesting. Many years ago, I developed Acme::EyeDrops -- which similarly had to solve the problem of how to represent arbitrary shapes for use in ascii art. If you look at Acme::EyeDrops Shape Reference, you'll see it defines two kinds of shapes:

Two simple examples to give you a feel for how this works.

Running this program:

use Acme::EyeDrops qw(sightly); print sightly({ Text => 1, TextFiller => '/\\', Shape => 'siertri', # For 'siertri' built-in shape, Width=>5 means: # height is 2**5 lines # width is 2 * 2**5 characters Width => 5 });
displays:
/\ /\/\ /\ /\ /\/\/\/\ /\ /\ /\/\ /\/\ /\ /\ /\ /\ /\/\/\/\/\/\/\/\ /\ /\ /\/\ /\/\ /\ /\ /\ /\ /\/\/\/\ /\/\/\/\ /\ /\ /\ /\ /\/\ /\/\ /\/\ /\/\ /\ /\ /\ /\ /\ /\ /\ /\ /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ /\ /\ /\/\ /\/\ /\ /\ /\ /\ /\/\/\/\ /\/\/\/\ /\ /\ /\ /\ /\/\ /\/\ /\/\ /\/\ /\ /\ /\ /\ /\ /\ /\ /\ /\/\/\/\/\/\/\/\ /\/\/\/\/\/\/\/\ /\ /\ /\ /\ /\/\ /\/\ /\/\ /\/\ /\ /\ /\ /\ /\ /\ /\ /\ /\/\/\/\ /\/\/\/\ /\/\/\/\ /\/\/\/\ /\ /\ /\ /\ /\ /\ /\ /\ /\/\ /\/\ /\/\ /\/\ /\/\ /\/\ /\/\ /\/\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\

Running this program:

use Acme::EyeDrops qw(sightly); print sightly({ Text => 1, TextFiller => 'Azzurri', Shape => 'map_italy' });
displays:
Azzurr iAzzurriAzz urriAzzurriAzzurr iA zzurriAzzurriAzzurriAzz urriAzzurriAzzurriAzzurriAzzur riAzzurriAzzurriAzzurriAzzurriAzz urriAzzurriAzzurriAzzurriAzzur riAzzurriAzzurriAzzurriAzzurr iAzzurriAzzurriAzzurriAzzurriA zzurriAzzurriAzzurriAzzurriAzzu rriAzzurriAzzurriAzzurriAzzurr iAzzurr iAzzurriAzzurri Azzu rriAzzurriAzzu rr iAzzurriAzzurri AzzurriAzzurriAzz urriAzzurriAzzurr iAzzurriAzzurriAzz u rriAzzurriAzzurriA zzur riAzzurriAzzurriA zzurr iAzzurriAzzurriAz zurri AzzurriAzzurriAzz urriA zzurriAzzurriAzzurriA zzu rriAzzurriAzzurriA zzurriAzzurriAzzur ri AzzurriAzzurriAzz urriAzzu rriAzzurriAzzurriA zzurriAz zurriAzzurriAzzurri Azzurri AzzurriAzzu rriAz zurriAz zurriAzz urr iAzzurr iAzz ur riAzzur riA zzurriA zzurr iAzz ur riAzz ur riAzz urri Azzu r ri Azzur riAzzurriAzzurri Az zurriAzzurriAzz urriAzzurri AzzurriA zzurr iAz

The primary purpose of Acme::EyeDrops is to auto-generate obfuscated, working Perl code ... so its shape pouring capabilities are fairly primitive. I'm just bringing it to your attention in case it gives you ideas for your current project, or in case it generates ideas for enhancing the shape pouring capabilities of Acme::EyeDrops.


In reply to Re: Polygon Creation -- Request for Algorithm Suggestions by eyepopslikeamosquito
in thread Polygon Creation -- Request for Algorithm Suggestions by golux

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.