pytessel 1.2.4__cp38-cp38-macosx_11_0_arm64.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.

@@ -0,0 +1,160 @@
1
+ Metadata-Version: 2.1
2
+ Name: pytessel
3
+ Version: 1.2.4
4
+ Summary: Python package for building isosurfaces from 3D scalar fields
5
+ Home-page: https://github.com/ifilot/pytessel
6
+ Author: Ivo Filot
7
+ Author-email: ivo@ivofilot.nl
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: POSIX
11
+ Requires-Python: >=3.5
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ Requires-Dist: numpy
15
+
16
+ # PyTessel
17
+
18
+ [![CI](https://github.com/ifilot/pytessel/actions/workflows/build_conda.yml/badge.svg)](https://github.com/ifilot/pytessel/actions/workflows/build_Conda.yml)
19
+ [![CI](https://github.com/ifilot/pytessel/actions/workflows/build_wheels.yml/badge.svg)](https://github.com/ifilot/pytessel/actions/workflows/build_wheels.yml)
20
+ [![Anaconda-Server Badge](https://anaconda.org/ifilot/pytessel/badges/version.svg)](https://anaconda.org/ifilot/pytessel)
21
+ [![PyPI](https://img.shields.io/pypi/v/pytessel?color=green)](https://pypi.org/project/pytessel/)
22
+ [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
23
+
24
+ ## Purpose
25
+
26
+ Python package for building isosurfaces from 3D scalar fields
27
+
28
+ ## Installation
29
+
30
+ ### Anaconda
31
+
32
+ [![Anaconda version](https://anaconda.org/ifilot/pytessel/badges/version.svg)](https://anaconda.org/ifilot/pytessel)
33
+ [![Anaconda last release](https://anaconda.org/ifilot/pytessel/badges/latest_release_date.svg)](https://anaconda.org/ifilot/pytessel)
34
+ [![Anaconda platforms](https://anaconda.org/ifilot/pytessel/badges/platforms.svg)](https://anaconda.org/ifilot/pytessel)
35
+ [![Anaconda downloads](https://anaconda.org/ifilot/pytessel/badges/downloads.svg)](https://anaconda.org/ifilot/pytessel)
36
+
37
+
38
+ ```
39
+ conda install -c ifilot pyqint
40
+ ```
41
+
42
+ ### PyPi
43
+
44
+ [![PyPI](https://img.shields.io/pypi/v/pytessel?color=green)](https://pypi.org/project/pytessel/)
45
+ [![PyPI - Downloads](https://img.shields.io/pypi/dm/pypi)](https://pypi.org/project/pytessel/)
46
+ ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pytessel)
47
+
48
+ ```
49
+ pip install pytessel
50
+ ```
51
+
52
+ ## Getting started
53
+
54
+ In the script below, the isosurface of a threedimensional Gaussian function is
55
+ constructed. The isosurface is written to `test.ply` and can, for example,
56
+ be opened using `ctmviewer` (Linux) or `3D viewer` (Windows).
57
+
58
+ ```python
59
+ from pytessel import PyTessel
60
+ import numpy as np
61
+
62
+ def main():
63
+ pytessel = PyTessel()
64
+
65
+ # generate some data
66
+ x = np.linspace(0, 10, 50)
67
+ # the grid is organized with z the slowest moving index and x the fastest moving index
68
+ grid = np.flipud(np.vstack(np.meshgrid(x, x, x, indexing='ij')).reshape(3,-1)).T
69
+
70
+ R = [5,5,5]
71
+ scalarfield = np.reshape(np.array([gaussian(r,R) for r in grid]), (len(x),len(x),len(x)))
72
+ unitcell = np.diag(np.ones(3) * 10.0)
73
+
74
+ vertices, normals, indices = pytessel.marching_cubes(scalarfield.flatten(), scalarfield.shape, unitcell.flatten(), 0.1)
75
+
76
+ pytessel.write_ply('test.ply', vertices, normals, indices)
77
+
78
+ def gaussian(r, R):
79
+ return np.exp(-(r-R).dot((r-R)))
80
+
81
+ if __name__ == '__main__':
82
+ main()
83
+ ```
84
+
85
+ ## Isosurface quality
86
+
87
+ In the script below, 6 different images are created of an icosahedral "metaball" using a grid
88
+ of `10x10x10`,`20x20x20`,`25x25x25`,`50x50x50`,`100x100x100`, and `200x200x200` points. The
89
+ resulting `.ply` files are rendered using [Blender](https://www.blender.org/).
90
+
91
+ ```python
92
+ from pytessel import PyTessel
93
+ import numpy as np
94
+
95
+ def main():
96
+ """
97
+ Build 6 .ply files of increasing quality
98
+ """
99
+ pytessel = PyTessel()
100
+
101
+ for nrpoints in [10,20,25,50,100,200]:
102
+ sz = 3
103
+
104
+ x = np.linspace(-sz, sz, nrpoints)
105
+ y = np.linspace(-sz, sz, nrpoints)
106
+ z = np.linspace(-sz, sz, nrpoints)
107
+
108
+ xx, yy, zz, field = icosahedron_field(x,y,z)
109
+
110
+ unitcell = np.diag(np.ones(3) * sz * 2)
111
+ pytessel = PyTessel()
112
+ isovalue = 3.75
113
+ vertices, normals, indices = pytessel.marching_cubes(field.flatten(), field.shape, unitcell.flatten(), isovalue)
114
+
115
+ pytessel.write_ply('icosahedron_%03i.ply' % nrpoints, vertices, normals, indices)
116
+
117
+ def icosahedron_field(x,y,z):
118
+ """
119
+ Produce a scalar field for the icosahedral metaballs
120
+ """
121
+ phi = (1 + np.sqrt(5)) / 2
122
+ vertices = [
123
+ [0,1,phi],
124
+ [0,-1,-phi],
125
+ [0,1,-phi],
126
+ [0,-1,phi],
127
+ [1,phi,0],
128
+ [-1,-phi,0],
129
+ [1,-phi,0],
130
+ [-1,phi,0],
131
+ [phi,0,1],
132
+ [-phi,0,-1],
133
+ [phi,0,-1],
134
+ [-phi,0,1]
135
+ ]
136
+
137
+ xx,yy,zz = np.meshgrid(x,y,z)
138
+ field = np.zeros_like(xx)
139
+ for v in vertices:
140
+ field += f(xx,yy,zz,v[0], v[1],v[2])
141
+
142
+ return xx,yy,zz,field
143
+
144
+ def f(x,y,z,X0,Y0,Z0):
145
+ """
146
+ Single metaball function
147
+ """
148
+ return 1 / ((x - X0)**2 + (y - Y0)**2 + (z - Z0)**2)
149
+
150
+ if __name__ == '__main__':
151
+ main()
152
+ ```
153
+
154
+ ![Icosahedral metaballs](https://raw.githubusercontent.com/ifilot/pytessel/master/img/metaballs_3x2.png)
155
+
156
+ ## Local compilation (Linux)
157
+
158
+ ```bash
159
+ python3 setup.py build_ext --inplace bdist
160
+ ```
@@ -0,0 +1,14 @@
1
+ pytessel/_version.py,sha256=XBKH8E1LmDxv06U39yqMBbXZapOERFgICEDYZs_kRso,22
2
+ pytessel/isosurface_mesh.cpp,sha256=zoahovBodabqx2zfHkW5xIGBvU84n15tUlsy0yyexp8,6387
3
+ pytessel/pytessel.cpython-38-darwin.so,sha256=3TzS7TVhGLF0TT6KKUbgyC0UaLW_QSLBQ62iSqjFj9k,176656
4
+ pytessel/__init__.py,sha256=vro51HMaT-ePmW0CgIsDkOgTzutYGB2UgmyV7elT09A,66
5
+ pytessel/isosurface_mesh.h,sha256=5n0TJDDlQBcJu9SOxTmW21_g8YEP5Jq9GVrVwMh7IH0,3458
6
+ pytessel/isosurface.h,sha256=dpenMn9T2KuiYw112HuEdIkuh7fqp12FaVJE-00vMsY,5570
7
+ pytessel/scalar_field.cpp,sha256=Ey1LxTnU_Ul40eIZvZZWgTnhJ8P-dP3aK16nEiOEOsk,8818
8
+ pytessel/isosurface.cpp,sha256=Q4a3lqrgnWGfwyZEdUnC6uSCQ46izSO-8SMWrcGTqWg,20664
9
+ pytessel/scalar_field.h,sha256=sfGoX7VtbA6V99dMqLDpYq79xCFFJAKXL1UXd5QBxWs,3593
10
+ pytessel-1.2.4.dist-info/RECORD,,
11
+ pytessel-1.2.4.dist-info/LICENSE,sha256=4cCtcomD2KVzNeUs8QZPGv_R1FQXPYzr0-2LSnK0hwQ,35121
12
+ pytessel-1.2.4.dist-info/WHEEL,sha256=9FabR3Kab7Nb3lO5nBQWtZc544XJ0hYCmiQC2RH2bHM,107
13
+ pytessel-1.2.4.dist-info/top_level.txt,sha256=QDauMEeJ6MuBmtCTV4HZAr1XodXsUesXTlcImp5LE54,9
14
+ pytessel-1.2.4.dist-info/METADATA,sha256=Td_69V4krFF8epMbV-l6PAiTlxyaLvvi-_ev5Iy3iaU,5009
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (75.3.2)
3
+ Root-Is-Purelib: false
4
+ Tag: cp38-cp38-macosx_11_0_arm64
5
+
@@ -0,0 +1 @@
1
+ pytessel