{"id":20750581,"url":"https://github.com/micycle1/betterbeziers","last_synced_at":"2025-03-11T14:21:42.645Z","repository":{"id":133574569,"uuid":"593988449","full_name":"micycle1/BetterBeziers","owner":"micycle1","description":"High-precision utils for 2D Cubic Bezier Curves","archived":false,"fork":false,"pushed_at":"2023-03-10T15:15:04.000Z","size":16,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-18T03:28:57.398Z","etag":null,"topics":["bezier","bezier-curves","quadrature"],"latest_commit_sha":null,"homepage":"","language":"Java","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/micycle1.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,"publiccode":null,"codemeta":null}},"created_at":"2023-01-27T10:27:36.000Z","updated_at":"2024-09-06T08:43:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"542f1384-7984-48ab-8a11-924b46049e2d","html_url":"https://github.com/micycle1/BetterBeziers","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/micycle1%2FBetterBeziers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micycle1%2FBetterBeziers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micycle1%2FBetterBeziers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micycle1%2FBetterBeziers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/micycle1","download_url":"https://codeload.github.com/micycle1/BetterBeziers/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243048606,"owners_count":20227660,"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":["bezier","bezier-curves","quadrature"],"created_at":"2024-11-17T08:27:56.151Z","updated_at":"2025-03-11T14:21:42.614Z","avatar_url":"https://github.com/micycle1.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![](https://jitpack.io/v/micycle1/BetterBeziers.svg)](https://jitpack.io/#micycle1/BetterBeziers)\n\n# BetterBeziers\nHigh-precision utils for 2D Cubic Bezier Curves.\n\n## Overview\n\nBetterBeziers is a Java library that provides high-precision utilities for working with 2D Cubic Bezier Curves. The library offers two main functions: computing the length of a cubic bezier curve and finding the time `t` at which a specific arc length occurs.\n\nThe length computation function uses _Legendre-Gauss quadrature_, while the function for finding time `t` for a specified arc length uses a hybrid approach of Newton’s method and bisection. Both of these algorithms are described in the paper _Moving Along a Curve with Specified Speed_ [[1]].\n\nWith these two functions, it is easy to sample the curve (find t) for a given distance (or fractional distance) along the curve, as well as subdividing the curve into equal-length segments. BetterBeziers offers methods for all of these operations.\n\n## Usage\nTo use BetterBeziers in your project, you can add it as a dependency using [JitPack](https://jitpack.io/#micycle1/BetterBeziers).\n\nTo compute the length of a cubic bezier curve, you can use the `getLength()` function. For example:\n\n```\nfinal double[][] controlPoints = {{0, 0}, {0.2, 0.3}, {0.7, 0.8}, {1, 1}};\nCubicBezier bezier = new CubicBezier(controlPoints);\ndouble length = bezier.getLength();\n```\n\nTo find the time t at which a specific arc length occurs, you can use the `getCurveParameter()` function. For example:\n```\nfinal double[][] controlPoints = {{0, 0}, {0.2, 0.3}, {0.7, 0.8}, {1, 1}};\nCubicBezier bezier = new CubicBezier(controlPoints);\narcLength = bezier.getLength()/3;\ndouble t = bezier.getCurveParameter(arcLength);\n```\n\n[1]: https://www.geometrictools.com/Documentation/MovingAlongCurveSpecifiedSpeed.pdf\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicycle1%2Fbetterbeziers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicycle1%2Fbetterbeziers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicycle1%2Fbetterbeziers/lists"}