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.0.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.0-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xyz_canvas-1.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 c8ae003b23fbcc1d7982da8bbfecb78700b88ca741006851af931aa85ce61216
MD5 1a81c0391f48b39dcc552d3eb064b4d3
BLAKE2b-256 2f8fbe779f2136cc039bcb9d182e7b7a24e34c6e6b12ee947d8b1c2e7eeb0449

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xyz_canvas-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.5 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9c1dda51181501adf0114e22a854c2cc1c7c7a428d9e92de475ad909aaeb827d
MD5 755fc2298849f3bc55ef7aab0d6b84dd
BLAKE2b-256 a02597855c537221d30eedcb7b6f79d0e9e5382ae0fd968ad8192458d61d0273

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