Git Product home page Git Product logo

vsketch's Introduction

vsketch

python Test Documentation Status

What is vsketch?

vsketch is a Python generative art toolkit for plotters with the following focuses:

  • Accessibility: vsketch is easy to learn and feels familiar thanks to its API strongly inspired from Processing.
  • Minimized friction: vsketch automates every part of the creation process (project initialisation, friction-less iteration, export to plotter-ready files) through a CLI tool called vsk and a tight integration with vpype.
  • Plotter-centric: vsketch is made for plotter users, by plotter users. It's feature set is focused on the peculiarities of this medium and doesn't aim to solve other problems.
  • Interoperability: vsketch plays nice with popular packages such as Numpy and Shapely, which are true enabler for plotter generative art.

vsketch is the sum of two things:

  • A CLI tool named vsk to automate every part of a sketch project lifecycle::
    • Sketch creation based on a customizable template.
    • Interactive rendering of your sketch with live-reload and custom parameters.
    • Batch export to SVG with random seed and configuration management as well as multiprocessing support.
  • An easy-to-learn API similar to Processing to implement your sketches.

This project is at an early the stage and needs contributions. You can help by providing feedback and improving the documentation.

Installing vsketch

The recommended way to install vsketch is as a stand-alone installation using pipx:

$ pipx install vsketch

To run the examples, they must be downloaded separately. After decompressing the archive, they can be run using the following command:

$ vsk run path/to/vsketch-master/examples/schotter

Check the installation instructions for more details.

Getting started

This section is meant as a quick introduction of the workflow supported by vsketch. Check the documentation for a more complete overview.

Open a terminal and create a new project:

$ vsk init my_project

This will create a new project structure that includes everything you need to get started:

$ ls my_project
config
output
sketch_my_project.py

The sketch_my_project.py file contains a skeleton for your sketch. The config and output sub-directories are used by vsk to store configurations and output SVGs.

Open sketch_my_project.py in your favourite editor and modify it as follows:

import vsketch

class SchotterSketch(vsketch.SketchClass):
    def draw(self, vsk: vsketch.SketchClass) -> None:
        vsk.size("a4", landscape=False)
        vsk.scale("cm")

        for j in range(22):
            with vsk.pushMatrix():
                for i in range(12):
                    with vsk.pushMatrix():
                        vsk.rotate(0.03 * vsk.random(-j, j))
                        vsk.translate(
                            0.01 * vsk.randomGaussian() * j,
                            0.01 * vsk.randomGaussian() * j,
                        )
                        vsk.rect(0, 0, 1, 1)
                    vsk.translate(1, 0)
            vsk.translate(0, 1)

    def finalize(self, vsk: vsketch.Vsketch) -> None:
        vsk.vpype("linemerge linesimplify reloop linesort")

if __name__ == "__main__":
    SchotterSketch.display()

Your sketch is now ready to be run with the following command:

$ vsk run my_project

You should see this:

image

Congratulation, you just reproduced Georg Nees' famous artwork!

Wouldn't be nice if you could interactively interact with the script's parameters? Let's make this happen.

Add the following declaration at the top of the class:

class SchotterSketch(vsketch.SketchClass):
    columns = vsketch.Param(12)
    rows = vsketch.Param(22)
    fuzziness = vsketch.Param(1.0)
    
    # ...

Change the draw() method as follows:

    def draw(self, vsk: vsketch.Vsketch) -> None:
        vsk.size("a4", landscape=False)
        vsk.scale("cm")

        for j in range(self.rows):
            with vsk.pushMatrix():
                for i in range(self.columns):
                    with vsk.pushMatrix():
                        vsk.rotate(self.fuzziness * 0.03 * vsk.random(-j, j))
                        vsk.translate(
                            self.fuzziness * 0.01 * vsk.randomGaussian() * j,
                            self.fuzziness * 0.01 * vsk.randomGaussian() * j,
                        )
                        vsk.rect(0, 0, 1, 1)
                    vsk.translate(1, 0)
            vsk.translate(0, 1)

Hit ctrl-S/cmd-S to save and, lo and behold, corresponding buttons just appeared in the viewer without even needing to restart it! Here is how it looks with some more fuzziness:

image

Let's play a bit with the parameters until we find a combination we like, then hit the Save button and enter a "Best config" as name.

