-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Operations Fail #5
Comments
Please make the files available unzipped somewhere, e.g. at http://gist.github.com, for ease of browsing by me and potentially others interested in the issue. At the moment I don't know what "FAILS" means without that, so I can't say much. |
I have made everything available in a git repo here: https://github.com/swill/polycliptest I have added more details of a failing case in the README.md file. You can also see a visual of this failing case example in this file: results/polycliptest_seg-15_fails.svg Let me know if you have more questions. You can also grab the compiled program from the |
I just pushed an updated version of everything which adds a grey background to the operation output polygons so it is easier to understand what the resulting polygons actually looks like. |
I tried building polycliptest, but it fails for me with:
|
Yes, this is expected. This is because my additions to the If you want to build this program, you will need to get the source of my However, you should not need to build this application from source to use it and reproduce the issue because I have cross compiled it already for you with all of the dependencies included in the Let me know if you have any issues with the compiled code. I included the source only for reference to show what I am doing. I was expecting you to use the precompiled version of the program. |
Ok, reproduces for me, thanks. _Big thanks_ for that, it definitely proves that my attempt at fixing #3 unfortunately totally breaks stuff. I'm reverting the bad commit. |
This is a HUGE difference. Thanks so much for this. For two polygons things seem to just work. Once you start moving to 3 polygons, things start to have some issues, but I think this is related to the #3 issue you have open. I have noticed that the XOR operation probably is affected by this same problem. So here is a working case (using the latest
And then one that is not perfect (but MUCH better than before).
I will see if I can figure out a way to work around these issues. I will also see if I can find a way to do a work around for the #3 issue. Thank you so much for looking into this. I am sure I can find a way to work around these smaller issues... |
BTW, I can stop posting in this issue now that it is closed if you want. I can move my troubleshooting elsewhere. I will see what I can figure out for this/these issues. Also, these are two cases. For other segment numbers, I am seeing both success and failures and the problem is consistently only a single segment being missing (and thus changing the outcome). This is a much easier problem to try to troubleshoot, so I will see what I can come up with. |
I have just posted a workaround for #3. It is midnight here, so I am going to head to bed, but I will see if I can use the same concept used in that workaround to adapt my My workaround for the problem would basically work as follows: I will do some testing of this idea tomorrow and see if this resolves my issue. |
I have been working with this library a lot the last couple weeks. I am working on an application that draws SVG files based on dynamic input. I have been having a lot of issues with this library, but I have been having a hard time isolating the problem.
I have written a small test application to allow me to enter different configuration details to try to isolate why the library is failing. Hopefully you guys can help me figure out what is going on. If we can figure out why things are failing I am up for working on a pull request.
Alright, lets get down to business...
I wrote a test application called
polycliptest
and I have made everything available here: https://objects-east.cloud.ca/v1/5ef827605f884961b94881e928e7a250/polycliptest/polycliptest.zipThis includes the application cross compiled for all OS's as well as the src and a few sample SVG files.
The core of the test is based around a function I wrote which allows you to create a dynamic polygon circle. The function takes coordinates, a radius and the number of line segments for each 90º of the circle. So if segments=1, a diamond will be drawn. If segments=3, then a 12 sided 'circle' will be created. This allows me to easily create different polygons to test the polyclip library. The test basically creates a rectangle and a circle with one edge of the rectangle centered in the circle. I then run each of the polyclip operations on the two polygons. Then via the command line, I can change the number of segments which make up the circle to find cases where everything fails.
The default configuration is a simple working example to show how the test works. This is just to give a foundation for how the test works. The output for this test is
polycliptest_default_ok.svg
. Here are a bunch of examples for how the test application works...All of the details of the contours and polygons being drawn are also output to the terminal for inspection.
Test Examples:
As I said before, I am willing to put in some time to try to solve these problems and providing a pull request, but I need some help understanding why things are failing. I thought it might have to do with the points being too close together, but I proved that incorrect with the following:
I am looking forward to some fresh eyes on this problem. :)
Let me know if you have any issues running my test application or if you need help compiling it (it depends on my fork of the svgo library which adds floating point support).
Cheers...
The text was updated successfully, but these errors were encountered: