From c64ae900a3428838483fefb07146d69252e1da15 Mon Sep 17 00:00:00 2001 From: harmening Date: Thu, 22 Sep 2022 23:24:57 +0200 Subject: [PATCH] adapt cython function defs to new namings --- examples/cython/openGJK_cython.pxd | 6 +++--- examples/cython/openGJK_cython.pyx | 10 +++++----- examples/cython/setup.py | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/examples/cython/openGJK_cython.pxd b/examples/cython/openGJK_cython.pxd index ea7a1ae..924522e 100644 --- a/examples/cython/openGJK_cython.pxd +++ b/examples/cython/openGJK_cython.pxd @@ -30,15 +30,15 @@ # Declare C function and data types cdef extern from "openGJK.h": - struct bd: + struct gkPolytope_: int numpoints double s[3] double ** coord - struct simplex: + struct gkSimplex_: int nvrtx double vrtx[4][3] int wids[4] double lambdas[4] - double gjk(bd bd1, bd bd2, simplex *s) + double compute_minimum_distance(gkPolytope_ bd1, gkPolytope_ bd2, gkSimplex_ *s) diff --git a/examples/cython/openGJK_cython.pyx b/examples/cython/openGJK_cython.pyx index 4ee60e5..07d6b36 100644 --- a/examples/cython/openGJK_cython.pyx +++ b/examples/cython/openGJK_cython.pyx @@ -30,7 +30,7 @@ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # # cython: language_level=3 -# distutils: sources = ../../src/openGJK.c +# distutils: sources = ../../openGJK.c # distutils: include_dirs = ../../include/openGJK cimport openGJK_cython @@ -44,9 +44,9 @@ def pygjk(bod1, bod2): # Declare data types cdef: - simplex s - bd bd1 - bd bd2 + gkSimplex_ s + gkPolytope_ bd1 + gkPolytope_ bd2 double dist2 # Convert 1D array to 2D, if any @@ -96,7 +96,7 @@ def pygjk(bod1, bod2): bd2.coord[i][j] = narr2[i,j] # Call C function - dist2 = gjk(bd1, bd2, &s) + dist2 = compute_minimum_distance(bd1, bd2, &s) # Free the memory for ii in range(0, bd1.numpoints): diff --git a/examples/cython/setup.py b/examples/cython/setup.py index 801ff67..5805e75 100644 --- a/examples/cython/setup.py +++ b/examples/cython/setup.py @@ -40,5 +40,5 @@ exts = Extension( setup( name='openGJK-cython-version', - ext_modules = cythonize( [exts] ) -) \ No newline at end of file + ext_modules = cythonize([exts], language_level = "3") +)