Boolean Mesh Operations and Mesh-Based CSG
I've been trying to figure out how to convert a CSG tree to a mesh, so that I can export it to a .obj.
Unfortunately, while I can find a lot of code and tutorials out there that show how to directly render a CSG tree in image space, I come up dry when it comes to converting to a mesh. Well, that's not entirely true, I did look through Blender source, and failed at finding the responsible code. I imagine that it comes to finding intersections of faces and building a mesh from that, or subdividing and merging. I could always voxelize and back, although I would loose quite a bit of information in the process.
Unfortunately, while I can find a lot of code and tutorials out there that show how to directly render a CSG tree in image space, I come up dry when it comes to converting to a mesh. Well, that's not entirely true, I did look through Blender source, and failed at finding the responsible code. I imagine that it comes to finding intersections of faces and building a mesh from that, or subdividing and merging. I could always voxelize and back, although I would loose quite a bit of information in the process.
GTS can do it, and is LGPL: http://gts.sourceforge.net/
CGAL can probably do it, though the relevant part is probably GPL: http://www.cgal.org/
You can do it with any kind of spatial partitioning tree. There used to be a decent tutorial about doing it with BSP but I'm having no luck finding it right now :/
CGAL can probably do it, though the relevant part is probably GPL: http://www.cgal.org/
You can do it with any kind of spatial partitioning tree. There used to be a decent tutorial about doing it with BSP but I'm having no luck finding it right now :/
I found this on BSPs http://www.cgafaq.info/wiki/BSP_boolean_operations
Now it looks like I'll have to figure out how to convert to BSP and back, which should be much more documented.
Now it looks like I'll have to figure out how to convert to BSP and back, which should be much more documented.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| how to create a grid / 2D mesh | bfarah | 1 | 3,217 |
Oct 20, 2010 02:22 AM Last Post: iamflimflam1 |
|
| OpenGL ES creating a 2D mesh | soulstorm | 0 | 2,480 |
May 20, 2009 02:37 AM Last Post: soulstorm |
|
| Spherical Mesh. | dave05 | 8 | 4,832 |
Oct 29, 2008 02:53 PM Last Post: mholg |
|
| Breaking down a concave mesh into convex pieces | Willem | 5 | 3,970 |
Aug 10, 2008 05:49 AM Last Post: Willem |
|
| Vector (Normal) Map blending operations? | kelvin | 10 | 5,942 |
Mar 16, 2007 04:31 PM Last Post: OneSadCookie |
|

