Fixed Islands

The fix for the bad islands below turned out to be pretty straightforward after staring at the code for a few hours. I have two large outstanding items to do now. First, take an unordered set of outline and island curves and order them into something that can be calculated. An example is below:

If you take each of the concentric rings and extract the edge curves then you’ll get a set of alternating outline and island curves. One of the few citical things for the boolean approach that I’ve taken is that if the curves are not ordered properly then the outermost island will destroy the inner pockets and leave them uncut. The code to organize this should be relatively straightforward and should not require any new code– just the existing polygon boolean code.
For what it’s worth, the approach in the winding number paper I linked to before doesn’t have this requirement.
The last item is the path linking. This will probably be a little more complicated but I’m sure I can find a doc in my collection outlining a couple of approaches that can be implemented with little effort.
Comments
7 Responses to “Fixed Islands”


OK, Robert, now I’m really confused. If the red squares represent a “hollow” island, shouldn’t the inner square really be cut? It used to be an island on its own, but taken together with the outer red square doesn’t it turn into a pocket itself? Or is the smaller red square really purple (i.e. an island in the purple polygon pocket) and you’re superimposing a larger island over it? Am I taking your example too literally?
No- both are islands so the “real” island becomes the union of the two when the pocket is calculated. Keep in mind that the red lines above are the islands that are input into the algortihm before they are merged.
An example of how this overlapping island case may occur is if you had a clamp you’d like to avoid that you represented as an island. If the clamp overlapped an existing island then you’d have a case that is conceptually like the one above where they’d need to be merged. Again, I’m using island in a more generic way to mean, “don’t machine this.”
I suppose this all only has meaning as you move beyond the zmap concept (and I have no idea of what that would involve.)
As it is, I add features to my solid model to represent “do not mahcine” areas, but the features are often just 2D surfaces at the top plane of my object and “shadow” any geometry below. I could also have an STL of an inverted Mayan pyramid, and it would appear to Meshcam as a cube, because the zmap “drapes a sheet” over the STL and Meshcam operates on that sheet rather than the STL directly.
But this pocket roughing development seems to indicate that this will not always be so, thus the need for your “superimposed island” scenario?
The real need to handle anything is because floating point numbers can be very problematic- the impossible can happen frequently. Also, when you write code that has a lot of subtlety like this it’s always hard to come back to it later after you’ve forgotten the details that you didn’t comment properly. I’d rather spend the extra few days and never have to come back to this to add functionality.
This code will apply to the zmap concept since the zmap would only be used to extract the roughing outline and island contours. Once I get the rest of MeshCAM beyond the zmap the roughing contours will just become more smooth and accurate.
OK, Robert. My understanding of this all is pretty much limited to being able to apply “eofill” when I’m writing Postscript files for my photoetching artwork. I’m gonna blame it on you for even posting that winding link, knowing that nerds like me would actually read it and think they understand. I remain your humble beta-tester, subject to the unfortunate disclaimer “as time allows”… I remain in awe of what you’re able to do, and enthusiastically recommend Meshcam to anyone who will listen.
There was supposed to be a GRIN (in brackets) after “think they understand” but the blog comment software seems to filter out a lot of punctuation…
The best academic papers are the ones you read 10 times and each time you think you understand it until the next time you read it.
The blog software does filter a lot- you wouldn’t believe the number of comment spams that are blocked by it- literally thousands in the last month compared to the ten or so that were valid.
Also, anyone handwriting postscript files is way more hardcore than me.