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