Install the package using pip
:
pip install PyPeridyno
We recommend installing in a real environment with administrator privileges.
GL_GlfwGUI.py
:import os
import sys
import PyPeridyno as dyno
print(sys.path)
scn = dyno.SceneGraph()
app = dyno.GlfwApp()
app.setSceneGraph(scn)
app.initialize(1920, 1080, True)
app.setWindowTitle("Empty GUI")
app.mainLoop()
python -u "/path/GL_GlfwGUI.py"
First import the PyPeridyno package: import PyPeridyno as dyno
Class Instantiation
Python classes mirror their C++ counterparts with identical names.
C++: std::shared_ptr<SceneGraph> scn = std::make_shared<SceneGraph>();
Python: scn = dyno.SceneGraph()
Templated Classes
For C++ template classes, use class name + type abbreviation in Python:
C++: CodimensionalPD<DataType3f>
→ Python: CodimensionalPD3f
Method Calls
All method names match C++, with pointer operators (->) replaced by dot notation (.):
C++: scn->setLowerBound();
→ Python: scn.setLowerBound()
Vector Types
dyno.Vector3f()
corresponds to C++’s dyno::Vec3f()
, but requires explicit list syntax:
C++: dyno::Vec3f(1)
→ Python: dyno.Vector3f([1,1,1])
Default Parameters
Python requires explicit specification of all parameters:
C++: CodimensionalPD<DataType3f>(0.15, 120, 0.001, 0.0001)
Python: CodimensionalPD3f(0.15, 120, 0.001, 0.0001, "default")
Enum Types
Enums maintain C++ naming but require full qualification:
C++: GLPointVisualModule::PER_OBJECT_SHADER
Python: dyno.GLPointVisualModule().ColorMapMode.PER_OBJECT_SHADER
File Paths
Use dyno.get_asset_path()
+ relative path (absolute paths also accepted).
Default path: C:\ProgramData\Peridyno\data
(created during pip install).
Download additional data from: data.zip
All other usage patterns remain consistent with the C++ implementation.
Q1: Why is administrator privilege required?
A: During installation, pip needs to copy
cufft64_11.dll
from the CUDA_PATH to your Python directory. Without admin rights, this copy operation may fail silently. While the installation may complete without errors, missing this DLL will prevent proper execution.
Workaround: Manually copycufft64_11.dll
to your Python installation directory if admin rights are unavailable.
Q2: Runtime Error: “ImportError: DLL load failed while importing PyPeridyno: The specified module could not be found”
Solution:
- Verify your CUDA version is exactly 12.2 (check CUDA_PATH)
- Manually copy the correct
cufft64_11.dll
to your Python directory- Ensure you’re using Python 3.12 (version mismatch can cause this error)
Q3: How to reinstall?
Complete removal steps:
pip uninstall PyPeridyno pip cache purge pip install PyPeridyno