JannisX11 / blockbench

Blockbench - A low poly 3D model editor
https://www.blockbench.net
GNU General Public License v3.0
3.04k stars 270 forks source link

Convex Merge of Cubes/Meshes #2191

Open Roosader opened 4 months ago

Roosader commented 4 months ago

Detailed description of your suggestion

One of my favorite ways to do level design is by using a tool like TrenchBroom and using basic cubes and then combining them to make more complex shapes by using a Convex Merge operation on them. While I would love to see something akin to brush-based editing like Hammer or TrenchBroom, I can understand that that might exceed the scope of BlockBench. However, I think that implementing a pre-made open source Convex Hull algorithm would be very helpful for creating complex shapes. A very basic example of what's possible:

image

Can be merged into this:

image

Just by using a single operation, all of the outermost vertices that make up the hull of all the shapes are made into a new resulting convex hull. This allows for bigger, less precise shapes, to be made very quickly without have to extrude edges or create faces between the shapes and then delete the interior faces.

I'm assuming that something like the Three.js ConvexHull class could get the job done without much of any effort as it does the work of taking a set of vertices and returning the vertices on the convex hull as well as indices for faces.

I think that having an extra option along with "Merge Meshes" in the right-click menu, that being "Convex Merge Meshes" or "Merge Meshes (Convex)" wouldn't be too intrusive.

If this would be straightforward to implement as a plugin, I can look into that as well, but I've got some learnin' to do in that case lol.

Thank you for reading! :)

JannisX11 commented 2 months ago

It's a cool idea, I'm not sure how well it would fit into Blockbench. But I'll keep it open as an idea for now. This would probably be a better fit for a plugin, yeah.