{"id":27055108,"url":"https://github.com/cadin/line-wobbler","last_synced_at":"2025-04-05T09:18:58.241Z","repository":{"id":223424004,"uuid":"749593119","full_name":"cadin/line-wobbler","owner":"cadin","description":"Class for making wobbly lines in Processing","archived":false,"fork":false,"pushed_at":"2024-02-24T18:55:25.000Z","size":98,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-02-24T19:55:32.952Z","etag":null,"topics":["creative-coding","plotter-art","processing"],"latest_commit_sha":null,"homepage":"","language":"Processing","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cadin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-01-29T01:47:32.000Z","updated_at":"2024-02-24T00:24:31.000Z","dependencies_parsed_at":"2024-02-20T07:24:27.952Z","dependency_job_id":"d866e694-bf50-4f6d-9bb6-08249dc31f2a","html_url":"https://github.com/cadin/line-wobbler","commit_stats":null,"previous_names":["cadin/line-wobbler"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cadin%2Fline-wobbler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cadin%2Fline-wobbler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cadin%2Fline-wobbler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cadin%2Fline-wobbler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cadin","download_url":"https://codeload.github.com/cadin/line-wobbler/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247312280,"owners_count":20918402,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["creative-coding","plotter-art","processing"],"created_at":"2025-04-05T09:18:57.741Z","updated_at":"2025-04-05T09:18:58.220Z","avatar_url":"https://github.com/cadin.png","language":"Processing","funding_links":[],"categories":[],"sub_categories":[],"readme":"# line-wobbler\n\nGenerate wobbly hand-drawn lines in Processing.  \nSave to SVG for clean pen plotter input.\n\n![banner](banner.jpg)\n\n## Getting Started\n\n### 📺 [Video Walkthrough](https://youtu.be/eRmvj5s2-kU)\n\n### Requirements\n\n-   [Processing 4](https://processing.org/download/)\n-   The [LazyGUI](https://github.com/KrabCode/LazyGui) library is required to run the `GuiControl` example sketch.\n\n### Installation\n\nCopy the `LineWobbler.pde` file from the [`src`](src/) folder into the folder for your Processing sketch.\n\n### Example Sketch\n\n1. Create an instance of the `LineWobbler` class.\n2. Use `drawLine()` or other drawing functions to create graphics with wobbly lines.\n\n```java\nLineWobbler wob = new LineWobbler();\n\nvoid setup() {\n  size(300, 200);\n}\n\nvoid draw() {\n  background(255);\n  randomSeed(0);\n  wob.drawLine(10, 20, 290, 20);\n}\n\n```\n\n## Usage\n\n### Instantiation\n\n_LineWobbler_ **new LineWobbler**( [ _int_ frequency, _float_ amplitude, _float_ frequencyJitter ] )\n\nCreate an instance of the LineWobbler class.  \n`frequency` sets the frequency of subpoints (in pixels).  \n`amplitude` sets how much the subpoints can deviate from the line (in pixels).  \n`frequencyJitter` sets how much the subpoints can deviate parallel to the line (as a percentage of of `frequency`)\n\n### Drawing Lines\n\n```java\nLineWobbler wob = new LineWobbler();\nwob.drawLine(10, 20, 290, 20);\n```\n\n_PVector[]_ **drawLine**( _float_ x1, _float_ y1, _float_ x2, _float_ y2 )\n\nDraw a line between two points.  \nReturns the array of subpoints used to render the wobbly line.\n\n_PVector[]_ **drawBrokenLine**( _float_ x1, _float_ y1, _float_ x2, _float_ y2 )\n\nDraw a broken line between two points.\nReturns the array of subpoints used to render the wobbly line.\n\n### Drawing Polylines\n\n```java\nLineWobbler wob = new LineWobbler();\nPVector[] points = {\n  new PVector(0, 0), new PVector(100, 100), new PVector(200, 0)\n};\nwob.drawPolyline(points);\n```\n\n_void_ **drawPolyline**( _PVector[]_ vertices, [ _boolean_ connectEnds ])\n\nDraw a multi-segment line through an array of points.  \n`connectEnds` specifies whether or not the last point in the line should be connected back to the first to form a closed shape.\n\n_void_ **drawBrokenPolyline**( _PVector[]_ vertices, [ _boolean_ connectEnds ] )\n\nDraw a broken multi-segment line through an array of points.  \n`connectEnds` specifies whether or not the last point in the line should be connected back to the first to form a closed shape.\n\n### Drawing Rectangles\n\n```java\nLineWobbler wob = new LineWobbler();\nwob.drawRect(20, 180, 370, 100);\n```\n\n_void_ **drawRect**( _float_ x, _float_ y, _float_ w, _float_ h, [ _boolean_ connectCorners])\n\nDraw a rectangle with the given dimensions.\n`x` and `y` specify the top left corner of the rectangle. `w` and `h` set the width and height.  \n`connectCorners` determines whether the four line segments should be joined at the corners.\n\n_void_ **drawBrokenRect**( _float_ x, _float_ y, _float_ w, _float_ h, [ _boolean_ connectCorners])\n\nDraw a rectangle with the given dimensions using broken lines.\n`x` and `y` specify the top left corner of the rectangle. `w` and `h` set the width and height.  \n`connectCorners` determines whether the four line segments should be joined at the corners.\n\n### Drawing Circles\n\n```java\nLineWobbler wob = new LineWobbler();\nwob.drawCircle(210, 400, 100);\n```\n\n_void_ **drawCircle**( _float_ x, _float_ y, _float_ r, [ _int_ numSegments ] )\n\nDraw a circle with the given dimensions.\n`x` and `y` specify the center of the circle. `r` sets the radius.  \nWobbly circles are rendered by breaking up the circle into many straight segments before adding subpoints. `numSegments` lets you specify how many segments should be used. In general, higher numbers of segments create smoother circles.\n\n_void_ **drawBrokenCircle**( _float_ x, _float_ y, _float_ r, [ _int_ numSegments ])\n\nDraw a with the given dimensions using a broken line.\n`x` and `y` specify the center of the circle. `r` sets the radius.  \nWobbly circles are rendered by breaking up the circle into many straight segments before adding subpoints. `numSegments` lets you specify how many segments should be used. In general, higher numbers of segments create smoother circles.\n\n### Drawing Shapes\n\n```java\nLineWobbler wob = new LineWobbler();\nPShape shape = loadShape(\"complexShape.svg\");\nwob.drawShape(shape);\n```\n\n\u003e [!NOTE]\n\u003e LineWobbler only extracts the shape's vertices and connects them with straight lines (no curves). Drawing shapes with large curves will most likely produce undesirable results unless those curves are first broken up by adding intermediate points.\n\n_void_ **drawShape**( _PShape_ shape, [ _float_ x, _float_ y ] )\n\nDraw a shape (such as a loaded SVG) with wobbly lines.\n\n_void_ **drawBrokenShape**( _PShape_ shape, [ _float_ x, _float_ y ] )\n\nDraw a shape (such as a loaded SVG) with wobbly broken lines.\n\n### Properties\n\n_int_ **frequency** = `10`\n\nThe distance between subpoints in pixels.  \nSmaller values create a more jagged line, larger values create a smooth wobble.\n\n_float_ **amplitude** = `0.5`\n\nHow much the subpoints can deviate from the line (in pixels).  \nLarger values create a rougher line, smaller values make the line straighter.\n\n_float_ **frequencyJitter** = `0.2`\n\nHow much the subpoints can deviate parallel to the line (as a percentage of frequency).  \nA value of `0` creates equidistant subpoints. Larger values may cause subpoints to appear out of order, creating a line that doubles back on itself in places.\n\n_boolean_ **wobbleEndPointAmplitude** = `true`\n\nWhether or not to wobble the end point positions perpendicular to the line.\n\n_boolean_ **wobbleEndPointPosition** = `true`\n\nWhether or not to wobble the end point positions parallel to the line.\n\n_boolean_ **drawGuides** = `false`\n\nWhether or not to draw the guides (useful for debugging).  \nWhen enabled, straight guide lines are drawn between points. Line vertices are highlighted with green dots and wobbly subpoints are drawn red.\n\n_float_ **minBreakSize** = `0.2`\n\nThe minimum size of a break in a line (in pixels) when using the broken line drawing methods.\n\n_float_ **maxBreakSize** = `5`\n\nThe maximum size of a break in a line (in pixels) when using the broken line drawing methods.\n\n_float_ **minLineSegmentLength** = `5`\n\nThe minimum length of a broken line segment (in pixels).\n\n_float_ **breakFrequency** = `0.2`\n\nThe frequency of breaks in a line when using the broken line drawing methods.\n\n### Randomization\n\nLineWobbler lines are recalculated with random values every frame. This will cause the lines to constantly move in sketches that utitlize a `draw()` loop. Calling the [`randomSeed()`](https://processing.org/reference/randomSeed_.html) function at the beginning of the draw loop will ensure that the same random values are used on each frame. Change the value sent to `randomSeed()` to calculate new random values.\n\n### Animation\n\nLineWobbler performs many unoptimized calculations on each frame. It is not meant to be used for animated sketches, and will most likely cause performance slowdowns if used for animations.\n\n## Build from Source\n\nThe build script for this project (`build.sh`) simply copies the class from `src` into the example sketches in the `examples` folder.\n\n```zsh\ncd [line-wobbler]\n./build.sh\n```\n\n## Support\n\nThis is a personal project and is mostly unsupported, but I'm happy to hear feedback or answer questions.\n\n## License\n\nThis project is licensed under the Unlicense - see the [LICENSE](LICENSE) file for details.\n\n---\n\n👨🏻‍🦲❤️🛠\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcadin%2Fline-wobbler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcadin%2Fline-wobbler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcadin%2Fline-wobbler/lists"}