Skip to content

Commit 652b716

Browse files
committed
2 parents dac43ce + f12c2b6 commit 652b716

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

README.md

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,32 @@
22
## Interactive canvas for editing 3D geometry, using only matplotlib.pyplot
33

44
### What is it?
5-
XYZ_canvas provides the starting point to create Python code that allows defining and editing points in 3D space, using only Matplotlib and just over 200 lines of library in canvas.py.
5+
**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.**
66

7-
![Capture](https://github.com/user-attachments/assets/5b499950-00f6-4d0b-983c-4a2492652ed2)
7+
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.
8+
9+
![Capture](https://github.com/user-attachments/assets/f53e6b01-ce03-4141-b15f-3077ab1065ad)
810

911
### How can I use it?
10-
The demo.py program shows how simple it is to instantiate the canvas:
11-
```
12-
demo_3D_builder = define_points(on_complete_cb = on_complete,
13-
xlim =[0,10], ylim =[-20,30], zlim=[-3,5],
14-
xlabel="x", ylabel="y", zlabel="z")
12+
The "demo_V1.1.0_minimal.py" program shows how simple it is to instantiate the canvas:
1513
```
16-
The 'on_complete_cb' function specified is called when the save button is pressed, and the list of 3D points created is passed to it.
14+
from xyz_canvas.canvas import xyz_canvas
15+
16+
#instantiating the canvas:
17+
demo = xyz_canvas( xlim =[0,1], ylim =[0,1], zlim=[0,1],
18+
xlabel="x", ylabel="y", zlabel="z"
19+
)
20+
21+
# showing the plot
22+
demo.plt.show()
1723
18-
There are two ways to use this library:
19-
1) Modify it for your own needs, by editing the code in canvas.py
20-
2) Incorporate it into your own code by processing the points that it returns - by building on the code in demo.py. For example, your code could take the returned points to define a polygon which you could then display in 3D.
24+
# note that this is so minimal that all it does is display;
25+
# the resulting points are not used here.
26+
27+
print("Demo finished ...")
28+
29+
```
30+
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.
2131

2232
## Installation
2333
Install with pip:

0 commit comments

Comments
 (0)