Skip to main content

A minimalist packadge for vizualizing 3D trajectories in space.

Project description

Space Trace

Spacetrace is a simple, lightweight, low-abstraction tool for visualizing astrodynamic trajectories. Spacetrace is agnostic of the physics, coordinate systems and the tools to generate the data. It's sole purpose is to plot trajectories and inspect them visually.

This tool should be used similarly to matplotlib's 3d plotting tool, but optimized for interactivity and inspection, as well as drawing large trajectories at a smooth framerate.

Screenshot 2

Installation

Spacetrace is a standard python package available on pypi:

pip install spacetrace

Spacetrace only depends on numpy as data interface and pyray for drawing.

Usage

The most basic usecase is as follows:

    import spacetrace

    scene = spacetrace.Scene()
    scene.add_trajectory(epochs, states)
    scene.add_static_body(0, 0, 0, radius=6.7e6, name='Earth', color='blue')
    spacetrace.show_scene(scene)

where states is a numpy array of size N x 3 or N x 6 and epochs is a numpy array of size N, with the corresponding times values. This program will draw the trajectory and add a blue sphere, representing Earth for reference.

For more details see the documentation within the source files (spacetrace/*) or the examples (examples/*)

GUI

  • Middle mouse button to pan camera
  • RMB click to offset camera vertically
  • shift + RMB to offset camera horizontally
  • Drag slider at the bottom to readjust time
  • Left click on entity label (top left) to hide/show
  • Press F while hovering over entity label to focus

Changelog

0.1.1

  • Update readme.md

0.1.2

  • Update how color palette works
  • Older python version should now work (as matched is no longer required)
  • Fixed Color type-hinting input
  • Updated raylib requirement to only support version 5.5 due to recent breaking api change
  • Clamped camera pitch to -pi/2 ... pi/2, preventing rendering glitch

0.2.0

  • Fixed bug of add_trajectory changing the output
  • Added transforms and vectors
  • BREAKING: User is now responsible for object initialization, i.e. add_xxx(...) notation is replaced with more flexible add(Xxx(...))

License

This project is licensed under the MIT 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

spacetrace-0.2.0.tar.gz (97.5 kB view details)

Uploaded Source

Built Distribution

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

spacetrace-0.2.0-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

Details for the file spacetrace-0.2.0.tar.gz.

File metadata

  • Download URL: spacetrace-0.2.0.tar.gz
  • Upload date:
  • Size: 97.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.12

File hashes

Hashes for spacetrace-0.2.0.tar.gz
Algorithm Hash digest
SHA256 777074f0d26a681d8c557aad2ae792ee3e1ebb82385f302113f3d72e6a1ea900
MD5 8ffe2ff5e284e8b3be1b5672510390c3
BLAKE2b-256 d9f93aa0579f02bcd0427ff64d96353db1e9e4c4467c251336e398134f730a2e

See more details on using hashes here.

File details

Details for the file spacetrace-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: spacetrace-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 14.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.12

File hashes

Hashes for spacetrace-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 af13f10f70a2efc9c22309b51f766637982f02f88b4bd40a1dc27c02b82ffddb
MD5 4ec5ef5d7aca0a2a55cc6a02d57ce3ba
BLAKE2b-256 1652ec1a397febaa13b6ed43d619c9b642afb0af1506972ef3b2cb14a7164cbb

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