OpenGeode-core

raw JSON →
16.5.1 verified Fri May 01 auth: no python

OpenGeode is an open-source C++/Python framework for representing and manipulating geometric models, with a focus on mesh and boundary representation. Current version 16.5.1, active development with quarterly releases. Provides high-performance data structures and algorithms for geometric modeling.

pip install opengeode-core
error ModuleNotFoundError: No module named 'OpenGeode'
cause Importing with wrong capitalization (O instead of o).
fix
Use 'import opengeode' (lowercase).
error AttributeError: module 'opengeode' has no attribute 'TetrahedralSolid3D'
cause Method name changed or not imported. Modern OpenGeode uses 'TetrahedralSolid3D' but may require loading extension.
fix
Ensure you have installed the full package and call 'opengeode.create_tetrahedral_solid3d()' or check documentation for correct class name.
gotcha OpenGeode is primarily a C++ library with Python bindings; direct Python object manipulation may have unexpected performance overhead. Many operations are optimized for C++ usage.
fix Use batch operations and avoid element-wise loops in Python.
deprecated The old 'import OpenGeode' (capital O) no longer works. Must use 'import opengeode' (lowercase).
fix Change 'import OpenGeode' to 'import opengeode'.
breaking In version 16.0, the geometry module was reorganized. Functions like 'compute_distance' moved from opengeode.geometry to opengeode.core.geometry.
fix Update imports: from opengeode.geometry to opengeode.core.geometry.

Create a 3D tetrahedral mesh with one tetrahedron.

import opengeode

# Create a 3D mesh
mesh = opengeode.TetrahedralSolid3D()
mesh.set_vertices([
    (0,0,0),
    (1,0,0),
    (0,1,0),
    (0,0,1)
])
mesh.add_tetrahedron([0,1,2,3])
print(f"Vertices: {mesh.nb_vertices()}")
print(f"Tetrahedra: {mesh.nb_tetrahedra()}")