GithubHelp home page GithubHelp logo

poly-bool-comparison's Issues

Switch to evenodd rule for SVGs?

I noticed that currently the SVGs don't specify a fill-rule, which means that they default to a nonzero fill rule (i.e., winding order matters). Some thoughts:

  • I'm not sure if Martinez implementations actually care about winding order. They most likely ignore it at the input and input is rather interpreted in "evenodd" semantics. As for the output I haven't put any effort (or tests) into rust-geo-booleanop to guarantee correct winding order; all tests seem to assume evenodd semantics. So in general you may see better results using evenodd semantics.
  • It looks like the input data itself does not follow the nonzero winding rule properly. How have the pngs of foo and twointersectingcontours been generated? It seems using "evenodd" fill rule is necessary to obtain them. This inconsistency leads to some wrong results: For instance, rust-geo-booleanop has an optimization when performing a union operation with an empty polygon: It returns the other polygon as is. Currently this shows a wrong result, because the input polygon gets converted wrongly.

Depending on what you want to achieve (testing for correctness w.r.t. evenodd or nonzero rules) you may either fix the input polygons or change the SVG conversion to evenodd. This can be done by changing line 9 of svg.js to:

w('<path style="fill:#000000" fill-rule="evenodd" d="')

This fixes a lot of "false negatives" for me as shown here: 21re/rust-geo-booleanop#15

unisamples : holes

Just wondering, but why does holes have the ending points; [0,1], [0,0]

[
    [ [0,0], [1,0], [0.5,1], [0,0], [0,1], [0,0] ], // <----
    [ [0.2,0.2], [0.5,0.8], [0.8,0.2], [0.2,0.2] ]
]

please include skia pathKit

Thank you for your project, I think its a very good way of benchmarking the algorithms.
There is a wasm version of skia's path algorithms (https://skia.org/docs/user/modules/pathkit/)
which includes boolean operations.
I think it would be very interesting to see how the leading 2d library performs in this test.
I could try to implement this, but if you would want to include it I think you would be more efficient in doing this.
Please let me know what you think.

unisamples : some

FYI, this polygon definition is rotating clockwise about Z, which I believe is wrong.

unisamples : tri2

FYI, this polygon definition is rotating clockwise about Z, which I believe is wrong.

viewing BAD results

How about changing the color of BAD results to gray or white?

It's impossible to see the results with BLACK backgrounds.

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.