Comments (3)
@andershol check this link
https://compiler-explorer.com/z/rzE1oab7j
you can check this python script , you can plot in your system and try it out
https://compiler-explorer.com/z/Gc3P1oex1
it is giving the correct points
from geometry.
check this link https://compiler-explorer.com/z/rzE1oab7j
I think you misunderstood, but perhaps I was imprecise. Except from making the output a bit more verbose (I tried to keep it short), your code seem identical to mine, and your result also seems to be identical. That is, there are 10 points in the output, but only 4 distinct points, so the quadrilateral is traversed twice.
you can check this python script , you can plot in your system and try it out https://compiler-explorer.com/z/Gc3P1oex1 it is giving the correct points
I was not saying that the points in the output is placed incorrectly. I was saying that the path goes around the rim twice. You don't see that, when you just draw the polygon as you don't see that every line segment is painted twice.
from geometry.
I can reproduce the issue with 1.84. This is a bug.
On my platform (linux, gcc9) the issue is "resolved" when using long double
instead of double
yielding the following output:
POLYGON((-0.91 0.48,-1.2 0.4,-1.4 1.9,-0.90478776881880620085 0.51756843862593651808,-0.90478776881879174887 0.51756843862590162786,-0.91 0.48))
Note that polygon a has 5 points (including closing duplicate), polygon b has 4 points, but output has 10 and I don't think the output should ever have more points than the sum of the input polygons. And going around twice seems to me to be invalid.
A side remark here, the output is indeed invalid but the statement about the number of vertices of the union is incorrect. Please consider the creation of new vertices in the union as the intersection of edges of the input polygons. Note, that the output computed with long double
has also 5 vertices.
from geometry.
Related Issues (20)
- sym_difference with rectilinear integer coordinate polygons produces wrong result.
- MSVC CI may not take effect HOT 2
- Mandate C++17 by default HOT 6
- Can't build with geometry.hpp in CLR project HOT 2
- Union producing self intersections after 1.78 HOT 3
- union_ perturbs a point and returns wrong result
- invalid intersection for CCW polygons HOT 3
- Wrong result in difference of linestrings
- buffer returns an invalid result HOT 1
- intersection returns an extra point in the output
- Combination of within and difference return wrong result
- within returns a wrong result with multi-linestrings
- static assertion failed: Not implemented for this Geometry's coordinate system HOT 1
- difference returns wrong results if double is the data type HOT 1
- Difference returns wrong result if hole touch the boundary of subtrahend HOT 2
- [Question] Get edges intersected with bounding boxes using boost::geometry::index::intersects HOT 2
- `boost::geometry::buffer()` of linestring returns inner polygon HOT 3
- Intersection gives incorrect result for polygon and line HOT 1
- Difference failed on two simple integer multi polygons (integral geometries cannot represent non-integral vertices/intersections) HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from geometry.