image

We just saved a configuration that we can load at any time.

Finally, being extremely picky, it would be nice to be able to generate ONE HUNDRED versions of this sketch with various random seeds, in hope to find the most perfect version for plotting and framing. vsk will do this for you, using all CPU cores available:

$ vsk save --config "Best config" --seed 0..99 my_project

You'll find all the SVG file in the project's output subdirectory:

image

Next steps:

  • Use vsk integrated help to learn about the all the possibilities (vsk --help).
  • Learn the vsketch API on the documentation's overview and reference pages.

Acknowledgments

Part of this project's documentation is inspired by or copied from the Processing project.

License

This project is licensed under the MIT license. The documentation is licensed under the CC BY-NC-SA 4.0 license. See the documentation for details.

vsketch's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vsketch's Issues

Allow for a Pythonic version of the API

Python prefers rect_mode() instead of the Java-style rectMode(). There should be a way to allow for a pythonic version of the API.

  1. Replace it altogether? (-> increases the difference with Processing)
  2. Both versions?

Pip and Wheels

Hello!

Just want to check if this is wanted before I work on it: I would like to work on a pull request to automate building the source distribution (sdist) and wheels (for all platforms poetry currently supports) with GitHub Actions. This would allow the package to be uploaded to Pypi with an easier install process (when you run pip install vsketch it will select the right wheel).

The wheels mean you don't have to build it when you install it, it will just pick the right precompiled wheel and install it, no build dependencies required. If a wheel for the platform isn't available, then it will still build from source using the sdist. If we do it right, then PiWheels will also build a wheel as well and add it to their repository, making it even easier to install on the Raspberry Pi.

Thanks!

Feature request: access vsketch seed in draw()

It would be useful to have access to the vsketch random seed into a command in the draw() function

Use case: being able to mash the Randomize button to change parameters in a plugin called in draw()

ResourceWarning: unclosed file after svgwrite

Hi abey79,
are you familiar with the following ResourceWarning: unclosed file <_io.TextIOWrapper name='./prints/test.svg' mode='w' encoding='cp1252'>?

It's referring to vsketch\vsketch.py", lineno 1400 file = open(file, "w").
Could possibly be resolved using a with open(file): block context?

Appreciate your work!

Unintuitive output for vsk.arc's start and stop params

I'm a bit confused by the "start" and "stop" parameters of vsk.arc. They don't seem to do what I'd expect:

self.ellipseMode("radius")
self.arc(0, 0, w=5, h=5, start=0, stop=90, degrees=True)
self.arc(15, 0, w=5, h=5, start=90, stop=180, degrees=True)
self.arc(30, 0, w=5, h=5, start=180, stop=270, degrees=True)
self.arc(45, 0, w=5, h=5, start=270, stop=360, degrees=True)
self.circle(60, 0, diameter=5)

Screen Shot 2021-03-11 at 7 21 54 PM

With the above code, I'd expect the output to look more like this:

Screen Shot 2021-03-11 at 7 22 06 PM

Put another way, it looks like the "start" and "stop" degrees are not always relative to the same absolute starting reference point. This same behavior seems to happen in radians mode too. Am I misunderstanding the intended usage?

Add the capability to load a SVG in a sketch

API:

  • vsketch.Vsketch(input.svg, merge=True/False): initialise the sketch with the SVG's dimensions and content, optionally merging all SVG layers into a single one.
  • vsk.image(input.svg): inserts the SVG in the sketch, applying any transforms and/or fill

Installation error with Python 3.9

These issues must be resolved to be compatible with Python 3.9:


Edit: the current work-around is the following (in a virtual env of course):

1) Manually install bezier:

This step is no longer required, new bezier binaries have been uploaded: dhermes/bezier#245

2) Install from the fix-python39 branch:

pip install git+https://github.com/abey79/vsketch@fix-python39#egg=vsketch

See @f4nu comment below for another possible issue and fix on macOS Big Sur.

MacOs Issue

Hi,
vsketch looks amazing but I can't get it to work on my Mac running 10.15

vsketch launches but the window on the left is blank and when I scroll down it says: Error: See Console.

In terminal:
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)>

I've tried various ways of updating the certificate, but I don't really know what I'm doing. Any specific instructions would be really helpful.

