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 1 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(...))

0.2.1

  • Added new example, illustrating usage of transforms
  • Window only pops up when scene is displayed

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.1.tar.gz (125.0 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.1-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: spacetrace-0.2.1.tar.gz
  • Upload date:
  • Size: 125.0 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.1.tar.gz
Algorithm Hash digest
SHA256 84ab472835193738618d9c06e390451f121485033a57541851a6050c407a9be3
MD5 a1a65b38dcdee7e70f459dd5d6917574
BLAKE2b-256 f24ffe1db648ef32cece15715e10044613eeb4137e9f3b9e0cd8e64c1fed8cd5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spacetrace-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 14.3 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 65167bcc98c6a4582127e5e650e01b2879b653ed2b4da5d0a7af0624b53ea379
MD5 b32103f854bffb4db952adfa6d3cee5e
BLAKE2b-256 17a1942d8c1f071bb78b00bace27ed9ad2d53ece99c78a87162faa7f72894759

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