-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
60 lines (48 loc) · 2.08 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
-----------
Kevin Dean
Copyright 2013
-----------
Python version of my Bezier demo. Keyboard and mouse controls:
left mouse click - add a control point, select an existing point, drag to move a point.
shift + left click - select more control points, drag to move them.
ctrl + left click - start a new curve with a control point at the click location.
right mouse click - remove the closest point within n pixels, hardcoded to 5 currently.
a - animate the calculations over 1 second for the selected (most recent) curve. Button exists.
ctrl + a - animate all curves simulaneously.
p - pause or resume animation
s - perform an animation step, can be done without starting animation
shift+s - reverse an animation step
c - clear the control points. Button exists.
r - remove the selected point
shift+r - remove the last added point
d - toggle debug mode
] - zoom in
[ - zoom out
----------
Requirements
----------
Runs and tested on Python 2.7, requires PyGTK to run.
----------
Building Releases
----------
Currently there is no reliable release method. Pyinstaller fails to include the correct glib libraries, currently looking into other options.
----------
Implementation Details
----------
The usage of static_calc_line_layer is now somewhat of a relic, it's only used for the animation structure. Actual regeneration has been switched over to using a more standard interpolate() function that uses binomial coefficient multiplication to calculate the curve. In tests comparing the two, I found that the interpolate method is 3 to 4 times as fast, even with 1000 points of calculation.
----------
Todo
----------
- detail slider instead of buttons
- add interfaces for multiple curve capabilities (already exist through ctrl modifier)
- add switching between curves
----------
Future
----------
- turn it into a module, maybe multiple options for drawing API
- possible 3d mode with rotation
- ability to save designs and extract the coordinates of points
- ability to have multiple curves
- antialiased lines
- curve guessing
- progessive curve drawing, using async map-reduce