Well done on all your projectsโ€“ you're a genius!

'pip install .' is failing

I've tried using Windows and Ubuntu to try and install this and feel like I'm banging my head against a brick wall, so would appreciate any hints.

The instructions seem to be written for Linux users since commands in Windows differ slightly. When installing via Windows it takes a ridiculously long time to collect dependencies (24 hours +) and then fails. Here's a sample snippet of the output I'm getting:

INFO: pip is looking at multiple versions of toml to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of text-unidecode to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of pywinpty to determine which version is compatible with other requirements. This could take a while.
  Using cached pywinpty-0.5.tar.gz (50.8 MB)
Collecting terminado>=0.8.3
  Using cached terminado-0.9.4-py3-none-any.whl (14 kB)
Collecting pywinpty>=0.5
  Using cached pywinpty-1.0.1-cp39-none-win_amd64.whl (1.4 MB)
INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. If you want to abort this run, you can press Ctrl + C to do so. To improve how pip performs, tell us what happened here: https://pip.pypa.io/surveys/backtracking

Under Ubuntu, I can't progress to try the examples. I've followed the installation instructions using a virtual environment. Here's the output I get:

$ git clone https://github.com/abey79/vsketch
Cloning into 'vsketch'...
remote: Enumerating objects: 818, done.
remote: Counting objects: 100% (92/92), done.
remote: Compressing objects: 100% (85/85), done.
remote: Total 818 (delta 30), reused 13 (delta 6), pack-reused 726
Receiving objects: 100% (818/818), 15.11 MiB | 2.34 MiB/s, done.
Resolving deltas: 100% (422/422), done.
$ cd vsketch
$ python3 -m venv venv
$ source venv/bin/activate
$ pip install .
Directory '.' is not installable. File 'setup.py' not found.

Installing via pip gives me this output:

$ pip install git+https://github.com/abey79/vsketch#egg=vsketch
Collecting vsketch from git+https://github.com/abey79/vsketch#egg=vsketch
  Cloning https://github.com/abey79/vsketch to /tmp/pip-build-d1NJgc/vsketch
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    IOError: [Errno 2] No such file or directory: '/tmp/pip-build-d1NJgc/vsketch/setup.py'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-d1NJgc/vsketch/

Where am I going wrong here?
Thanks in advance.

Set line color

It would be great if I could customize the stroke color. Otherwise it's hard to use this with Jupyter in dark mode, or vscode notebooks, which use a dark theme by default.

image

I see color_mode but that doesn't quite do what I need.

Installation issues

Hello,

I am running macOS big sur on an Apple M1 (MacBook Air)
I am trying to install vsketch by following the documentation. There are a couple of dependencies required by vsketch that I could successfully install with brew (scipy, geos, shapely) but I have trouble in particular with PySide2.

I keep getting the following error
ERROR: No matching distribution found for PySide2<6.0.0,>=5.15.2
although I have installed PySide2 via home-brew

Do you have any idea what is happening? Could you help me with installing vsketch?

Negative value for vsk.Param() causes error

Minimal code to reproduce:

class SimpleSketch(vsketch.Vsketch):
    # Sketch parameters:
    a = vsketch.Param(-1.4)

    def draw(self) -> None:
        self.size("21cmx28.2cm", landscape=False)
        self.scale("cm")

    def finalize(self) -> None:
        self.vpype("linemerge linesimplify reloop linesort")

if __name__ == "__main__":
    vsk = AttractorsSketch()
    vsk.draw()
    vsk.finalize()
    vsk.display()

The error when running vsk run simple:

