CreateBooleanDifference silently skips in Rhino 8 (correct in Rhino 7)

Hi,

I have a Brep pair where the subtractor overlaps the main solid in three disjoint regions. In Rhino 8, Brep.CreateBooleanDifference removes two of them and silently ignores the largest one — and reports no failure. It returns a single closed, valid Brep with no exception, so from the API there is nothing to distinguish this from a correct result.

The same call, on the same file, at the same tolerance, is correct in Rhino 7.

  • Rhino 8.33.26188.13001 — removes 1,968.645 mm³ of 33,355.662 mm³ :cross_mark:
  • Rhino 7.38 — removes 33,355.108 mm³ :white_check_mark:

Windows 11 (10.0.26200), 64-bit. Model units mm, absolute tolerance 0.001, angle tolerance 1.0°.

The file

03_GS02_R8.3dm (attached) contains exactly two Breps, saved straight out of my plugin immediately before the boolean call:

03_GS02_R8.3dm (621.9 KB)

Object name Faces IsSolid IsValid Volume
MAIN_GS02 110 true true 2,349,059.275 mm³
SUB_0 8 true true —

MAIN_GS02 is an extruded aluminium transom profile, SUB_0 is the subtractor that notches it where a mullion crosses.

What the two solids share

CreateBooleanIntersection at tolerance 0.01 gives three separate lumps:

Piece Volume Size (mm) Z range Removed by Rhino 8?
0 31,386.902 mm³ 50.94 × 155.80 × 37.00 3828.83 – 3865.83 no
1 1,966.664 mm³ 40.67 × 15.35 × 13.67 3852.16 – 3865.83 yes
2 2.097 mm³ 39.92 × 6.33 × 0.44 3865.39 – 3865.83 yes
33,355.662 mm³

Rhino 8 removes 1,968.645 mm³, which is pieces 1 + 2 (1,968.761) to within boolean noise. Piece 0 — a 51 × 156 × 37 mm notch, the largest of the three by a factor of sixteen — is left completely untouched. This is not a sliver or a tolerance-scale artifact; it is a whole notch that never gets cut.

Reproduce

import scriptcontext as sc
from Rhino.Geometry import Brep, VolumeMassProperties

def by_name(name):
    for o in sc.doc.Objects:
        if o.Attributes.Name == name:
            return o.Geometry
    return None

main = by_name("MAIN_GS02")
sub  = by_name("SUB_0")
tol  = sc.doc.ModelAbsoluteTolerance          # 0.001

def total_volume(breps):
    t = 0.0
    for b in breps:
        t += VolumeMassProperties.Compute(b).Volume
    return t

res = Brep.CreateBooleanDifference([main], [sub], tol)
print("returned: %d brep(s), faces=%d" % (len(res), res[0].Faces.Count))
print("removed : %.3f mm3" % (VolumeMassProperties.Compute(main).Volume - total_volume(res)))

# how much SHOULD be removed - the shared volume, as separate lumps
inter = Brep.CreateBooleanIntersection([main], [sub], 0.01)
print("expected: %.3f mm3 in %d piece(s)" % (total_volume(inter), len(inter)))
for b in inter:
    print("   piece: %10.3f mm3" % VolumeMassProperties.Compute(b).Volume)

Rhino 8 prints:

returned: 1 brep(s), faces=116
removed : 1968.645 mm3
expected: 33355.662 mm3 in 3 piece(s)
   piece:  31386.902 mm3
   piece:   1966.664 mm3
   piece:      2.097 mm3

Rhino 7 prints 1 brep(s), faces=118 and removed: 33355.108 mm3.

Tolerance sweep (Rhino 8)

Tolerance Intersection.BrepBrep curves CreateBooleanDifference Volume removed
1e-6 7 null —
1e-5 6 null —
1e-4 7 null —
0.0005 8 1 brep, 116 faces 1,968.800
0.001 (doc) 8 1 brep, 116 faces 1,968.645
0.002 8 1 brep, 116 faces 1,968.529
0.005 6 1 brep, 116 faces 1,968.800
0.01 7 1 brep, 119 faces 33,346.864
0.05 7 1 brep, 119 faces 33,334.772
0.1 12 1 brep, 116 faces 33,335.600
0.5 9 1 brep, 119 faces 33,334.772

Two things I found odd:

  1. There is a band from roughly 0.0005 to 0.005 where the result is silently wrong, and it straddles the document tolerance. Below 1e-4 the call fails outright (null); from 0.01 up it is correct.
  2. The overlap curve count from Intersection.BrepBrep is not monotonic in tolerance — 7, 6, 7, 8, 8, 8, 6, 7, 7, 12, 9. At the document tolerance it reports 9 curves in Rhino 7 and 8 in Rhino 8 for this pair. The missing curve looks like the trim loop bounding piece 0.

Also worth noting: Brep.CreateBooleanIntersection(main, sub, 0.001) returns null in Rhino 8 — the intersection fails outright at exactly the tolerance where the difference silently succeeds with a wrong answer.

Already ruled out

  • Distance from origin. The geometry sits ~414,000 mm out, so this was my first suspect. Translating both Breps ~414,000 mm toward the origin and repeating gives identical curve counts. Not the trigger.
  • Invalid input. Both Breps report IsValid and IsSolid true.
  • Different inputs between the two versions. Both were written to disk by the same instrumentation immediately before the call. Same face counts, same volume to three decimals, same bounding box.
  • Different code path. One source tree, no conditional compilation anywhere in the modeling code; only the target framework (net48 / net8.0-windows) and the RhinoCommon package version differ.

Why I am reporting this rather than working around it

I am migrating a curtain-wall plugin from Rhino 7 to Rhino 8. These booleans feed fabrication drawings and NC hole data.

A boolean that fails is recoverable — I already retry at increasing tolerances, and have done since the early days. A boolean that returns a clean, valid, wrong solid is not something the caller can detect, short of computing the expected shared volume for every operation and comparing. That roughly doubles the cost of a step that runs thousands of times per model, so it is not a practical guard.

Until this is sorted I cannot trust Rhino 8 output for production work, which is a shame because the rest of the migration has gone smoothly.

Is this a known regression? Happy to provide more files — I have the matching capture from the Rhino 7 run, and can dump other joints from the same model if that would help narrow it down.

Thanks,

Hi 정춘섭,

Thanks for the file and the exceptionally complete report — that made this quick to verify.

i was able to repeat in the latest 8.35 service release and in the current Rhino 9 WIP, exact same numbers as yours — 1,968.645 of 33,355.662 mm³ removed, the big notch untouched, result closed and valid. Also confirmed CreateBooleanIntersection returns null at doc tolerance while the difference silently succeeds.

Filed as RH-97145 with your tolerance sweep and the BrepBrep curve count observation included — that missing intersection curve looks like the lead. There are a few open issues in this regard around intersections at seams that the developers are aware of.

The 0.01 tolerance result being correct is your interim workaround for production, but i understand thats not something you want to run at blindly. We’ll take a look.