Problem with Curve.CreateBooleanDifference() in Rhino 7!

Hi Guys,
I realized the Curve.CreateBooleanDifference() method does not work in the same was as it used to work in Rhino 6. As you can see in the attached screenshots the method return the closed curve in Rhino 7 only when the tolerance value is above 1,3 which is very large value and does not make sense. In rhino 6 it works with the default 0.001 . notice the curves and their location are the same in both version and the method in C# component is simply
private void RunScript(Curve r, List c, double t, ref object A)
{
A = Curve.CreateBooleanDifference(r, c, t);
}
Any idea if that is a bug or

there is something that I need to change?

Hi @torabiarchitect,

Can you post your .gh file?

Thanks,

– Dale

the funny thing is that it works in R7 with tolerance above 1.3 , but in R6 it is just fine. I used the method in my plugin which is now suffering from this bug.

tolerance test.gh (8.9 KB) to r6.3dm (54.2 KB)

BTW, I checked with my colleagues and we believe this behavior is observed after installing the latest update on Rhino 7

Hi @torabiarchitect,

I can repeat the behavior here, and I have logged the issue.

https://mcneel.myjetbrains.com/youtrack/issue/RH-63787

In the mean time, you might curve calculate the difference one curve at a time.

  private void RunScript(Curve curve, List<Curve> subtractors, double t, ref object A)
  {
    var temp = curve;
    for (var i = 0; i < subtractors.Count; i++)
    {
      var out_curves = Curve.CreateBooleanDifference(temp, subtractors[i], t);
      if (null != out_curves && out_curves.Length == 1)
        temp = out_curves[0];
    }
    A = temp;
  }

– Dale

1 Like

Thanks @dale for your prompt reply, Unfortunately I cant subtract curves one by one as I am not always expecting a single curve as result. For now I am using Curve.CreateBooleanUnion() on the subtractors and then subtract them from the stock. So far it is working although I am not sure how stable is this workaround.
waiting for the fix in the next update,
thanks
Aii

Hi @torabiarchitect,

Can you provide a sample were you would expect more than one output curve?

– Dale

here for example.


moreThanOneCurve.3dm (26.0 KB)

RH-63787 is fixed in the latest Rhino 7 Service Release Candidate

1 Like

Thanks , I asked by college to update and test it .
Cheer s
Ali