Geometry Scripting Split Operation?

Hello,

Let’s say I have a dynamic mesh that I cut into two pieces with a boolean operation. How can I then separate those two pieces into two different meshes?

I’ve been looking at the polygroup and decomposing functions, but I can’t figure out how to detect and split the geometry based on geometric connection. What I want is something similar to the “Split” operation in the editor’s modeling tools, which “Splits the selected meshes into separate parts based on connectivity”.

Can anyone help me?