pyridescence 0.1.6__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.
Files changed (76) hide show
  1. pyridescence-0.1.6/LICENSE +21 -0
  2. pyridescence-0.1.6/MANIFEST.in +1 -0
  3. pyridescence-0.1.6/PKG-INFO +227 -0
  4. pyridescence-0.1.6/README.md +196 -0
  5. pyridescence-0.1.6/data/__init__.py +0 -0
  6. pyridescence-0.1.6/data/models/bunny.ply +105411 -0
  7. pyridescence-0.1.6/data/shader/bilateral.frag +41 -0
  8. pyridescence-0.1.6/data/shader/brdf/diffuse_disney.frag +15 -0
  9. pyridescence-0.1.6/data/shader/brdf/diffuse_disney_normalized.frag +18 -0
  10. pyridescence-0.1.6/data/shader/brdf/diffuse_lambert.frag +7 -0
  11. pyridescence-0.1.6/data/shader/brdf/diffuse_one.frag +5 -0
  12. pyridescence-0.1.6/data/shader/brdf/diffuse_oren_nayar.frag +17 -0
  13. pyridescence-0.1.6/data/shader/brdf/diffuse_zero.frag +5 -0
  14. pyridescence-0.1.6/data/shader/brdf/iridescence.frag +21 -0
  15. pyridescence-0.1.6/data/shader/brdf/iridescence_zero.frag +5 -0
  16. pyridescence-0.1.6/data/shader/brdf/occlusion_ambient.frag +5 -0
  17. pyridescence-0.1.6/data/shader/brdf/occlusion_zero.frag +5 -0
  18. pyridescence-0.1.6/data/shader/brdf/schlick_fresnel.frag +5 -0
  19. pyridescence-0.1.6/data/shader/brdf/specular_blinn_phong.frag +10 -0
  20. pyridescence-0.1.6/data/shader/brdf/specular_cook_torrance.frag +33 -0
  21. pyridescence-0.1.6/data/shader/brdf/specular_phong.frag +10 -0
  22. pyridescence-0.1.6/data/shader/brdf/specular_zero.frag +5 -0
  23. pyridescence-0.1.6/data/shader/iridescence.frag +48 -0
  24. pyridescence-0.1.6/data/shader/naive_ssao.frag +58 -0
  25. pyridescence-0.1.6/data/shader/partial_clear.frag +31 -0
  26. pyridescence-0.1.6/data/shader/phong.frag +36 -0
  27. pyridescence-0.1.6/data/shader/phong.vert +20 -0
  28. pyridescence-0.1.6/data/shader/rainbow.frag +57 -0
  29. pyridescence-0.1.6/data/shader/rainbow.vert +84 -0
  30. pyridescence-0.1.6/data/shader/splat/calc_pos.frag +29 -0
  31. pyridescence-0.1.6/data/shader/splat/debug.frag +17 -0
  32. pyridescence-0.1.6/data/shader/splat/distribution.frag +23 -0
  33. pyridescence-0.1.6/data/shader/splat/distribution.vert +49 -0
  34. pyridescence-0.1.6/data/shader/splat/eigen.frag +234 -0
  35. pyridescence-0.1.6/data/shader/splat/extract_points.frag +25 -0
  36. pyridescence-0.1.6/data/shader/splat/extract_points.geom +30 -0
  37. pyridescence-0.1.6/data/shader/splat/extract_points.vert +8 -0
  38. pyridescence-0.1.6/data/shader/splat/farthest_point.frag +8 -0
  39. pyridescence-0.1.6/data/shader/splat/finalize_radius.frag +38 -0
  40. pyridescence-0.1.6/data/shader/splat/finalize_splat.frag +19 -0
  41. pyridescence-0.1.6/data/shader/splat/gathering.frag +31 -0
  42. pyridescence-0.1.6/data/shader/splat/gathering.vert +38 -0
  43. pyridescence-0.1.6/data/shader/splat/gaussian_finalization.frag +65 -0
  44. pyridescence-0.1.6/data/shader/splat/gaussian_gathering.frag +34 -0
  45. pyridescence-0.1.6/data/shader/splat/initial_radius.frag +36 -0
  46. pyridescence-0.1.6/data/shader/splat/one_float.frag +7 -0
  47. pyridescence-0.1.6/data/shader/splat/one_int.frag +7 -0
  48. pyridescence-0.1.6/data/shader/splat/splat.geom +78 -0
  49. pyridescence-0.1.6/data/shader/splat/splat.vert +9 -0
  50. pyridescence-0.1.6/data/shader/splat/splat_first.frag +14 -0
  51. pyridescence-0.1.6/data/shader/splat/splat_second.frag +26 -0
  52. pyridescence-0.1.6/data/shader/splat/tex2screen.vert +13 -0
  53. pyridescence-0.1.6/data/shader/splat/tex2screen_test_finalized.vert +23 -0
  54. pyridescence-0.1.6/data/shader/splat/update_bounds.frag +54 -0
  55. pyridescence-0.1.6/data/shader/splatting.frag +63 -0
  56. pyridescence-0.1.6/data/shader/splatting.geom +91 -0
  57. pyridescence-0.1.6/data/shader/splatting.vert +22 -0
  58. pyridescence-0.1.6/data/shader/ssae_ao.frag +64 -0
  59. pyridescence-0.1.6/data/shader/ssae_normal.frag +49 -0
  60. pyridescence-0.1.6/data/shader/ssae_pos.frag +27 -0
  61. pyridescence-0.1.6/data/shader/ssao.frag +23 -0
  62. pyridescence-0.1.6/data/shader/ssli.frag +79 -0
  63. pyridescence-0.1.6/data/shader/texture.frag +9 -0
  64. pyridescence-0.1.6/data/shader/texture.vert +8 -0
  65. pyridescence-0.1.6/data/shader/transform_normal_dists_indices.comp +28 -0
  66. pyridescence-0.1.6/data/shader/transform_normal_dists_vertices.comp +41 -0
  67. pyridescence-0.1.6/data/texture/iridescence1.png +0 -0
  68. pyridescence-0.1.6/data/texture/iridescence2.png +0 -0
  69. pyridescence-0.1.6/data/texture/iridescence3.png +0 -0
  70. pyridescence-0.1.6/pyproject.toml +23 -0
  71. pyridescence-0.1.6/pyridescence.egg-info/PKG-INFO +227 -0
  72. pyridescence-0.1.6/pyridescence.egg-info/SOURCES.txt +74 -0
  73. pyridescence-0.1.6/pyridescence.egg-info/dependency_links.txt +1 -0
  74. pyridescence-0.1.6/pyridescence.egg-info/top_level.txt +1 -0
  75. pyridescence-0.1.6/setup.cfg +4 -0
  76. pyridescence-0.1.6/setup.py +2 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Kenji Koide
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ graft data
@@ -0,0 +1,227 @@
1
+ Metadata-Version: 2.1
2
+ Name: pyridescence
3
+ Version: 0.1.6
4
+ Summary: 3D visualization library for rapid prototyping of 3D algorithms
5
+ Author-email: Kenji Koide <k.koide@aist.go.jp>
6
+ License: MIT License
7
+
8
+ Copyright (c) 2023 Kenji Koide
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Requires-Python: >=3.7
29
+ Description-Content-Type: text/markdown
30
+ License-File: LICENSE
31
+
32
+ ![Iridescence](docs/assets/logo.png)
33
+
34
+ **Iridescence** is a light-weight visualization library for rapid prototyping of 3D algorithms. This library is designed for accelerating personal research and development projects (mainly focusing on point-cloud-related algorithms) and is NOT intended to be a general-purpose visualization library with rich rendering capabilities.
35
+
36
+ [![Build](https://github.com/koide3/iridescence/actions/workflows/build.yml/badge.svg)](https://github.com/koide3/iridescence/actions/workflows/build.yml) on Ubuntu 20.04 / 22.04 / 24.04
37
+
38
+ ## Features
39
+
40
+ What this library provides:
41
+ - An easy-to-use 3D visualization framework (inpaticular suitable for rendering point clouds)
42
+ - Tightly integrated Dear ImGui interfaces for rapid UI design
43
+
44
+ What this library does NOT provide:
45
+ - Realistic rendering and shading
46
+ - Rich textured 3D mesh rendering
47
+
48
+ See **[documentation](https://koide3.github.io/iridescence/)** for details.
49
+
50
+ ## Dependencies
51
+
52
+ - [GLFW](https://www.glfw.org/) ([zlib/libpng license](https://www.glfw.org/license.html))
53
+ - [gl3w](https://github.com/skaslev/gl3w) ([Public domain](https://github.com/skaslev/gl3w/blob/master/UNLICENSE))
54
+ - [Dear ImGui](https://github.com/ocornut/imgui) ([MIT license](https://github.com/ocornut/imgui/blob/master/LICENSE.txt))
55
+ - [ImGuizmo](https://github.com/CedricGuillemet/ImGuizmo) ([MIT license](https://github.com/CedricGuillemet/ImGuizmo/blob/master/LICENSE))
56
+ - [implot](https://github.com/epezent/implot) ([MIT license](https://github.com/epezent/implot/blob/master/LICENSE))
57
+ - [Eigen](https://eigen.tuxfamily.org/index.php) ([MPL2 license](https://www.mozilla.org/en-US/MPL/2.0/))
58
+ - [portable-file-dialogs](https://github.com/samhocevar/portable-file-dialogs) ([WTFPL license](https://github.com/samhocevar/portable-file-dialogs/blob/main/COPYING))
59
+
60
+ ## Installation
61
+
62
+ ### Install from source
63
+
64
+ ```bash
65
+ # Install dependencies
66
+ sudo apt-get install -y libglm-dev libglfw3-dev libpng-dev libjpeg-dev libeigen3-dev
67
+
68
+ # Build and install Iridescence
69
+ git clone https://github.com/koide3/iridescence --recursive
70
+ mkdir iridescence/build && cd iridescence/build
71
+ cmake ..
72
+ make -j
73
+ sudo make install
74
+
75
+ # [Optional] Build and install python bindings
76
+ cd ..
77
+ pip install .
78
+
79
+ # [Optional2] Install stubs for autocomplete
80
+ pip install pybind11-stubgen
81
+
82
+ cd ~/.local/lib/python3.12/site-packages
83
+ # If you are using a virtual environment, you can find the path with:
84
+ # cd $(dirname $(which python))/../lib/python3.12/site-packages
85
+
86
+ pybind11-stubgen -o . pyridescence
87
+ ```
88
+
89
+ ### Install from [PPA](https://github.com/koide3/ppa) [AMD64, ARM64]
90
+
91
+ #### Ubuntu 24.04
92
+
93
+ ```bash
94
+ curl -s --compressed "https://koide3.github.io/ppa/ubuntu2404/KEY.gpg" | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/koide3_ppa.gpg >/dev/null
95
+ echo "deb [signed-by=/etc/apt/trusted.gpg.d/koide3_ppa.gpg] https://koide3.github.io/ppa/ubuntu2404 ./" | sudo tee /etc/apt/sources.list.d/koide3_ppa.list
96
+
97
+ sudo apt update && sudo apt install -y libiridescence-dev
98
+ ```
99
+
100
+ #### Ubuntu 22.04
101
+
102
+ ```bash
103
+ curl -s --compressed "https://koide3.github.io/ppa/ubuntu2204/KEY.gpg" | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/koide3_ppa.gpg >/dev/null
104
+ echo "deb [signed-by=/etc/apt/trusted.gpg.d/koide3_ppa.gpg] https://koide3.github.io/ppa/ubuntu2204 ./" | sudo tee /etc/apt/sources.list.d/koide3_ppa.list
105
+
106
+ sudo apt update && sudo apt install -y libiridescence-dev
107
+ ```
108
+
109
+ #### Ubuntu 20.04
110
+
111
+ ```bash
112
+ curl -s --compressed "https://koide3.github.io/ppa/ubuntu2004/KEY.gpg" | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/koide3_ppa.gpg >/dev/null
113
+ echo "deb [signed-by=/etc/apt/trusted.gpg.d/koide3_ppa.gpg] https://koide3.github.io/ppa/ubuntu2004 ./" | sudo tee /etc/apt/sources.list.d/koide3_ppa.list
114
+
115
+ sudo apt update && sudo apt install -y libiridescence-dev
116
+ ```
117
+
118
+
119
+ ## Use Iridescence in your cmake project
120
+
121
+ ```cmake
122
+ # Find package
123
+ find_package(Iridescence REQUIRED)
124
+
125
+ # Add include dirs and link libraries
126
+ add_executable(your_program
127
+ src/your_program.cpp
128
+ )
129
+ target_link_libraries(your_program
130
+ Iridescence::Iridescence
131
+ )
132
+ ```
133
+
134
+
135
+ ## Minimum example
136
+
137
+ C++:
138
+ ```cpp
139
+ #include <glk/primitives/primitives.hpp>
140
+ #include <guik/viewer/light_viewer.hpp>
141
+
142
+ int main(int argc, char** argv) {
143
+ // Create a viewer instance (global singleton)
144
+ auto viewer = guik::LightViewer::instance();
145
+
146
+ float angle = 0.0f;
147
+
148
+ // Register a callback for UI rendering
149
+ viewer->register_ui_callback("ui", [&]() {
150
+ // In the callback, you can call ImGui commands to create your UI.
151
+ // Here, we use "DragFloat" and "Button" to create a simple UI.
152
+ ImGui::DragFloat("Angle", &angle, 0.01f);
153
+
154
+ if (ImGui::Button("Close")) {
155
+ viewer->close();
156
+ }
157
+ });
158
+
159
+ // Spin the viewer until it gets closed
160
+ while (viewer->spin_once()) {
161
+ // Objects to be rendered are called "drawables" and managed with unique names.
162
+ // Here, solid and wire spheres are registered to the viewer respectively with the "Rainbow" and "FlatColor" coloring schemes.
163
+ // The "Rainbow" coloring scheme encodes the height of each fragment using the turbo colormap by default.
164
+ Eigen::AngleAxisf transform(angle, Eigen::Vector3f::UnitZ());
165
+ viewer->update_drawable("sphere", glk::Primitives::sphere(), guik::Rainbow(transform));
166
+ viewer->update_drawable("wire_sphere", glk::Primitives::wire_sphere(), guik::FlatColor({0.1f, 0.7f, 1.0f, 1.0f}, transform));
167
+ }
168
+
169
+ return 0;
170
+ }
171
+ ```
172
+
173
+ <details>
174
+ <summary>Python version</summary>
175
+
176
+ ```py
177
+ #!/usr/bin/python3
178
+ import numpy
179
+ from scipy.spatial.transform import Rotation
180
+
181
+ from pyridescence import *
182
+
183
+ # Create a viewer instance (global singleton)
184
+ viewer = guik.LightViewer.instance()
185
+
186
+ angle = 0.0
187
+
188
+ # Define a callback for UI rendering
189
+ def ui_callback():
190
+ # In the callback, you can call ImGui commands to create your UI.
191
+ # Here, we use "DragFloat" and "Button" to create a simple UI.
192
+
193
+ global angle
194
+ _, angle = imgui.drag_float('angle', angle, 0.01)
195
+
196
+ if imgui.button('close'):
197
+ viewer.close()
198
+
199
+ # Register a callback for UI rendering
200
+ viewer.register_ui_callback('ui', ui_callback)
201
+
202
+ # Spin the viewer until it gets closed
203
+ while viewer.spin_once():
204
+ # Objects to be rendered are called "drawables" and managed with unique names.
205
+ # Here, solid and wire spheres are registered to the viewer respectively with the "Rainbow" and "FlatColor" coloring schemes.
206
+ # The "Rainbow" coloring scheme encodes the height of each fragment using the turbo colormap by default.
207
+ transform = numpy.identity(4)
208
+ transform[:3, :3] = Rotation.from_rotvec([0.0, 0.0, angle]).as_matrix()
209
+ viewer.update_drawable('sphere', glk.primitives.sphere(), guik.Rainbow(transform))
210
+ viewer.update_drawable('wire_sphere', glk.primitives.wire_sphere(), guik.FlatColor(0.1, 0.7, 1.0, 1.0, transform))
211
+
212
+ ```
213
+ </details>
214
+
215
+
216
+ ![example_01](https://user-images.githubusercontent.com/31344317/210127177-31630466-f8a1-45b6-8bc7-2fdd2e4c9548.gif)
217
+
218
+ See **[documentation](https://koide3.github.io/iridescence/)** for details.
219
+
220
+ ## Some use examples in my academic works
221
+
222
+ ![ral2021](https://user-images.githubusercontent.com/31344317/210128637-80f79abf-69c3-479c-91e9-0807e5b8b3ae.jpg)
223
+ ![iros2022](https://user-images.githubusercontent.com/31344317/210128635-2ef02dff-3d74-499e-bde8-2c9c0dc047ff.jpg)
224
+
225
+ ## License
226
+
227
+ This package is released under the MIT license.
@@ -0,0 +1,196 @@
1
+ ![Iridescence](docs/assets/logo.png)
2
+
3
+ **Iridescence** is a light-weight visualization library for rapid prototyping of 3D algorithms. This library is designed for accelerating personal research and development projects (mainly focusing on point-cloud-related algorithms) and is NOT intended to be a general-purpose visualization library with rich rendering capabilities.
4
+
5
+ [![Build](https://github.com/koide3/iridescence/actions/workflows/build.yml/badge.svg)](https://github.com/koide3/iridescence/actions/workflows/build.yml) on Ubuntu 20.04 / 22.04 / 24.04
6
+
7
+ ## Features
8
+
9
+ What this library provides:
10
+ - An easy-to-use 3D visualization framework (inpaticular suitable for rendering point clouds)
11
+ - Tightly integrated Dear ImGui interfaces for rapid UI design
12
+
13
+ What this library does NOT provide:
14
+ - Realistic rendering and shading
15
+ - Rich textured 3D mesh rendering
16
+
17
+ See **[documentation](https://koide3.github.io/iridescence/)** for details.
18
+
19
+ ## Dependencies
20
+
21
+ - [GLFW](https://www.glfw.org/) ([zlib/libpng license](https://www.glfw.org/license.html))
22
+ - [gl3w](https://github.com/skaslev/gl3w) ([Public domain](https://github.com/skaslev/gl3w/blob/master/UNLICENSE))
23
+ - [Dear ImGui](https://github.com/ocornut/imgui) ([MIT license](https://github.com/ocornut/imgui/blob/master/LICENSE.txt))
24
+ - [ImGuizmo](https://github.com/CedricGuillemet/ImGuizmo) ([MIT license](https://github.com/CedricGuillemet/ImGuizmo/blob/master/LICENSE))
25
+ - [implot](https://github.com/epezent/implot) ([MIT license](https://github.com/epezent/implot/blob/master/LICENSE))
26
+ - [Eigen](https://eigen.tuxfamily.org/index.php) ([MPL2 license](https://www.mozilla.org/en-US/MPL/2.0/))
27
+ - [portable-file-dialogs](https://github.com/samhocevar/portable-file-dialogs) ([WTFPL license](https://github.com/samhocevar/portable-file-dialogs/blob/main/COPYING))
28
+
29
+ ## Installation
30
+
31
+ ### Install from source
32
+
33
+ ```bash
34
+ # Install dependencies
35
+ sudo apt-get install -y libglm-dev libglfw3-dev libpng-dev libjpeg-dev libeigen3-dev
36
+
37
+ # Build and install Iridescence
38
+ git clone https://github.com/koide3/iridescence --recursive
39
+ mkdir iridescence/build && cd iridescence/build
40
+ cmake ..
41
+ make -j
42
+ sudo make install
43
+
44
+ # [Optional] Build and install python bindings
45
+ cd ..
46
+ pip install .
47
+
48
+ # [Optional2] Install stubs for autocomplete
49
+ pip install pybind11-stubgen
50
+
51
+ cd ~/.local/lib/python3.12/site-packages
52
+ # If you are using a virtual environment, you can find the path with:
53
+ # cd $(dirname $(which python))/../lib/python3.12/site-packages
54
+
55
+ pybind11-stubgen -o . pyridescence
56
+ ```
57
+
58
+ ### Install from [PPA](https://github.com/koide3/ppa) [AMD64, ARM64]
59
+
60
+ #### Ubuntu 24.04
61
+
62
+ ```bash
63
+ curl -s --compressed "https://koide3.github.io/ppa/ubuntu2404/KEY.gpg" | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/koide3_ppa.gpg >/dev/null
64
+ echo "deb [signed-by=/etc/apt/trusted.gpg.d/koide3_ppa.gpg] https://koide3.github.io/ppa/ubuntu2404 ./" | sudo tee /etc/apt/sources.list.d/koide3_ppa.list
65
+
66
+ sudo apt update && sudo apt install -y libiridescence-dev
67
+ ```
68
+
69
+ #### Ubuntu 22.04
70
+
71
+ ```bash
72
+ curl -s --compressed "https://koide3.github.io/ppa/ubuntu2204/KEY.gpg" | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/koide3_ppa.gpg >/dev/null
73
+ echo "deb [signed-by=/etc/apt/trusted.gpg.d/koide3_ppa.gpg] https://koide3.github.io/ppa/ubuntu2204 ./" | sudo tee /etc/apt/sources.list.d/koide3_ppa.list
74
+
75
+ sudo apt update && sudo apt install -y libiridescence-dev
76
+ ```
77
+
78
+ #### Ubuntu 20.04
79
+
80
+ ```bash
81
+ curl -s --compressed "https://koide3.github.io/ppa/ubuntu2004/KEY.gpg" | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/koide3_ppa.gpg >/dev/null
82
+ echo "deb [signed-by=/etc/apt/trusted.gpg.d/koide3_ppa.gpg] https://koide3.github.io/ppa/ubuntu2004 ./" | sudo tee /etc/apt/sources.list.d/koide3_ppa.list
83
+
84
+ sudo apt update && sudo apt install -y libiridescence-dev
85
+ ```
86
+
87
+
88
+ ## Use Iridescence in your cmake project
89
+
90
+ ```cmake
91
+ # Find package
92
+ find_package(Iridescence REQUIRED)
93
+
94
+ # Add include dirs and link libraries
95
+ add_executable(your_program
96
+ src/your_program.cpp
97
+ )
98
+ target_link_libraries(your_program
99
+ Iridescence::Iridescence
100
+ )
101
+ ```
102
+
103
+
104
+ ## Minimum example
105
+
106
+ C++:
107
+ ```cpp
108
+ #include <glk/primitives/primitives.hpp>
109
+ #include <guik/viewer/light_viewer.hpp>
110
+
111
+ int main(int argc, char** argv) {
112
+ // Create a viewer instance (global singleton)
113
+ auto viewer = guik::LightViewer::instance();
114
+
115
+ float angle = 0.0f;
116
+
117
+ // Register a callback for UI rendering
118
+ viewer->register_ui_callback("ui", [&]() {
119
+ // In the callback, you can call ImGui commands to create your UI.
120
+ // Here, we use "DragFloat" and "Button" to create a simple UI.
121
+ ImGui::DragFloat("Angle", &angle, 0.01f);
122
+
123
+ if (ImGui::Button("Close")) {
124
+ viewer->close();
125
+ }
126
+ });
127
+
128
+ // Spin the viewer until it gets closed
129
+ while (viewer->spin_once()) {
130
+ // Objects to be rendered are called "drawables" and managed with unique names.
131
+ // Here, solid and wire spheres are registered to the viewer respectively with the "Rainbow" and "FlatColor" coloring schemes.
132
+ // The "Rainbow" coloring scheme encodes the height of each fragment using the turbo colormap by default.
133
+ Eigen::AngleAxisf transform(angle, Eigen::Vector3f::UnitZ());
134
+ viewer->update_drawable("sphere", glk::Primitives::sphere(), guik::Rainbow(transform));
135
+ viewer->update_drawable("wire_sphere", glk::Primitives::wire_sphere(), guik::FlatColor({0.1f, 0.7f, 1.0f, 1.0f}, transform));
136
+ }
137
+
138
+ return 0;
139
+ }
140
+ ```
141
+
142
+ <details>
143
+ <summary>Python version</summary>
144
+
145
+ ```py
146
+ #!/usr/bin/python3
147
+ import numpy
148
+ from scipy.spatial.transform import Rotation
149
+
150
+ from pyridescence import *
151
+
152
+ # Create a viewer instance (global singleton)
153
+ viewer = guik.LightViewer.instance()
154
+
155
+ angle = 0.0
156
+
157
+ # Define a callback for UI rendering
158
+ def ui_callback():
159
+ # In the callback, you can call ImGui commands to create your UI.
160
+ # Here, we use "DragFloat" and "Button" to create a simple UI.
161
+
162
+ global angle
163
+ _, angle = imgui.drag_float('angle', angle, 0.01)
164
+
165
+ if imgui.button('close'):
166
+ viewer.close()
167
+
168
+ # Register a callback for UI rendering
169
+ viewer.register_ui_callback('ui', ui_callback)
170
+
171
+ # Spin the viewer until it gets closed
172
+ while viewer.spin_once():
173
+ # Objects to be rendered are called "drawables" and managed with unique names.
174
+ # Here, solid and wire spheres are registered to the viewer respectively with the "Rainbow" and "FlatColor" coloring schemes.
175
+ # The "Rainbow" coloring scheme encodes the height of each fragment using the turbo colormap by default.
176
+ transform = numpy.identity(4)
177
+ transform[:3, :3] = Rotation.from_rotvec([0.0, 0.0, angle]).as_matrix()
178
+ viewer.update_drawable('sphere', glk.primitives.sphere(), guik.Rainbow(transform))
179
+ viewer.update_drawable('wire_sphere', glk.primitives.wire_sphere(), guik.FlatColor(0.1, 0.7, 1.0, 1.0, transform))
180
+
181
+ ```
182
+ </details>
183
+
184
+
185
+ ![example_01](https://user-images.githubusercontent.com/31344317/210127177-31630466-f8a1-45b6-8bc7-2fdd2e4c9548.gif)
186
+
187
+ See **[documentation](https://koide3.github.io/iridescence/)** for details.
188
+
189
+ ## Some use examples in my academic works
190
+
191
+ ![ral2021](https://user-images.githubusercontent.com/31344317/210128637-80f79abf-69c3-479c-91e9-0807e5b8b3ae.jpg)
192
+ ![iros2022](https://user-images.githubusercontent.com/31344317/210128635-2ef02dff-3d74-499e-bde8-2c9c0dc047ff.jpg)
193
+
194
+ ## License
195
+
196
+ This package is released under the MIT license.
File without changes