pytessel 1.1.1__cp310-cp310-win_amd64.whl → 1.2.4__cp310-cp310-win_amd64.whl

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/_version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "1.1.1"
1
+ __version__ = "1.2.4"
Binary file
pytessel/scalar_field.cpp CHANGED
@@ -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]-1);
173
- g.y *= float(this->grid_dimensions[1]-1);
174
- g.z *= float(this->grid_dimensions[2]-1);
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
+ }
pytessel/scalar_field.h CHANGED
@@ -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
1
+ Metadata-Version: 2.2
2
2
  Name: pytessel
3
- Version: 1.1.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
 
@@ -0,0 +1,14 @@
1
+ pytessel/__init__.py,sha256=n7uXMiIPBCWoCxVi2lWP47jsE7dr7w-ajKiVAv2BEvQ,69
2
+ pytessel/_version.py,sha256=_Y5uxGUwMxg8VuksWkiGXU_QOTxRnVtkALvNtmszjOI,23
3
+ pytessel/isosurface.cpp,sha256=1ovX4lar5bhCSMzmJ-nYWfOl3VlsZKxSdomj4dgM6fw,21225
4
+ pytessel/isosurface.h,sha256=uSAhenb-IAsxbODv8nkWwbghO4j0rsQXuRO7KjpSoVU,5750
5
+ pytessel/isosurface_mesh.cpp,sha256=8XuvSXCBAoIo_Cyje8GxeHbkNm7MKwc7JOMDgOFMscY,6531
6
+ pytessel/isosurface_mesh.h,sha256=0_R98GiHaw14sh1Zae9AGgAk7lReM-sqlzTVQx8oDto,3562
7
+ pytessel/pytessel.cp310-win_amd64.pyd,sha256=N2eNNc4s-3JuZhMS6mcKfBI3ohXdQKhccPRn8uWjFao,116736
8
+ pytessel/scalar_field.cpp,sha256=Eo36rmC1JYnTDe4u59M07knUR4g0vvigtnlm9PWBNT8,9056
9
+ pytessel/scalar_field.h,sha256=KgELLozQr5uyZUUB07hTp4xuH70IqmS3-yrI5mtEoQQ,3697
10
+ pytessel-1.2.4.dist-info/LICENSE,sha256=N9LlpinTG3mzwIdqFGx9TB-NLPcCdt1PrC2Nar0_CzI,35795
11
+ pytessel-1.2.4.dist-info/METADATA,sha256=x3RNFVsBlqZgdmNZvIZhNBgk9jnp0L9NonFxT-d30qY,5375
12
+ pytessel-1.2.4.dist-info/WHEEL,sha256=H72wNgFePEN0L06A2Z11ydRFbMa6Lsr93VFntInNpxE,101
13
+ pytessel-1.2.4.dist-info/top_level.txt,sha256=QDauMEeJ6MuBmtCTV4HZAr1XodXsUesXTlcImp5LE54,9
14
+ pytessel-1.2.4.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.42.0)
2
+ Generator: setuptools (76.1.0)
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp310-cp310-win_amd64
5
5
 
@@ -1,14 +0,0 @@
1
- pytessel/__init__.py,sha256=n7uXMiIPBCWoCxVi2lWP47jsE7dr7w-ajKiVAv2BEvQ,69
2
- pytessel/_version.py,sha256=KGJQJ23MnEKMR2yQigWuN5Fj9B4JRjsenwhmGe0cwAA,23
3
- pytessel/isosurface.cpp,sha256=1ovX4lar5bhCSMzmJ-nYWfOl3VlsZKxSdomj4dgM6fw,21225
4
- pytessel/isosurface.h,sha256=uSAhenb-IAsxbODv8nkWwbghO4j0rsQXuRO7KjpSoVU,5750
5
- pytessel/isosurface_mesh.cpp,sha256=8XuvSXCBAoIo_Cyje8GxeHbkNm7MKwc7JOMDgOFMscY,6531
6
- pytessel/isosurface_mesh.h,sha256=0_R98GiHaw14sh1Zae9AGgAk7lReM-sqlzTVQx8oDto,3562
7
- pytessel/pytessel.cp310-win_amd64.pyd,sha256=wxPTi-1STv04fefXWrdOoRycfC2qfYDcz5yOuwyBwe4,99840
8
- pytessel/scalar_field.cpp,sha256=D6S1CPI731djHR_VT31KAbQYnFmQtA7ttTEPhAHKLQ4,8123
9
- pytessel/scalar_field.h,sha256=DNkThvBf26FR7eyildNQ-Szb4uZeKjLHRYktALOkFYI,3490
10
- pytessel-1.1.1.dist-info/LICENSE,sha256=N9LlpinTG3mzwIdqFGx9TB-NLPcCdt1PrC2Nar0_CzI,35795
11
- pytessel-1.1.1.dist-info/METADATA,sha256=TAJT5utB_UvJH1Mal4ObfxqLRMMvGBIfq1EOztXZn_c,5169
12
- pytessel-1.1.1.dist-info/WHEEL,sha256=5JPYeYl5ZdvdSkrGS4u21mmpPzpFx42qrXOSIgWf4pg,102
13
- pytessel-1.1.1.dist-info/top_level.txt,sha256=QDauMEeJ6MuBmtCTV4HZAr1XodXsUesXTlcImp5LE54,9
14
- pytessel-1.1.1.dist-info/RECORD,,