{"id":15632911,"url":"https://github.com/crushedpixel/polyline2d","last_synced_at":"2025-06-24T21:31:40.914Z","repository":{"id":93945284,"uuid":"167096373","full_name":"CrushedPixel/Polyline2D","owner":"CrushedPixel","description":"A header-only library to generate meshes for a solid path. Useful to render thick lines using OpenGL.","archived":false,"fork":false,"pushed_at":"2024-04-05T18:20:59.000Z","size":19,"stargazers_count":202,"open_issues_count":0,"forks_count":21,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-30T21:39:55.328Z","etag":null,"topics":["2d-graphics","mesh","opengl","polyline"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CrushedPixel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2019-01-23T01:37:45.000Z","updated_at":"2025-04-29T13:12:34.000Z","dependencies_parsed_at":"2023-05-02T01:00:42.789Z","dependency_job_id":null,"html_url":"https://github.com/CrushedPixel/Polyline2D","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/CrushedPixel/Polyline2D","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrushedPixel%2FPolyline2D","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrushedPixel%2FPolyline2D/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrushedPixel%2FPolyline2D/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrushedPixel%2FPolyline2D/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CrushedPixel","download_url":"https://codeload.github.com/CrushedPixel/Polyline2D/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrushedPixel%2FPolyline2D/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261759141,"owners_count":23205503,"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":["2d-graphics","mesh","opengl","polyline"],"created_at":"2024-10-03T10:45:47.109Z","updated_at":"2025-06-24T21:31:40.885Z","avatar_url":"https://github.com/CrushedPixel.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Polyline2D\n*Polyline2D* is a header-only C++17 library that generates a triangle mesh from a list of points.\nIt can be used to draw thick lines with rendering APIs like *OpenGL*, which do not support line drawing out of the box.  \nIt supports common joint and end cap styles.\n\n## Example usage\n```c++\n#include \u003cPolyline2D/Polyline2D.h\u003e\nusing namespace crushedpixel;\n\nstd::vector\u003cVec2\u003e points{\n\t\t{ -0.25f, -0.5f  },  \n\t\t{ -0.25f,  0.5f  },  \n\t\t{  0.25f,  0.25f },  \n\t\t{  0.0f,   0.0f  },  \n\t\t{  0.25f, -0.25f },  \n\t\t{ -0.4f,  -0.25f }\n};\n\nauto thickness = 0.1f;\nauto vertices = Polyline2D::create(points, thickness, \n\t\tPolyline2D::JointStyle::ROUND,\n\t\tPolyline2D::EndCapStyle::SQUARE);\n\n// render vertices, for example using OpenGL...\n```\nThis code results in the following mesh:\n![Result](https://i.imgur.com/D0lvyYT.png)\nFor demonstration purposes, the generated mesh is once rendered in wireframe mode (light green), and once in fill mode (transparent green).\n\nThe red points show the input points.\n\nThere is *no overdraw* within segments, only lines that overlap are filled twice.\n\nFor an example application using this software, visit [Polyline2DExample](https://github.com/CrushedPixel/Polyline2DExample).\n\n## Installation\n### Manual\nTo use *Polyline2D*, simply clone this repository and include the file `Polyline2D.h`  from the `include` directory.\n\n### Using CMake\nTo install the header files into your global header directory, you can use CMake:\n```\nmkdir build\ncd build\ncmake ..\nmake install\n```\n\nYou can then include the header file using `#include \u003cPolyline2D/Polyline2D.h\u003e`.\n\n## Attribution and similar projects\nThe concepts and maths behind this project are largely inspired by [this amazing blog post](https://artgrammer.blogspot.com/2011/07/drawing-polylines-by-tessellation.html) by \"To be an Artgrammer\".\n\nCheck out the original author's project \n[vaserenderer](https://github.com/tyt2y3/vaserenderer), which also offers \na C# implementation based on fragment shaders.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrushedpixel%2Fpolyline2d","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrushedpixel%2Fpolyline2d","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrushedpixel%2Fpolyline2d/lists"}