Ah ok, I work a little differently and start with a primitive, subdivide, then loop - hence MeshDataTool.
I've been playing around with it but, honestly, I'm not sure what form the face data takes (as opposed to vertex data)... The vector maths is different for concave but I'm just not sure what form they want it. I mean, a face is just three verts with an index...
I'll copy my musings below so you can see my train of thought if it's any help:
func make_col_shape(mesh):
var am = ArrayMesh.new()
am.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, mesh.get_mesh_arrays())
var mdt = MeshDataTool.new()
mdt.create_from_surface(am, 0)
print("face count: ", mdt.get_vertex_count())
var data = []
for face in range(mdt.get_face_count()):
data.append(mdt.get_face_vertex(0, face))
data.append(mdt.get_face_vertex(1, face))
data.append(mdt.get_face_vertex(2, face))
print(data)
There's almost certainly a really easy way to do this... The editor has a Create Trimesh Static Body
tool but there's no api sadly. Maybe just make a CollisionShape and add your vertices
(or verts & indices) variable above as a PoolVector3Array.
Btw, the docs explicitly say: You can only use concave shapes within StaticBodies
which I wasn't aware of until now.
https://docs.godotengine.org/en/stable/tutorials/physics/collision_shapes_3d.html