Menu

ClipperLib2 : no default fill rule assumed in Execute()?

2022-02-25
2022-02-25
  • Phil Stopford

    Phil Stopford - 2022-02-25

    It looks like the user is forced to provide a fill rule now, and the argument order has changed in Execute.

    Previously, we had 

    Execute(clipType, outPaths, fillRule)

    Now we have :

    Execute(clipType, fileRule, outTree)

    I cannot take the Clipper default by lazily calling :

    Execute(clipType, outTree)

    Is the order of argument change intended? Is it intentional to make the fill rule a required parameter even if most of the time the user will take the default (even-odd)?

     
  • Angus Johnson

    Angus Johnson - 2022-02-25

    Is the order of argument change intended?

    Yes, it is 😜.

    Is it intentional to make the fill rule a required parameter

    Yes. This parameter should never have had a default value. (I also over complicated this in Clipper1 by having two filling rules, so users could specify different filling from Subject and Clip paths.) Nevertheless, the filling rule is crucial to clipping behavior and I'm not persuaded that most uses would default to even-odd filling. The filling rule really should be explicit.

    Anyhow, I'm hoping I've made clipping much simpler with lots of simple wrapper functions in Clipper.cs.