How to use to component from meshinspector in python #2945
Answered
by
Grantim
dhanraj-khatal
asked this question in
Q&A
-
|
Beta Was this translation helpful? Give feedback.
Answered by
Grantim
Jul 5, 2024
Replies: 1 comment 1 reply
-
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") |
Beta Was this translation helpful? Give feedback.
1 reply
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: