# Boolean Operations

I'm trying to manipulate a number of BMesh items in code with the hope of stitching them together, via boolean operators, to produce more complex geometries/meshes. Do BMesh instances support boolean operations between one one another ? Or must we still drop to normal meshes for this sort of thing.

I suspect the answer will be one of Yes, No or Install Version X.YZ (I am currenty on 2.69).

From a precursory oogle at google there appears to be two threads pertaining to this blenderartists, where it's stated that it is only possible to perform such operations on normal meshes using modifiers, and Elysiun, which provides an example on how to do so. Locally there are two questions pertaining to boolean operation, the link provided links to the other question. These simply serve as additional examples for the standard Mesh library. The other questions on here regarding boolean operations seem to focus on how to fix various problems and do not appear relevant. A few days ago I saw something on boolean operations being provided by the now deprecated NMesh. I was hoping BMesh would support the same. Looking at bmesh.ops there does not appear to be any such operators, have I missed something ?

## Musings :

In a way this makes sense as bmesh seems to target the manipulation of a single mesh, rather then manipulate a generic mesh or a set of meshes which some of the forums seem to imply. Pythonically one sort of expects bmeshes to provide the following functionality, given two meshes meshA and meshB :

# Union (Addition)
meshA += meshB            # B is destroyed/deleted leaving a modified A
meshC  = meshA + meshB    # A and B remain with the addition of C
# Exclusion/Difference/Subtraction
meshA -= meshB
meshC  = meshA - meshB
# Intersection (Multiplication)
meshA *= meshB
meshC  = meshA * meshB


Though such a proposal may be against the design goals of the BMesh API, alternatively there may be better operations to support. Where would one suggest such a thing ?

• Currently (2016 16 Jan) it's not there as a feature of bmesh.ops either as named operation or overloaded operator *+-. I've asked for this too. Ideasman42 suggested that at this point it would be easy to implement. would love it. – zeffii Jan 16 '16 at 14:37
• Hi @zeffii, it seemed like a natural thing to expect. If I finish my addon I will start looking into compiling from scratch and when I get that right I'll start looking into contributing such things back properly but it may take me a while still. – Carel Jan 16 '16 at 14:41

No, at this point in time this functionality has been requested but not included.

There is an e-mail pertaining to this (circa Dec 2014) and a ticket which was opened and subsequently closed (circa Dec 2015) with regards to this. Whether this means it has been included in the main development tree or not is not known to myself nor is it stated in the commit log.

There is mention of the Carve library in the commit which appears to have been included in Blender 2.62. This seems to be the C/C++ library underlying the boolean modifiers operation. This does not appear to be exposed to the Python API.

## Wiki :

This answer is setup as a comunity wiki, please edit when the above is no longer True.

• you might provide a link to the Request. – Samoth Jan 16 '16 at 15:29
• related: developer.blender.org/D1664 – zeffii Jan 16 '16 at 16:20
• related original question to bf-commiters: lists.blender.org/pipermail/bf-committers/2014-December/… – zeffii Jan 16 '16 at 16:22
• @Samoth I have included the links by Zeffii (Ty btw) I'll try to keep the answer up to date going forward. Should you or anyone else find anything new please post in the comments or feel free to update the answer, it's a community wiki for that reason.My familiarity with blender extends but a few days/weeks (I used it when I was way younger). I have no clue at this time of the blender foundations development practices (version control/communication structure etc.). – Carel Jan 16 '16 at 16:58