I am looking for libraries that provide 3D boolean operations (union, subtract, intersect) in java, to use in a game. So, basically, the boolean operations in 3D models will happen dynamically, procedurally, at the player's will (or challenging it). The input and the resulting output is actually a simple 3D mesh, no file needs to be generated, this is actually data objects in memory.

The library license must be compatible with BSD license, for my purposes, but it is acceptable if there are also references to other libraries with other licenses. UnBBoolean once was GPL, and by request, it was made Public Domain (it could have been BSD just to comply with JME by the way).

If possible, they should have performance and provide textures support at the dynamically generated meshes, after all this will be a game, and games to be successful must have good looks, unless it is minecraft (but this is another subject..)

PS.: I am not willing to code anything to provide that feature, like here.


By order of usability (JME ready) and robustness:

  1. jMonkeyCSG this is a JMonkey port of UnBBoolean (so basically, UnBBoolean was (re)made 100% compatible with JMonkeyEngine), read more here. It has all the required boolean operations and is BSD license. It support textures and its performance seems good. ATM, this would be the best choice, as it seems error proof.

  2. Fabian CSG this is JME3 ready and also provides all the boolean operations, it license is here and seems compatible with BSD. It supports textures with good performance too. You can try this too, but when there are very small triangles being processed, it may crash. btw, (1.) development was inspired by this one too.

  3. UnBBoolean Latest to the date, v1.1, does not support textures. Here there is some simple code to just integrate it into JME3, it has all the required boolean operations and its license is Public Domain. Performance not tested (see JMonkeyCSG above). Despite last entry, it can still be considered the core (base/inspiration to all others mentioned above).

Concerning performance: if the results are not required to happen in real time, they can be processed in a background thread to not interfere with the game's frame rate.

PS.: this is actually a new technology, so there aren't many options available to the date.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.