Traceback (most recent call last):
  File "/home/loic/.cache/pypoetry/virtualenvs/vsketch-Rpwrotvj-py3.7/bin/vsk", line 5, in <module>
    cli()
  File "/home/loic/.cache/pypoetry/virtualenvs/vsketch-Rpwrotvj-py3.7/lib/python3.7/site-packages/typer/main.py", line 214, in __call__
    return get_command(self)(*args, **kwargs)
  File "/home/loic/.cache/pypoetry/virtualenvs/vsketch-Rpwrotvj-py3.7/lib/python3.7/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/loic/.cache/pypoetry/virtualenvs/vsketch-Rpwrotvj-py3.7/lib/python3.7/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/loic/.cache/pypoetry/virtualenvs/vsketch-Rpwrotvj-py3.7/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/loic/.cache/pypoetry/virtualenvs/vsketch-Rpwrotvj-py3.7/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/loic/.cache/pypoetry/virtualenvs/vsketch-Rpwrotvj-py3.7/lib/python3.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/loic/.cache/pypoetry/virtualenvs/vsketch-Rpwrotvj-py3.7/lib/python3.7/site-packages/typer/main.py", line 497, in wrapper
    return callback(**use_params)  # type: ignore
  File "/home/loic/Documents/python/vsketch/vsketch_cli/cli.py", line 204, in run
    show(str(path), second_screen=fullscreen)
  File "/home/loic/Documents/python/vsketch/vsketch_cli/gui.py", line 23, in show
    widget = SketchViewer(pathlib.Path(path))
  File "/home/loic/Documents/python/vsketch/vsketch_cli/sketch_viewer.py", line 98, in __init__
    self.reload_sketch_class()
  File "/home/loic/Documents/python/vsketch/vsketch_cli/sketch_viewer.py", line 162, in reload_sketch_class
    self._sidebar.params_widget.set_params(self._sketch_class.get_params())
  File "/home/loic/Documents/python/vsketch/vsketch_cli/param_widget.py", line 175, in set_params
    widget = FloatParamWidget(param)
  File "/home/loic/Documents/python/vsketch/vsketch_cli/param_widget.py", line 80, in __init__
    decimals = max(1, 1 - math.floor(math.log10(val)))
ValueError: math domain error

EDIT:

  • a = vsk.Param(-1) works fine,
  • a = vsk.Param(-1.4) causes the error
  • a = vsk.Param(-1.4, decimals=1) works fine

So maybe we need a way to check if the value input has decimals, and change FloatParamWidget's __init__ function to detect that.

launchpadlib requires testresources

$ pip3 install git+https://github.com/abey79/vsketch#egg=vsketch

will give the following error:

ERROR: launchpadlib 1.10.13 requires testresources, which is not installed.

which can be solved with:

$ sudo apt install python3-testresources

maybe you can do smth so that this doesn't have to be solved manually?

Add a vsketch CLI to create template, provide a GUI and auto-run sketches

Idea would be:

vsketch new my_sketch  # initialize a new sketch project named "my_sketch"
                        # based on a template (prob using cookiecutter)
cd my_sketch
vsketch run             # display a GUI with the sketch that auto-refresh each
                        # time my_sketch.py is saved (using Dear PyGui probably)

vsketch save -s 69      # save a SVG from the sketch, setting the random seed to 69

parallel vsketch save -s ::: {0..200}
                        # save SVGs from sketch with all seed values from 0 to 200, using
                        # multiprocessing

Sketch would look like:

def setup(vsk: vsketch.Vsketch) -> None:
  vsk.size("a4")

def draw(vsk: vsketch.Vsketch) -> None:
  vsk.line(0, 0, 10, 10)
  # etc.

def finalize(vsk: vsketch.Vsketch) -> None:
  vsk.vpype("linemerge reloop linesort")

Sketches can't import modules next to the sketch script

Example:

demo
-> sketch_demo.py
-> utils.py

Then sketch_demo.py cannot import utils.

To address this, the sketch directory should be added to the python path by the sketch runner.

Workaround:

import sys
from pathlib import Path

import vsketch

sys.path.append(str(Path(__file__).parent))

from utils import my_util

# ...

Remove bezier dependency

No ARM binary is available for the bezier package, which has proven multiple time to be an annoying dependency. It should be easy enough to implement its functionality manually, possibly by using the code in svgelements.

installation issues on MacOs Big Sur 11.5

I'm facing this issue with vpype

ERROR: Could not find a version that satisfies the requirement vpype[all]==1.7.0 (from vsketch) (from versions: 1.0.0, 1.1.0, 1.2.0, 1.2.1, 1.3.0, 1.4.0, 1.5.0, 1.5.1) ERROR: No matching distribution found for vpype[all]==1.7.0

I can't seem to move forward with the installation.

I really want to try all these generative art examples. Help me with this please.

Hash does not match requirements file

