{"id":20265266,"url":"https://github.com/mxygem/linedesigns","last_synced_at":"2025-04-11T02:31:59.613Z","repository":{"id":57712078,"uuid":"131464531","full_name":"mxygem/linedesigns","owner":"mxygem","description":"Digitizing an elementary school craft for easy prototyping.","archived":false,"fork":false,"pushed_at":"2022-05-17T22:43:50.000Z","size":4384,"stargazers_count":18,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T23:51:32.639Z","etag":null,"topics":["drawing","fun","lines"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mxygem.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}},"created_at":"2018-04-29T04:00:30.000Z","updated_at":"2024-11-27T22:09:51.000Z","dependencies_parsed_at":"2022-09-26T21:31:01.639Z","dependency_job_id":null,"html_url":"https://github.com/mxygem/linedesigns","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mxygem%2Flinedesigns","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mxygem%2Flinedesigns/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mxygem%2Flinedesigns/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mxygem%2Flinedesigns/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mxygem","download_url":"https://codeload.github.com/mxygem/linedesigns/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248329633,"owners_count":21085571,"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":["drawing","fun","lines"],"created_at":"2024-11-14T11:46:29.113Z","updated_at":"2025-04-11T02:31:59.586Z","avatar_url":"https://github.com/mxygem.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `linedesigns`\n\u003cimg src=\"assets/trioct.png\" width=\"300\" height=\"300\" alt=\"trioct\"\u003e\u003cimg src=\"assets/mixed.png\" width=\"300\" height=\"300\" alt=\"mixed\"\u003e\n\u003cimg src=\"assets/freeform.png\" width=\"300\" height=\"300\" alt=\"freeform\"\u003e\u003cimg src=\"assets/recttri.png\" width=\"300\" height=\"300\" alt=\"recttri\"\u003e\n\n`linedesigns` is the digitization of an arts craft I was taught in my elementary school days. It's meant to help prototype new designs quickly since doing these designs by hand can take hours.\n\n---\n## Install\n```\n$ go get -u github.com/mxygem/linedesigns\n```\n---\n## How To\n`linedesigns` commands generally follow the pattern of taking in a series of coordinates that process/connect to one another in a counter-clockwise fashion.\n\nEach run consists of three main steps: \n- **Object Creation** - setup a `linedesign` object to use by defining default line thickness, image width, and image height.\n- **Design Creation** - These commands are what make the actual designs. You can perform as many design creation steps as you'd like in order to add multiple designs to a single image. Coordinate points are based off a Cartesian plane with (0,0) as the centered origin point and 1 being the max displayable point on either axis.\n- **Saving** - Finalizes the current `linedesign` object and writes the file to disk.\n\n### Start\nThe following examples will all assume that a `linedesigns` object has been created with the following:\n```go\n// new input: line width, dot size, image width, image height\nl := lines.New(0.1, 0.05, 1000, 1000)\n```\n\n\n### Design Creators\n`linedesign's` creators are split into two main groups based on their outputs:\n- **Dotted** - Outputs only dots at each point position instead of connecting each by lines. This output can be used if you'd like to connect the lines yourself for instance. Takes in N number of coordinates to create designs from, a count of how many points per line segment/design to create, and a dot size.\n- **Lined** - Outputs designs connected by lines. Currently the only method for line connection is via straight \u0026 black lines. These creators take in N amount of coordinates based on the shape to be created unless otherwise noted below.\n\n#### Dotted Creators\n\n**LineDotted**\n\nThe simplest command available to `linedesign`. It takes in two coordinates, a count, and outputs a single, dotted line.\n```go\nl.LineDotted(-.8, 0, .8, 0, 25)\n```\n\u003cimg src=\"assets/linedotted_ex.png\" width=\"300\" height=\"300\" alt=\"linedotted_ex\"\u003e\n\n**AngleDotted**\n\nOne step up from a single line. It takes in three coordinates, a count, and outputs a single, dotted angle.\n```go\nl.AngleDotted(-.6, .6, 0, -.6, .6, .6, 25)\n```\n\u003cimg src=\"assets/angledotted_ex.png\" width=\"300\" height=\"300\" alt=\"angledotted_ex\"\u003e\n\n**TriangleDotted**\n\nTriangleDotted takes in three coordinates, a count, and outputs a dotted triangle.\n```go\nl.TriangleDotted(0, .9, -.9, -.9, .9, -.9, 50)\n```\n\u003cimg src=\"assets/triangledotted_ex.png\" width=\"300\" height=\"300\" alt=\"triangledotted_ex\"\u003e\n\n**RectangleDotted**\n\nRectangleDotted takes in four coordinates, a count, and outputs a dotted rectangle.\n```go\nl.RectangleDotted(-.8, .8, -.8, -.8, .8, -.8, .8, .8, 25)\n```\n\u003cimg src=\"assets/rectangledotted_ex.png\" width=\"300\" height=\"300\" alt=\"rectangledotted_ex\"\u003e\n\n**CircleDotted**\n\nCircleDotted takes in a center point, a radius, a count, and outputs a dotted circle.\n```go\nl.CircleDotted(0, 0, .8, 100)\n```\n\u003cimg src=\"assets/circledotted_ex.png\" width=\"300\" height=\"300\" alt=\"circledotted_ex\"\u003e\n\n**FreeformDotted**\n\nFreeformDotted takes in a collection(slice of slices) of three or more coordinates, a count, and outputs a dotted whateveryoucreated. *Note: The two Freeform commands connect the last provided coordinate to the first!*\n```go\ncoords := [][]float64{\n    []float64{-.9, .9},\n    []float64{-.2, .0},\n    []float64{-.9, -.9},\n    []float64{0, -.9},\n    []float64{0, 0},\n    []float64{.9, 0},\n    []float64{.9, .9},\n}\nl.FreeformDotted(coords, 50)\n```\n\u003cimg src=\"assets/freeformdotted_ex.png\" width=\"300\" height=\"300\" alt=\"freeformdotted_ex\"\u003e\n\n#### Lined Creators\n\n**Angle**\n\nThe simplest of the lined creators. It takes in three coordinates, a count, and outputs a single, lined angle.\n```go\nl.Angle(-.6, .6, 0, -.6, .6, .6, 25)\n```\n\u003cimg src=\"assets/angle_ex.png\" width=\"300\" height=\"300\" alt=\"angle_ex\"\u003e\n\n**Triangle**\n\nTriangle takes in three coordinates, a count, and outputs a lined triangle. Similar to `Angle`, except this connects each combo of line segments. (1 \u0026 2, 2 \u0026 3, 3 \u0026 1)\n```go\nl.Triangle(0, .9, -.9, -.9, .9, -.9, 50)\n```\n\u003cimg src=\"assets/triangle_ex.png\" width=\"300\" height=\"300\" alt=\"triangle_ex\"\u003e\n\n**Rectangle**\n\nRectangle takes in four coordinates, a count, and outputs a lined rectangle.\n```go\nl.Rectangle(-.6, .6, -.6, -.6, .6, -.6, .6, .6, 25)\n```\n\u003cimg src=\"assets/rectangle_ex.png\" width=\"300\" height=\"300\" alt=\"rectangle_ex\"\u003e\n\n**Circle**\n\nCircle takes in a center point, a radius, a count, an offset, a wrap bool, and outputs a lined circle.\n- Offset is a number that defines how many points `linedesign` will skip to connect two points with a line. This can have neat outputs based on what you input. \n- Wrap tells `linedesign` whether to continue around through to make sure all points created are connected. Without it, depending on your offset value, you may not have all points connected which can also lead to other neat designs.\n\n*The below examples show the same parameters but with wrap on and off for each photo respectively.\n```go\nl.Circle(0, 0, .8, 100, 40, true)\n```\n\u003cimg src=\"assets/circle_ex.png\" width=\"300\" height=\"300\" alt=\"circle_ex\"\u003e\u003cimg src=\"assets/circle_nowrap_ex.png\" width=\"300\" height=\"300\" alt=\"circle_nowrap_ex\"\u003e\n\n**Freeform**\n\nFreeform takes in a collection(slice of slices) of three or more coordinates, a count, an offset, a wrap bool, and outputs a lined whateveryoucreated.\n```go\ncoords := [][]float64{\n    []float64{-.9, .9},\n    []float64{-.2, .0},\n    []float64{-.9, -.9},\n    []float64{0, -.9},\n    []float64{0, 0},\n    []float64{.9, 0},\n    []float64{.9, .9},\n    []float64{-.9, .9},\n    []float64{-.2, .0},\n}\nl.Freeform(coords, 50, 51, false)\n```\n\u003cimg src=\"assets/freeform_ex.png\" width=\"300\" height=\"300\" alt=\"freeform_ex\"\u003e\n\n\n---\n## Color\n\nEventually, I plan to utilize Pinhole's color options and allow for the lines drawn to be other than black, but that is still yet to come. Additionally, I'd like to implement a way to automate the fill patterns below as well as others, but that'll be quite the challenge. (PRs welcomed!)\n\n\u003cimg src=\"assets/aquax.png\" width=\"300\" height=\"300\" alt=\"aquax\"\u003e\u003cimg src=\"assets/circle_colored_colorful.png\" width=\"300\" height=\"300\" alt=\"circle_colored_colorful\"\u003e\n\n\n## Background\n\nLine designs are essentially a series of points connected by straight or curved lines to create neat looking designs. To further add to these designs, the squares created by the crossing of lines can be filled in different patterns. (as shown above)\n\nIf I remember correctly, I was introduced to this type of art in 4th or 5th grade math class. Here's one of the earliest versions of one of these that I did as a kid:\n\n\u003cimg src=\"assets/early.jpg\" width=\"300\" height=\"400\" alt=\"iloveyoumom\"\u003e\n\nThat one had a piece of graph paper taped to the back side that was used as a guide for sewing the thread through on the other side.\n\nThe bulk of these types of works I've done have been with a rule/protractor, not the messy string as above. I did a lot of these later on in years and came up with a number of different ways they could be modified to be made more unique. Throughout my adult life I've sporadically done them and when doing one recently (April 2018) I thought about writing some software to help me out in prototyping.\n\nSome of my older drawings:\n\n\u003cimg src=\"assets/02.jpg\" width=\"300\" height=\"400\" alt=\"2002\"\u003e\u003cimg src=\"assets/07.jpg\" width=\"300\" height=\"400\" alt=\"2007\"\u003e\n\n## Thanks\n\nThanks to [@tidwall](http://twitter.com/tidwall) for his work on [pinhole](https://github.com/tidwall/pinhole) as linedesigns is built on top of it and this readme has been heavily influenced by [pinhole's](https://github.com/tidwall/pinhole).\n\n## Contact\n\nGemini Smith [@mxygem](http://twitter.com/mxygem) or open a [github issue.](https://github.com/mxygem/linedesigns/issues)\n\n## License\n\n`linedesigns` source code is available under the ISC [License](/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmxygem%2Flinedesigns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmxygem%2Flinedesigns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmxygem%2Flinedesigns/lists"}