Comments (5)
Hi Fribur.
Something certainly seems odd but I'll need some data to sort out what's happening.
You'll find a link to my email address here.
Unrelated, I have a hunch line 853 should be _vertexList.Add(curr_v); and not _vertexList.Add(v0);
Yes, that's definitely a bug. Thanks!
from clipper2.
Attached the three integer polygons leading to the result in picture above (consecutive union of 1+2-->result1, then result1+3--result2). Interestingly this only occurs when I add them as PathD. Using Path64 leads to the expected result. Puzzling.
var jobClipper2 = new Clipper2Lib.ClipperD();
...
jobClipper2.Execute(ClipType.Union, FillRule.EvenOdd, result);
Outline_0.txt
Outline_1.txt
Outline_2.txt
from clipper2.
OK, problem found.
private static double DistanceSqr(Point64 pt1, Point64 pt2)
{
return (double) (pt1.X - pt2.X) * (pt1.X - pt2.X) +
(double) (pt1.Y - pt2.Y) * (pt1.Y - pt2.Y);
}
The C# compiler indicated that my explicit casting to double in Clipper.Engine.DistanceSqr()
was unnecessary (by fading out these casts). Unfortunately I removed them without testing the consequences and it turns out they are very much needed. Now I'm wondering what other casts I've removed that the compiler indicated were superfluous.
from clipper2.
I assume the math runs on integer (with rounding errors) and converts to float at last step (the result is wrong at that point).
from clipper2.
and converts to float at last step (the result is wrong at that point)
Yep. Anyhow, fixed now.
from clipper2.
Related Issues (20)
- Add Extensions to C#
- Unexpected result offset with PathsD HOT 3
- PolyTree64 output has improper structure HOT 4
- Open-path clipping with ZCallback not consistently called for all generated vertices HOT 4
- Sliver Artifacts created by ClipperOffset HOT 5
- C#: ExecuteRectClipLines (aka RectClipLines, previously) seems to be broken in 1.2.2 HOT 2
- ClipperOffset ignore orientation of (single) polygon HOT 2
- Error in offsetting in latest releases HOT 4
- Enhancement request : offset in specified axis only HOT 16
- some questions about the interface
- Wierd stuff with Difference HOT 1
- ExecuteRectClip bug HOT 1
- self intersecting polygons
- Minkowski for Paths
- Infinite recursion building PolyTree HOT 2
- Clipping open subject creates a lot of single-point polylines HOT 6
- DLL export function definitions RectClip64 and RectClipD have parameter convex_only but implementations do not
- Framework 4.8.1 witch use Dotnet Standard 2.0 cannot load reference HOT 1
- Clipper1 compatability . HOT 5
- CheckPrecision dissallowing precision values more negative than `-8` HOT 1
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 clipper2.