Skip to main content

3D visualization library for rapid prototyping of 3D algorithms

Project description

Iridescence

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.

Build on Ubuntu 20.04 / 22.04 / 24.04

Features

What this library provides:

  • An easy-to-use 3D visualization framework (inpaticular suitable for rendering point clouds)
  • Tightly integrated Dear ImGui interfaces for rapid UI design

What this library does NOT provide:

  • Realistic rendering and shading
  • Rich textured 3D mesh rendering

See documentation for details.

Dependencies

Installation

Install from source

# Install dependencies
sudo apt-get install -y libglm-dev libglfw3-dev libpng-dev libjpeg-dev libeigen3-dev

# Build and install Iridescence
git clone https://github.com/koide3/iridescence --recursive
mkdir iridescence/build && cd iridescence/build
cmake ..
make -j
sudo make install

# [Optional] Build and install python bindings
cd ..
pip install .

# [Optional2] Install stubs for autocomplete
pip install pybind11-stubgen

cd ~/.local/lib/python3.12/site-packages
# If you are using a virtual environment, you can find the path with:
# cd $(dirname $(which python))/../lib/python3.12/site-packages

pybind11-stubgen -o . pyridescence

Install from PPA [AMD64, ARM64]

Ubuntu 24.04

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
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

sudo apt update && sudo apt install -y libiridescence-dev

Ubuntu 22.04

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
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

sudo apt update && sudo apt install -y libiridescence-dev

Ubuntu 20.04

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
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

sudo apt update && sudo apt install -y libiridescence-dev

Use Iridescence in your cmake project

# Find package
find_package(Iridescence REQUIRED)

# Add include dirs and link libraries
add_executable(your_program
  src/your_program.cpp
)
target_link_libraries(your_program
  Iridescence::Iridescence
)

Minimum example

C++:

#include <glk/primitives/primitives.hpp>
#include <guik/viewer/light_viewer.hpp>

int main(int argc, char** argv) {
  // Create a viewer instance (global singleton)
  auto viewer = guik::LightViewer::instance();

  float angle = 0.0f;

  // Register a callback for UI rendering
  viewer->register_ui_callback("ui", [&]() {
    // In the callback, you can call ImGui commands to create your UI.
    // Here, we use "DragFloat" and "Button" to create a simple UI.
    ImGui::DragFloat("Angle", &angle, 0.01f);

    if (ImGui::Button("Close")) {
      viewer->close();
    }
  });

  // Spin the viewer until it gets closed
  while (viewer->spin_once()) {
    // Objects to be rendered are called "drawables" and managed with unique names.
    // Here, solid and wire spheres are registered to the viewer respectively with the "Rainbow" and "FlatColor" coloring schemes.
    // The "Rainbow" coloring scheme encodes the height of each fragment using the turbo colormap by default.
    Eigen::AngleAxisf transform(angle, Eigen::Vector3f::UnitZ());
    viewer->update_drawable("sphere", glk::Primitives::sphere(), guik::Rainbow(transform));
    viewer->update_drawable("wire_sphere", glk::Primitives::wire_sphere(), guik::FlatColor({0.1f, 0.7f, 1.0f, 1.0f}, transform));
  }

  return 0;
}
Python version
#!/usr/bin/python3
import numpy
from scipy.spatial.transform import Rotation

from pyridescence import *

# Create a viewer instance (global singleton)
viewer = guik.LightViewer.instance()

angle = 0.0

# Define a callback for UI rendering
def ui_callback():
  # In the callback, you can call ImGui commands to create your UI.
  # Here, we use "DragFloat" and "Button" to create a simple UI.

  global angle
  _, angle = imgui.drag_float('angle', angle, 0.01)

  if imgui.button('close'):
    viewer.close()

# Register a callback for UI rendering
viewer.register_ui_callback('ui', ui_callback)