As title says, the hash after installation does not match the requirements file. Thanks!


ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them.
    PySide2<6.0.0,>=5.15.2 from https://files.pythonhosted.org/packages/81/73/830023aa8f06d9b04bf45146fd95f1a0f8644f196713fe98bc678e35ab6c/PySide2-5.15.2-5.15.2-cp35.cp36.cp37.cp38.cp39-none-win_amd64.whl#sha256=1316aa22dd330df096daf7b0defe9c00297a66e0b4907f057aaa3e88c53d1aff (from vsketch):
        Expected sha256 1316aa22dd330df096daf7b0defe9c00297a66e0b4907f057aaa3e88c53d1aff
             Got        7b87ec873f61ed69045ba1599e4e9ad6fc8a3aad60470168c701bd5b2d04725a

Sub-sketch Points Do Not Match

Hello,

I am having an issue with sub-sketches and points. Here is an example:

sub_sketch = vsketch.Vsketch()
sub_sketch.point(0, 0)
vsk.sketch(sub_sketch)
vsk.point(0,0)

This produces:
image
The outer circle is the subsketch point. The inner point is what was expected.

I tried playing with the penWidth option in and out of the subsketch to no avail.

Unable to change the value of a text param at runtime

I'm getting an error at runtime when I try to update a text based param:

Traceback (most recent call last):
  File ".../vsketch/venv/lib/python3.8/site-packages/vsketch_cli/param_widget.py", line 115, in update_param
    self._param.set_value_with_validation(self.text())
AttributeError: 'TextParamWidget' object has no attribute 'text'

It looks like that error is coming from here:

self._param.set_value_with_validation(self.text())
Is it possible that this should be using self.toPlainText() instead of self.text()?

To repro:

class Sketch(vsketch.SketchClass):
    my_param = vsketch.Param("abc")

Run vsk run sketch, and then try to change the value of "my_param" using the text input.

Install issue on MacOS

Hello,
Does anyone know how to fix this issue?
I did a fresh install on my Mac in virtual env as described
I did not get error messages
but when launching vsk I get the following error.
Any help would be appreciated.
Thanks!

/Users/xxx/Documents/Maker/Python/vsketch/examples/quick_draw/sketch_quick_draw.py
objc[9323]: Class RunLoopModeTracker is implemented in both /Users/xxx/opt/anaconda3/lib/python3.8/site-packages/PySide2/Qt/lib/QtCore.framework/Versions/5/QtCore (0x13e147288) and /Users/xxx/opt/anaconda3/lib/libQt5Core.5.9.7.dylib (0x14c910a80). One of the two will be used. Which one is undefined.
QObject::moveToThread: Current thread (0x7fb4b72740a0) is not the object's thread (0x7fb4b742c550).
Cannot move to target thread (0x7fb4b72740a0)

You might be loading two sets of Qt binaries into the same process. Check that all plugins are compiled against the right Qt binaries. Export DYLD_PRINT_LIBRARIES=1 and check that only one set of binaries are being loaded.
qt.qpa.plugin: Could not load the Qt platform plugin "cocoa" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: cocoa, minimal, offscreen.

CLI: add support for dynamic parameters

Bonus to #46:

def draw(vsk: vsketch.Vsketch) -> None:
  row = vsk.param(10, "row count", int, 0, 100)  # create a new parameter
  for i in range(row):
    pass
    # draw stuff

vsketch run would display the parameter, allowing a range from 0 to 100.

vsketch save would allow setting the value of the parameter:

vsketch save -s 0 -p row_count 15
parallel vsketch save -s {1} -p row_count {2} ::: {0..50} ::: {12..15}

Feature: sketch()

Fonction sketch(ask) to insert the content of another sketch inside the sketch, applying the current transformation matrix. This enables the use of sub-sketch as reusable graphical elements. Layers are preserved.

Recursive inclusion of sketch inside a sketch might lead to interesting results too :)

Viewer sidebar too narrow on my display

One of my displays is set to 125% scale. I suppose this is what confuses the gui and causes it to be too narrow, and add a horizontal scroll bar.
If I drag the window to another display, it looks fine immediately.

Making the window wider does not make a difference.

afbeelding

Win10

Problems importing library (cli.result_callback seems to be undefined)

I have troubles importing the library using Python 3.9 within a Miniconda environment. After installation (using the approach from prettymaps) and creating a new environment I try to import vsketch which gives the following stack trace:

