from meshlib import mrmeshpy as mm
mesh = mm.loadMesh("mesh.stl")
lDeformer = mm.Laplacian(mesh)
ancV0 = mesh.topology.getValidVerts().find_first()
ancV1 = mesh.topology.getValidVerts().find_last()
freeVerts = mm.VertBitSet()
freeVerts.resize(mesh.topology.getValidVerts().size())
freeVerts.set( ancV0, True )
freeVerts.set( ancV1, True )
mm.expand(mesh.topology,freeVerts,5)
lDeformer.init(freeVerts,mm.EdgeWeights.CotanWithAreaEqWeight)
shiftAmount = mesh.computeBoundingBox().diagonal()*0.01
lDeformer.fixVertex( ancV0, mesh.points.vec[ancV0.get()] + mesh.normal(ancV0) * shiftAmount )
lDeformer.fixVertex( ancV1, mesh.points.vec[ancV1.get()] + mesh.normal(ancV1) * shiftAmount )
lDeformer.apply()
mesh.invalidateCaches()
mm.saveMesh(mesh,"deformed_mesh.stl")