Unable to get the similar result in inflate method #4455
Closed
ParvGuptaSpCT
started this conversation in
General
Replies: 2 comments
-
Hello! Some of the settings in MeshInspctor might be different then defaults in MeshLib, this settings are closer to MeshInspector: from meshlib import mrmeshpy as mm
mesh = mm.loadMesh(__file__+"/../mesh.stl")
params = mm.FillHoleNicelySettings()
params.maxEdgeSplits = 20000
params.maxEdgeLen = 0.24204#mesh.averageEdgeLength()
params.triangulateParams.metric = mm.getUniversalMetric(mesh)
params.triangulateOnly = False
params.triangulateParams.multipleEdgesResolveMode = params.triangulateParams.MultipleEdgesResolveMode.Strong
params.smoothCurvature = True
params.edgeWeights = mm.EdgeWeights.CotanWithAreaEqWeight
holes = mesh.topology.findHoleRepresentiveEdges()
maxAreaHole = mm.EdgeId()
maxHoleAreaSq = 0
# find max area hole
for e in holes:
areaSq = mesh.holeDirArea(e).lengthSq()
if (areaSq > maxHoleAreaSq):
maxHoleAreaSq = areaSq
maxAreaHole = e
for e in holes:
newFaces = mm.fillHoleNicely(mesh, e, params)
if (e==maxAreaHole):
dSetting = mm.DecimateSettings()
dSetting.region = newFaces
dSetting.touchNearBdEdges = True
dSetting.packMesh = True
dSetting.optimizeVertexPos = True
dSetting.stabilizer = 0.000001
dSetting.maxEdgeLen = 15.5
dSetting.criticalTriAspectRatio = 10000
dSetting.subdivideParts = 1
dSetting.maxTriangleAspectRatio = 20
dSetting.angleWeightedDistToPlane = False
dSetting.maxError = 0.0155#mesh.computeBoundingBox().diagonal()*1e-3
mm.decimateMesh(mesh, dSetting)
newVerts = mm.getInnerVerts(mesh.topology,newFaces)
mm.positionVertsSmoothlySharpBd(mesh,newVerts)
infParams = mm.InflateSettings()
infParams.preSmooth = False
infParams.pressure = 15
mm.inflate(mesh, newVerts, infParams)
mm.saveMesh(mesh,__file__+"/../out.stl") |
Beta Was this translation helpful? Give feedback.
0 replies
-
hello @Grantim!! |
Beta Was this translation helpful? Give feedback.
0 replies
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 @Grantim!!
I was trying to use inflate method and I'm unable to reproduce the same result as i Mesh Inspector Application.
Here's the steps I followed:
fillHoleNicely
pressure = 10
here's the code snippet
Output from the code:

Here's the mesh i'm using: mesh
Beta Was this translation helpful? Give feedback.
All reactions