#Combine basic Bevy 3D shapes (union/intersection/difference)?

13 messages · Page 1 of 1 (latest)

bitter depot
#

Bevy has some built-in basic 3S shapes which can be used to generate meshes. I know these meshes can be modified manually, but that is a lot of getting-into-details. It'd be nice to have a higher-level way to combine these primatives into one mesh.

I'm looking for either

  1. A way to combine meshes with union, intersection, and difference operations, or
  2. A way to build the same with higher-level conceptual shapes, resulting in a single mesh at the end.

Is there an existing way in bevy to do this, or a crate I haven't managed to find?

Thank you!

coral heron
#

CSG (constructive solid geometry) / boolean mesh operations aren't built in to bevy, and I don't know of am existing plug-in for it...

#

Unfortunately, at this point I think that you'd need to create your own abstractions over basic meshes if you want to create procedural meshes

modern kettle
#

You'd probably need to implement that yourself, this crate might give you an idea of how to work with meshes, combine them, edit them, etc:
https://github.com/Adamkob12/bevy_meshem
If you need any more help let me know and I might be able to help you.

empty storm
#

You could probably improvise a meh solution by creating the meshes then appending the vertices, indices, uvs, normals etc. of one to the other

#

definitely won't be very nice or high level

#

The shapes in bevy are extremely primitive, just some more or less hardcoded vertices

bitter depot
#

Thanks all. I'll take a look at existing CSG stuff in rust and see if that can be adapted.

bitter depot
leaden bane
#

There are a number of libraries in C or C++ for CSG, such as CGAL and Cork. I wrote my own (fast!) CSG implementation for Noumenal (https://noumenal.app), which uses Bevy, but the app and CSG library are not open source.

bitter depot
#

I definitely care about it all being open source. Thank you for the paper reference!