python – How to decompose a mesh into several partitions?

I had a .stl file(original model) and several .ply files(partitions).

model files

These .ply files can be composed into the original model

    import open3d as o3d
    import numpy as np

    # load stl file
    mesh = o3d.io.read_triangle_mesh("data/Product_JAG61-1.stl")
    mesh = mesh.remove_duplicated_vertices()
    mesh = mesh.remove_duplicated_triangles()
    mesh = mesh.compute_triangle_normals()
    mesh = mesh.compute_vertex_normals()
    mesh = mesh.normalize_normals()

    # create a mesh to store ply file
    new_mesh = o3d.geometry.TriangleMesh()

    # compose all ply files into the mesh
    path="data/partition_results/"
    for id in range(168):
        full_path = path + 'segment' + str(id) + '.ply'
        tem_mesh = o3d.io.read_triangle_mesh(full_path)
        new_mesh += tem_mesh

    # visualize two meshes
    o3d.visualization.draw_geometries([mesh])
    o3d.visualization.draw_geometries([new_mesh])

The original model:
enter image description here

The composed model:
enter image description here

Now I want to know the inverse operation. that is how to decompose a mesh or .stl file into several partitions

Read more here: Source link