3DTools

Batch conversion between 3D mesh formats — VTP, STL, OBJ.

Overview

3DTools is a small Python package I wrote for batch-converting 3D mesh files between formats, mainly to get OpenSim and SIMM VTK meshes out into STL and OBJ. It is a set of command-line tools built on top of VTK, plus a couple of mesh utilities.

Tools

  • vtp2stl - Convert VTP files to STL format
  • stl2obj - Convert STL files to OBJ format
  • obj2stl - Convert OBJ files to STL format
  • stl2vtp - Convert STL files to VTP format
  • obj2vtp - Convert OBJ files to VTP format
  • mirrorobj - Mirror OBJ files along specified axes
  • meshdecimator - Reduce triangle count

Technical Details

Built with Python 3.8+ and VTK 9.4.2. Dependencies are managed with Poetry, formatting is handled by Ruff, and there is a pytest test suite.

Documentation

Documentation is available at https://aravind-sundararajan.github.io/3dtools/, including usage examples and an API reference.

Installation

Install via pip:

pip install py3dtools

Or clone the repository and install in development mode:

git clone https://github.com/aravind-sundararajan/3dtools.git
cd 3dtools
pip install -e .