Meshinspector thickenMesh vs. Python thickenMesh | Achieve same results #5283
Replies: 1 comment
-
| Hello @emil-peters ! First thing is that "Hollowing/Thickening" tool in MeshInspector actually uses different function that is not voxel based:
As for additional questions:
outMap = mr.FaceMapOrHashMap() map = mr.PartMapping() map.src2tgtFaces = outMap mesh2 = mr.thickenMesh(mesh, 2, params, map) thickenFaces = mesh2.topology.getValidFaces() for ifId in mesh.topology.getValidFaces(): if map.src2tgtFaces.var.current_type() == "Vector_Id_FaceTag_Id_FaceTag": thickenFaces.set(map.src2tgtFaces.getMap()[ifId],False) else: thickenFaces.set(map.src2tgtFaces.getHashMap()[ifId],False) innerFaces = mesh2.topology.getValidFaces() - thickenFaces print (innerFaces.count(),"+",thickenFaces.count(),"=",mesh2.topology.getValidFaces().count())As for params = mr.ThickenParams() params.insideOffset = 0.1 params.outsideOffset = 0.2 mesh2 = mr.makeThickMesh(mesh,params) outerFaces = mesh2.topology.getValidFaces() - mesh.topology.getValidFaces() innerFaces = mesh2.topology.getValidFaces() - outerFaces # this block is need if input mesh is not closed and we want to eliminate connector faces numFace = 0 for f in mesh2.topology.getValidFaces(): if numFace == 2*mesh.topology.numValidFaces(): outerFaces.reset(f,mesh2.topology.numValidFaces() - numFace ) break numFace = numFace+1
Suggestion: params = mr.GeneralOffsetParameters() params.signDetectionMode = mr.SignDetectionMode.Unsigned params.voxelSize = 0.05 positive_offset = 0.1 negative_offset = 0.05 mid_offset = 0.5*positive_offset+0.5*negative_offset single_offset = positive_offset - mid_offset oneSideMesh = mr.offsetOneDirection(mesh, single_offset,params) shell = mr.generalOffsetMesh(oneSideMesh,mid_offset,params)It will surely provide clean mesh |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I'm experimenting with offsetting an isosurface mesh and found that the Hollowing/Thickening operation in MeshInspector works perfectly for my use case (see Video A).
However, when I try to reproduce the same operation using the Python bindings, specifically
mrmeshpy.thickenMesh, the results differ noticeably. The generated mesh appears to be only an isosurface, and the outer boundary of the mesh isn't preserved as cleanly as with the MeshInspector operation (see Image B).Am I missing something in my implementation, or is there another function that more closely matches MeshInspector's behavior?
I also have two additional questions about the thickening process, listed below.
I've attached the code I used to reproduce the result, along with the input mesh.
Thank you!
Additional Questions
thickenMesh, is it possible to obtain the FaceBitSet corresponding to the inner and outer surfaces separately?References
Video A:
Screencast.from.23-10-25.16_02_28.webm
Image B:
Code to Reproduce
shell.zip
Beta Was this translation helpful? Give feedback.
All reactions