$ conda create -n default
$ conda activate default
$ pip install git+https://github.com/abey79/vsketch#egg=vsketch
$ python3.9 -c 'import vsketch'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/user/.miniconda3/envs/default/lib/python3.9/site-packages/vsketch/__init__.py", line 3, in <module>
    from .sketch_class import Param, ParamType, SketchClass
  File "/home/user/.miniconda3/envs/default/lib/python3.9/site-packages/vsketch/sketch_class.py", line 10, in <module>
    from .vsketch import Vsketch
  File "/home/user/.miniconda3/envs/default/lib/python3.9/site-packages/vsketch/vsketch.py", line 22, in <module>
    import vpype_cli
  File "/home/user/.miniconda3/envs/default/lib/python3.9/site-packages/vpype_cli/__init__.py", line 5, in <module>
    from .blocks import *
  File "/home/user/.miniconda3/envs/default/lib/python3.9/site-packages/vpype_cli/blocks.py", line 7, in <module>
    from .cli import BlockProcessor, cli, execute_processors
  File "/home/user/.miniconda3/envs/default/lib/python3.9/site-packages/vpype_cli/cli.py", line 126, in <module>
    @cli.result_callback()
TypeError: 'NoneType' object is not callable

Here's a more detailed log of trying to import vsketch using ipython.

Since I couldn't find anything in the issue tracker: Is the libary compatible with Python 3.9?

Improve API for primitives

These are Processing's primitives, which we aim to replicate:

image

