gilbo / cork

3D Boolean / CSG Library
Other
401 stars 172 forks source link

Wrote an alternative #41

Open reduz opened 6 years ago

reduz commented 6 years ago

For Godot, I had to implement my own CSG library as we needed something compatible with MIT. If anyone wants to take it out and make a standalone lib, please let me know. I would have loved to useing Cork, but I don't understand the reasoning behind using GPL and then abandoning it.

Please change the license to MIT at least.

maximecb commented 6 years ago

@reduz Came here looking for a Python CSG library. Seems they are all abandoned/unmaintained. I think it would be worthwhile to produce a new one. I'm particularly interested in using this for procedural mesh generation. If you're doing this and looking for a beta tester, ping me.

Raki commented 6 years ago

Hi @reduz , I'm looking for a cpp CSG library, seems your own CSG for Godot is a fit. Can you share me code to make standalone lib ?

spiroyster commented 6 years ago

@reduz , yep another vote here for something else. Happy to contribute if there is an upto date MIT CSG lib for c++. Carve has errors, Cork has errors, csgjs-cpp infinitely loops which leaves OpenCascade OCE (LGPL) and a few vague others. Don't want a whoel framework, just a simple lib that can perform the standard boolean operations would be nice... a working one seems to be somewhat elusive. o.0

nyholku commented 6 years ago

just a simple lib that can perform the standard boolean operations would be nice.

There is no such thing. Simple to use, maybe, simple to implement, don't think so, thus very unlikely to materialise ... OCE is everyone's best bet if you can live with LGPL... and why not.

yetigit commented 6 years ago

@reduz +1 , any csg stuff is welcome at this point

gsohler commented 5 years ago

Hi Group, Is such a library available yet ?

best regards Günther

spiroyster commented 5 years ago

I have a working one. https://github.com/spiroyster/qdcsg, which is a quick and dirty header only implementation using the same white paper... It works fine in 99% of cases although has issues around coplanar triangles from each solid and can sometimes lead to infinite looping (FP precision issues with exrtemely small triangles). I have done some research on this for work and have much better implementations which at some point I may be able to open source. A better approach is to check for intersections and carve (no punn inteneded) up the triangles based around just the intersections. Only problem with this approach is that you need a decent tessellator. qdcsg doesn't require retessellation which means it is easy to implement but results in nasty tessellations some times (many triangles, and long thin ones at that). ymmv.

yetigit commented 5 years ago

@spiroyster you are precious , will try it

baldhumanity commented 4 years ago

I have a working one. https://github.com/spiroyster/qdcsg, which is a quick and dirty header only implementation using the same white paper... It works fine in 99% of cases although has issues around coplanar triangles from each solid and can sometimes lead to infinite looping (FP precision issues with exrtemely small triangles). I have done some research on this for work and have much better implementations which at some point I may be able to open source. A better approach is to check for intersections and carve (no punn inteneded) up the triangles based around just the intersections. Only problem with this approach is that you need a decent tessellator. qdcsg doesn't require retessellation which means it is easy to implement but results in nasty tessellations some times (many triangles, and long thin ones at that). ymmv.

Tried it, too slow compared to cork, uses too much memory. Ty anyway

loic-jourdan commented 4 years ago

I have a working one. https://github.com/spiroyster/qdcsg, which is a quick and dirty header only implementation using the same white paper... It works fine in 99% of cases although has issues around coplanar triangles from each solid and can sometimes lead to infinite looping (FP precision issues with exrtemely small triangles). I have done some research on this for work and have much better implementations which at some point I may be able to open source. A better approach is to check for intersections and carve (no punn inteneded) up the triangles based around just the intersections. Only problem with this approach is that you need a decent tessellator. qdcsg doesn't require retessellation which means it is easy to implement but results in nasty tessellations some times (many triangles, and long thin ones at that). ymmv.

I've had a look at it, it's very clean, modern-styled, clear, simple (as simple as possible), efficient, easy-to-use, easy-to-build and quite robust. It's really worth a try. Congrats @spiroyster, it's an amazing job.

bluelightning32 commented 2 years ago

I found this thread too late, and I ended up writing my own boolean operation library too: https://github.com/bluelightning32/walnut

The algorithm is different than Cork's, but there is a design doc explaining it.