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 window → how to capture 3D mesh screenshots with Vedo. If you meant Blender / Unreal / KeyShot → 3D visualization software. If you meant what a .vtk file is → VTK data format. If you meant open a DICOM / NIfTI and paint a mask → Slicer + 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
- Not a DCC list. Blender / Unreal sit on 3D visualization software.
- Not an offscreen PNG. That is the screenshot note.
- Not a PYCAD product. A Python snippet we ran; not a mesh-cutting suite.
If the mesh or the viewer has to live in a clinic app, that is the imaging piece. Case studies.