TedPride
The example I gave would work if the equivalent lines were different lengths with slight modification. Identifiy the points that are on the same line, only add points from second line if they are not the same as the first. If you look at the post
gnu@perl did for an example we have two shapes A-B-C-D and E-F-G-H. in this case B-C is on the same line as H-E and H-E is shorter. Thus on the co-linear line looking down it you would have B-H-E-C.
From my routine you would insert the H-E shape between points B-C. Thus going from
A-B-C-D and E-F-G-H
to
A-(B-C)-D and E)-F-G-(H
which gives
A-B-E-F-G-H-C-D
or
A----B
| |
| | E-----F
| | | |
| | H-----G
D----C
A----B
| |
| E-----F
| |
| H-----G
D----C
You are right though this does not take care of holes, or overlaps and intersections, this would be more a pure math problem of intersections etc and these can be found on the web. I was just postulating that the problem may have been more one of tiling and hence if this was the case the solution is not all that complicated.
Regards Paul.
Update: There is a good link here which can be simplified as some of the calculations are already available in the module Math::Geometry::Planar from my first post.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.