Splitting concave geometry into convex parts

Hi

I use SketchUp to create maps and models for Source-based games. The plug-ins available for exporting to the required formats all work well. There’s just one problem. Level design and collision meshes are required to be built up using only convex shapes (ref: SketchUp to Hammer Export plugin - Valve Developer Community). I’ve taken a screenshot to illustrate the issue:

The model to the far left is a concave shape. It will not export properly.

The second model is an attempt at dividing the shape into smaller convex shapes. To do this, I copied the original model, mate if flat, drew the necessarily lines, made each segment a group, and finally used the push/pull tool to make each segment 3d again.

The third model was made with the same process as the second one, but defining the segments differently (also convex).

This is tedious work. Even so, it can be done without too much fuzz. It becomes a big problem when more complex shapes like the last model are introduced though.

I basically need a way to have this done automatically. Valve (the creator of the Source engine) is unlikely to do anything about this, I’m afraid. Is this feature something we could see in SketchUp? Alternatively, through an extension? I’ve seen other people asking similar questions, but there doesn’t seem to be any good solution. Some have mentioned some ruby scripts, but I have no idea how to use them.

Any useful tips would be welcome!

vermilicious,

Can you repost the image? I am seeing it

CD

I don’t much about game modelling. But if you just need concave geometry, does having them all in triangles work? I use the SU STL exporter that you can find in the extension warehouse and it makes thing into triangles for you, don’t know if that’ll work for you, but it’s an idea.

I think that what Vermilicious is saying that his models ought to be constructed out of closed 3D blocks, like Legos, that have no parts that curve inward.

I wonder if a different approach to modelling might help. You might try building from ready-made block components and then use the Boolean commands (in SU Pro or the OSCoolean plugin) to subtract the concave shapes out of a “stack of bricks” so that the remaining parts will still be “convex”.

Just an idea

Anssi

Ah, thanks. Sounds weird, why would the be an issue for game modeling?

Or is voxelization (?) an option?

or a more complex shape:

Does this image url work better?

Anssi understood the issue correctly. The shapes need to consist of individual 3d segments (groups). I’m unsure his suggested approach is any easier though.

The voxelization would result in valid shapes, but voxels aren’t really what I’m after. Besides, I would end up with a tonne of unneccesary geometry.

Here’s how the shape turned out from three different angles. The transparent texture is a special texture that doesn’t get drawn in the engine. The pink texture is the reverse faces.

It’s doable, but very tedious and error-prone. I have to hide faces, use the pencil tools and create all the subgroups manually.

I’m not very experienced with game engines, but as far as I understand, this is a limitation in the .bsp format Source engine uses for map “brushes”. I think some other engines uses similar formats. Geometry can also be used as models, which do not have this limitation (just for the collision meshes), but have a different use than brushes.

If the “collision meshes” are different from the actual model and they are not visible in the game, I wonder if they could be much more coarse than the actual model - they only regulate that you cannot fly/walk through the objects. And I wonder if the collision meshes are allowed to intersect - that would make building a coarse replica even easier.

Anssi

Yes, collision meshes are typically rougher, and therefore somewhat easier.