Skip to main content

Python binding for the 3Dconnexion's Navigation Library.

Project description

PyNavlib

PyNavlib is a Python extension module that binds original C++ accessors of the 3Dconnexion Navigation Library into a Python code. The binding covers most of the C/C++ API defined within 3Dconnexion’s SDK header <SpaceMouse/CNavigation3D.hpp> and a minimal subset of propietary data types. It was created using pybind11 library.

About 3Dconnexion Navigation Library

The Navigation Library is a part of 3Dconnexion software. It is responsible for handling data exchange between the driver and a client application. The 3Dconnexion SDK provides C/C++ API to interact with the NavLib from within client application's code or plugin. From now on, with PyNavlib binding, it is also possible for the NavLib to be used by Python applications.

Installation

The package was released on PyPI and can be installed using pip.

pip install pynavlib

General usage

The package contains pre-built extension module responsible for binding C++ NavLib accessors to Python. The extension attempts to dynamically load the Navigation Library which is being installed on the system along with 3DxWare. The binding is accessible via interface module called pynavlib_interface.

from pynavlib import pynavlib_interface as pynav

PyNavlib's main class is called NavlibNavigationModel. It is a base class which provides an interface that has to be implemented by derived NavLib client class. The interface consists of setter and getter methods (no underscore preffixed), which are responsible for sending and receiving relevant 3D view data.


class NavlibClient(pynav.NavlibNavigationModel):

    def get_camera_matrix(self) -> pynav.NavlibMatrix:
        return pynav.NavlibMatrix()
    
    def get_model_extents(self) -> pynav.NavlibBox:
        return pynav.NavlibBox(pynav.NavlibVector(-10., -10., -10.), pynav.NavlibVector(10., 10., 10.))

    def get_is_view_perspective(self) -> bool:
        return False

    ...

    def set_camera_matrix(self, matrix) :
        matrix_as_list = matrix._matrix
        print(f'set_camera_matrix:\n{matrix_as_list[0]}\n{matrix_as_list[1]}\n{matrix_as_list[2]}\n{matrix_as_list[3]}\n')
    
    def set_view_extents(self, extents) :
        _min = extents._min
        _max = extents._max
        print(f'set_view_extents: {[_min._x, _min._y, _min._z]}, {[_max._x, _max._y, _max._z]}')
    
    def set_view_fov(self, fov) :
        pass

    ...

To see the full set of overridable setter and getter methods refer to the pynavlib_interface.py source.

Examples

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

pynavlib-0.9.4-cp313-cp313-win_amd64.whl (4.8 MB view details)

Uploaded CPython 3.13Windows x86-64

pynavlib-0.9.4-cp313-cp313-macosx_12_0_universal2.whl (853.0 kB view details)

Uploaded CPython 3.13macOS 12.0+ universal2 (ARM64, x86-64)

pynavlib-0.9.4-cp312-cp312-win_amd64.whl (4.8 MB view details)

Uploaded CPython 3.12Windows x86-64

pynavlib-0.9.4-cp312-cp312-macosx_12_0_universal2.whl (852.8 kB view details)

Uploaded CPython 3.12macOS 12.0+ universal2 (ARM64, x86-64)

pynavlib-0.9.4-cp311-cp311-win_amd64.whl (4.8 MB view details)

Uploaded CPython 3.11Windows x86-64

pynavlib-0.9.4-cp311-cp311-macosx_12_0_universal2.whl (863.3 kB view details)

Uploaded CPython 3.11macOS 12.0+ universal2 (ARM64, x86-64)

pynavlib-0.9.4-cp310-cp310-win_amd64.whl (4.8 MB view details)

Uploaded CPython 3.10Windows x86-64

pynavlib-0.9.4-cp310-cp310-macosx_12_0_universal2.whl (860.4 kB view details)

Uploaded CPython 3.10macOS 12.0+ universal2 (ARM64, x86-64)

File details

Details for the file pynavlib-0.9.4-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: pynavlib-0.9.4-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 4.8 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.8

File hashes

