soegaard / sketching

A Racket library for creative drawings and animations. Inspired by Processing.
110 stars 10 forks source link

some examples + error message fix for size function #61

Closed Ecsodikas closed 2 years ago

Ecsodikas commented 2 years ago

I added some examples, the corresponding js files and the documentation entries, namely:

I also fixed the error messages from #50.

I don't understand how to use a local installation of the library so I did raco pkg install ./sketching which installed the library, but it also build a completely new documentation and all the good stuff. I did not include those newly build docs in my pull request. I hope this is okay, or even correct. Maybe I find out how to use a debug/test version of a library with raco in the future. :D

Edit: I think I found the solution to my problem: #lang reader "./sketching/sketching-lib/sketching/lang/reader.rkt" does the trick, is this a good way to import a local copy of the library?

soegaard commented 2 years ago

Thanks for both examples and the fix. I am going to take a closer look at parameters.rkt. Maybe some of the guards for the other parameters need adjusting too.

soegaard commented 2 years ago

Thanks for finding the guard bug in #50. The other guards also needed fixing.

I forgot to make a new branch, so the new commit is slighly odd looking in Github. Only parameters.rkt and gui.rkt was touched. On afterthought I changed the guards for width and height to check for a positive integer only. The gui needs the width and height to be at least 100, but I suddenly remembered that Derren was using Sketching to render directly to an svg. And svgs can be smaller than a 100x100. Instead in "gui.rkt" the width and height is adjusted to 100, if they are too small. I think, this was what you suggested in the first place :-)

With respect to running a local copy.

  1. Use git clone to the a copy of your fork on Github.
  2. Use raco pkg update sketching/ in the terminal.

The backslash in the end is important, it makes raco pkg update interpret "sketching/" as a folder name. Without it sees it as a package name.

After 2. the system ought to use your version of sketching.

[I think the "update" is misleading. In the past I used --link, but I have discovered "pkg update" works much better.]