TODO:

  • ellipse(): to implement def arc(a, b, c, d, mode="center"), with mode accepting "center", "radius", "corner", "corners" (see https://py.processing.org/reference/ellipseMode.html). Note: ideally the base implementation of the ellipse should sit inside vpype, like circle and arc.
  • arc(): to implement def arc(a, b, c, d, start, stop, degrees=False, close="no", mode="center"), with close accepting "no", "chord", "pie" (see https://py.processing.org/reference/arc.html) and mode same as ellipse()
  • circle(): add mode parameter same as for ellipse()
  • point(): we don't support path with a single point for various reason, so we must do a very small circle for point, probably of diameter "penWidth"
  • quad(): to implement
  • rect(): add mode="corner" parameter accepting "corner", "corners", "radius", "center" (see https://py.processing.org/reference/rectMode.html)
  • rect(): finish implementation of round corners
  • square(): add mode parameter as for rect()
  • merge all tests in test_primitives.py to keep the number of files in check
  • make a nice big example demonstrating all of the above features

Feature request: delay/disable automatic redraw

I am working with the flow_img plugin which takes some time to process and would like to disable the automatic refresh until I have finished editing multiple UI parameters.

It would be ideal to have a 'Refresh' button to manually redraw when desired or even just being able to set the delay before redrawing would do the trick.

vsk run examples/quick_draw gives TypeError: 'NoneType' object is not callable

I am following all steps but getting this error when I run vsk run examples/quick_draw:

Traceback (most recent call last):
  File "/Users/invlab/Desktop/ML/Generative-Art/vsketch/genart-venv/bin/vsk", line 6, in <module>
    from vsketch_cli.cli import cli
  File "/Users/invlab/Desktop/ML/Generative-Art/vsketch/genart-venv/lib/python3.7/site-packages/vsketch_cli/cli.py", line 11, in <module>
    import vsketch
  File "/Users/invlab/Desktop/ML/Generative-Art/vsketch/genart-venv/lib/python3.7/site-packages/vsketch/__init__.py", line 3, in <module>
    from .sketch_class import Param, ParamType, SketchClass
  File "/Users/invlab/Desktop/ML/Generative-Art/vsketch/genart-venv/lib/python3.7/site-packages/vsketch/sketch_class.py", line 10, in <module>
    from .vsketch import Vsketch
  File "/Users/invlab/Desktop/ML/Generative-Art/vsketch/genart-venv/lib/python3.7/site-packages/vsketch/vsketch.py", line 22, in <module>
    import vpype_cli
  File "/Users/invlab/Desktop/ML/Generative-Art/vsketch/genart-venv/lib/python3.7/site-packages/vpype_cli/__init__.py", line 5, in <module>
    from .blocks import *
  File "/Users/invlab/Desktop/ML/Generative-Art/vsketch/genart-venv/lib/python3.7/site-packages/vpype_cli/blocks.py", line 7, in <module>
    from .cli import BlockProcessor, cli, execute_processors
  File "/Users/invlab/Desktop/ML/Generative-Art/vsketch/genart-venv/lib/python3.7/site-packages/vpype_cli/cli.py", line 126, in <module>
    @cli.result_callback()
TypeError: 'NoneType' object is not callable
(genart-venv) (base) invlabs-MacBook-Pro:vsketch invlab$ vsk run examples/quick_drawvsk run examples/quick_draw
Traceback (most recent call last):
  File "/Users/invlab/Desktop/ML/Generative-Art/vsketch/genart-venv/bin/vsk", line 6, in <module>
    from vsketch_cli.cli import cli
  File "/Users/invlab/Desktop/ML/Generative-Art/vsketch/genart-venv/lib/python3.7/site-packages/vsketch_cli/cli.py", line 11, in <module>
    import vsketch
  File "/Users/invlab/Desktop/ML/Generative-Art/vsketch/genart-venv/lib/python3.7/site-packages/vsketch/__init__.py", line 3, in <module>
    from .sketch_class import Param, ParamType, SketchClass
  File "/Users/invlab/Desktop/ML/Generative-Art/vsketch/genart-venv/lib/python3.7/site-packages/vsketch/sketch_class.py", line 10, in <module>
    from .vsketch import Vsketch
  File "/Users/invlab/Desktop/ML/Generative-Art/vsketch/genart-venv/lib/python3.7/site-packages/vsketch/vsketch.py", line 22, in <module>
    import vpype_cli
  File "/Users/invlab/Desktop/ML/Generative-Art/vsketch/genart-venv/lib/python3.7/site-packages/vpype_cli/__init__.py", line 5, in <module>
    from .blocks import *
  File "/Users/invlab/Desktop/ML/Generative-Art/vsketch/genart-venv/lib/python3.7/site-packages/vpype_cli/blocks.py", line 7, in <module>
    from .cli import BlockProcessor, cli, execute_processors
  File "/Users/invlab/Desktop/ML/Generative-Art/vsketch/genart-venv/lib/python3.7/site-packages/vpype_cli/cli.py", line 126, in <module>
    @cli.result_callback()
TypeError: 'NoneType' object is not callable
(genart-venv) (base) invlabs-MacBook-Pro:vsketch invlab$ vsk run examples/quick_draw                           
Traceback (most recent call last):
  File "/Users/invlab/Desktop/ML/Generative-Art/vsketch/genart-venv/bin/vsk", line 6, in <module>
    from vsketch_cli.cli import cli
  File "/Users/invlab/Desktop/ML/Generative-Art/vsketch/genart-venv/lib/python3.7/site-packages/vsketch_cli/cli.py", line 11, in <module>
    import vsketch
  File "/Users/invlab/Desktop/ML/Generative-Art/vsketch/genart-venv/lib/python3.7/site-packages/vsketch/__init__.py", line 3, in <module>
    from .sketch_class import Param, ParamType, SketchClass
  File "/Users/invlab/Desktop/ML/Generative-Art/vsketch/genart-venv/lib/python3.7/site-packages/vsketch/sketch_class.py", line 10, in <module>
    from .vsketch import Vsketch
  File "/Users/invlab/Desktop/ML/Generative-Art/vsketch/genart-venv/lib/python3.7/site-packages/vsketch/vsketch.py", line 22, in <module>
    import vpype_cli
  File "/Users/invlab/Desktop/ML/Generative-Art/vsketch/genart-venv/lib/python3.7/site-packages/vpype_cli/__init__.py", line 5, in <module>
    from .blocks import *
  File "/Users/invlab/Desktop/ML/Generative-Art/vsketch/genart-venv/lib/python3.7/site-packages/vpype_cli/blocks.py", line 7, in <module>
    from .cli import BlockProcessor, cli, execute_processors
  File "/Users/invlab/Desktop/ML/Generative-Art/vsketch/genart-venv/lib/python3.7/site-packages/vpype_cli/cli.py", line 126, in <module>
    @cli.result_callback()
TypeError: 'NoneType' object is not callable

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.