mesh_smooth_centerofmass
- compas.datastructures.mesh_smooth_centerofmass(mesh, fixed=None, kmax=100, damping=0.5, callback=None, callback_args=None)[source]
Smooth a mesh by moving every free vertex to the center of mass of the polygon formed by the neighboring vertices.
- Parameters
mesh (
compas.datastructures.Mesh
) – A mesh object.fixed (list[int], optional) – The fixed vertices of the mesh.
kmax (int, optional) – The maximum number of iterations.
damping (float, optional) – The damping factor.
callback (callable, optional) – A user-defined callback function to be executed after every iteration.
callback_args (list[Any], optional) – A list of arguments to be passed to the callback.
- Returns
None
- Raises
Exception – If a callback is provided, but it is not callable.