GithubHelp home page GithubHelp logo

Polygon Union error about clipper2 HOT 9 CLOSED

angusjohnson avatar angusjohnson commented on July 20, 2024
Polygon Union error

from clipper2.

Comments (9)

AngusJohnson avatar AngusJohnson commented on July 20, 2024

I presume from this that you're clipping with FillRule::NonZero.
So make sure that the orientation of all your paths are the same.

from clipper2.

rafmag avatar rafmag commented on July 20, 2024

I'll double check, But I'm sure this worked before with Clipper 1

from clipper2.

rafmag avatar rafmag commented on July 20, 2024

Is there a function in the library to check the orientation of a Path?

from clipper2.

AngusJohnson avatar AngusJohnson commented on July 20, 2024

Area().
See Clipper.Core.h
Positive areas are clockwise (unless REVERSE_ORIENTATION is defined).

I'll double check, But I'm sure this worked before with Clipper 1

I'm pretty sure that what is generating your paths has changed.
I'm very confident that Clipper1 would return this XOR'ed (or EvenOdd) result with the same input paths.

from clipper2.

rafmag avatar rafmag commented on July 20, 2024

I found the problem. My default orientation is counter clockwise. When I do a InflatePaths operation the output orientation is clockwise by default. This would flip the orientation for some of the geometry. Is there any way to control the default orientation of the library. If not I could do it the manual way and reverse the vectors after an InflatePaths operation.

from clipper2.

AngusJohnson avatar AngusJohnson commented on July 20, 2024

Is there any way to control the default orientation of the library.

#define REVERSE_ORIENTATION

😁

from clipper2.

rafmag avatar rafmag commented on July 20, 2024

Now it's a bug. When I define REVERSE_ORIENTATION, InflatePaths gives me no output. When I don't define it, it gives me the correct output but with clockwise orientation.

from clipper2.

rafmag avatar rafmag commented on July 20, 2024

Also, union doesn't seem to be reversing the orientation of holes.

from clipper2.

AngusJohnson avatar AngusJohnson commented on July 20, 2024

Now it's a bug. When I define REVERSE_ORIENTATION

Yep, should be fixed now. 😁

Also, union doesn't seem to be reversing the orientation of holes.

I'm not sure what you mean. Holes should remain oriented opposite to outer paths.

from clipper2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.