Archive 17/01/2023.

Any good CSG lib?

esakylli

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.

johnnycable

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.

slapin

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…

johnnycable

http://www.openscad.org/

dakilla

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

esakylli

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).

Numerator

I think that blender uses carve

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

rku

I experimented with cpp port of csgjs: https://github.com/***/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.