Skip to content
Discussion options

You must be logged in to vote

Hello!

You need to create new mesh out of face bitsets like this:

import meshlib.mrmeshpy as mr

mesh = mr.loadMesh("out_boolean.stl")
print(f"{mesh.topology.numValidFaces()} faces")

components = mr.getAllComponents(mesh)
print(f"{len(components)} components")

for i, face_bitset in enumerate(components):
    print(f"{face_bitset.count()} faces")
    component_mesh = mr.Mesh()
    component_mesh.addMeshPart(mr.MeshPart(mesh, face_bitset))
    print(f"{component_mesh.topology.numValidFaces()} faces")
    mr.saveMesh(component_mesh, f"component_{i}.stl")

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@bardiche89
Comment options

@bardiche89
Comment options

@Grantim
Comment options

Answer selected by bardiche89
@bardiche89
Comment options

@bardiche89
Comment options

@Grantim
Comment options

@bardiche89
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants