Skip to content

Commit

Permalink
deprecate interfaces.gmsh
Browse files Browse the repository at this point in the history
  • Loading branch information
mikedh committed Apr 7, 2024
1 parent f74c8b6 commit f2385c3
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions trimesh/interfaces/gmsh.py
@@ -1,5 +1,6 @@
import os
import tempfile
import warnings

import numpy as np

Expand All @@ -10,6 +11,17 @@
_min_gmsh = (4, 12, 1)


_warning = " ".join(
[
"`trimesh.interfaces.gmsh` is deprecated and will be removed January 2025!",
"There are *many* gmsh options on PyPi: `scikit-gmsh` `gmsh` `pygmsh` `gmsh-sdk`,",
"users should pick one of those and use it directly. If STEP loading is the only",
"thing needed you may want `pip install cascadio` which uses OpenCASCADE more",
"directly and will immediatly enable STEP as a loadable format in trimesh.",
]
)


def load_gmsh(file_name, gmsh_args=None):
"""
Returns a surface mesh from CAD model in Open Cascade
Expand Down Expand Up @@ -38,6 +50,8 @@ def load_gmsh(file_name, gmsh_args=None):
mesh : trimesh.Trimesh
Surface mesh of input geometry
"""
warnings.warn(_warning, category=DeprecationWarning, stacklevel=2)

# use STL as an intermediate format
# do import here to avoid very occasional segfaults
import gmsh
Expand Down Expand Up @@ -179,6 +193,8 @@ def to_volume(mesh, file_type="msh", max_element=None, mesher_id=1) -> bytes:
MSH data, only returned if file_name is None
"""
warnings.warn(_warning, category=DeprecationWarning, stacklevel=2)

# do import here to avoid very occasional segfaults
import gmsh

Expand Down

0 comments on commit f2385c3

Please sign in to comment.