# Spin the viewer until it gets closed
while viewer.spin_once():
  # Objects to be rendered are called "drawables" and managed with unique names.
  # Here, solid and wire spheres are registered to the viewer respectively with the "Rainbow" and "FlatColor" coloring schemes.
  # The "Rainbow" coloring scheme encodes the height of each fragment using the turbo colormap by default.
  transform = numpy.identity(4)
  transform[:3, :3] = Rotation.from_rotvec([0.0, 0.0, angle]).as_matrix()
  viewer.update_drawable('sphere', glk.primitives.sphere(), guik.Rainbow(transform))
  viewer.update_drawable('wire_sphere', glk.primitives.wire_sphere(), guik.FlatColor(0.1, 0.7, 1.0, 1.0, transform))

example_01

See documentation for details.

Some use examples in my academic works

ral2021 iros2022

License

This package is released under the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyridescence-0.1.9.tar.gz (1.2 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyridescence-0.1.9-cp313-cp313-win_amd64.whl (9.1 MB view details)

Uploaded CPython 3.13Windows x86-64

pyridescence-0.1.9-cp313-cp313-manylinux_2_28_x86_64.whl (7.8 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

pyridescence-0.1.9-cp313-cp313-manylinux_2_28_aarch64.whl (7.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

pyridescence-0.1.9-cp312-cp312-win_amd64.whl (9.1 MB view details)

Uploaded CPython 3.12Windows x86-64

pyridescence-0.1.9-cp312-cp312-manylinux_2_28_x86_64.whl (7.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

pyridescence-0.1.9-cp312-cp312-manylinux_2_28_aarch64.whl (7.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

pyridescence-0.1.9-cp311-cp311-win_amd64.whl (9.1 MB view details)

Uploaded CPython 3.11Windows x86-64

pyridescence-0.1.9-cp311-cp311-manylinux_2_28_x86_64.whl (7.8 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

pyridescence-0.1.9-cp311-cp311-manylinux_2_28_aarch64.whl (7.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

pyridescence-0.1.9-cp310-cp310-win_amd64.whl (9.1 MB view details)

Uploaded CPython 3.10Windows x86-64

pyridescence-0.1.9-cp310-cp310-manylinux_2_28_x86_64.whl (7.8 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

pyridescence-0.1.9-cp310-cp310-manylinux_2_28_aarch64.whl (7.4 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ ARM64

File details

Details for the file pyridescence-0.1.9.tar.gz.

File metadata

  • Download URL: pyridescence-0.1.9.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyridescence-0.1.9.tar.gz
Algorithm Hash digest
SHA256 9795c878a0ef075824261d1b1bd640454de2d6b373182da6c5210af6e033e0fb
MD5 c338343a385108b1ef2fb4eecc9d90b7
BLAKE2b-256 e38bffc29b97aa50ddece064bbd83a12da1a9da7ee35920ac56d07cacf3eb6f8

See more details on using hashes here.

File details

Details for the file pyridescence-0.1.9-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for pyridescence-0.1.9-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 b41498bc398439ef009d1c647d16cac80baa166a69352b4e7612d09870e05bc9
MD5 32139d417be7df2e2cd9358d155fbbaf
BLAKE2b-256 beea9e281e0cd1e823aa0c82ed06c90db46d6f3cdaa418e9adc510b6efed51cb

See more details on using hashes here.

File details

Details for the file pyridescence-0.1.9-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyridescence-0.1.9-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 76ddb0045d0e11baff7625b093e105fcb81bf49349164ff90e87ab7c3885e8ac
MD5 341594038446444f628d329de0fa6f6d
BLAKE2b-256 dcdea355ce9903e070d4cf576b28717eb7ac3e0e144827f8e41afc73d4b8789d

See more details on using hashes here.

File details

Details for the file pyridescence-0.1.9-cp313-cp313-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pyridescence-0.1.9-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 d9cca5c69de0e22868701600e1e535562bf9ab53a73b2574a5575f91e3d55815
MD5 826a39862a126854399b379e5e06c288
BLAKE2b-256 c589d6a2e06781880bf89e43d86de2e1f9021daea1f1b6d25398c645e150b331

See more details on using hashes here.

File details

Details for the file pyridescence-0.1.9-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for pyridescence-0.1.9-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 cf26fb5598ff6a5edba0b9dd41e41fdd30f6258462eb87f0033dd33f229f9f29
MD5 22e0f5741568b94ba7371c57a2658b05
BLAKE2b-256 db4d399f9c1cda102a4d09b27514c41a5557b8f078aba65e1a12d835b1948f35

See more details on using hashes here.

File details

Details for the file pyridescence-0.1.9-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyridescence-0.1.9-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 26f5529d009ac7961c8749c24db1dbbcf2a797dab06207c86fef420cd33f59e1
MD5 6e1c95c06f331c57af6927a790bb5dbd
BLAKE2b-256 7c24dea0eb0f1c3f57c68b19dc8ff5071215c6bfb5d34348ca7891677ed942ed

See more details on using hashes here.

File details

Details for the file pyridescence-0.1.9-cp312-cp312-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pyridescence-0.1.9-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 684236f33a89b1e7f1f0d38ce691029304743c17695b467228219ff189aeb4a5
MD5 8c7913ecc2930a67b0d5ce4cfa0ecebb
BLAKE2b-256 4941773c9e62796505148593791e6c5762bfafb27dbede35b077c434b4243d88

See more details on using hashes here.

File details

Details for the file pyridescence-0.1.9-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for pyridescence-0.1.9-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 1461ad17665a569241808f7e6342edcb5060c4fbb34daf593f00af59bdf1d48c
MD5 36690bcefa2f40a22a8f4e6f9bec267e
BLAKE2b-256 5a35b1c81cc90e340d5b1f137177a26043f8ce692f2691ae94052442af858a09

See more details on using hashes here.

File details

Details for the file pyridescence-0.1.9-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyridescence-0.1.9-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5dcdd05466dd389d8ccc31cc729be523e4b0458c95d68820f7247d2c4bf564cc
MD5 f4f9937bde906272af60596a7cdcc83e
BLAKE2b-256 9bf6e04fde1afa9a93c2d6a6183b1cfcd5a5d033ef22a966073e0cd3f6e8bd69

See more details on using hashes here.

File details

Details for the file pyridescence-0.1.9-cp311-cp311-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pyridescence-0.1.9-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 1ba5f16cd681727831e289ce148787202382f54cfdca50fd2504d0e9a50c6e8d
MD5 003b49f63434eafb522dfd15d72b17de
BLAKE2b-256 f79f152743e8c185865942d59fe56715cef9c50341a2152d8f4ed0971aee72b3

See more details on using hashes here.

File details

Details for the file pyridescence-0.1.9-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for pyridescence-0.1.9-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 a727685d21a4df63d3a135d84a1821747bd805a1565443a0e7a34547bb42e56b
MD5 5cfbdb1e33046be03368f566545aee19
BLAKE2b-256 aecce20f2af8ebd44616da902feb056998dc5a25035db1e93680211c42c31621

See more details on using hashes here.

File details

Details for the file pyridescence-0.1.9-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyridescence-0.1.9-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3c7aea3f79c1275773ac8b679cad189e9dd5c1aa1c211263eb1a61295549100f
MD5 48c1e5a28f76c4774f9f857a6f776ff5
BLAKE2b-256 701a883326cd962a4f888161189ee2eda863786db1402bfad43e305a873fd5a3

See more details on using hashes here.

File details

Details for the file pyridescence-0.1.9-cp310-cp310-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pyridescence-0.1.9-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 cc80febecc831dbf5914904a10638ff87f989864679c26d173d42501d957f880
MD5 debb0fa6c1ff0ca00ee2f4c38f630c0f
BLAKE2b-256 bd69ea19ae9367a59825d69ddd34e6ec13456a068033721ed56586a40222d719

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page