Boolean union output layer switches back and forth

I am experiencing a weird bug with the order of operations for BooleanUnion. I had thought that the last object you select defines the target layer for the output. However, here’s what is happening:

  1. Select part on red layer, then shift-select part on blue layer, then booleanUnion. This puts the new solid on the red layer.
  2. Undo, because I wanted it on the blue layer.
  3. Select part on red layer, then shift-select part on blue layer, then booleanUnion again (i.e. the exact same operation). This puts the new solid on the blue layer.

What?

Repeating the undo and union, selecting the parts in the same order every time, switches which layer becomes the output. I made a video because it’s easier to see in operation:

The same bug happens when doing a join between surfaces on different layers, incidentally. The order of operations seems to be backwards from what it’s supposed to be (last object selected defines the layer) half the time, and undoing and doing the exact same thing again reverses it.

Any ideas what is going on? Am I just doing something wrong? The inconsistency is driving me a little nuts.

Systeminfo:

Rhino 8 SR34 2026-8-11 (Rhino 8, 8.34.26223.11001, Git hash:master @ f416e902495235e4e4a45cfc29ff1320cc8c70d8)
License type: Educational, build 2026-08-11
License details: Cloud Zoo

Windows 11 (10.0.26200 SR0.0) or greater (Physical RAM: 32GB)
.NET 8.0.14

Computer platform: DESKTOP

Standard graphics configuration.
Primary display and OpenGL: NVIDIA GeForce RTX 3070 (NVidia) Memory: 8GB, Driver date: 5-19-2026 (M-D-Y). OpenGL Ver: 4.6.0 NVIDIA 610.47
> Accelerated graphics device with 4 adapter port(s)
- Windows Main Display attached to adapter port #0

OpenGL Settings
Safe mode: Off
Use accelerated hardware modes: On
GPU Tessellation is: On
Redraw scene when viewports are exposed: On
Graphics level being used: OpenGL 4.6 (primary GPU's maximum)

Anti-alias mode: 4x
Mip Map Filtering: Linear
Anisotropic Filtering Mode: High

Vendor Name: NVIDIA Corporation
Render version: 4.6
Shading Language: 4.60 NVIDIA
Driver Date: 5-19-2026
Driver Version: 32.0.16.1047
Maximum Texture size: 32768 x 32768
Z-Buffer depth: 24 bits
Maximum Viewport size: 32768 x 32768
Total Video Memory: 8 GB

Rhino plugins that do not ship with Rhino
C:\Users\xxxxxxxxx\AppData\Roaming\McNeel\Rhinoceros\7.0\Plug-ins\KeyShot11RhinoPlugin (55124e8a-aa81-4be8-8e12-9f452c473970)\1.0.0.0\KeyShot11RhinoPlugin\Rhino 7\KeyShot11RhinoPlugin.rhp	"KeyShot11RhinoPlugin"	1.0.0.0
C:\Program Files\Common Files\McNeel\Rhinoceros\7.0\Plug-ins\KeyShot9RhinoPlugin (ecfe8d1f-876a-460f-aa5e-3dd816936811)\1.0.0.0\KeyShot9RhinoPlugin\Rhino 5.0\KeyShot9RhinoPlugin.rhp	"KeyShot9RhinoPlugin"	1.0.0.0

Rhino plugins that ship with Rhino
D:\applications\rhino-8\Plug-ins\SolidTools.rhp	"SolidTools"	
D:\applications\rhino-8\Plug-ins\Commands.rhp	"Commands"	8.34.26223.11001
D:\applications\rhino-8\Plug-ins\rdk.rhp	"Renderer Development Kit"	
D:\applications\rhino-8\Plug-ins\RhinoRenderCycles.rhp	"Rhino Render"	8.34.26223.11001
D:\applications\rhino-8\Plug-ins\rdk_etoui.rhp	"RDK_EtoUI"	8.34.26223.11001
D:\applications\rhino-8\Plug-ins\NamedSnapshots.rhp	"Snapshots"	
D:\applications\rhino-8\Plug-ins\MeshCommands.rhp	"MeshCommands"	8.34.26223.11001
D:\applications\rhino-8\Plug-ins\export_STEP.rhp	"STEP Export"	
D:\applications\rhino-8\Plug-ins\RhinoCycles.rhp	"RhinoCycles"	8.34.26223.11001
D:\applications\rhino-8\Plug-ins\Grasshopper\GrasshopperPlugin.rhp	"Grasshopper"	8.34.26223.11001
D:\applications\rhino-8\Plug-ins\Toolbars\Toolbars.rhp	"Toolbars"	8.34.26223.11001
D:\applications\rhino-8\Plug-ins\3dxrhino.rhp	"3Dconnexion 3D Mouse"	
D:\applications\rhino-8\Plug-ins\Displacement.rhp	"Displacement"	
D:\applications\rhino-8\Plug-ins\Calc.rhp	"Calc"	
D:\applications\rhino-8\Plug-ins\SectionTools.rhp	"SectionTools"


Hi Phizz,

What happens depends on whether you select objects one by one - in which case I believe the layer of the first object picked is used - or en masse - in which case I think the layer of the object with the lowest RuntimeSerialNumber is used. Unfortunately you have no control over the RuntimeSerialNumber assigned to an object and it isn’t immutable so in the latter case the layer you get can be unpredictable.

HTH
Jeremy

P.S. The R9 WIP has added an option to place the unioned object on the Current layer, which will make the outcome predictable.

In the video I’m just picking one object at a time: first the red lamp housing, then the car body, with single clicks on each. Both are closed polysurfaces. Does the number of subobjects/surfaces within the selection matter?

Also, this doesn’t explain why I first select the red object, then the blue object, and the result goes onto the red layer – then I undo, select the red object, then the blue object, and the result goes onto the blue layer.

Hi phizz -

To control on which layer the new object will be placed you’ll need to post-pick. First run the BooleanUnion command, then select the object that is on the layer that you want the result to end up on, then pick other objects.

Pre-picking and undoing is just changing the RuntimeSerialNumber that Jeremy mentioned.
-wim

You’re right. Here’s a different explanation derived after a little hacking. When you preselect several objects they are held internally in ascending RuntimeSerialNumber order. You union them and then undo the boolean. This time after you preselect them they are held in descending RuntimeSerialNumber order. Each time you union, undo and select, the internal order flips. The layer used is always that of the first object in the sequence. The RuntimeSerialNumber allocated to an object remains consistent through the undo - mutability is not an issue here.

I have no idea if this flip is deliberate or a side effect of some low-level storage algorithm.

Regards
Jeremy

Ah, thanks – that makes sense. Still a bit annoying, because I practically always select the objects first and then run the tool, and from the user standpoint there’s no reason for the behavior to be different in those two cases. But I can get used to the different approach for when it matters.