Hashes for pynavlib-0.9.4-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 9173f61ad83172c306b92bbe38f949889c158cd6dfdc924db01f257a437bf2a6
MD5 50204cba935349c61bd87bb0e3ab0510
BLAKE2b-256 910de7d1a7a8363c59e9ad74fe5291fe490b2c909ceb3ad88e7527c6b86be38a

See more details on using hashes here.

File details

Details for the file pynavlib-0.9.4-cp313-cp313-macosx_12_0_universal2.whl.

File metadata

File hashes

Hashes for pynavlib-0.9.4-cp313-cp313-macosx_12_0_universal2.whl
Algorithm Hash digest
SHA256 d06d94b1dee4ba024b4a121869e572f571673a3b8c15b4055f52236d43c19a02
MD5 5271f2f399b80a4cdf34542333bd9347
BLAKE2b-256 dcf1e0b2d93be0017496e3bd0994e9f55dd9209ec10f2945a039f808b35d43d6

See more details on using hashes here.

File details

Details for the file pynavlib-0.9.4-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pynavlib-0.9.4-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 4.8 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.8

File hashes

Hashes for pynavlib-0.9.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 332831553a70be05fe58c43a08109b42970cfedc6086ffb4306859142a0e9210
MD5 4dca7cd44c9dd14546e575e0995a18a2
BLAKE2b-256 afc80a56423f042d67217f3bfe84c1076ddf04e44a75d1011ad51ec300494bce

See more details on using hashes here.

File details

Details for the file pynavlib-0.9.4-cp312-cp312-macosx_12_0_universal2.whl.

File metadata

File hashes

Hashes for pynavlib-0.9.4-cp312-cp312-macosx_12_0_universal2.whl
Algorithm Hash digest
SHA256 33962a322033a78db05a8c2cc3d59e057fbea5b04879c3c54e2fe3041d691a12
MD5 11114345c73ab0a05196d52bb3505313
BLAKE2b-256 b6cca285d5c8c8dc17c21f7284da48832a9727982a6edf37c922b17e2cecab02

See more details on using hashes here.

File details

Details for the file pynavlib-0.9.4-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pynavlib-0.9.4-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 4.8 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.8

File hashes

Hashes for pynavlib-0.9.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 493c4b3cacc939b021a694d99723106dbd7ee5515ad4dfc1c7fc8219ef20cf3a
MD5 b846120194f079b7e699ac725b3cf915
BLAKE2b-256 f5c8e571fb4ca5f2b6aa2963fe633d1a3d25c20bfaffb31411659f1c7188d6dd

See more details on using hashes here.

File details

Details for the file pynavlib-0.9.4-cp311-cp311-macosx_12_0_universal2.whl.

File metadata

File hashes

Hashes for pynavlib-0.9.4-cp311-cp311-macosx_12_0_universal2.whl
Algorithm Hash digest
SHA256 f0d7ce426e816788aa96b419fd7da263eafb99aca46ce3b6e5dbaf2bbf6b614a
MD5 93fc9fe0ebdf14934705587d8e5d9115
BLAKE2b-256 73a42afa8d6ec9e7b5842831f75350a8de62937f3abb1ce11f652eee0a1e33ee

See more details on using hashes here.

File details

Details for the file pynavlib-0.9.4-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pynavlib-0.9.4-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 4.8 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.8

File hashes

Hashes for pynavlib-0.9.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 fdd5ab5b6e0a2c9bbcebb154ac7303daf845865a1649be04e1bd8e8e5889401f
MD5 9d32aaf9167a1b0a637bf9cbccacce13
BLAKE2b-256 ec000ecf9c1942a97a111834d93fcbcd8ac2bb7e206facda232c6b794996428d

See more details on using hashes here.

File details

Details for the file pynavlib-0.9.4-cp310-cp310-macosx_12_0_universal2.whl.

File metadata

File hashes

Hashes for pynavlib-0.9.4-cp310-cp310-macosx_12_0_universal2.whl
Algorithm Hash digest
SHA256 567efd0af97f9014326898b209eea94d9f5cc58e9f589ccf8354584568fcb87d
MD5 3ff9a8a8babf7972cb8089428736f428
BLAKE2b-256 3bd0ea1f1bab823efcc6f7699e1996457b7b2ce9c8d61c41c77853dabf6b2d62

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