Closed martinhansdk closed 6 years ago
Could you please try to run: ./examples/nfp data/handcrafted/hole/A.wkt data/handcrafted/hole/B.wkt Because on my side it returns the correct nfp like you expect it.
How can I then distinguish the inner ring from the outer ring?
The first ring is always the outter ring.
Why is it a vector of rings containing one point each?
In this particular case it shouldn't contain only single points. Single points are only in the result in a situation where there is a perfect inner fit. (see: data/handcrafted/fit/)
Will the rings sometimes contain multiple points? What does it mean when they do? Does the order of the rings and points carry any significance?
Yes, they will most of the time. The points form a polygon if you interpret them in the given order.
Which point is the reference point?
The reference point is the lowest point of the B polygon. If there is more than one point with the lowest x-value the right-most one is chosen.
I just did a fresh clone, modified only the Makefile to point to my boost include files. This is what I get:
This is the same result as above, there I had modified the write_svg function to include one of the points that was not showing up in the output. Let's continue the discussion in issue #7.
I'm trying to understand how to use the output of
generateNFP()
.From the README, I was expecting, that generateNFP() would return the NFP in a form that would allow me to draw an image like the following:
However, this does not seem to be possible. The repository has the sample data
data/handcrafted/hole
which is very similar to the above situation. This generates the following NFP:I have a few questions about this:
First of all, it seems like there are two points missing in the hole. Couldn't the small square also be located top left and bottom right?
Second, the returned type is a vector of rings, but each ring always seems to contain only a single point. How can I then distinguish the inner ring from the outer ring?
Lastly, if I treat the individual points as points in a polygon, the order in which they appear in the output gives me the following polygon:
To clarify, I don't need to distinguish the inner ring from the outer ring or have the points appear in any particular order (although this would be nice and make my application faster). It's just that the README had caused me to expect a certain kind of output. What I'm asking for is some documentation about the return value of
generateNFP()
:Thank you.