{"id":32271598,"url":"https://github.com/lepsch/bezier_kit","last_synced_at":"2025-10-22T22:55:52.631Z","repository":{"id":265563042,"uuid":"740982648","full_name":"lepsch/bezier_kit","owner":"lepsch","description":"Bezier curves and paths in Dart for building vector applications ","archived":false,"fork":false,"pushed_at":"2024-12-01T12:35:06.000Z","size":2163,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-22T22:55:48.300Z","etag":null,"topics":["bezier","bezier-curves","curve","geometry","intersection","quadratic"],"latest_commit_sha":null,"homepage":"","language":"Dart","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/lepsch.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-01-09T13:19:02.000Z","updated_at":"2025-06-19T07:57:33.000Z","dependencies_parsed_at":"2024-12-06T16:54:14.734Z","dependency_job_id":null,"html_url":"https://github.com/lepsch/bezier_kit","commit_stats":null,"previous_names":["lepsch/bezier_kit"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/lepsch/bezier_kit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lepsch%2Fbezier_kit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lepsch%2Fbezier_kit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lepsch%2Fbezier_kit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lepsch%2Fbezier_kit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lepsch","download_url":"https://codeload.github.com/lepsch/bezier_kit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lepsch%2Fbezier_kit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280528607,"owners_count":26345643,"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","status":"online","status_checked_at":"2025-10-22T02:00:06.515Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["bezier","bezier-curves","curve","geometry","intersection","quadratic"],"created_at":"2025-10-22T22:55:47.423Z","updated_at":"2025-10-22T22:55:52.622Z","avatar_url":"https://github.com/lepsch.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bezier_kit\n\n[![bezier_kit](https://github.com/lepsch/bezier_kit/actions/workflows/dart.yaml/badge.svg)](https://github.com/lepsch/bezier_kit/actions/workflows/dart.yaml)\n\n`bezier_kit` is a comprehensive Bezier Path library written in Dart.\n\n## About\n\n`bezier_kit` has been manually converted from the original\n[BezierKit in Swift](https://github.com/hfutrell/BezierKit).\nIt's based on the fork of [BezierKit ref 11a87c26](https://github.com/hfutrell/BezierKit/commits/11a87c261d03ac4d0a7c8d20595b841e5307e8cb)\nfrom June 28 of 2022 (version 0.15.0).\n\n## Features\n\n- [x] Constructs linear (line segment), quadratic, and cubic Bézier curves\n- [x] Determines positions, derivatives, and normals along curves\n- [x] Lengths of curves via Legendre-Gauss quadrature\n- [x] Intersects curves and computes cubic curve self-intersection to any degree of accuracy\n- [x] Determines bounding boxes, extrema,\n- [x] Locates nearest on-curve location to point\n- [x] to any degree of accuracy\n- [x] Splits curves into subcurves\n- [x] Offsets and outlines curves\n- [ ] Comprehensive Unit and Integration Test Coverage\n- [ ] Complete Documentation\n\n## Installation\n\nDart\n\n```shell\ndart pub add dart_lapack\n```\n\nFlutter\n\n```shell\nflutter pub add dart_lapack\n```\n\n## Usage\n\n### Constructing \u0026 Drawing Curves\n\n`bezier_kit` supports cubic Bezier curves (`CubicCurve`) and quadratic Bezier\ncurves (`QuadraticCurve`) as well as line segments (`LineSegment`) each of which\nadopts the `BezierCurve` protocol that encompasses most API functionality.\n\n\u003cimg src=\"https://raw.githubusercontent.com/lepsch/bezier_kit/main/images/usage-construct.png\" width=\"256\" height=\"256\"\u003e\n\n```dart\nimport 'package:bezier_kit/bezier_kit.dart';\n\nfinal curve = CubicCurve(\n  p0: Point(x: 100, y: 25),\n  p1: Point(x: 10, y: 90),\n  p2: Point(x: 110, y: 100),\n  p3: Point(x: 150, y: 195),\n);\n\nfinal canvas: Canvas = ...        // your graphics context here\nfinal draw = Draw(canvas);\ndraw.drawSkeleton(curve: curve);  // draws visual representation of curve control points\ndraw.drawCurve(curve: curve);     // draws the curve itself\n```\n\n### Intersecting Curves\n\nThe `intersections(with curve: BezierCurve) -\u003e [Intersection]` method determines each intersection between `self` and `curve` as an array of `Intersection` objects. Each intersection has two fields: `t1` represents the t-value for `self` at the intersection while `t2` represents the t-value for `curve` at the intersection. You can use the `ponit(at:)` method on either of the curves to calculate the coordinates of the intersection by passing in the corresponding t-value for the curve.\n\nCubic curves may self-intersect which can be determined by calling the `selfIntersections()` method.\n\n\u003cimg src=\"https://raw.githubusercontent.com/lepsch/bezier_kit/main/images/usage-intersects.png\" width=\"256\" height=\"256\"\u003e\n\n```dart\nfinal intersections = curve1.intersectionsWithCurve(curve2);\nfinal points = intersections.map((i) =\u003e curve1.point(at: i.t1));\n\ndraw.drawCurve(curve: curve1);\ndraw.drawCurve(curve: curve2);\nfor (final p in points) {\n  draw.drawPoint(origin: p);\n}\n```\n\n### Splitting Curves\n\nThe `split(from:, to:)` method produces a subcurve over a given range of t-values. The `split(at:)` method can be used to produce a left subcurve and right subcurve created by splitting across a single t-value.\n\n\u003cimg src=\"https://raw.githubusercontent.com/lepsch/bezier_kit/main/images/usage-split.png\" width=\"256\" height=\"256\"\u003e\n\n```dart\ndraw.setColor(color: Draw.lightGrey);\ndraw.drawSkeleton(curve: curve);\ndraw.drawCurve(curve: curve);\nfinal subcurve = curve.split(from: 0.25, to: 0.75); // or try (leftCurve, rightCurve) = curve.split(at:)\ndraw.setColor(color: Draw.red);\ndraw.drawCurve(curve: subcurve);\ndraw.drawCircle(center: curve.point(at: 0.25), radius: 3);\ndraw.drawCircle(center: curve.point(at: 0.75), radius: 3);\n```\n\n### Determining Bounding Boxes\n\n\u003cimg src=\"https://raw.githubusercontent.com/lepsch/bezier_kit/main/images/usage-bounding-box.png\" width=\"256\" height=\"256\"\u003e\n\n```dart\nfinal boundingBox = curve.boundingBox;\ndraw.drawSkeleton(context, curve: curve);\ndraw.drawCurve(context, curve: curve);\ndraw.setColor(context, color: Draw.pinkish);\ndraw.drawBoundingBox(context, boundingBox: curve.boundingBox);\n```\n\n### More\n\n`bezier_kit` is a powerful library with **a lot** of functionality. For the time\nbeing the best way to see what it offers is to build the example Flutter app and\ncheck out each of the provided demos.\n\n## Testing\n\n`bezier_kit` includes the entire test suite from the original sources converted\nfrom Swift to Dart.\n\nTo run the test suite do:\n\n```shell\ndart test\n```\n\n## License\n\n`bezier_kit` is released under the MIT license. [See LICENSE](https://github.com/lepsch/bezier_kit/blob/main/LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flepsch%2Fbezier_kit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flepsch%2Fbezier_kit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flepsch%2Fbezier_kit/lists"}