Skip to main content

Interactive canvas for editing 3D geometry, using matplotlib.pyplot

Project description

xyz_canvas

Interactive canvas for editing 3D geometry, using only matplotlib.pyplot

What is it?

XYZ_canvas provides the starting point to create Python code that allows defining and editing objects in 3D space, using only Matplotlib and just over 200 lines of library in canvas.py.

This library provides you with the 3D co-ordinates of points clicked on and moved to / over, so that you can create your own code to process the points created. You can reach down into the definitions made in canvas.py to manipulate what's created during use, e.g. delete all the points as shown in the customisation example.

Capture

How can I use it?

The "demo_V1.1.0_minimal.py" program shows how simple it is to instantiate the canvas:

from xyz_canvas.canvas import xyz_canvas

#instantiating the canvas:
demo = xyz_canvas(  xlim =[0,1], ylim =[0,1], zlim=[0,1],
                                xlabel="x", ylabel="y", zlabel="z"            
                               )

# showing the plot
demo.plt.show()

# note that this is so minimal that all it does is display;
# the resulting points are not used here.

print("Demo finished ...")

If you want to do things with the points created, look in "demo_V1.1.0_with_customisation.py". Here you'll see examples of customising the colour scheme and reacting to mouse clicks and mouse moves.

Installation

Install with pip:

pip install xyz_canvas

Or simply download the canvas.py and demo.py files, and develop from there.

Future plans / ideas

  • demo how to build on top of this to create objects? (might highlight extra functions needed here)
  • add snap to grid (make it settable as dx,dy,dz
  • polar / spherical co-ordinates?
  • transforms?

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

xyz_canvas-1.1.1.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

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

xyz_canvas-1.1.1-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file xyz_canvas-1.1.1.tar.gz.

File metadata

  • Download URL: xyz_canvas-1.1.1.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for xyz_canvas-1.1.1.tar.gz
Algorithm Hash digest
SHA256 1ae725e3cff4d6fadc2f23c8a8609ef5ad3047d604b3059997e06bd5a3c3612d
MD5 604c3873a409d3e087fb09579a467f74
BLAKE2b-256 649e67c25dae2810c5a70a72952373f7e185fb0692bb0b15a8486e26aab70edb

See more details on using hashes here.

File details

Details for the file xyz_canvas-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: xyz_canvas-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for xyz_canvas-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d878fa7b425b38d4b99277a2a1b297d89dad6a41e8fdae13331ab7a6e1dec283
MD5 420e1e4b97c60fd3c4c9c059f9a39bef
BLAKE2b-256 160febe2cdf0f0dd0ae1275356dddeba4708178125c3735830a600ccf222f4d0

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