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.7.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.7-cp312-cp312-win_amd64.whl (9.1 MB view details)

Uploaded CPython 3.12Windows x86-64

pyridescence-0.1.7-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.7-cp312-cp312-manylinux_2_28_aarch64.whl (7.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.11Windows x86-64

pyridescence-0.1.7-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.7-cp311-cp311-manylinux_2_28_aarch64.whl (7.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.10Windows x86-64

pyridescence-0.1.7-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.7-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.7.tar.gz.

File metadata

  • Download URL: pyridescence-0.1.7.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.7.tar.gz
Algorithm Hash digest
SHA256 e39718a99f169dbed2e6be9cc9c23af8ff7e195a4e803aec2ff9b152a6ce4460
MD5 23aeeb0d3b775f7e505e5fcea26ca55e
BLAKE2b-256 953a82957c8883369eee5e9335753be43310d7dd3b4aa78ca48faa4ab81c14a5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyridescence-0.1.7-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 b8db6ed628eaa8f1b9c8932d122a82df8a91a77b0def4a4651d9b5e8c80142de
MD5 dca65360ef19164dce8c07714bbe6241
BLAKE2b-256 f08ad2294e5ec3041b332d775252805f612947ea4bd4135fca1c58e6258c4ab2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyridescence-0.1.7-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a5a527c910629370fb070e7386f4ae9d5f87857540c69d5375b87baef1c66efb
MD5 c020f71adb30c9e80340a74741839861
BLAKE2b-256 47e282c4cb51ac924e509399377a56f2ebcc87634313135fcd47bc3963fbe6c8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyridescence-0.1.7-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 4551caac1fc79875fe1001a4f6bb6fc3fe888bb1f5c3f88b8825be25eac2d13d
MD5 8a037d66389510d147c6bd60f6edddb7
BLAKE2b-256 6ca697d468b03a85bb6023d836f8f93bb3888f95bbdb2bc08fb10ba852034593

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyridescence-0.1.7-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 f1c5ea4fc7798b66effa94db0563621c932ff72fa7f1e9fbac34219011cca4c8
MD5 fd2f79be3e652df2a7fe655f4964501d
BLAKE2b-256 3ebe40a2f85e3a0a438a0133aa97391861ee0a27f41bd4487def0f59f69cd337

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyridescence-0.1.7-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 04f9664301da6d5214abfd1bb7d16a7b5f55573090ec3209874f5c311f715bc7
MD5 bd06cd8107c1556c822cf07c3d1b1652
BLAKE2b-256 89f16567306d08ac58cc2852083094b1a5f4337f7afd6fb1c8c6249616a35a29

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyridescence-0.1.7-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 bda05f25db6fe48f431f1c7c84b50d2bc9a9427ec84d1d5819d484d77ba96582
MD5 68f618d463367fc7d9bfe04c814d6d9e
BLAKE2b-256 d84a570c114fbaf3b1792c97d8fd71d0069970b35327518da74b7b94e8562b71

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyridescence-0.1.7-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 0ec7b93a573145b2cb673c88a8e65da40a07045397f2dee38f1cb13fec7ae625
MD5 ada53dca8bb6df36e5de5b840b39c4d3
BLAKE2b-256 f39771d81a8471783605e2a3c0b990a8f680a0aa41eb16711f2a7f460df84171

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyridescence-0.1.7-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f46578b70c00644d9f391b0e4f3455d2a8f535a8f020e62bc5db89a8f6668729
MD5 4ea6fc4b16fe1723fe790e1075bc5372
BLAKE2b-256 16b9e3d9cd6fb1b33b843275656e3abe81f141060a0e480f41cf0234cce3dfb2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyridescence-0.1.7-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 a8d9919e067f3ee663d76f71aca206b0fb9522bd80dc980f7b1aaee0752c8ebf
MD5 17d7ea70d2f87d671221f11de56837f6
BLAKE2b-256 8ec5e955205efaa12c8774cad39132c9666170225303e34e8375e3a09be948af

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