{"id":17153146,"url":"https://github.com/axect/bspline","last_synced_at":"2025-03-24T13:10:43.074Z","repository":{"id":245070690,"uuid":"817171278","full_name":"Axect/BSpline","owner":"Axect","description":"Implement B-Spline from scratch in rust","archived":false,"fork":false,"pushed_at":"2024-07-07T02:18:48.000Z","size":319,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-19T22:17:24.180Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Axect.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":"2024-06-19T07:00:37.000Z","updated_at":"2024-12-30T11:00:10.000Z","dependencies_parsed_at":"2024-06-19T15:20:33.815Z","dependency_job_id":"93e5c336-5e29-4b7c-bed5-9237af620e88","html_url":"https://github.com/Axect/BSpline","commit_stats":null,"previous_names":["axect/bspline"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Axect%2FBSpline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Axect%2FBSpline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Axect%2FBSpline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Axect%2FBSpline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Axect","download_url":"https://codeload.github.com/Axect/BSpline/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245276195,"owners_count":20588894,"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-10-14T21:45:24.941Z","updated_at":"2025-03-24T13:10:43.054Z","avatar_url":"https://github.com/Axect.png","language":"Rust","readme":"# B-Spline Interpolation in Rust\n\nThis repository contains a Rust implementation of B-Spline interpolation. The code demonstrates how to create a B-Spline curve using a set of control points and generate basis functions using the Cox-de Boor recursion formula.\n\n## Features\n\n- Create a B-Spline curve with a specified degree, knot vector, and control points\n- Generate basis functions using the Cox-de Boor recursion formula\n- Interpolate points along the B-Spline curve\n- Plot the basis functions and the interpolated B-Spline curve\n\n## Dependencies\n\n- `peroxide`: For plotting functionality \u0026 numerical utils\n\n## Usage\n\nTo use the B-Spline interpolation code in your Rust project, follow these steps:\n\n1. Add the necessary dependencies\n\n```sh\ncargo add peroxide --features plot\n```\n\n2. Import the required modules in your Rust code:\n\n```rust\nuse peroxide::fuga::*;\nuse anyhow::Result;\n```\n\n3. Create an instance of the `BSpline` struct with the desired parameters:\n\n```rust\nlet knots = vec![0f64, 0f64, 0f64, 0f64, 1f64, 2f64, 3f64, 3f64, 3f64, 3f64];\nlet degree = 3;\nlet num_points = 100;\nlet control_points = vec![\n    vec![0f64, 2f64],\n    vec![0.2, -1f64],\n    vec![0.4, 1f64],\n    vec![0.6, -1f64],\n    vec![0.8, 1f64],\n    vec![1f64, 2f64],\n];\n\nlet spline = BSpline::new(degree, knots, num_points, control_points);\n```\n\n4. Generate the basis functions and plot them:\n\n```rust\nlet bases = spline.generate_bases();\nspline.bases_plot(bases)?;\n```\n\n5. Interpolate points along the B-Spline curve and plot the curve:\n\n```rust\nspline.plot()?;\n```\n\n## Plots\n\nThe code generates two plots:\n\n1. `plot.png`: A plot of the basis functions generated using the Cox-de Boor recursion formula.\n\n![Basis Functions Plot](plot.png)\n\n2. `interpolate_plot.png`: A plot of the interpolated B-Spline curve using the provided control points.\n\n![Interpolated B-Spline Curve Plot](interpolate_plot.png)\n\n## License\n\nThis code is released under the [MIT License](LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxect%2Fbspline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faxect%2Fbspline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxect%2Fbspline/lists"}