navis.smooth_mesh¶
- navis.smooth_mesh(x, iterations=5, L=0.5, backend='auto', inplace=False)[source]¶
Smooth meshes (TriMesh, MeshNeuron, Volume).
Uses Laplacian smoothing. Not necessarily because that is always the best approach but because there are three backends (see below) that offer similar interfaces.
- Parameters:
x (navis.MeshNeuron/List | navis.Volume | trimesh.Trimesh) – Mesh(es) to simplify.
iterations (int) – Round of smoothing to apply.
L (float [0-1]) – Diffusion speed constant lambda. Larger = more aggressive smoothing.
backend ("auto" | "open3d" | "blender" | "trimesh") – Which backend to use. Currenly we support
open3d
, Blender 3D ortrimesh
.inplace (bool) – If True, will perform simplication on
x
. If False, will simplify and return a copy.parallel (bool) – If True and input is NeuronList, use parallel processing. Requires pathos.
n_cores (int, optional) – Numbers of cores to use if
parallel=True
. Defaults to half the available cores.progress (bool) – Whether to show a progress bar. Overruled by
navis.set_pbars
.omit_failures (bool) – If True will omit failures instead of raising an exception. Ignored if input is single neuron.
- Returns:
Smoothed object.
- Return type:
smoothed