The Lounge is rated PG. If you're about to post something you wouldn't want your
kid sister to read then don't post it. No flame wars, no abusive conduct, no programming
questions and please don't post ads.
1. The lounge is for the CodeProject community to discuss things of interest to the community, and as a place for the whole community to participate. It is, first and foremost, a respectful meeting and discussion area for those wishing to discuss the life of a Software developer.
The #1 rule is: Be respectful of others, of the site, and of the community as a whole.
2. Technical discussions are welcome, but if you need specific programming question answered please use Quick Answers[^], or to discussion your programming problem in depth use the programming forums[^]. We encourage technical discussion, but this is a general discussion forum, not a programming Q&A forum. Posts will be moved or deleted if they fit better elsewhere.
4. No politics (including enviro-politics[^]), no sex, no religion. This is a community for software development. There are plenty of other sites that are far more appropriate for these discussions.
5. Nothing Not Safe For Work, nothing you would not want your wife/husband, your girlfriend/boyfriend, your mother or your kid sister seeing on your screen. For those discussions where you wish to be a little more frank, use the Soapbox[^]
6. Any personal attacks, any spam, any advertising, any trolling, or any abuse of the rules will result in your account being removed.
7. Not everyone's first language is English. Be understanding.
Please respect the community and respect each other. We are of many cultures so remember that. Don't assume others understand you are joking, don't belittle anyone for taking offense or being thin skinned.
We are a community for software developers. Leave the egos at the door.
It's good to see you exspouse these thoughts so regularly!
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
I got that cool app idea... It wouldn't have many customer, but it would have some and, to really shine, I just needed to solve one tiny (ahem) mathematical problems... Plus it would be like my.. mmm.. legacy? you know something, forgot the word, that shows your art and pride!
3 years and many frustration later (to be fair I spent more time playing video game than looking at it, since it's trauma inducing frustration) it isn't complete..
At this stage the code looks almost simple and elegant (some method implementation are still scary though, some of them are 300 lines!) but it finally stumbled on what I guess looks strongly like... unavoidable mathematical rounding error...
It all starts with Bezier-Bezier curve intersection is an inexact science...
And it shows in unexpected place (or maybe dreadly expected hey?) when one does potato-potato intersections...
I don't want to give up.. but I have doubts..
An idea just hit me...
What if I made an article "a potato-potato intersection algorithm that almost work", would that attract the attention of challenge seeking programmer?
I would have to share sh*t ton of (undocumented) visualization code though (I dunno how much of my utility library I need to make it work, but just the low level visual classes are 100KB and 12 files)
And it's also part of what make my (unfinished) app looks great... Mmmm...
Or I could share the unit test code... but it's dreadfull and not conducive to creativity, it looks like that:
(data was collected from a user friendly test app)
var cutter = new Ring(new Element(new Point(130.783333333333, 199.310477598184)), new Element(new Point(127.38497431913, 199.310477598184), new Point(124.073849393798, 198.234627893256), new Point(121.32451919832, 196.237122582712)), new Element(new Point(118.575189002842, 194.239617272168), new Point(116.528801257989, 191.423006177879), new Point(115.478650569613, 188.190974692711)), new Element(new Point(114.428499881237, 184.958943207542), new Point(114.428499881237, 181.477420428821), new Point(115.478650569613, 178.245388943653)), new Element(new Point(116.528801257989, 175.013357458484), new Point(118.575189002842, 172.196746364196), new Point(121.32451919832, 170.199241053652)), new Element(new Point(124.073849393798, 168.201735743108), new Point(127.38497431913, 167.12588603818), new Point(130.783333333333, 167.12588603818)), new Element(new Point(131.219696969697, 167.12588603818)), new Element(new Point(134.6180559839, 167.12588603818), new Point(137.929180909233, 168.201735743108), new Point(140.678511104711, 170.199241053652)), new Element(new Point(143.427841300188, 172.196746364196), new Point(145.474229045041, 175.013357458484), new Point(146.524379733417, 178.245388943653)), new Element(new Point(147.574530421793, 181.477420428821), new Point(147.574530421793, 184.958943207542), new Point(146.524379733417, 188.190974692711)), new Element(new Point(145.474229045041, 191.423006177879), new Point(143.427841300188, 194.239617272168), new Point(140.678511104711, 196.237122582712)), new Element(new Point(137.929180909233, 198.234627893256), new Point(134.6180559839, 199.310477598184), new Point(131.219696969697, 199.310477598184)));
var shape = new Shape(new Ring(new Element(new Point(12.7754813116188, -33.4128419451628), new Point(19.5223174580931, -29.9751572249652)), new Element(new Point(179.975157224965, 130.477682541907), new Point(183.412841945163, 137.224518688381)), new Element(new Point(185.725341896497, 151.825068758803), new Point(184.540796469908, 159.303994240127)), new Element(new Point(177.829660223277, 172.475340741641), new Point(172.475340741641, 177.829660223277)), new Element(new Point(159.303994240127, 184.540796469908), new Point(151.825068758803, 185.725341896497)), new Element(new Point(147.413657866616, 184.927395588484)), new Element(new Point(146.852379570287, 182.353400030402)), new Element(new Point(146.522877591701, 179.583755006682)), new Element(new Point(145.383023854803, 176.075645925844), new Point(144.229050444769, 174.093123340167)), new Element(new Point(141.746213714654, 171.399140511575)), new Element(new Point(139.217451805972, 169.454756076673), new Point(138.114716791943, 168.838299011114)), new Element(new Point(136.430867679513, 168.027334481522)), new Element(new Point(133.339495787831, 167.287179375534)), new Element(new Point(131.869596806395, 167.12588603818)), new Element(new Point(126.328777433712, 167.1807243084), new Point(125.140927792807, 167.390174249117)), new Element(new Point(120.57800049798, 170.108706697922)), new Element(new Point(-30.046677867818, 19.3819502930698), new Point(-33.4128419451628, 12.7754813116189)), new Element(new Point(-35.7253418964969, -1.82506875880269), new Point(-34.5407964699084, -9.30399424012683)), new Element(new Point(-27.8296602232773, -22.4753407416414), new Point(-22.4753407416414, -27.8296602232773)), new Element(new Point(-9.30399424012684, -34.5407964699084), new Point(-1.8250687588027, -35.7253418964969), new Point(5.47520627640808, -34.5690919208298))));
var result = shape.Cut(cutter, 0.1);
This is not really helping...
Even if I were to give up on my classes and uses Region, once I do am Xor or Intersects.. there is no way to get the resulting Drawing.. i.e. no way to further manipulating the resulting shape (after, say an Xor) by having handle on its vertices...
It's a bit like the RichTextBox a completely opaque and not really customizable much solution to a complicated problem...