Installation#

pysdic requires Python 3.11 or later. To install it, you can use the following command:

pip install pysdic

Or install it directly from the GitHub repository using:

pip install git+https://github.com/Artezaru/pysdic.git

Required dependencies#

The following dependencies are installed with pysdic:

Optional dependencies#

Some features need an optional package. The optional packages are not imported when pysdic is loaded: a feature that needs one of them imports it at its first call, and raises an explicit ImportError with the installation instructions if it is missing. The rest of the package works without them.

Package

Installation

Extra

Used by

py3dframe

pip install py3dframe

frames

The frame argument of the mesh creators and pysdic.PointCloud.frame_transform().

pyzernike

pip install pyzernike-polynomials

zernike

pysdic.ZernikeDistortion.

meshio

pip install meshio

meshio

Conversion to and from meshio and the VTK files with use_module="meshio" (default).

PyVista

pip install pyvista

pyvista

3D displays (pysdic.Plotter3D, quick_visualize of the point clouds and meshes) and conversion to and from pyvista.

VTK

pip install vtk

vtk

Conversion to and from vtk objects and the VTK files with use_module="vtk".

Open3D

pip install open3d

open3d

Ray casting on 3D meshes: pysdic.Mesh.cast_rays(), pysdic.compute_visibility(), the 3D case of pysdic.generate_synthetic_image() and pysdic.compute_pixel_integration_points().

h5py

pip install h5py

hdf5

HDF5 files (to_hdf5_file, from_hdf5_file).

All the optional packages are installed with:

pip install pysdic[all]

or one by one with the extras of the table, e.g.:

pip install pysdic[pyvista,open3d]

Note

For vtk, only the light package vtkmodules is imported (import vtk loads every VTK module, which is slow).

The classes that need an optional package can be checked before their use, e.g. pysdic.Plotter3D.is_available().

Rendering with Blender (pysdic-blender)#

The rendering of synthetic images with Blender (lighting, shading, materials) is provided by a separate package, pysdic-blender, built on pysdic (see Blender Rendering):

pip install pysdic-blender

It installs pysdic and bpy (Blender as a Python module). bpy exists for only one version of Python per Blender release: pysdic-blender requires Python 3.13 (bpy 5.1). Use a dedicated environment for the rendering, e.g.:

python3.13 -m venv blender-env
source blender-env/bin/activate
pip install pysdic-blender