pyviewfactor 1.0.3__tar.gz → 1.1.0__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.
- {pyviewfactor-1.0.3 → pyviewfactor-1.1.0}/PKG-INFO +14 -16
- {pyviewfactor-1.0.3 → pyviewfactor-1.1.0}/README.md +159 -161
- {pyviewfactor-1.0.3 → pyviewfactor-1.1.0}/pyviewfactor/__init__.py +42 -43
- {pyviewfactor-1.0.3 → pyviewfactor-1.1.0}/pyviewfactor/_version.py +6 -6
- pyviewfactor-1.1.0/pyviewfactor/pvf_geometry_preprocess.py +824 -0
- pyviewfactor-1.1.0/pyviewfactor/pvf_integrators.py +485 -0
- {pyviewfactor-1.0.3 → pyviewfactor-1.1.0}/pyviewfactor/pvf_plot.py +81 -88
- pyviewfactor-1.1.0/pyviewfactor/pvf_viewfactor_computations.py +293 -0
- {pyviewfactor-1.0.3 → pyviewfactor-1.1.0}/pyviewfactor/pvf_visibility_obstruction.py +102 -151
- {pyviewfactor-1.0.3 → pyviewfactor-1.1.0}/pyviewfactor.egg-info/PKG-INFO +14 -16
- {pyviewfactor-1.0.3 → pyviewfactor-1.1.0}/pyviewfactor.egg-info/SOURCES.txt +1 -0
- pyviewfactor-1.1.0/test/test_new_kernels.py +414 -0
- pyviewfactor-1.1.0/test/test_view_factor.py +216 -0
- pyviewfactor-1.0.3/pyviewfactor/pvf_geometry_preprocess.py +0 -537
- pyviewfactor-1.0.3/pyviewfactor/pvf_integrators.py +0 -317
- pyviewfactor-1.0.3/pyviewfactor/pvf_viewfactor_computations.py +0 -402
- pyviewfactor-1.0.3/test/test_view_factor.py +0 -407
- {pyviewfactor-1.0.3 → pyviewfactor-1.1.0}/LICENSE.txt +0 -0
- {pyviewfactor-1.0.3 → pyviewfactor-1.1.0}/pyviewfactor.egg-info/dependency_links.txt +0 -0
- {pyviewfactor-1.0.3 → pyviewfactor-1.1.0}/pyviewfactor.egg-info/requires.txt +0 -0
- {pyviewfactor-1.0.3 → pyviewfactor-1.1.0}/pyviewfactor.egg-info/top_level.txt +0 -0
- {pyviewfactor-1.0.3 → pyviewfactor-1.1.0}/setup.cfg +0 -0
- {pyviewfactor-1.0.3 → pyviewfactor-1.1.0}/setup.py +0 -0
- {pyviewfactor-1.0.3 → pyviewfactor-1.1.0}/test/__init__.py +0 -0
- {pyviewfactor-1.0.3 → pyviewfactor-1.1.0}/test/test_geometry_preprocess.py +0 -0
- {pyviewfactor-1.0.3 → pyviewfactor-1.1.0}/test/test_plot.py +0 -0
- {pyviewfactor-1.0.3 → pyviewfactor-1.1.0}/test/test_visibility_obstruction.py +0 -0
- {pyviewfactor-1.0.3 → pyviewfactor-1.1.0}/test/test_visibility_obstruction_semantics.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyviewfactor
|
|
3
|
-
Version: 1.0
|
|
3
|
+
Version: 1.1.0
|
|
4
4
|
Summary: "A lightweight open-source Python library for exact view-factor computations on polygonal meshes"
|
|
5
5
|
Home-page: https://gitlab.com/arep-dev/pyViewFactor/
|
|
6
6
|
Author: Mateusz BOGDAN, Edouard WALTHER
|
|
@@ -34,7 +34,7 @@ Dynamic: license-file
|
|
|
34
34
|
> - obstruction detection,
|
|
35
35
|
> - accurate view factor computation.
|
|
36
36
|
|
|
37
|
-
*Full documentation available [
|
|
37
|
+
*Full documentation available at [arep-dev.gitlab.io/pyViewFactor](https://arep-dev.gitlab.io/pyViewFactor/).*
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
<img src="https://gitlab.com/arep-dev/pyViewFactor/-/raw/3d40d1804eccbaefbc8b1736ff30d0d9f08141ad/img/FF_sceneUrbaine_cyl_RT.png" alt="Urban View Factor" width="800" />
|
|
@@ -45,7 +45,7 @@ Dynamic: license-file
|
|
|
45
45
|
[](https://opensource.org/licenses/MIT)
|
|
46
46
|
[](https://pypi.org/project/pyviewfactor/)
|
|
47
47
|
[](https://pypi.org/project/pyviewfactor/)
|
|
48
|
-
|
|
48
|
+
[](https://joss.theoj.org/papers/cc7d3aebf5e8ed25b343c6dd822f70b4)
|
|
49
49
|
|
|
50
50
|
|
|
51
51
|
## Features
|
|
@@ -56,11 +56,11 @@ with insights from [(Schmid 2016)](https://hal.archives-ouvertes.fr/tel-01734545
|
|
|
56
56
|
* It uses the handy [`Pyvista`](https://docs.pyvista.org/) package to deal with geometry imports (`*.stl`, `*.vtk`, `*.obj`, ...),
|
|
57
57
|
geometry creations, and some other mesh functionalities under the hood.
|
|
58
58
|
* It enables:
|
|
59
|
-
- 🔺 View factor computation between planar polygons
|
|
59
|
+
- 🔺 View factor computation between planar polygons via the **SA-30 semi-analytic kernel** — handles touching and coplanar faces analytically, no epsilon shift
|
|
60
60
|
- 👁️ Visibility checks based on face orientation
|
|
61
|
-
- 🚧 Obstruction detection using ray-triangle intersection
|
|
61
|
+
- 🚧 Obstruction detection using Möller–Trumbore ray-triangle intersection, **BVH-accelerated** (O(log N) per ray)
|
|
62
62
|
- ⚙️ Strict / non-strict modes for robustness control
|
|
63
|
-
- ⚡
|
|
63
|
+
- ⚡ Full N×N view-factor matrix with Numba `prange` parallelism (~33× faster than v1.0)
|
|
64
64
|
- 📦 Built on `numpy`, `scipy`, `pyvista`, `numba`
|
|
65
65
|
|
|
66
66
|
|
|
@@ -86,7 +86,7 @@ tqdm==4.65.0
|
|
|
86
86
|
The code will probably work with lower versions of the required packages, however this has not been tested.
|
|
87
87
|
|
|
88
88
|
> [!NOTE]
|
|
89
|
-
>
|
|
89
|
+
> `numba` is optional but strongly recommended. Without it, all kernels fall back to sequential pure-Python with identical results — no need to pin an older version.
|
|
90
90
|
|
|
91
91
|
|
|
92
92
|
## Quick Start
|
|
@@ -135,8 +135,8 @@ pl.add_mesh(arrows2, color="darkred")
|
|
|
135
135
|
pl.show()
|
|
136
136
|
```
|
|
137
137
|
|
|
138
|
-
You
|
|
139
|
-
(`*.dat`, `*.idf`, ...)
|
|
138
|
+
You want to import your own geometry from a different format?
|
|
139
|
+
(`*.dat`, `*.idf`, `*.stl`, ...)
|
|
140
140
|
|
|
141
141
|
Check pyvista's documentation on [how to generate a PolyData facet from points](https://docs.pyvista.org/examples/00-load/create-poly.html).
|
|
142
142
|
|
|
@@ -144,14 +144,12 @@ Check pyvista's documentation on [how to generate a PolyData facet from points](
|
|
|
144
144
|
|
|
145
145
|
For detailed explanations and advanced usage, see:
|
|
146
146
|
|
|
147
|
-
https://arep-dev.gitlab.io/pyViewFactor/
|
|
147
|
+
https://arep-dev.gitlab.io/pyViewFactor/
|
|
148
148
|
|
|
149
149
|
The documentation includes:
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
* Numerical robustness guidelines,
|
|
154
|
-
* Extended examples (that can also be found in the `examples/` folder of the repository).
|
|
150
|
+
* Theory: view factor integral, SA-30 semi-analytic kernel, BVH obstruction engine,
|
|
151
|
+
* Implementation: architecture, visibility & obstruction semantics, performance guide,
|
|
152
|
+
* Extended examples with analytical validations.
|
|
155
153
|
|
|
156
154
|
|
|
157
155
|
## Citation & Acknowledgments
|
|
@@ -170,7 +168,7 @@ So if you use `pyViewFactor` in your work, please cite:
|
|
|
170
168
|
Bibtex entry:
|
|
171
169
|
``` latex
|
|
172
170
|
@inproceedings{pyViewFactor22bogdan,
|
|
173
|
-
|
|
171
|
+
author = "Mateusz BOGDAN and Edouard WALTHER and Marc ALECIAN and Mina CHAPON",
|
|
174
172
|
title = "Calcul des facteurs de forme entre polygones - Application à la thermique urbaine et aux études de confort",
|
|
175
173
|
year = "2022",
|
|
176
174
|
organization = "IBPSA France",
|
|
@@ -1,161 +1,159 @@
|
|
|
1
|
-
# PyViewFactor
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
<div align="center">
|
|
5
|
-
<img src="https://gitlab.com/arep-dev/pyViewFactor/-/raw/da36d4a0b08308009d9e71876091492ecb97d476/img/Logo%20pVF%20512x512%20v3%20transparent%20crop.png" alt="pvf_logo" width="256px"/>
|
|
6
|
-
</div>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
> `pyViewFactor` is a lightweight open-source Python library for exact view-factor computations on polygonal meshes.
|
|
10
|
-
> It provides robust tools for:
|
|
11
|
-
> - geometric visibility analysis,
|
|
12
|
-
> - obstruction detection,
|
|
13
|
-
> - accurate view factor computation.
|
|
14
|
-
|
|
15
|
-
*Full documentation available [
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
<img src="https://gitlab.com/arep-dev/pyViewFactor/-/raw/3d40d1804eccbaefbc8b1736ff30d0d9f08141ad/img/FF_sceneUrbaine_cyl_RT.png" alt="Urban View Factor" width="800" />
|
|
19
|
-
|
|
20
|
-
[](https://gitlab.com/arep-dev/pyViewFactor/-/releases)
|
|
21
|
-
[](https://gitlab.com/arep-dev/pyViewFactor/pipelines)
|
|
22
|
-
[](https://codecov.io/gl/arep-dev/pyViewFactor)
|
|
23
|
-
[](https://opensource.org/licenses/MIT)
|
|
24
|
-
[](https://pypi.org/project/pyviewfactor/)
|
|
25
|
-
[](https://pypi.org/project/pyviewfactor/)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
## Features
|
|
30
|
-
|
|
31
|
-
* This library enables the computation of radiation view factors between planar polygons using an **accurate** double‐contour integration method described in
|
|
32
|
-
[(Mazumder and Ravishankar 2012)](https://www.academia.edu/download/77459051/Viewfactor_paper_IJHMT.pdf)
|
|
33
|
-
with insights from [(Schmid 2016)](https://hal.archives-ouvertes.fr/tel-01734545/).
|
|
34
|
-
* It uses the handy [`Pyvista`](https://docs.pyvista.org/) package to deal with geometry imports (`*.stl`, `*.vtk`, `*.obj`, ...),
|
|
35
|
-
geometry creations, and some other mesh functionalities under the hood.
|
|
36
|
-
* It enables:
|
|
37
|
-
- 🔺 View factor computation between planar polygons
|
|
38
|
-
- 👁️ Visibility checks based on face orientation
|
|
39
|
-
- 🚧 Obstruction detection using ray-triangle intersection
|
|
40
|
-
- ⚙️ Strict / non-strict modes for robustness control
|
|
41
|
-
- ⚡
|
|
42
|
-
- 📦 Built on `numpy`, `scipy`, `pyvista`, `numba`
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
## Installation
|
|
47
|
-
`pyViewFactor` can be installed from [PyPi](https://pypi.org/project/pyviewfactor/)
|
|
48
|
-
using `pip` on Python >= 3.10:
|
|
49
|
-
```shell
|
|
50
|
-
pip install pyviewfactor
|
|
51
|
-
```
|
|
52
|
-
You can also visit [PyPi](https://pypi.org/project/pyviewfactor/) or
|
|
53
|
-
[Gitlab](https://gitlab.com/arep-dev/pyViewFactor) to download the sources.
|
|
54
|
-
|
|
55
|
-
Requirements:
|
|
56
|
-
```
|
|
57
|
-
numpy==1.26.4
|
|
58
|
-
pyvista==0.45
|
|
59
|
-
scipy==1.11.4
|
|
60
|
-
numba==0.61.2
|
|
61
|
-
tqdm==4.65.0
|
|
62
|
-
|
|
63
|
-
```
|
|
64
|
-
The code will probably work with lower versions of the required packages, however this has not been tested.
|
|
65
|
-
|
|
66
|
-
> [!NOTE]
|
|
67
|
-
>
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
## Quick Start
|
|
71
|
-
|
|
72
|
-
Suppose we want to compute the radiation view factor between a triangle
|
|
73
|
-
and a rectangle facing each other:
|
|
74
|
-
|
|
75
|
-
<img src="https://gitlab.com/arep-dev/pyViewFactor/-/raw/9dbd31d124eb898cc5d17913cfc1f010116e2245/img/mwe.png" alt="Triangle and rectangle configuration" width="260"/>
|
|
76
|
-
|
|
77
|
-
You are few lines of code away from your first view factor computation:
|
|
78
|
-
|
|
79
|
-
```python
|
|
80
|
-
import pyvista as pv
|
|
81
|
-
import pyviewfactor as pvf
|
|
82
|
-
|
|
83
|
-
# Create a rectangle and a triangle facing each other
|
|
84
|
-
pointa1 = [0.0, 0.0, 0.0]
|
|
85
|
-
pointb1 = [1.0, 0.0, 0.0]
|
|
86
|
-
pointc1 = [0.0, 1.0, 0.0]
|
|
87
|
-
rectangle = pv.Rectangle([pointa1, pointb1, pointc1])
|
|
88
|
-
|
|
89
|
-
pointa2 = [0.0, 0.0, 1.0]
|
|
90
|
-
pointb2 = [0.0, 1.0, 1.0]
|
|
91
|
-
pointc2 = [1.0, 1.0, 1.0]
|
|
92
|
-
triangle = pv.Triangle([pointa2, pointb2, pointc2])
|
|
93
|
-
|
|
94
|
-
if pvf.get_visibility(rectangle, triangle)[0]:
|
|
95
|
-
F = pvf.compute_viewfactor(triangle, rectangle)
|
|
96
|
-
print("VF from rectangle to triangle :", F)
|
|
97
|
-
else:
|
|
98
|
-
print("Not facing each other")
|
|
99
|
-
|
|
100
|
-
pl = pv.Plotter()
|
|
101
|
-
pl.add_mesh(rectangle, color="lightblue", opacity=0.7)
|
|
102
|
-
pl.add_mesh(triangle, color="salmon", opacity=0.7)
|
|
103
|
-
|
|
104
|
-
# compute and glyph normals for mesh1
|
|
105
|
-
n1 = rectangle.compute_normals(cell_normals=True, point_normals=False)
|
|
106
|
-
arrows1 = n1.glyph(orient="Normals", factor=0.1)
|
|
107
|
-
pl.add_mesh(arrows1, color="blue")
|
|
108
|
-
# similarly for mesh2
|
|
109
|
-
n2 = triangle.compute_normals(cell_normals=True, point_normals=False)
|
|
110
|
-
arrows2 = n2.glyph(orient="Normals", factor=0.1)
|
|
111
|
-
pl.add_mesh(arrows2, color="darkred")
|
|
112
|
-
|
|
113
|
-
pl.show()
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
You
|
|
117
|
-
(`*.dat`, `*.idf`, ...)
|
|
118
|
-
|
|
119
|
-
Check pyvista's documentation on [how to generate a PolyData facet from points](https://docs.pyvista.org/examples/00-load/create-poly.html).
|
|
120
|
-
|
|
121
|
-
## Documentation
|
|
122
|
-
|
|
123
|
-
For detailed explanations and advanced usage, see:
|
|
124
|
-
|
|
125
|
-
https://arep-dev.gitlab.io/pyViewFactor/
|
|
126
|
-
|
|
127
|
-
The documentation includes:
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
*
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
## License
|
|
161
|
-
MIT License - Copyright (c) AREP 2025
|
|
1
|
+
# PyViewFactor
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
<div align="center">
|
|
5
|
+
<img src="https://gitlab.com/arep-dev/pyViewFactor/-/raw/da36d4a0b08308009d9e71876091492ecb97d476/img/Logo%20pVF%20512x512%20v3%20transparent%20crop.png" alt="pvf_logo" width="256px"/>
|
|
6
|
+
</div>
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
> `pyViewFactor` is a lightweight open-source Python library for exact view-factor computations on polygonal meshes.
|
|
10
|
+
> It provides robust tools for:
|
|
11
|
+
> - geometric visibility analysis,
|
|
12
|
+
> - obstruction detection,
|
|
13
|
+
> - accurate view factor computation.
|
|
14
|
+
|
|
15
|
+
*Full documentation available at [arep-dev.gitlab.io/pyViewFactor](https://arep-dev.gitlab.io/pyViewFactor/).*
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
<img src="https://gitlab.com/arep-dev/pyViewFactor/-/raw/3d40d1804eccbaefbc8b1736ff30d0d9f08141ad/img/FF_sceneUrbaine_cyl_RT.png" alt="Urban View Factor" width="800" />
|
|
19
|
+
|
|
20
|
+
[](https://gitlab.com/arep-dev/pyViewFactor/-/releases)
|
|
21
|
+
[](https://gitlab.com/arep-dev/pyViewFactor/pipelines)
|
|
22
|
+
[](https://codecov.io/gl/arep-dev/pyViewFactor)
|
|
23
|
+
[](https://opensource.org/licenses/MIT)
|
|
24
|
+
[](https://pypi.org/project/pyviewfactor/)
|
|
25
|
+
[](https://pypi.org/project/pyviewfactor/)
|
|
26
|
+
[](https://joss.theoj.org/papers/cc7d3aebf5e8ed25b343c6dd822f70b4)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
## Features
|
|
30
|
+
|
|
31
|
+
* This library enables the computation of radiation view factors between planar polygons using an **accurate** double‐contour integration method described in
|
|
32
|
+
[(Mazumder and Ravishankar 2012)](https://www.academia.edu/download/77459051/Viewfactor_paper_IJHMT.pdf)
|
|
33
|
+
with insights from [(Schmid 2016)](https://hal.archives-ouvertes.fr/tel-01734545/).
|
|
34
|
+
* It uses the handy [`Pyvista`](https://docs.pyvista.org/) package to deal with geometry imports (`*.stl`, `*.vtk`, `*.obj`, ...),
|
|
35
|
+
geometry creations, and some other mesh functionalities under the hood.
|
|
36
|
+
* It enables:
|
|
37
|
+
- 🔺 View factor computation between planar polygons via the **SA-30 semi-analytic kernel** — handles touching and coplanar faces analytically, no epsilon shift
|
|
38
|
+
- 👁️ Visibility checks based on face orientation
|
|
39
|
+
- 🚧 Obstruction detection using Möller–Trumbore ray-triangle intersection, **BVH-accelerated** (O(log N) per ray)
|
|
40
|
+
- ⚙️ Strict / non-strict modes for robustness control
|
|
41
|
+
- ⚡ Full N×N view-factor matrix with Numba `prange` parallelism (~33× faster than v1.0)
|
|
42
|
+
- 📦 Built on `numpy`, `scipy`, `pyvista`, `numba`
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## Installation
|
|
47
|
+
`pyViewFactor` can be installed from [PyPi](https://pypi.org/project/pyviewfactor/)
|
|
48
|
+
using `pip` on Python >= 3.10:
|
|
49
|
+
```shell
|
|
50
|
+
pip install pyviewfactor
|
|
51
|
+
```
|
|
52
|
+
You can also visit [PyPi](https://pypi.org/project/pyviewfactor/) or
|
|
53
|
+
[Gitlab](https://gitlab.com/arep-dev/pyViewFactor) to download the sources.
|
|
54
|
+
|
|
55
|
+
Requirements:
|
|
56
|
+
```
|
|
57
|
+
numpy==1.26.4
|
|
58
|
+
pyvista==0.45
|
|
59
|
+
scipy==1.11.4
|
|
60
|
+
numba==0.61.2
|
|
61
|
+
tqdm==4.65.0
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
The code will probably work with lower versions of the required packages, however this has not been tested.
|
|
65
|
+
|
|
66
|
+
> [!NOTE]
|
|
67
|
+
> `numba` is optional but strongly recommended. Without it, all kernels fall back to sequential pure-Python with identical results — no need to pin an older version.
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
## Quick Start
|
|
71
|
+
|
|
72
|
+
Suppose we want to compute the radiation view factor between a triangle
|
|
73
|
+
and a rectangle facing each other:
|
|
74
|
+
|
|
75
|
+
<img src="https://gitlab.com/arep-dev/pyViewFactor/-/raw/9dbd31d124eb898cc5d17913cfc1f010116e2245/img/mwe.png" alt="Triangle and rectangle configuration" width="260"/>
|
|
76
|
+
|
|
77
|
+
You are few lines of code away from your first view factor computation:
|
|
78
|
+
|
|
79
|
+
```python
|
|
80
|
+
import pyvista as pv
|
|
81
|
+
import pyviewfactor as pvf
|
|
82
|
+
|
|
83
|
+
# Create a rectangle and a triangle facing each other
|
|
84
|
+
pointa1 = [0.0, 0.0, 0.0]
|
|
85
|
+
pointb1 = [1.0, 0.0, 0.0]
|
|
86
|
+
pointc1 = [0.0, 1.0, 0.0]
|
|
87
|
+
rectangle = pv.Rectangle([pointa1, pointb1, pointc1])
|
|
88
|
+
|
|
89
|
+
pointa2 = [0.0, 0.0, 1.0]
|
|
90
|
+
pointb2 = [0.0, 1.0, 1.0]
|
|
91
|
+
pointc2 = [1.0, 1.0, 1.0]
|
|
92
|
+
triangle = pv.Triangle([pointa2, pointb2, pointc2])
|
|
93
|
+
|
|
94
|
+
if pvf.get_visibility(rectangle, triangle)[0]:
|
|
95
|
+
F = pvf.compute_viewfactor(triangle, rectangle)
|
|
96
|
+
print("VF from rectangle to triangle :", F)
|
|
97
|
+
else:
|
|
98
|
+
print("Not facing each other")
|
|
99
|
+
|
|
100
|
+
pl = pv.Plotter()
|
|
101
|
+
pl.add_mesh(rectangle, color="lightblue", opacity=0.7)
|
|
102
|
+
pl.add_mesh(triangle, color="salmon", opacity=0.7)
|
|
103
|
+
|
|
104
|
+
# compute and glyph normals for mesh1
|
|
105
|
+
n1 = rectangle.compute_normals(cell_normals=True, point_normals=False)
|
|
106
|
+
arrows1 = n1.glyph(orient="Normals", factor=0.1)
|
|
107
|
+
pl.add_mesh(arrows1, color="blue")
|
|
108
|
+
# similarly for mesh2
|
|
109
|
+
n2 = triangle.compute_normals(cell_normals=True, point_normals=False)
|
|
110
|
+
arrows2 = n2.glyph(orient="Normals", factor=0.1)
|
|
111
|
+
pl.add_mesh(arrows2, color="darkred")
|
|
112
|
+
|
|
113
|
+
pl.show()
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
You want to import your own geometry from a different format?
|
|
117
|
+
(`*.dat`, `*.idf`, `*.stl`, ...)
|
|
118
|
+
|
|
119
|
+
Check pyvista's documentation on [how to generate a PolyData facet from points](https://docs.pyvista.org/examples/00-load/create-poly.html).
|
|
120
|
+
|
|
121
|
+
## Documentation
|
|
122
|
+
|
|
123
|
+
For detailed explanations and advanced usage, see:
|
|
124
|
+
|
|
125
|
+
https://arep-dev.gitlab.io/pyViewFactor/
|
|
126
|
+
|
|
127
|
+
The documentation includes:
|
|
128
|
+
* Theory: view factor integral, SA-30 semi-analytic kernel, BVH obstruction engine,
|
|
129
|
+
* Implementation: architecture, visibility & obstruction semantics, performance guide,
|
|
130
|
+
* Extended examples with analytical validations.
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
## Citation & Acknowledgments
|
|
134
|
+
* Main contributors:
|
|
135
|
+
* Mateusz BOGDAN,
|
|
136
|
+
* Edouard WALTHER.
|
|
137
|
+
* Acknowledgment: The authors would like to acknowledge *M. Alecian* for his initial work on the quadrature
|
|
138
|
+
code and *M. Chapon* for her contribution to the code validation.
|
|
139
|
+
|
|
140
|
+
There is even a [conference paper](https://www.researchgate.net/publication/360835982_Calcul_des_facteurs_de_forme_entre_polygones_-Application_a_la_thermique_urbaine_et_aux_etudes_de_confort), showing analytical validations.
|
|
141
|
+
|
|
142
|
+
So if you use `pyViewFactor` in your work, please cite:
|
|
143
|
+
> [!IMPORTANT] Citation:
|
|
144
|
+
> Mateusz BOGDAN, Edouard WALTHER, Marc ALECIAN and Mina CHAPON. *Calcul des facteurs de forme entre polygones - Application à la thermique urbaine et aux études de confort*. IBPSA France 2022, Châlons-en-Champagne.
|
|
145
|
+
|
|
146
|
+
Bibtex entry:
|
|
147
|
+
``` latex
|
|
148
|
+
@inproceedings{pyViewFactor22bogdan,
|
|
149
|
+
author = "Mateusz BOGDAN and Edouard WALTHER and Marc ALECIAN and Mina CHAPON",
|
|
150
|
+
title = "Calcul des facteurs de forme entre polygones - Application à la thermique urbaine et aux études de confort",
|
|
151
|
+
year = "2022",
|
|
152
|
+
organization = "IBPSA France",
|
|
153
|
+
venue = "Châlons-en-Champagne, France"
|
|
154
|
+
note = "IBPSA France 2022",
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## License
|
|
159
|
+
MIT License - Copyright (c) AREP 2025
|
|
@@ -1,43 +1,42 @@
|
|
|
1
|
-
"""
|
|
2
|
-
.. include:: ../docs/index.md
|
|
3
|
-
"""
|
|
4
|
-
|
|
5
|
-
from ._version import __version__
|
|
6
|
-
from .pvf_geometry_preprocess import (
|
|
7
|
-
ProcessedGeometry,
|
|
8
|
-
FaceMeshPreprocessor,
|
|
9
|
-
fc_unstruc2poly,
|
|
10
|
-
face_to_array,
|
|
11
|
-
polygon_area,
|
|
12
|
-
polygon_centroid,
|
|
13
|
-
face_normal_numpy,
|
|
14
|
-
tri_overlaps_aabb
|
|
15
|
-
)
|
|
16
|
-
from .pvf_visibility_obstruction import (
|
|
17
|
-
get_visibility,
|
|
18
|
-
get_visibility_from_cache,
|
|
19
|
-
get_obstruction,
|
|
20
|
-
get_obstruction_from_cache,
|
|
21
|
-
ray_intersects_triangle,
|
|
22
|
-
is_ray_blocked
|
|
23
|
-
)
|
|
24
|
-
|
|
25
|
-
from .pvf_integrators import (
|
|
26
|
-
set_quadrature_order,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
# End of file
|
|
1
|
+
"""
|
|
2
|
+
.. include:: ../docs/index.md
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from ._version import __version__
|
|
6
|
+
from .pvf_geometry_preprocess import (
|
|
7
|
+
ProcessedGeometry,
|
|
8
|
+
FaceMeshPreprocessor,
|
|
9
|
+
fc_unstruc2poly,
|
|
10
|
+
face_to_array,
|
|
11
|
+
polygon_area,
|
|
12
|
+
polygon_centroid,
|
|
13
|
+
face_normal_numpy,
|
|
14
|
+
tri_overlaps_aabb
|
|
15
|
+
)
|
|
16
|
+
from .pvf_visibility_obstruction import (
|
|
17
|
+
get_visibility,
|
|
18
|
+
get_visibility_from_cache,
|
|
19
|
+
get_obstruction,
|
|
20
|
+
get_obstruction_from_cache,
|
|
21
|
+
ray_intersects_triangle,
|
|
22
|
+
is_ray_blocked
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
from .pvf_integrators import (
|
|
26
|
+
set_quadrature_order,
|
|
27
|
+
compute_viewfactor_dblquad,
|
|
28
|
+
compute_viewfactor_gauss_legendre,
|
|
29
|
+
compute_viewfactor_sa30,
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
from .pvf_viewfactor_computations import (
|
|
33
|
+
compute_viewfactor,
|
|
34
|
+
compute_viewfactor_matrix,
|
|
35
|
+
compute_viewfactor_matrix_fast,
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
from .pvf_plot import (
|
|
39
|
+
plot_viewfactor
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
# End of file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"""Version info for pyViewFactor"""
|
|
2
|
-
version_info = 1,
|
|
3
|
-
|
|
4
|
-
# Nice string for the version
|
|
5
|
-
|
|
6
|
-
__version__ = ".".join(map(str, version_info))
|
|
1
|
+
"""Version info for pyViewFactor"""
|
|
2
|
+
version_info = 1, 1, 0
|
|
3
|
+
|
|
4
|
+
# Nice string for the version
|
|
5
|
+
|
|
6
|
+
__version__ = ".".join(map(str, version_info))
|