pytessel 1.1.1__tar.gz → 1.2.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pytessel might be problematic. Click here for more details.
- {pytessel-1.1.1/pytessel.egg-info → pytessel-1.2.4}/PKG-INFO +11 -2
- {pytessel-1.1.1 → pytessel-1.2.4}/pyproject.toml +2 -2
- pytessel-1.2.4/pytessel/_version.py +1 -0
- {pytessel-1.1.1 → pytessel-1.2.4}/pytessel/scalar_field.cpp +38 -9
- {pytessel-1.1.1 → pytessel-1.2.4}/pytessel/scalar_field.h +8 -0
- {pytessel-1.1.1 → pytessel-1.2.4/pytessel.egg-info}/PKG-INFO +11 -2
- {pytessel-1.1.1 → pytessel-1.2.4}/setup.py +20 -6
- pytessel-1.1.1/pytessel/_version.py +0 -1
- {pytessel-1.1.1 → pytessel-1.2.4}/LICENSE +0 -0
- {pytessel-1.1.1 → pytessel-1.2.4}/README.md +0 -0
- {pytessel-1.1.1 → pytessel-1.2.4}/pytessel/__init__.py +0 -0
- {pytessel-1.1.1 → pytessel-1.2.4}/pytessel/isosurface.cpp +0 -0
- {pytessel-1.1.1 → pytessel-1.2.4}/pytessel/isosurface.h +0 -0
- {pytessel-1.1.1 → pytessel-1.2.4}/pytessel/isosurface_mesh.cpp +0 -0
- {pytessel-1.1.1 → pytessel-1.2.4}/pytessel/isosurface_mesh.h +0 -0
- {pytessel-1.1.1 → pytessel-1.2.4}/pytessel.egg-info/SOURCES.txt +0 -0
- {pytessel-1.1.1 → pytessel-1.2.4}/pytessel.egg-info/dependency_links.txt +0 -0
- {pytessel-1.1.1 → pytessel-1.2.4}/pytessel.egg-info/requires.txt +0 -0
- {pytessel-1.1.1 → pytessel-1.2.4}/pytessel.egg-info/top_level.txt +0 -0
- {pytessel-1.1.1 → pytessel-1.2.4}/setup.cfg +0 -0
- {pytessel-1.1.1 → pytessel-1.2.4}/tests/test_isosurface.py +0 -0
- {pytessel-1.1.1 → pytessel-1.2.4}/tests/test_metaball_icosahedron.py +0 -0
- {pytessel-1.1.1 → pytessel-1.2.4}/tests/test_version.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: pytessel
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.2.4
|
|
4
4
|
Summary: Python package for building isosurfaces from 3D scalar fields
|
|
5
5
|
Home-page: https://github.com/ifilot/pytessel
|
|
6
6
|
Author: Ivo Filot
|
|
@@ -12,6 +12,15 @@ Requires-Python: >=3.5
|
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
License-File: LICENSE
|
|
14
14
|
Requires-Dist: numpy
|
|
15
|
+
Dynamic: author
|
|
16
|
+
Dynamic: author-email
|
|
17
|
+
Dynamic: classifier
|
|
18
|
+
Dynamic: description
|
|
19
|
+
Dynamic: description-content-type
|
|
20
|
+
Dynamic: home-page
|
|
21
|
+
Dynamic: requires-dist
|
|
22
|
+
Dynamic: requires-python
|
|
23
|
+
Dynamic: summary
|
|
15
24
|
|
|
16
25
|
# PyTessel
|
|
17
26
|
|
|
@@ -8,8 +8,8 @@ requires = [
|
|
|
8
8
|
build-backend = "setuptools.build_meta"
|
|
9
9
|
|
|
10
10
|
[tool.cibuildwheel]
|
|
11
|
-
test-requires = "pytest"
|
|
11
|
+
test-requires = "pytest numpy cython"
|
|
12
12
|
test-command = "pytest {project}/tests"
|
|
13
13
|
|
|
14
14
|
# skip PyPy wheels
|
|
15
|
-
skip = ["pp*"]
|
|
15
|
+
skip = ["pp*", "cp36-*"]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.2.4"
|
|
@@ -60,6 +60,11 @@ float ScalarField::get_value_interp(float x, float y, float z) const {
|
|
|
60
60
|
// cast the input to the nearest grid point
|
|
61
61
|
Vec3 r = this->realspace_to_grid(x,y,z);
|
|
62
62
|
|
|
63
|
+
// recast
|
|
64
|
+
if(r.x < 0.0) r.x += (float)this->grid_dimensions[0];
|
|
65
|
+
if(r.y < 0.0) r.y += (float)this->grid_dimensions[1];
|
|
66
|
+
if(r.z < 0.0) r.z += (float)this->grid_dimensions[2];
|
|
67
|
+
|
|
63
68
|
// calculate value using trilinear interpolation
|
|
64
69
|
float xd = remainderf(r.x, 1.0);
|
|
65
70
|
float yd = remainderf(r.y, 1.0);
|
|
@@ -69,12 +74,12 @@ float ScalarField::get_value_interp(float x, float y, float z) const {
|
|
|
69
74
|
if(yd < 0) yd += 1.0;
|
|
70
75
|
if(zd < 0) zd += 1.0;
|
|
71
76
|
|
|
72
|
-
float x0 = floor(r.x);
|
|
73
|
-
float x1 = ceil(r.x);
|
|
74
|
-
float y0 = floor(r.y);
|
|
75
|
-
float y1 = ceil(r.y);
|
|
76
|
-
float z0 = floor(r.z);
|
|
77
|
-
float z1 = ceil(r.z);
|
|
77
|
+
float x0 = fmod(floor(r.x), this->grid_dimensions[0]);
|
|
78
|
+
float x1 = fmod(ceil(r.x), this->grid_dimensions[0]);
|
|
79
|
+
float y0 = fmod(floor(r.y), this->grid_dimensions[1]);
|
|
80
|
+
float y1 = fmod(ceil(r.y), this->grid_dimensions[1]);
|
|
81
|
+
float z0 = fmod(floor(r.z), this->grid_dimensions[2]);
|
|
82
|
+
float z1 = fmod(ceil(r.z), this->grid_dimensions[2]);
|
|
78
83
|
|
|
79
84
|
return
|
|
80
85
|
this->get_value(x0, y0, z0) * (1.0 - xd) * (1.0 - yd) * (1.0 - zd) +
|
|
@@ -169,9 +174,9 @@ Vec3 ScalarField::realspace_to_direct(float x, float y, float z) const {
|
|
|
169
174
|
Vec3 ScalarField::realspace_to_grid(float i, float j, float k) const {
|
|
170
175
|
Vec3 g = this->realspace_to_direct(i, j, k);
|
|
171
176
|
|
|
172
|
-
g.x *= float(this->grid_dimensions[0]
|
|
173
|
-
g.y *= float(this->grid_dimensions[1]
|
|
174
|
-
g.z *= float(this->grid_dimensions[2]
|
|
177
|
+
g.x *= float(this->grid_dimensions[0]);
|
|
178
|
+
g.y *= float(this->grid_dimensions[1]);
|
|
179
|
+
g.z *= float(this->grid_dimensions[2]);
|
|
175
180
|
|
|
176
181
|
return g;
|
|
177
182
|
}
|
|
@@ -208,3 +213,27 @@ void ScalarField::inverse(const mat33& mat, mat33* invmat) {
|
|
|
208
213
|
(*invmat)[2][1] = (mat[2][0] * mat[0][1] - mat[0][0] * mat[2][1]) * invdet;
|
|
209
214
|
(*invmat)[2][2] = (mat[0][0] * mat[1][1] - mat[1][0] * mat[0][1]) * invdet;
|
|
210
215
|
}
|
|
216
|
+
|
|
217
|
+
std::vector<float> ScalarField::get_unitcell_vf() const {
|
|
218
|
+
std::vector<float> ans(9,0.0);
|
|
219
|
+
|
|
220
|
+
for(unsigned int i=0; i<3; i++) {
|
|
221
|
+
for(unsigned int j=0; j<3; j++) {
|
|
222
|
+
ans[i*3 + j] = this->unitcell[i][j];
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
return ans;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
std::vector<float> ScalarField::get_unitcell_inverse() const {
|
|
230
|
+
std::vector<float> ans(9,0.0);
|
|
231
|
+
|
|
232
|
+
for(unsigned int i=0; i<3; i++) {
|
|
233
|
+
for(unsigned int j=0; j<3; j++) {
|
|
234
|
+
ans[i*3 + j] = this->unitcell_inverse[i][j];
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
return ans;
|
|
239
|
+
}
|
|
@@ -92,5 +92,13 @@ public:
|
|
|
92
92
|
return this->unitcell;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
+
inline const mat33& get_mat_inverse() const {
|
|
96
|
+
return this->unitcell_inverse;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
std::vector<float> get_unitcell_vf() const;
|
|
100
|
+
|
|
101
|
+
std::vector<float> get_unitcell_inverse() const;
|
|
102
|
+
|
|
95
103
|
private:
|
|
96
104
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: pytessel
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.2.4
|
|
4
4
|
Summary: Python package for building isosurfaces from 3D scalar fields
|
|
5
5
|
Home-page: https://github.com/ifilot/pytessel
|
|
6
6
|
Author: Ivo Filot
|
|
@@ -12,6 +12,15 @@ Requires-Python: >=3.5
|
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
License-File: LICENSE
|
|
14
14
|
Requires-Dist: numpy
|
|
15
|
+
Dynamic: author
|
|
16
|
+
Dynamic: author-email
|
|
17
|
+
Dynamic: classifier
|
|
18
|
+
Dynamic: description
|
|
19
|
+
Dynamic: description-content-type
|
|
20
|
+
Dynamic: home-page
|
|
21
|
+
Dynamic: requires-dist
|
|
22
|
+
Dynamic: requires-python
|
|
23
|
+
Dynamic: summary
|
|
15
24
|
|
|
16
25
|
# PyTessel
|
|
17
26
|
|
|
@@ -1,8 +1,24 @@
|
|
|
1
|
-
import subprocess
|
|
2
1
|
from setuptools import Extension, setup
|
|
3
2
|
from Cython.Build import cythonize
|
|
4
3
|
import os
|
|
5
4
|
import sys
|
|
5
|
+
import re
|
|
6
|
+
|
|
7
|
+
PKG = "pytessel"
|
|
8
|
+
VERSIONFILE = os.path.join(os.path.dirname(__file__), PKG, "_version.py")
|
|
9
|
+
verstr = "unknown"
|
|
10
|
+
try:
|
|
11
|
+
verstrline = open(VERSIONFILE, "rt").read()
|
|
12
|
+
except EnvironmentError:
|
|
13
|
+
pass # Okay, there is no version file.
|
|
14
|
+
else:
|
|
15
|
+
VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]"
|
|
16
|
+
mo = re.search(VSRE, verstrline, re.M)
|
|
17
|
+
if mo:
|
|
18
|
+
verstr = mo.group(1)
|
|
19
|
+
else:
|
|
20
|
+
print(r"Unable to find version in %s" % (VERSIONFILE,))
|
|
21
|
+
raise RuntimeError(r"If %s.py exists, it is required to be well-formed" % (VERSIONFILE,))
|
|
6
22
|
|
|
7
23
|
def find_windows_versions():
|
|
8
24
|
"""
|
|
@@ -59,14 +75,12 @@ if os.name == 'nt':
|
|
|
59
75
|
os.environ['PATH'] = ";".join(newpaths)
|
|
60
76
|
|
|
61
77
|
if os.name == 'posix' and sys.platform != 'darwin':
|
|
62
|
-
os.environ['CFLAGS'] = '-I/usr/include/glm'
|
|
63
78
|
extra_compile_args = ["-Wno-date-time", "-fopenmp", "-fPIC"]
|
|
64
79
|
extra_link_args = ["-fopenmp"]
|
|
65
80
|
elif os.name == 'nt':
|
|
66
81
|
extra_compile_args = ["/wd4244"]
|
|
67
82
|
extra_link_args = []
|
|
68
83
|
elif sys.platform == 'darwin':
|
|
69
|
-
os.environ['CFLAGS'] = '-I/usr/local/Cellar/boost/1.81.0_1/include -I /usr/local/Cellar/glm/0.9.9.8/include'
|
|
70
84
|
extra_compile_args = ["-Wno-date-time", "-fPIC", "-std=c++14"]
|
|
71
85
|
extra_link_args = []
|
|
72
86
|
|
|
@@ -83,8 +97,8 @@ with open("README.md", "r", encoding="utf-8") as fh:
|
|
|
83
97
|
long_description = fh.read()
|
|
84
98
|
|
|
85
99
|
setup(
|
|
86
|
-
name=
|
|
87
|
-
version=
|
|
100
|
+
name=PKG,
|
|
101
|
+
version=verstr,
|
|
88
102
|
author="Ivo Filot",
|
|
89
103
|
author_email="ivo@ivofilot.nl",
|
|
90
104
|
description="Python package for building isosurfaces from 3D scalar fields",
|
|
@@ -94,7 +108,7 @@ setup(
|
|
|
94
108
|
ext_modules=cythonize(ext_modules[0],
|
|
95
109
|
language_level = "3",
|
|
96
110
|
build_dir="build"),
|
|
97
|
-
packages=[
|
|
111
|
+
packages=[PKG],
|
|
98
112
|
include_package_data=True,
|
|
99
113
|
classifiers=[
|
|
100
114
|
"Programming Language :: Python :: 3",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "1.1.1"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|