Skip to main content

A real-time 3D visualization engine with PyOpenGL.

Project description

PhalcoPulse Engine

License Python Version Build Status

PhalcoPulse is a lightweight, real-time 3D visualization engine for Python, built on PyOpenGL. It is designed for the rapid prototyping of scientific simulations, physics-based animations, interactive art, and educational tools.

The engine provides a clean scene-based architecture and a modern, interactive GUI overlay, allowing you to focus on your simulation logic while the studio handles the rendering and user interaction.

PhalcoPulse Demo


✨ Key Features

  • Real-Time 3D Rendering: Leverages the power and speed of PyOpenGL for smooth, interactive 3D graphics.
  • Interactive Camera: Built-in mouse controls for orbit (rotate), pan, and zoom.
  • Modern GUI Overlay: An elegant and customizable UI with interactive widgets like buttons and sliders to control your scene in real-time.
  • Extensible Scene Architecture: Simply inherit from the PhalcoPulseFX class to define your own scenes, separating your logic from the engine's boilerplate.
  • Helpful Environment: Comes with a dynamic, adaptive grid and reference axes that make 3D space intuitive to work with.

⚙️ Installation

Prerequisites

Before you begin, ensure you have the following installed on your system:

  • Python 3.8 or newer
  • pip (Python's package installer)
  • git (for cloning the repository)

Installation Steps

It is highly recommended to install the package in a virtual environment to isolate project dependencies.

  1. Clone the Repository Open your terminal and clone the project's source code:

    git clone https://github.com/PhalcoAi/PhalcoPulse
    cd PhalcoPulse
    
  2. Create and Activate a Virtual Environment From the project's root directory, create and activate a new environment.

    # Create the environment
    python3 -m venv .venv
    
    # Activate it (on macOS and Linux)
    source .venv/bin/activate
    
    # On Windows, use: .venv\Scripts\activate
    
  3. Install the Package Install PhalcoPulse in "editable" mode. The -e flag links the installation to the source code, so your changes are reflected immediately.

    pip install -e .
    

🚀 Quick Start Example

Creating a new visualization is simple. The following script creates a scene with a ball that bounces under gravity. Save it in the examples/ folder and run it.

# File: examples/bouncing_ball.py

from phalcopulse import PhalcoPulseStudio, PhalcoPulseFX, pgfx
from phalcopulse.ui import Label, Button, TextInput, ToggleSwitch


class BouncingBall(PhalcoPulseFX):
    """A clean example scene that draws a single, bouncing ball."""

    def setup(self):
        self.position = 2.0  # Initial height
        self.velocity = 0.5  # Initial upward velocity
        self.gravity = -0.98  # Gravity acceleration
        self.e = 0.95  # Coefficient of restitution

    def loop(self, delta_time):
        # Update position and velocity
        self.velocity += self.gravity * delta_time
        self.position += self.velocity * delta_time

        # Bounce off the ground
        if self.position < 0.5:
            self.position = 0.5
            self.velocity = -self.velocity * self.e

        pgfx.draw_sphere(
            radius=0.5,
            color=(0.2, 0.6, 0.9),
            center=(0, self.position, 0)
        )


if __name__ == '__main__':
    # Instantiate the example scene and the studio engine
    my_scene = BouncingBall()
    studio = PhalcoPulseStudio(scene_fx=my_scene)

    # Run the main loop
    studio.run()

📦 Dependencies

The core dependencies are managed by pip during installation.

  • PyOpenGL: The core OpenGL wrapper for Python.
  • Pygame (Community Edition): Used for window creation and event handling.
  • NumPy: Used for various numerical calculations.

🤝 Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page of the repository.

📜 License

This project is licensed under the Apache 2.0 License. See the LICENSE file for details.

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

phalcopulse-0.1.5.tar.gz (22.7 kB view details)

Uploaded Source

Built Distribution

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

phalcopulse-0.1.5-py3-none-any.whl (25.3 kB view details)

Uploaded Python 3

File details

Details for the file phalcopulse-0.1.5.tar.gz.

File metadata

  • Download URL: phalcopulse-0.1.5.tar.gz
  • Upload date:
  • Size: 22.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for phalcopulse-0.1.5.tar.gz
Algorithm Hash digest
SHA256 417cacfe1e394a3de1c15f21fcc1456016000ba287b94b7b74e1b077277103e2
MD5 df4e85d73a181f8c5e38b8cd0bb3702b
BLAKE2b-256 7903535148ad19b4e8f2c5e82648eb3b02cb40bb3653bddcc49516287c97d790

See more details on using hashes here.

Provenance

The following attestation bundles were made for phalcopulse-0.1.5.tar.gz:

Publisher: python-publish.yml on PhalcoAi/PhalcoPulse

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file phalcopulse-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: phalcopulse-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 25.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for phalcopulse-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 f08761bf7269c9c303fec7a2468121e2fe2d6f59fc01edf04c573757084c5603
MD5 9dfb88a8ecb3db7936139d3a811c86da
BLAKE2b-256 4c2fca5da4f7036a1696dbadfe522588bd80f158eff66edd228f32738e9e3493

See more details on using hashes here.

Provenance

The following attestation bundles were made for phalcopulse-0.1.5-py3-none-any.whl:

Publisher: python-publish.yml on PhalcoAi/PhalcoPulse

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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