Repository navigation
How to use to component from meshinspector in python #2945
Answered
by
Grantim
dhanraj-khatal
asked this question in
Q&A
|
|
Answered by
Grantim
Jul 5, 2024
Replies: 1 comment 2 replies
|
Hello! from meshlib import mrmeshpy as mm
# load mesh with several components
mesh = mm.loadMesh("in/path/filename.stl")
# separate components
components = mm.getAllComponents(mesh)
for i in range(len(components)):
compMesh = mm.Mesh()
compMesh.addPartByMask(mesh, components[i])
mm.saveMesh(compMesh,"component_"+str(i) + ".stl") |
2 replies
Answer selected by
dhanraj-khatal
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Hello!
Please try this way: