Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Learn precise 3D mesh cutting using Python and vedo library for applications in medical imaging, engineering analysis, and 3D modeling.

3D mesh cutting with Vedo is a Python how-to: load a NIfTI isosurface or an STL, then freehand-cut the mesh with FreeHandCutPlotter. It is not a list of Blender / Unreal tools. It is not a VTK file-format note. It is not a screenshot recipe.

If you meant save a PNG of the mesh, no windowhow to capture 3D mesh screenshots with Vedo. If you meant Blender / Unreal / KeyShot3D visualization software. If you meant what a .vtk file isVTK data format. If you meant open a DICOM / NIfTI and paint a maskSlicer + ITK-SNAP.

This is the 2023 PYCAD Team cut. The job is interactive: draw a loop on the mesh, drop the piece you do not want. Screenshot of the same mesh is the other post.

Why you cut a mesh

A volume or an STL is the whole object. A cut is how you isolate one structure — a vessel, a tumor surface, a print-ready half — without going back to the labelmap. In imaging that is usually “show the surgeon this surface, not the whole chest.” In print it is “this half fits the build plate.” It is not a prettier render.

Parallel projection stays on. Perspective foreshortens the far side of the mesh and you will cut the wrong triangle.

The cut

Two inputs. A NIfTI (.nii / .nii.gz) becomes a mesh via Volume(...).isosurface(). An STL loads as a mesh and we color it so the cut is visible. Then FreeHandCutPlotter is the interactive window: hover legend, no axes, you draw the loop.

import vedo
from vedo.applications import FreeHandCutPlotter
from vedo import load, Volume

vedo.settings.use_parallel_projection = True

def cut_3d(file_path: str):
    if file_path.endswith('.nii') or file_path.endswith('.nii.gz'):
        mesh = Volume(file_path).isosurface()
    elif file_path.endswith('.stl'):
        mesh = load(file_path).color('red')
    else:
        raise ValueError('expected .nii / .nii.gz or .stl')
    plt = FreeHandCutPlotter(mesh).add_hover_legend()
    plt.start(axes=0, interactive=1).close()

cut_3d('./data/file.stl')

Install is pip install vedo. Sibling notebooks live in vedo-tutorials.

What this page is not

If the mesh or the viewer has to live in a clinic app, that is the imaging piece. Case studies.

We build custom medical imaging platforms — advanced DICOM viewers, AI segmentation, and the clinical systems around them.

Get in Touch

Copyright © 2026 PYCAD. All Rights Reserved.