blender splitting objects code example
Example: separate object blender
Select the faces to seperate in edit mode
press 'P' and choose "By selection"
Select the faces to seperate in edit mode
press 'P' and choose "By selection"