kopia lustrzana https://github.com/villares/sketch-a-day
readme_and_comments
rodzic
45d9a6083d
commit
c01f78bb02
|
@ -1,11 +1,12 @@
|
|||
# Alexandre B A Villares - https://abav.lugaralgum.com/sketch-a-day
|
||||
"""
|
||||
A minimal poly editor
|
||||
r - load polys from pickled data
|
||||
s - save polys
|
||||
t - show pt annotations
|
||||
SHIFT - to drag-add points
|
||||
CONTROL - to remove points
|
||||
r: load polys from pickled data
|
||||
s: save polys
|
||||
t: show pt annotations
|
||||
SHIFT: to drag-add points
|
||||
CONTROL: to remove points
|
||||
01234567890-: change vertex radius (- makes it -1, "hidden")
|
||||
m + drag - move whole poly
|
||||
|
||||
TODO: Create modes for move, add vertex, change vertex, remove vertex
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
add_library('VideoExport')
|
||||
# Alexandre B A Villares - https://abav.lugaralgum.com/sketch-a-day
|
||||
# Fixed arc_augmented_poly bug with verticaly aligned vertices
|
||||
|
||||
# Testing Video Export library
|
||||
# add_library('VideoExport')
|
||||
|
||||
from random import choice
|
||||
|
||||
|
@ -12,10 +15,10 @@ def setup():
|
|||
size(500, 500)
|
||||
create_points()
|
||||
# Video Export
|
||||
global ve
|
||||
ve = VideoExport(this)
|
||||
ve.setFrameRate(1)
|
||||
ve.startMovie()
|
||||
# global ve
|
||||
# ve = VideoExport(this)
|
||||
# ve.setFrameRate(1)
|
||||
# ve.startMovie()
|
||||
|
||||
def create_points():
|
||||
global pts, rds
|
||||
|
@ -41,12 +44,11 @@ def draw():
|
|||
ellipse(pt[0], pt[1], 10, 10)
|
||||
# text(str(rds[i]), pt[0] + 10, pt[1] + 10)
|
||||
|
||||
global save_frame
|
||||
if save_frame:
|
||||
ve.saveFrame()
|
||||
save_frame = False
|
||||
# global save_frame
|
||||
# if save_frame:
|
||||
# ve.saveFrame()
|
||||
# save_frame = False
|
||||
|
||||
|
||||
def mouseWheel(E):
|
||||
global r, d
|
||||
for i, pt in enumerate(pts):
|
||||
|
@ -58,11 +60,11 @@ def keyPressed():
|
|||
saveFrame("####.png")
|
||||
if key == " ":
|
||||
create_points()
|
||||
if key == "m":
|
||||
global save_frame
|
||||
save_frame = True
|
||||
if key == "e":
|
||||
ve.endMovie()
|
||||
# if key == "m":
|
||||
# global save_frame
|
||||
# save_frame = True
|
||||
# if key == "e":
|
||||
# ve.endMovie()
|
||||
|
||||
def mousePressed():
|
||||
global dragged_pt
|
||||
|
|
|
@ -28,12 +28,18 @@ Get updates from my sort-of-weekly newsletter: [[sketch-mail](https://villares.o
|
|||
|
||||
[sketch_190612a](https://github.com/villares/sketch-a-day/tree/master/2019/sketch_190612a) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]
|
||||
|
||||
- Fixed a bug that prevented drawing the arc-tangents with vertically aligned points!
|
||||
- This version defines the radii acording to the area formed by the vertex point and its neighbours.
|
||||
- Testing Video Export library
|
||||
|
||||
---
|
||||
|
||||

|
||||
|
||||
[sketch_190611a](https://github.com/villares/sketch-a-day/tree/master/2019/sketch_190612a) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]
|
||||
|
||||
- Changing vertex type/radius
|
||||
|
||||
---
|
||||
|
||||

|
||||
|
|
Ładowanie…
Reference in New Issue