Implementing 'Brush - Patch' Functionality from MeshInspector in Python #3853
Unanswered
jeahyuklee
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Hello! Patch tool actually do two things:
You can do it in c++ with: MeshLib/source/MRMesh/MRRegionBoundary.h Lines 33 to 37 in 6a67dd1 and MeshLib/source/MRMesh/MRFillHoleNicely.h Lines 43 to 49 in 6a67dd1 note that all c++ function are available in meshlib python modules after 3 version. Now to install latest version you need to manually set it up for pip: pip install meshlib==3.0.1.205 but after next release you will be able to install it simply with getting latest version from You code in python should look somewhat like this: from meshlib import mrmeshpy as mm
mesh = mm.loadMesh( "path/to/mesh.stl" )
facesToPatch = mm.FaceBitSet()
facesToPatch.resize( mesh.topology.getValidFaces().size() )
facesToPatch.set( mm.FaceId( 1 ), True ) # set some faces that you want to patch, or fill the bitset in other way
newHoles = mm.delRegionKeepBd(mesh,facesToPatch)
for hole in newHoles:
mm.fillHoleNicely( mesh, hole[0], mm.FillHoleNicelySettings() )
mm.saveMesh( mesh, "path/to/export_mesh.stl" ) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello!
How can I implement a feature similar to 'Mesh Edit - Brush - Patch' from MeshInspector in Python? Could you provide an example code for this functionality?
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions