Any good CSG lib?

Does anyone know of any good, easy-to-use CSG lib out there?
In a first step I just want to subtract (difference) a sphere from a box.
Preferably a lib that could easily be integrated into Urho3D.

Have a look at PyMesh. It’s a python wrapper over a number of such C++ libraries. Check the docs. Integration should be easy as every of them is managed as cmake project.

EDIT: possibly CSG afaik are carve and cork.

Can I hijack your topic and ask for good C or C++ CSG library with permissive license (like MIT, BSD, Zlib)?
Bad library with above conditions are fine too though…

http://www.openscad.org/

You could use the godot implementation.
I’m also looking for a csg library for a near future…

article : Godot gets CSG support

code : godot csg module

2 Likes

Thanks for the pointers!

I also found this javascript lib:
https://evanw.github.io/csg.js/

And a C# port of it:

I’m thinking of giving the C# lib a try (because I’m using C# with UrhoSharp).

I think that blender uses carve

https://code.google.com/archive/p/carve/downloads

1 Like

I experimented with cpp port of csgjs: https://github.com/rokups/Urho3D/commits/feature/CSG
But csgjs is slow, you most likely do not want to use that code. I would work on porting godot’s implementation. It is so much faster.

3 Likes