{"id":20400326,"url":"https://github.com/fschutt/simplify-rs","last_synced_at":"2025-04-12T13:51:07.847Z","repository":{"id":57667489,"uuid":"316327091","full_name":"fschutt/simplify-rs","owner":"fschutt","description":"Line / Bezier simplification algorithm","archived":false,"fork":false,"pushed_at":"2024-05-29T11:51:48.000Z","size":75,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T23:07:11.410Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fschutt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2020-11-26T20:06:37.000Z","updated_at":"2024-12-30T08:27:58.000Z","dependencies_parsed_at":"2024-04-17T19:46:33.558Z","dependency_job_id":"e6f9d187-4baf-41ca-b39b-22b49ae76aef","html_url":"https://github.com/fschutt/simplify-rs","commit_stats":{"total_commits":17,"total_committers":1,"mean_commits":17.0,"dds":0.0,"last_synced_commit":"cedd2030f277f43c04bfa0723902a048d3a9965e"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fschutt%2Fsimplify-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fschutt%2Fsimplify-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fschutt%2Fsimplify-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fschutt%2Fsimplify-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fschutt","download_url":"https://codeload.github.com/fschutt/simplify-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248575695,"owners_count":21127247,"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":[],"created_at":"2024-11-15T04:39:34.094Z","updated_at":"2025-04-12T13:51:07.826Z","avatar_url":"https://github.com/fschutt.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# simplify-rs\n\nAlgorithm for point -\u003e cubic bezier curve simplification:\n\n## Example\n\n```rust\n// example: https://bit.ly/2UYdxLw\nlet points = vec![\n    Point { x:256.0,                    y:318.0},\n    Point { x:258.6666666666667,        y:315.3333333333333},\n    Point { x:266.6666666666667,        y:308.6666666666667},\n    Point { x:314.0,                    y:274.6666666666667},\n    Point { x:389.3333333333333,        y:218.0},\n    Point { x:448.6666666666667,        y:176.0},\n    Point { x:472.0,                    y:160.66666666666666},\n    Point { x:503.3333333333333,        y:145.33333333333334},\n    Point { x:516.0,                    y:144.66666666666666},\n    Point { x:520.0,                    y:156.66666666666666},\n    Point { x:479.3333333333333,        y:220.66666666666666},\n    Point { x:392.6666666666667,        y:304.0},\n    Point { x:314.0,                    y:376.6666666666667},\n    Point { x:253.33333333333334,       y:436.6666666666667},\n    Point { x:238.0,                    y:454.6666666666667},\n    Point { x:228.66666666666666,       y:468.0},\n    Point { x:236.0,                    y:467.3333333333333},\n    Point { x:293.3333333333333,        y:428.0},\n    Point { x:428.0,                    y:337.3333333333333},\n    Point { x:516.6666666666666,        y:283.3333333333333},\n    Point { x:551.3333333333334,        y:262.0},\n    Point { x:566.6666666666666,        y:253.33333333333334},\n    Point { x:579.3333333333334,        y:246.0},\n    Point { x:590.0,                    y:241.33333333333334},\n    Point { x:566.6666666666666,        y:260.0},\n    Point { x:532.0,                    y:290.6666666666667},\n    Point { x:516.6666666666666,        y:306.0},\n    Point { x:510.6666666666667,        y:313.3333333333333},\n    Point { x:503.3333333333333,        y:324.6666666666667},\n    Point { x:527.3333333333334,        y:324.6666666666667},\n    Point { x:570.6666666666666,        y:313.3333333333333},\n    Point { x:614.0,                    y:302.6666666666667},\n    Point { x:631.3333333333334,        y:301.3333333333333},\n    Point { x:650.0,                    y:300.0},\n    Point { x:658.6666666666666,        y:304.0},\n    Point { x:617.3333333333334,        y:333.3333333333333},\n    Point { x:546.0,                    y:381.3333333333333},\n    Point { x:518.6666666666666,        y:400.6666666666667},\n    Point { x:505.3333333333333,        y:412.6666666666667},\n    Point { x:488.0,                    y:430.6666666666667},\n    Point { x:489.3333333333333,        y:435.3333333333333},\n    Point { x:570.6666666666666,        y:402.0},\n    Point { x:700.0,                    y:328.6666666666667},\n    Point { x:799.3333333333334,        y:266.0},\n    Point { x:838.0,                    y:240.0},\n    Point { x:854.0,                    y:228.66666666666666},\n    Point { x:868.0,                    y:218.66666666666666},\n    Point { x:879.3333333333334,        y:210.66666666666666},\n    Point { x:872.6666666666666,        y:216.0},\n    Point { x:860.0,                    y:223.33333333333334},\n];\n\nlet result = simplify_rs::simplify(\u0026points, 800.0);\n\nif result.is_empty() {\n    println!(\"no solution!\");\n} else if result.len() == 1 {\n    println!(\"solution:\\r\\n\\tpoint {:?}\", result[0]);\n} else if result.len() == 2 {\n    println!(\"solution:\\r\\n\\tline {:?} - {:?}\", result[0], result[1]);\n} else {\n    println!(\"solution:\");\n    for cubic_curve in result.chunks_exact(4) {\n        println!(\"\\tcubic curve: [\");\n        println!(\"\\t\\t{:?}\", cubic_curve[0]);\n        println!(\"\\t\\t{:?}\", cubic_curve[1]);\n        println!(\"\\t\\t{:?}\", cubic_curve[2]);\n        println!(\"\\t\\t{:?}\", cubic_curve[3]);\n        println!(\"\\t]\");\n    }\n}\n```\n\n\n## Features\n\nThe library can use both `f64` and `f32` points, toggle it on / off using\nthe `double_precision` feature.\n\n## Performance\n\nThe JavaScript (paper.js) version takes about 6 - 7ms to generalize the 50 points,\nthe Rust version takes ~40 - 50µs.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffschutt%2Fsimplify-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffschutt%2Fsimplify-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffschutt%2Fsimplify-rs/lists"}