Minkowski addition/sum

I need to create a minkowski sum of two objects, and then subtract that sum from a third object.

The reason being is that I am trying to find a valid location to place the first object inside of the third object and the first object is not allowed to touch the second.

I can use the CSG to subtract the summed object that represents the collision zone from the third object that represents valid placement space. However I don’t know how to make the minkowski sum of the two meshes representing the objects not allowed to overlap. minkowski additions and differences are used often in collision detection and for “bumping out” objects that should not be inside each other. if we were to take just the minkowski sum of the first two objects, any point along the surface of the sum would allow the two objects to be placed beside each other without touching.

I got a bit off track, I couldn’t find anything in babylonjs to create minkowski sums but I might have just missed it. If it’s not in babylonjs does anyone know of any resources that can take a babylonjs mesh to generate a sum? or maybe export the babylonjs mesh to an intermediate object structure that the sum can be performed on and converted back to a babylonjs mesh? this needs to happen at runtime but can be recalculated before gameplay.

Thanks!

this might be of interest then

https://www.babylonjs-playground.com/#5ZCGRM#568

Thanks! That’s a good writeup of minkowski sums and their uses and a good visual of what the sums look like. Unfortunately I three 3d polygonal meshes of the sums, or if I was going to project the solution into 2d space I’d need the vertexes of the polygons created. The example is drawing to the canvas, which could work if we consider the canvas image data as our result but that would be a lot of unnecessary data.

Thanks again!